Articles in Featured
Finding Prime Numbers
I have no intention of competing with GIMPS. To me this is a fun scripting exercise that may produce useful results beyond this initial application. Our goal is to take a bunch of integers and …
Parallel MySQL Queries
Unlike Oracle, MySQL has no support for parallel SQL queries. A bummer for sure, in light of all the awesome multi-coreness we enjoy these days. There’ve been some attempts (1, 2) to get around this …
Tracking Network Connections Over Time
Firewall changes, datacenter migrations, application re-hostings, server decommissions are just some of the activities where having a record of network connections over time can help avoid confusion and unplanned downtime. To capture all network connections, …
Log Event Time Distribution (Part II)
Earlier I discussed a way to visualize frequency and distribution of messages in log files. Here’s a script to help you with that. Currently, the script works with two time formats: the one used in …
Securing VSFTP with TCP Wrappers and IPTables
I’ve been drinking beer and perhaps had one too many. Regardless of the reason, I felt the urge to further secure my favorite server. The target of my paranoia is once again the VSFTPd. I …
Create ISO Images
The genisoimage has been around for a few years, but is relatively little-known. It is a pre-mastering program to generate ISO9660/Joliet/HFS hybrid filesystems and is particularly good for creating portable data backups. Here are a …
Linux CLI Network Speed Test
The speedtest.net is probably one of the more popular bandwidth testing utilities, Unfortunately, this and many other similar tools require a Web browser with late-version Flash or Java support, which can be problematic on Unix …
Dealing with Runaway Processes
There is no official definition of a “runaway process”. Generally, it is a process that ignores its scheduled priority. It can also be a process that enters an infinite loop. Or it can be a process …
Practical TShark Capture Filters
The tshark is the command-line interface for Wireshark – a popular open-source network packet analyzer. A seemingly infinite variety of options make tshark an unlikely choice for casual use. Nevertheless, the power of CLI justifies the extra …
Simple Statistical Functions in Shell
Here’s a small collection of basic statistical functions you can use in your shell scripts. This may come in handy when analyzing disk space, system performance, etc.
Regex Collection
Just a small collection of POSIX regular expressions that may come in handy for writing sysadmin scripts.
A Better Mysqlcheck Script
Mysqlcheck is a stand-alone MySQL utility for checking, optimizing and repairing tables. It’s a useful tool that allows automating the usually time-consuming database maintenance tasks. One of the advantages of mysqlcheck it is ability to run …
IMDB Lookup Script
IMDB is one of the most complete movie and television databases on the Internet. It offers an advanced Web search UI, but Unix CLI support has been discontinued years ago and the old scripts no …
Ad-Hoc Analysis of /var/log/secure
The /var/log/secure contains a record of authentication and authorization activity on the system. It can be an invaluable resource for the purposes of intrusion detection and prevention. Below are a few simple examples that show how …
Salt Configuration Notes
Here are just some random notes on installing and configuring salt-master and salt-minion services. I figured I better write this down before I forget. Most of this is covered in official documentation, but in a very nonchalant …
Salt Snippets
SaltStack has decent documentation (at least compared to Puppet), but it’s a bit lacking on examples. There’s plenty of simple stuff that is useful if you’re managing a handful of nodes. However, why would you …
VSFTPd, SSL, and Firewalls
If you ever wanted to configure SSL/TLS encryption for an FTP server behind a firewall, the “Google wisdom” ranges from “a major pain” to “can’t be done”. Fortunately, things are not all that bad. In …
Multithreaded Encryption and Compression
One problem with encryption is it’s a slow and resource-intensive process. While most encryption software lacks multithreading support, it is possible to use the GNU Parallel to take full advantage of modern multi-core CPUs to …
Filesystem Syncronization with Lsyncd
Lsyncd monitors a local filesystem for changes and mirrors those changes to a filesystem on a remote server. The advantage of lsyncd over rsync is the former’s ability to detect filesystem changes without having to re-scan …
Toilet Fun
It’s been a slow Friday afternoon at the office, so I decided to pimp my VM. The tool of choice is “toilet“. Depending on your flavor, this may or may not be easy to install. …
Resizing Hitachi VSP LDEVs (LUNs)
Resizing Hitachi VSP LUNs (aka LDEVs) is a quick and simple task. Unfortunately, due to Hitachi Storage Navigator’s archaic design, the LDEV resize function, while easy to use, is not easy to find. So, here’s …
Rescanning New LUNs on VNX
Just a quick background of the little problem I ran into with our VNX: after creating a couple of LUNs for the mapped file pool using Unisphere, I clicked “Rescan Storage Systems” and got “This …
Latest Comments