🏚️ Home


Jan 30, 2020
Note: github.com links in this post are no longer functional as of September 2022

Early in 2018, I took a Linux administration class. I took two, actually. But for the purposes of this post, only the second is relevant. A decent portion of everyone's grade depended on creating and demonstrating a shell script. We were given two options for this task: Create a script according to a design the teacher had made, or come up with our own design. The latter was obviously going to be more interesting, but complete freedom with no direction is a challenge of its own.

My instinct in meeting this challenge was to play with pretty colors. I love pretty colors.

colorful shell script
While true: break.

Before long, I found myself with the script pictured above. Just what anyone needs—as long as what they need is a 32x64 grid of randomly-colored ដs. My ability to vomit colors onto the screen was unparalleled. But what to do with this ability..? You guessed it: rebel against my lack of GUI. I knew how to make grids with many colors. Pictures are grids with many colors. It was a match made in heaven.

My initial plan for presentation was quite dramatic. I wanted the picture to slowly load pixel by pixel. Perhaps a feeling of nostalgia for the days of dial-up. The days I never experienced at all. Saudade, dial-up.

It is important to note that this could not have been achieved without writing the script as root, by the way.

The random colors that I worked so hard on simply had to be incorporated somehow, so I used them to fill in the parts of the screen in which there were no loaded pixels. As I did not yet know how to read image information, I tested this presentation style with the color red acting in the stead of an image. It was a success! I could now vomit random and predetermined colors onto the screen.

What followed were hours and hours of googling, copying, and pasting. Of chief concern was gaining the ability to read the color information of an individual image pixel. If I had one, I had them all. Time united me with ImageMagick. My savior! Not only did it allow me to read individual pixel information, it allowed me to resize pictures as well! A handy tool. The googling, copying, and pasting continued.

It continued until, one day, I completed my task. I had done the inconceivable. An image in the terminal.

demo of shell script drawing a legend of zelda character
A masterpeice indeed.

As you can see, I gave the user a massive amount of control. You can't trust just anyone to select a resampling filter. You really can't, so I removed that option later. Now I have some good news or bad news for you: the story does not end here.

Early in 2019, I took a data structures class. I was introduced to C++ and graded on, among other things, code formatting. Almost everyone complained about this. Perhaps almost is an underestimation. Nevertheless, the experience quickly inspired me to look back at my ancient project from the previous year. According to git, it was still January when I made my move. How's that for quickly? Reading the script was painful. So I did my best to ease the pain. Maybe it worked. Maybe it made things worse. Who can say? Dr. Abrahamson can. Hopefully he doesn't.

Early in 2020 (that's this year), I was avoiding my operating systems notetaking. I disguised this waste of time as a productive use of time by fiddling around with python. Can't fault me for trying to learn. And what better way to familiarize yourself with a new language than to implement an old design? Certainly not Hello World. Within one sitting, I had pycthing. Better, faster, stronger than picthing. No ImageMagick. No awk. No typo. Just a few python libraries. Cause for celebration, I say.

2022 Note: This is heretical. I'm sorry that I ever besmirched the name of ImageMagick like that.

shell script drawing kirby
At the end of the day, my favorite thing about this project is that it has absolutely nothing at all to do with Linux administration.