Articles in Commands & Shells
Gnuplot with Bash
OK, so both of these things have been around forever and will be around long after we’re gone. It’s worth your time to learn how to use the to together.
Multi-Dimensional Arrays in Bash
Bash does not support multi-dimensional arrays, but there is a way to imitate this functionality, if you absolutely have to.
Asciinema Notes
Asciinema is an awesome tool for recording your console sessions. It’s great for documenting processes and, in general, showing people how shit works: one look is worth a thousand words, as they say. Unfortunately, I …
Killing Process Network Access
Imagine this scenario: a particular process on your server is connecting to a host outside your internal network and you don’t like that. On the other hand, you can’t just kill that process because you need it.
Installing t CLI power tool for Twitter
The ‘t’ is an excellent Ruby-based CLI utility for interacting with the Twitter API written by Erik Berlin. This is certainly not the only such tool available, but, in my estimation, it is the most full-featured and expertly-written. No amateur-hour coding here.
Auto-Update /etc/hosts
This was a silly solution to a silly problem, but may come in handy in the future for other things. A user process was establishing frequent connections to a handful of FQDNs. Not having any IP caching capability, every connection attempt was preceded by DNS lookup.
Automating Web Page Screenshots
Automatic Web page screenshots are commonly used for various monitoring tasks, such as detecting copyright infringement, website defacement, and other legal and security matters. Automatic screenshotting can also be a useful tool for researchers, developers, and journalists. There are free and open-source tools out there that can help you automate the task of creating Web page screenshots.
AWS CLI Cheat Sheet
The installation and configuration process for AWS CLI is fairly simple. The package itself is installed with pip (yum -y install python-pip):
Copying X11 Magic Cookies
I rarely use GUIs, but when I do, it’s from CLI and every time I run into the annoying MIT-MAGIC-COOKIE-1 data did not match error. It’s easy to fix, but it happens to me so …
Verify Network Port Access
There are several tools you can use to verify access to a remote network port: nc, tcping, telnet. Unfortunately, nc from the netcat package has been replaced by the one from nmap, which lacks the -z option, making …
Deleting Hidden Files
This simplest of problems just never fails to find a new victim. For whatever reason you want to delete all hidden files in the current directory and subfolders. Without much thinking you just type rm …
Quickly Grow tmpfs filesystem
Just a quick command to double the size of the /tmp filesystem that uses tmpfs. This is for those situations when you can’t be bothered to think.
Duck Duck Go Search from Shell
The ddgr python script is a command line interface for Duck Duck Go – a privacy-oriented search engine that, unlike Google, will not give away your data to the likes of Cambridge Analytica. In the …
Document Conversion with Unoconv
The other day I ran into the “Flexible Import/Export” article by Bruce Byfield in the March 2018 issue of Linux Pro Magazine and thought it could use some more detail. So here’s some more detail.
Obfuscating Shell Scripts
Unix shell scripting language is run by the command-line interpreter and, as such, can be read and understood by anyone with sufficient access and experience. Sometimes this is not a good thing. Sometimes you want …
Tmux Bootstrap Configuration
Just a list of commands to quickly configure tmux with some of the best (i.e. my favorite) plugins and options. Feel free to disagree – you may be right – but I don’t think so.
Show Logged In Users During a Time Window
Let’s say you want to see who was logged in on the server during last weekend. This includes users who, say, logged in on Thursday and haven’t logged out until Saturday afternoon.
Obfuscating Passwords in Shell Scripts
At the risk of repeating myself, I must say that this article is about obfuscating passwords – rendering obscure, unclear, or unintelligible – not hiding them. This can still be useful.
Extracting Email Addresses from TCP Streams
Here’s a quick example of using tshark to extract email addresses from TCP streams. Let’s say some application on your server is sending emails and you want to find out who is receiving those emails. …
Whiptail and Dialog Snippets
Whiptail is a newt-based utility allowing to build pseudo-graphical dialog boxes from shell scripts. Dialog uses ncurses and is similar to whiptail but has more options and, consequently, a bit harder to use. I find both useful …
Export WP Posts and Sync to Sharepoint
Long story short: old wiki is overloaded and broken; new wiki is not a wiki but SharePoint – a glorified file server; people are forced to improvise and put documentation on a WP wiki; bosses …
Checking Multiple Variables in Bash
Let’s say you have a dozen variables in your script and you need to check if they have values set. The usual approach can get a bit tedious.

Latest Comments