Featured »

March 2, 2022 – 2:00 pm

Books have been written on the subject of awk and sed. Here’s a small sample of commands I put together over the years that are useful for everyday system administration tasks. Most of these tasks …

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Archive by Category

Articles in Data

Synology NAS Hacks

February 22, 2022 – 1:58 pm
rhd3hj6zvnqeth7qo8em0alduj0[1]

I’ve been using various Synology NAS devices for many years now, and they’re great. Well, almost. There are a few rough spots that don’t thrill me. These consumer-grade devices are designed to be difficult to …

Finding Duplicate Photos

February 15, 2022 – 1:57 pm
9dwz62kvm0gtjya9kwb7pawtk9y[1]

Being a shutterbug and a digital hoarder can get expensive. A couple of days ago, my
TerraMaster D5-300 5-bay DAS crashed. Again. This time it was the power supply. I replaced it only to discover that …

Focus Stacking with Lightroom and Photoshop

January 24, 2022 – 1:50 pm
zxulfg358ydpeyelfjppawbkxhr[1]

Not the usual topic for this blog and not the most comprehensive guide on the subject out there, but here I go anyway. Focus stacking combines multiple photos taken at different focal distances into an …

Generating Honeypot Data Structure

January 17, 2022 – 1:49 pm
on7avnij18ozm2jvppgdny2lhlv[1]

I’ve been fiddling with my inotifywatch scripts to make a better “early-warning” system for ransomware detection and realized I needed a more realistic honeypot data structure. Ransomware is getting more clever and is no longer …

Inventorying NFS Mounts and Mount Options

December 26, 2021 – 1:41 pm
4ucne6vs8m7hqdl0el9ddqd1sql[1]

As time goes by, NFS mounts multiply like rabbits. Added by many different people over the years, these entries present a dizzying variety of mount options – most are a copy-paste job that makes little …

Automatic File Backups in VIM

December 21, 2021 – 1:37 pm
bqlpzjqba7fn1jtghunz0z1vv5d[1]

Having to undo stupid changes to config files is an unfortunate side effect of too few sysadmins supporting too many servers. The VIM editor has some built-in file backup options. However, I find these options …

Joining Text Files and Data Columns

December 18, 2021 – 12:17 pm
p65q1znipa66jngo3jjvbnmb7s7-scaled[1]

When working with application logs and other text files, it is often useful to view the contents of different source files side-by-side. Here we will take a quick look at various command-line methods for joining …

Decision Making Using Python TOPSIS

November 20, 2021 – 12:03 pm
96wed5sso8yxby9c0qj83cnkh6s[1]

In a nutshell, TOPSIS – the Technique for Order of Preference by Similarity to Ideal Solution – seeks out one of many options that is the closest to the ideal option while at the same …

Laziness vs Phishing

October 21, 2021 – 2:02 pm
43v0r4nyow1rbpxrr6gunkcbfcj[1]

Here’s an interesting article detailing the methods scammers use to steal your one-time passwords for Coinbase.

A Wrapper Script for unrar

October 21, 2021 – 11:51 am
53wmyx6na9379un1mmku8ibq6x6-2[1]

Just a straightforward wrapper script for the unrar command that allows extracting specified filetypes from multipart archives while utilizing all available CPU cores.

Convert XLSX to a MySQL Table

October 14, 2021 – 11:49 am
7auipjfjec4veay7sa4hrw32xzg[1]

Some people find it hard to let go of Excel even when the situation is ripe for a database. And so dozens of different versions of the same spreadsheet edited by many people are floating …

Generating IP Whitelists

October 7, 2021 – 11:44 am
sonlxanvz0en50ijq03cedkaz2e[1]

I have several scripts that scan various log files for signs of suspicious activity and block the offending IPs on my Web servers – pretty standard stuff. The trick, of course, is not to block …

Scraping a Web Page in Bash

September 23, 2021 – 11:33 am
clfud46mxf2t5zph2l04zlpgl1d[1]

Just a scripting exercise because I need to do something important, but I am procrastinating. The idea is simple: grab some URL with text containing somewhat structured data and convert it into a spreadsheet. I …

Generating Random Text Files for Testing

September 16, 2021 – 11:31 am
91ebozy1e3b138waujy28agrngy[1]

Sometimes you need dummy folder structures populated with random data for testing your various scripts and processes – backups, file transfers, encryption, compression, etc. Every time I need something like this, I end up writing …

Renaming Files with exiftool

September 2, 2021 – 11:25 am
b8g72yca7casi5shj7otypjbi20[1]

Recently I exported a whole bunch of files from Lightroom to a NAS share and filenames like 2E570434-67B7E0489CA2-39354-000017CF24DD8ACD.jpg are not very informative. It would’ve been nice if the filename contained some useful information like date, …

Fixing Sudo

January 28, 2021 – 11:53 am
c3i8vv2eqg40fc05p9whm8yjys0[1]

A decade-old massive and easy-to-exploit security hole (CVE-2021-3156) has been found in sudo allowing for full root access by any unprivileged system user. This is one of those rare security bugs you can’t delay remediating.

Bulk Create Linux Users using Salt

October 9, 2020 – 1:48 pm
l5km2qq7sz7bbvg5pra24eygsdp-2[1]

Recently I ran into a situation where hundreds of VMs recently built via OpenShift/Ansible automation were missing an important local user account used for security audits. While our automation guys were working on tracking down …

Checking Linux Account Password

October 8, 2020 – 1:46 pm
IMG_5456-scaled[1]

On occasion you may need to check if an account has a specific password. For example, when you build VMs, you may use some default passwords for some default accounts (i.e. root) that should be …

Updating Lynis

October 6, 2020 – 8:22 am
IMG_5427

Lynis is an excellent security audit tool for Linux and various Unix derivatives. I have a small wrapper script that runs Lynis via a cron job, does a selective diff with the previous run’s output, …

Hiding Passwords

October 5, 2020 – 8:20 am
IMG_5301

I’ve touched on this subject previously, but suddenly felt I should repeat myself. The big issue with using passwords from command line is shell history.

Backup Options for Raspberry Pi

October 3, 2020 – 8:16 am
IMG_5275

Just about every Raspberry Pi I used suffered the same fate: the micro SD card died. It is generally accepted that the expected lifespan of an SD card is around ten years of normal use.

Backing Up WSL Images

October 1, 2020 – 8:13 am
v7oe8qnrpcxhmu3bw4m0qrja3uz

Microsoft’s WSL is interesting. I’d go as far as to say that I like it. The mistake here would be to forget that your Linux image is running under Windows, with everything this entails. Making …