Category Archives: Tidbits

Extension to make Twitter more usable

After setting up an RSS reader and a bridge to pull in tweets, I no longer access Twitter. If there is interesting content, I click the link on my RSS reader and comment directly without visiting the Twitter homepage.

If I were a more regular user of Twitter, I think I would use this extension: https://github.com/insin/tweak-new-twitter

I might even install it for the few times a month I click on a Twitter link.

Depression and Anxiety

This morning I read from one of the people I follow a short, concise list of comparing Depression and Anxiety. It is quite good to read over, but I think it is quite lacking in its explanation. Primarily limited from the 280 character posts on Twitter.

I feel like I have authority to speak on this subject because I am the son of a medically-diagnosed bi-polar manic depressive and my other parent is anxious about living in the perfect climate known as San Diego, California. To say that I know what depression and anxiety look like would be an understatement. Not only have I observed it in my parents, but I have had seasons where the struggle between the two extremes was real in my own life. Now, as a parent, I view some of the struggles that I have seen in my parents and my own life beginning to surface in my children.

How does one overcome anxiety or depression? Here are some solutions:

  1. Find an anchor. An anchor is one that does not change over time. Some like to put their anchor in a schedule, in a relationship, in a religious set of beliefs, or in a church; however, those are false anchors.

    The only true anchor is God.

    David wrote, “Truly my soul waiteth upon God: from him cometh my salvation. He only is my rock and my salvation; he is my defence; I shall not be greatly moved.” (Psalm 62:1-2).
  2. Belong to a church that develops your connection to the anchor. Some like to evaluate this position to mean that the church has a ton of programs going on. However, the way to evaluate this section is if the pastor gives a sermon (or brings in men to preach on his behalf), that equip you to become better attached to the anchor. This is amplified through opportunities to use this attachment.

    Sadly, it is increasingly common to find a church in America that preaches republicanism where Trump is god or wokeism where everything must be accepted. If you increasingly feel better equipped to attack the other side rather than develop the peace which is in God (John 14:27), it is time for you to find a different church.

    Paul wrote, “For the kingdom of God is not meat and drink; but righteousness, and peace, and joy in the Holy Ghost. For he that in these things serveth Christ is acceptable to God, and approved of men. Let us therefore follow after the things which make for peace, and things wherewith one may edify another.” (Romans 14:17-19)
  3. Understand: depression and anxiety are temporary seasons (Ecc 3:1). If you are finding that they linger longer than expected, you might have to seek medical help. Medicine is the use of God’s created resources to aid in the sustainability of His creation.

    Anxiety is relieved when that particular worry is completely let go to be cared for by God (1 Peter 5:7). It is a difficult practice to learn, but God’s outcomes are better than mine.

    Depression has many causes and it is complex to even identify the reason for the depression. The worst thing you can do to yourself is to hide this depression from others. Seek help when necessary from your pastor or a Nuethetic Counselor he recommends.

    What makes me get into a depressive mood is when I am overwhelmed with tasks. I feel like I am drowning and there appears to be no deliverer. This is often caused by my own doing; therefore, it is solvable by me without the help of others. I have to remove tasks from my workload through completing them or not taking as many on as I would like. In recent days, I have discovered a new thing that contributes to my depression – a lack of sunlight. Whereas this only affects those who live in the earth’s extremities, the solution is easily known – take Vitamin D.

    When it comes to depression, one should not seek to self-diagnose or fix by one’s self. Depression is exaggerated when there is no one to help you. However, to this seemingly impossible season, the Bible is the source giver of hope:

    “There hath no temptation taken you but such as is common to man: but God is faithful, who will not suffer you to be tempted above that ye are able; but will with the temptation also make a way to escape, that ye may be able to bear it.” (1 Cor 10:13 – memorize it if you have not already done so!)
  4. If you are not currently going through a season of depression or anxiety, help someone who is.

    “And the Lord said,
    Simon,
    Simon,
    behold,
    Satan hath desired to have you,
    that he may sift you as wheat:

    But I have prayed for thee,
    that thy faith fail not:
    and when thou art converted,
    strengthen thy brethren.”
    (Luke 22:31-32)

Ironic

It is very ironic – to me at least – that when I visit drive.google.com on a Chromebook, I am presented with a notification to install Google drive.

This is a Chromebook.

Google apps are loaded by default.

This includes Google drive.

I just prefer the web experience over the native file explorer.

2023 – Return to the Syndicated Stone age (RSSa)

The new year has already been dubbed by some in the tech world as the year of RSS, meaning people will ditch social media for the consumption-style RSS feed. It is the same concept of switching from a smartphone to a mobile phone. You might be thinking, “Why would anyone go backwards in technology?” Everyone may have their own reasons for doing so, but mine is simply because of the social media trap.

The past few months I have noticed a personal, increased social media presence. I would have my app open 7 or 8 times a day, and because of the algorithms to keep me in the app longer, this would equate to 4 or 5 hours a day. I was managing to keep my studies, work, and family life balanced so I do not feel as if I have somehow lost that time or that I am wrong for spending that spare time on social media. It is just that 4 or 5 hours can be a bit excessive for a single particular hobby.

One of the items I have learned through osmosis is that having regularly scheduled checkpoints to evaluate my personal life is important. Just like the feedback loop in software engineering presents a better product, a feedback loop in daily life is just as important. Software engineering says the feedback loop should be the shortest possible to completion; however, my feedback loop is every 3 months. This gives me enough time to cycle through and evaluate how I am doing without changing too rapidly. This last iteration, ending in September, allowed me to gather the data to know I was spending about 24 hours a week on social media.

This current iteration was filled with thoughts of, “I know I need to do something, but what!?” However, when Elon Musk bought Twitter, everyone scrambled off of it to their own respective platforms. It was then I remembered that a solution exists in the form of RSS. The content I want to view and consume is retrieved without the help of a company’s algorithm of keeping me on their platform.

I settled for Yarr as my feed reader and RSS-Bridge for middleware when RSS feeds were not available. I am hosting these apps in my Kubernetes homelab and am using Github OAuth for authentication. While I have only tested this option for several weeks now, it seems to have kept me out of the algorithm octopus. Preliminary observations have shown 3-5 more hours for other hobbies – such as sleep, books, video games, blog posts, and other silly stuff that is interesting to me alone.

I think I will keep LastPass

LastPass was recently hacked and the hacker was able to steal keys from a developer which had access to the company’s backup files. In the backup files, the hacker could use the decryption keys he stole from the developer to create something like:

somesite.com,<plaintext_username>,<hashed_password>

I can assume my data has been leaked. I am a LastPass user; however, I do not think this is good reason for my departure from LastPass.

This is not the first time a hacker was able to get this sort of information from LastPass. I was also a LastPass user during that time and my passwords were never compromised after than hack. The Zero-knowledge password storing employed by LastPass seems to have worked in the past, and I anticipate it being sufficient again.

As a safety precaution, I went ahead and changed my financial passwords, but other than that step, is there anything else that needs to be done? Perhaps I will change my Master password once more. If LastPass gets hacked again, at least all my SHAs will be different.

Incarnation Haiku

God became a man.
He experienced life.
A life without sin.

He, unworthily,
Received punishment for sin.
God the Son had died.

Three days have now passed.
And Jesus did not stay dead
He came back to life.

It was His power.
Without the help of others.
Life came back to Him.

By resurrection,
Jesus says, “Place trust in me.”
“I make all things new.”

This event declares
And even more loudly proclaims
Flawless victory.

Impossible to define

It is impossible to define a complex thought with one sentence. Even the previous sentence demands further information. What kind of thoughts do I mean? What is the reasoning for saying such a thing? Context adds further information to the reasoning behind such a statement. It also sets the stage for the real reason for the statement or provokes further thought.

If one considers the previous paragraph to be accurate in its message, then one should not settle for a single verse to explain a complex doctrine, such as salvation.

Asking ChatGPT to define love

As programmers develop new text generation methods, what can come as a result is interesting. Recently, ChatGPT responses have been propagating to Twitter, with many asking the AI text generator for common paradigms with known human solutions. Some posts have been insightful about how the chatbot was instructed to learn and associate words. However, to those who have programmed AI models, the shortcomings are apparent, and there is no immediate threat of a robot uprising. Currently, many perceived issues are corrected by inputting the correct wording to the chatbot, indicating the idiom, garbage in – garbage out, is still valid.

I was interested in asking the ChatGPT to clarify the love quality found in John 3:16.

Love is an emotion that is, in Christian circles, attributed to different levels or types of love. One can have a love for a sports team, a love for a spouse, and a love for chocolate. However, these types of love vary based on each object and the love holder.

In English, we would use the same word for love to describe the varying emotion, but in other languages, the varying degrees are expressed in different word choices. It is common for Bible preachers to equate Greek word choices with varying forms of love, such as in the dialog between Peter and Jesus in John 21. (Although Carson has made good dialog into overthrowing this perceived relation.1)

My recent study of the Greek text in John 3:16 revealed a language barrier between what is written in Greek and what is translated into English. When written, love was given a form without English verb equivalency. It is translated in the English past tense, which offers a sense of something performed in previous times, but does not apply to today. However, as John wrote in Greek, the phrasal action exists in an eternal state.

Perhaps ChatGPT could describe this immeasurable amount of love:

ChatGPT trying to express love by stating: Ultimately, the best way to express an immeasurable amount of love is to show it through your actions, and to make the other person feel loved and valued.

The response is what you would expect of popular psychology, being there for a person regardless of the circumstance. The fallacy of this thought is easily identified in a situation where the one you love has escaped from prison. In that instance, supporting them would require you to harbor a known fugitive – an act punishable by US law. It is also impossible to be supportive of everyone’s actions at all times. Can immeasurable love be shown to groups that have contrary opinions? However, this type of love is expressed in John 3:16.

God’s love is an immeasurable amount of love, which has lasting effects that continually build up. The potency by which God shows His love is presented through its conceptualization and increasing exponential power, which began in eternity past. In essence, God’s love will continually build upon the foundation until the recipient has no more room to receive it. At this point, God’s love is exponentially more.

The very nature of God’s love felt for the world is signified by this thought: God expressed it in giving the most prized possession He had – His only begotten Son. The power and intensity by which God loves are based on the virtue of Jesus Christ.

God so loved; therefore, He gave.

1 D. A. Carson, Exegetical Fallacies, 2nd ed. (Grand Rapids, MI: Baker Books, 2013). 51-53.

Back to the blogs

The painfully slow death of social media is pushing the masses back into our blog-o-spheres. In 2 years, the only people doing social media will be those who are not technical enough to click a one-button wordpress/ghost install and pay $5/month from a hosting provider.
Of course, there will be the faithful few who still insist that Markdown is the way to go.

For now, I want to experiment and see how a “status” post format works.

Use the same Dockerfile – please

As Containers have progressed, Docker has stood out as the defacto standard. As many of the laggards are coming up to speed, Dockerfiles can be seen in many open source repositories. With the addition to that, I have seen a few repos with a Dockerfile-prod, Dockerfile-dev, Dockerfile-test, etc.

Additionally, you find an IF clause in the CMD statement such as:

CMD if [ "$REACT_NODE_ENV" = "development" ]; \
  then yarn dev;  \
  else yarn build && yarn start --only=production; \
  fi

To those repositories, I have one daunting question:

WHY?

Container start commands can be overwritten at run time. Here is how to do it:

# Dockerfile
FROM alpine:3.6

CMD echo "production start command"
# docker-compose.yml
version: '3'
services:
  dev-server:
    build: .
    command: echo 'development start command'
# kubernetes-deployment.yml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cool-app
  namespace: cool-app-testing
  labels:
    app: cool-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cool-app
  template:
    metadata:
      labels:
        app: cool-app
    spec:
      containers:
      - name: cool-app
        image: alpine:3.6
        command:
        - echo
        - 'testing start command'

Docker-izing WordPress for Kubernetes

WordPress is amazingly popular considering how antiquated the file structure and code appears to be. Even still, it is the easiest CMS that I have used and the community has created plugins to make the copy-folder-for-a-new-theme/plugin at least tolerable. A challenge comes when one wants to use the 1990’s method of serving web applications in a more modern way (such as running inside a container on top of Kubernetes). Containers are meant to be immutable and treated as read-only. (No change to files in the container after they are built.) Containers are supposed to be a point-in-time release of software. As such, I can roll-back to a specific container version and have that specific code running. This causes a problem when one wants to use a file-dependent application such as WordPress. The best I could come up with for running WordPress in a container is a forward-only method of deploying code (basically, giving up the ability to use a previous version of code.) There is a way to keep that functionality, but it would mean storing everything (including uploads) inside an ever-growing container or using a central object store such as S3 for uploads. It would also require a re-build of the container every time a plugin is updated – which would presumably be every hour. My deployments of WordPress are so little that I can hardly justify using S3 for uploads, keeping the plugins in sync, and going backwards in time. When deploying to Kubernetes, one can scale the replicas to N copies. Keeping plugins, themes, and updates the same across all replicas will require a READ WRITE MANY (rwx) volume to be shared. This could be a GlusterFS volume or NFS, but it cannot be a AWS EBS volume or any other single-use block storage. When looking at the available WordPress images, there are three that seem interesting. With the official image, I like that I can use php-fpm and alpine. The next top two implementations of WordPress have very bloated docker files. I have come to the conclusion that my WordPress container will have to be built from scratch.
The Dockerfile is very similar to the official WordPress container. It uses php:7.2-fpm-alpine as the base image, adds in nginx, and inserts a generic wp-config.php file.
The folder structure for the container is as follows:
WordPress Container Folder
├── docker-entrypoint.sh
├── Dockerfile
├── html
│   └── ... Contents of wordpress-X.Y.Z.zip
├── nginx.conf
└── wp-config.php
It can be built by running a command similar to docker build -t andrewwippler/wordpress:latest .
nginx.conf is a very basic configuration file with gzip and cache headers. The real neat things come in the docker-entrypoint.sh file.
I borrowed the database creation script; however, since PHP was already installed in the container, I ran a few more checks in PHP rather than bash. For instance, the container places the local code in /var/www/html-original and rsyncs it to /var/www/html where the webserver sees it, but it only does this if the code in html-original is newer than html. This allows an operator to mount a storage volume at /var/www/html which can be shared across Kubernetes Deployment replicas. The code for this is:
// see if we need to copy files over
include '/var/www/html-original/wp-includes/version.php';
$dockerWPversion = $wp_version;

if (file_exists('/var/www/html/wp-includes/version.php')) {
    include '/var/www/html/wp-includes/version.php';
    $installedWPversion = $wp_version;
} else {
    $installedWPversion = '0.0.0';
}

fwrite($stderr, "dockerWPversion: $dockerWPversion - installedWPversion: $installedWPversion\n");
if(version_compare($dockerWPversion, $installedWPversion, '>')) {
    fwrite($stderr, "Installing wordpress files\n");
    exec('rsync -au /var/www/html-original/ /var/www/html');
}
I have also included a theme-only check that will update the theme if it has changed. This is necessary to update the theme files when the version of WordPress has not changed.
if (filemtime('/var/www/html-original/wp-content/themes') > filemtime('/var/www/html/wp-content/themes')) {
    fwrite($stderr, "Updating theme files\n");
    exec('rsync -au --delete-after /var/www/html-original/wp-content/themes/ /var/www/html/wp-content/themes');
}
All files I have referenced in this article are located in a gist. In addition to those files a local docker-compose.yml file might be helpful for your local development:
version: '2'
services:
  db:
    image: mariadb:10
    volumes:
      - ./tmp/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=secretPASS

  wordpress:
    build: wordpress
    volumes:
      - ./html:/var/www/html
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - db
    environment:
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=root
      - WORDPRESS_DB_PASSWORD=secretPASS
    ports:
      - 8080:80

Why Jesus and Easter Matters

There is a God and He loves you. John 3:16 says, “For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.”

Everyone is a sinner and our sin separates us from the love that God wants to express toward us  “For all have sinned, and come short of the glory of God;” (Romans 3:23) “But your iniquities have separated between you and your God, and your sins have hid his face from you…” (Isaiah 59:2).

Jesus came to break down the barrier of sin. “But God commendeth his love toward us, in that, while we were yet sinners, Christ died for us” (Romans 5:8).

The death of Jesus satisfied all the requirements, but Jesus did not stay dead. Three days later – Easter morning, He arose from the grave by His own power. “He is not here: for he is risen, as he said.” (Matthew 28:6) “No man taketh it from me, but I lay it down of myself. I have power to lay it down, and I have power to take it again.”(John 10:18)

Having a relationship with God is not about being good or religious. It is claiming the work Jesus fulfilled on the cross.

Jesus said in John 6:47, “He that believeth on me hath everlasting life.”

Those who trust in Jesus are saved from the penalty and power of sin and will have eternal life in Heaven with God.

“For whosoever shall call upon the name of the Lord shall be saved” (Romans 10:13).

Place your trust in Jesus today.

kubernetes health check

The day before thanksgiving, I was pondering an issue I was having. I was pinning a package to a specific version in my Docker container and the repository I grabbed it from stopped offering this specific version. This resulted in a container that Jenkins responded as being built correctly, but missing an integral package that allowed my application to function properly. This led me to believe I had to implement Puppet’s Lumogon in my Jenkins build process. Curious if anyone had something like this already developed, I headed over to github.com which eventually led me to compose this tweet:

This readinessProbe communicates with kubeproxy to either allow a pod to be in service or out of service. At first I thought the readinessProbe was a once-and-done check, but I found out later this is not the case. When a pod gets launched, kubernetes waits until the container is in the ready state. We can define what consists of a ready container by the use of probes. Coupled with a kubernetes strategy, we can also define and ensure our application survives broken container updates.

Since the application I am supporting is already HTTP based, making an HTTP check to an endpoint that reports on connectivity to core services was the most trivial to implement. I created a script to verify connectivity to MariaDB, MongoDB, Memcached, Message Queue, and verified certain paths on the NFS share were present. All of these items are important to my application and most of them require certain configuration values in my containers to operate. Having kubernetes run this script every time there is a new pod verifies I will never an experience an outage due to a missing package again. As I mentioned before, I thought the readinessProbe was a once-and-done, however, I found that after implementing it, my metrics indicated the script was running every 10 seconds per every replica… this quickly added up!

After some chatting in the #kubernetes-users slack, I was able to get more understanding of the readinessProbe and how it was designed to communicate with kubeproxy so that you could “shut off” a container by taking it out of rotation. This was not the behavior I wanted so it was suggested that I create a state file. This state file is created after the check and, if it is present, it skips all checks. Due to the ephemeral nature of container storage, it can be assumed this file will never exist on a pod where this check has not been performed.

Tupperware announces new container platform

Today, in a surprise move into technology, Tupperware has released a new container platform competing with Docker and rkt. Tupperware’s new platform – named Bowl – has been in alpha for the past 6 months, but now has achieved public beta status.

Tupperware party
An early photograph of a Tupperware party. This announcement was made at a similar one.

What’s unique about Bowl is that it introduces a new concept to containers – Lid. A Lid goes neatly on top of the container and seals the contents from evildoers and prevents bad code from escaping. Bowls, due to their circular shape, require burping the attached Lid. This burping maneuver was demonstrated live to the audience and was described as a method to keep the containerized application fresh across hybrid clouds. With Burping, we no longer have to worry about our code going stale inside of the container.

Unlike other containers, when done with a Bowl, they go through a cleaning cycle and are available for reuse immediately or stacked in a cupboard for later. Lids, associated with Bowls, are placed underneath to keep the associated roles in relative proximity. Unlike some deployments which require planetary alignment, Bowl comes in several predetermined sizes which negate this prerequisite. If for some reason your code does not fit in a Bowl size, multiple Bowls can be used. This feature instantly transforms your monolith application into a microservice architecture – all without refactoring your workflow!

Bowl will be showcased at global parties as early as next week, but preview respondents have come across the following remarks about Bowl:

It is so good that Tupperware has launched into the tech business. Tupperware already has such a good influence on minority groups and bringing an interest of tech to them is really a great idea.

Joan P

This isn’t your grandma’s container technology.

Jon S

I was surprised how well Bowl stacked up to the challenge.

Andrew B

And when you’re done, it doubles as a barber aid!

Rob N

This is exactly the kind of container I was looking for – Lightweight, secure, reusable, and dishwasher safe.

Chris B

Bowl is expected to integrate nicely with the next version of Kubernetes, which is due out next year.

Captive Portal Restaurant Menu

I have been contacted several times in regards to my captive portal post. In India there seems to be a surge in popularity for restaurants to have an open WiFi that prompts a user to open up a menu/splash page. The caveat being the legal issues encountered when providing free, open wireless internet. In order to avoid legal issues, the device that broadcasts must be disconnected from the internet. Although I am curious if just blocking internet access for those connecting is enough. 

It seems like an interesting issue to tackle, but I think creating something out of a WiFi captive portal would be like hammering a square peg through a round hole. It might work (if given enough time and effort), but in the end, it is probably not the right tool for the job.

While writing this post, I was reminded how Google appears to be tackling this problem. On my Android phone, I let the NSA spy on my whereabouts by enabling location services. It also lets my wife pinpoint where I am physically located. With it enabled, I can visit most shops in my area and get a Google maps prompt with the business information, reviews, and a few pictures. (Side note: if you appear in court over a childish/dumb action, you validate the judge’s decision when you post a negative review of the court house. Also please do not butcher the English language when trying to review places.)

Utilizing GPS location as well as having an app that provides the information seems like the best route to go in this circumstance. An alternative would be to have an app with WiFi credentials hardcoded in, listen for when a WiFi connection is made, check to see if it matches a predefined SSID, and attempt to communicate with a local app server to process data. Of course doing something like that is outside the scope of my tutorials.