Category: Command-line Interface
-
Using multiple profiles with aws-cli
One of the best aspects of Amazon Web Services (AWS) is that a full featured command-line utility exists for it. If you’ve ever spent a decent amount of time in the AWS Console (their web interface) then you understand why this is a good thing. As you venture into better…
-
How to use an SSH tunnel to forward ports
Security is important. Bastion hosts (or jump servers) are an easy way to wall off your private servers from the outside world. Improved security is always a good thing, but it isn’t always convenient. With a bastion host in place, you shouldn’t be able to connect directly to a private…
-
Execute command in timed intervals
Running a command (script, program, et cetera) on a regularly timed interval can be accomplished a few different ways. One way, is to leverage the crontab utility, which schedules runs to run one or more times per day. While a fantastic utility, crontab can be a bit heavy at times,…
-
How to run a command after changing directories in zsh
About once a year or so, I go through my dotfiles and do some clean up. Usually around spring time, but also, usually after I discover some new hotness that I had not known about that I want to leverage. This year, it’s both. Spring is nearly in the air,…
-
Reattaching to a still attached GNU Screen session
While tmux is my daily driver for local terminal multiplexing, I still use GNU screen when I’m working on remote servers. The primary reason for this is to avoid nesting tmux sessions. I can use tmux locally, ssh to a remote server, start up a screen session and I’m off…
-
Associative arrays in Bash
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”) #…
-
Monitoring the progress of dd
Whether you’re zeroing out an old disk drive or creating a USB flash drive with your favorite Linux distro, dd is there to take care of business. One of the shortcomings of using dd back in the day was the lack of transparency into what it was actually doing and…
-
How to push an empty git commit
We’ve all been there. We need to trigger something from a commit to a git repository, and instead of triggering the build directly, we end up tweaking something in a file, committing it, and pushing it. It’s usually just adding a blank line (and subsequently removing it, depending on where…
-
Migrating from aws ecr get-login to aws ecr get-login-password
I’m not entirely sure when the change happens, but recently as I was upgrading AWS CodeBuilds to use a newer version of Ubuntu, I ran into some problems with aws ecr get-login. Without making any code changes, my build started to fail with the following: [Container] 2021/06/21 20:44:19 Running command…
-
Using find with symbolic links
Symbolic links, or symlinks come in handy when you need to share directories with multiple directories and not have to worry about keeping each linked instance in sync. The problem with symlinks is that not every command-line utility supports them, and often times, they do support them, but it’s not…