Shell Script Articles
It’s happening again. I’ve grown a bit tired of Debian, and have started to long for all the bleeding edge glory that is Arch. As this is a semi-frequent occurrence in my life, I’ve gotten pretty good at juggling distributions within my shell scripts, specifically in my dotfiles. Since each
[…]
I write a good amount of shell scripts, but I tend to use arguments pretty sparingly. Because of this, my implementation to handle said arguments tends to be pretty weak. Some good examples are the arguments needing to be passed in a specific order and a lack of using long
[…]
There comes a time in every software engineer’s life, when they need to run a command, but only after a port has been opened by a completely separate process. Sure, you could sit around and wait for the port to open up before running your command, but what’s the fun
[…]
Arrays, both indexed and associative are a powerful and versatile data type, regardless of the language you’re utilizing them in. At one point in Bash’s history, pre-version 4.0, Bash only had indexed arrays. These indexed arrays were defined as such: # Initialize an array with values arr=("first" "second" "third") #
[…]
While I do love the command-line, and will throw shell script at most problems if it’s the right tool for the job, it’s actually fairly rare that I write case statements. Generally speaking, my shell scripts will usually interrogate a variable or two, never too crazy or anything. With that,
[…]
Last year I had sunset a project that was using both AWS’ S3 and Linode’s S3-compatible object storage offering. After pulling down some final snapshots, I wanted to delete the buckets on both services. Similar to the error you receive when you attempt to rmdir a directory with files in
[…]
Generally speaking, when I need to work with an array or dictionary type of variable, I tend to reach for something other than Bash / shell scripting. This primarily stems from the fact that Bash didn’t support arrays until version 4.x and when I first learned about them, macOS (then
[…]
Even though the command-line is like my second home, I still fall short in terms of being able to some basic things. This is primarily because they just don’t come up that often so when I do figure out how to do it, I just don’t retain what I’ve learned.
[…]
Automation is one of the best ways to improve productivity. Even as a development team of one, spending a bit of time on DevOps and improving your developer quality of life can pay off immensely. Automated tasks strip away cognitive load. No more forgetting to deploy code because the process
[…]
I’m known for having a lot of projects. These days I have a day job, am trying to grind out more posts a week on this blog, regularly write for Alligator.io, run HolidayAPI and Ginpop and am currently on the “advisor track” for Startup School with CrowdSync. This list doesn’t
[…]
I’ve been spending more time at the pool lately (sorry, not sorry) and I’ve found myself manually switching between a light and a dark gnome-terminal theme. This was all well and good, but my .vimrc includes set background=dark so regardless of which theme I’m using in the terminal, vim has
[…]
If you’re like me, you use Vim. If you’re like me, you use :sh[ell]. If you’re like me, you forget that you used :sh and open Vim again. I’ve been getting better about it, but every once in a while I end up with 2 or 3 nested Vim processes
[…]
It’s happened to all of us. A script just locks up and we’re unsure why. At closer inspection we find that we’re written a loop that has no terminating condition. It is an endless loop and in many cases consumes memory until it crashes. But what if you want to
[…]
Fact: Shell aliases save you time. Fact: Saving time increases your productivity. Fact: Everybody wants to be more productive. Fact: Retraining muscle memory can be a pain in the ass. I have been fighting that last fact for a while now. I have the single character alias v pointed to
[…]
The start of 2014 has been an exercise in going back to basics for me. I’ve been re-evaluating my workflows when hacking and attempting to streamline as much as humanly possible. This has resulted in a ton of new aliases in an attempt to get my common CLI commands down
[…]
This post was originally planned to be a social commentary on the potential for riots this coming Novemeber (a/k/a The 2013 Food Stamp Riots a/k/a The Backlash of the Entitlement Society) but that seemed like such a fucking downer. Then the post was supposed to be about a Python script
[…]
Last week I discussed the importance of version control for individuals but something I didn’t touch on was how version control systems can be used to simplify and/or automate deployments. I’ve been through the different setups out there, using plain old rsync, leveraging GitHub’s Post-Receive WebHook to call a URL
[…]
One thing that I really enjoy about OSX (possibly the only thing) is the text to speech capabilities. The command line application say sounds good and doesn’t seem nearly as buggy as some of the open source counterparts. Now what I’ve been doing recently to help get my daughter acclimated
[…]
Just cleaning up a repository at work and came across a script I haven’t used in forever, a script to lint all PHP files in a directory, recursively. Expect something more stimulating soon as I found out the hard way that tumblr doesn’t seem to auto-save your posts once you’ve
[…]
So after giving Gwibber an honest try for a few months, I’ve decided it’s time to move back to DestroyTwitter for my tweeting needs. Unfortunately, earlier in the year when I completely denounced Adobe products (specifically Flash) I went ahead and completely removed Air from my system. But alas, I
[…]
So I have a tendency to add a bunch of new files to a project before actually doing a commit in Subversion. It’s usually not an issue, I go through an add each new file and then finally do my commit. Welp, I’m sick of it, so I wrote a
[…]
I just came across an old CD of Fonts that I had purchased before I knew better. Well I didn’t want to throw the disc out without copying all the fonts to my system. All the fonts were broken up into directories that corresponded to the first letter of the
[…]
So if you’re a Linux user that’s ever used Solaris, you know that a lot of the commands don’t translate exactly the same. One such issue is the lack of a recursive flag (-R) on the grep command. Not a problem though, bash is a powerful thing. Here’s my solution
[…]