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.

Obfuscating Passwords in Shell Scripts

December 17, 2017 – 9:41 am
security_004

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

December 5, 2017 – 7:06 pm
shell

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. …

Occupy Subnet

December 1, 2017 – 2:15 pm
DSC_6214 copy copy

The script below (tested on RHEL 7) will use arp-scan to identify unused IPs on your subnet and configure virtual interfaces attached to your primary NIC to take over every available IP. 

Whiptail and Dialog Snippets

November 27, 2017 – 3:41 am
oiuekjhdhdh

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

November 14, 2017 – 12:24 pm
DSC_6744 copy

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 …

CLI System Monitoring Tools

November 12, 2017 – 12:24 pm
DSC_6236 copy copy copy copy copy

The multitude of sophisticated centralized monitoring tools available these days excel at one thing: telling you what happened while you’ve been sleeping. But what if you’re awake and need to know what’s going on right …

Useful MySQL One-Liners

November 8, 2017 – 12:16 pm
DSC_6805 copy

I am by no means an expert SQL programmer. Having said that, I’ve been using MySQL for a very long time. This is a collection of simple but useful SQL queries and MySQL configuration options. …

Checking Multiple Variables in Bash

September 19, 2017 – 10:04 am
DSC_8295 copy_1280

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.

Plotting Log Data

August 9, 2017 – 10:13 pm
logs_002

While I am on the subject of selecting time ranges from logs, a practical application presented itself. A lonely server in a far-away land with a habit of running out of memory could only be …

Croncal – the Cron Calendar

August 9, 2017 – 10:52 am
time clock watch

The croncal is a clever Perl script that reads entries in your crontab and outputs a schedule, showing the time when cron jobs will run.

Selecting Time Ranges from Logs

July 29, 2017 – 6:00 pm
shell_001

Consider a common situation: you would like to select lines from a log file that match a specific string, but only during a specific time frame. For example, my /var/log/messages contains entries from one of the …

Install and Configure Etckeeper

June 23, 2017 – 8:05 am
shell_0006

Etckeeper is a handy tool that uses git to keep track of changes to anything in /etc (or any other folder you choose). It’s very simple to use and can help you quickly identify and undo stupid …

Using IPTables to Allow Access to Private Networks

June 22, 2017 – 9:46 am
network_cable_01

Below is a quick example of how to use iptables to allow port access for all types of private networks. In this case we’re allowing access to ports 10000 and 20000, commonly used by webmin and usermin.

Parallel Rsync

June 10, 2017 – 3:55 pm
shell_003

This is an update of the script I originally wrote five years ago and used to migrate many terabytes of production data between two NAS systems. What’s new: more efficient subfolder crawling, more effective way …

SystemD: Back To The Future

May 23, 2017 – 8:38 pm
oiuwpoiiie

A creature in its death throes, Sun Microsystems gave birth to Solaris SMF – the product of a disturbing union between Unix System V and the Microsoft Windows Registry. Shortly thereafter the proud father died, …

Migrating Filesystems with Active Processes

May 2, 2017 – 1:47 pm
poiwiioiw

I’ve run into an interesting challenge: I needed to migrate application data from a local filesystem to NFS without stopping the processes running in the original mountpoint. Here’s a basic overview of the process. This …

Get a List of all ESX Hosts in a Datacenter

April 17, 2017 – 3:18 pm
storage barrels cluster hpc

Another simple one-liner to get a list of hostnames of all ESX servers in the vCenter. This can be useful for a number of things, specifically as input for other PowerCLI scripts.

Use PowerCLI to Change NIC Type

April 17, 2017 – 11:52 am
machine-gun-001

This is a quick PowerCLI script that reads from a list of VM names and for each VM with network adapter type “E1000” changes it to “Vmxnet3”. Nothing fancy, no reboot is needed. MAC should …

Pushing SSH Keys

March 21, 2017 – 10:54 am
security_006

This is just a quick note for me on pushing SSH keys using sshpass and xargs. The ~/hosts.txt file contains a list of remote hosts, one per line. And the ~/.passwd.txt contains your password. Make sure to chmod 400 …

Sample Salt Proxy Configuration for vCenter/ESX

March 20, 2017 – 4:15 pm
Spoon_Salt_Sugar_Black_Pour_1920x1200

The Salt proxy agent is a relatively new feature of Salt allowing to control networked devices where salt-minion cannot be installed directly. The official Salt documentation on the subject is outdated and full of syntax errors. It’s actually …

Configure and Run esxcli on Red Hat

March 20, 2017 – 3:58 pm
redhat_rhel_linux_0001

The esxcli utility is used to interface with the vSphere and ESX hosts. It is a useful tool for getting to some basic VMWare functionality from Unix shell. It is also a pre-requisite for some of …

Wget Examples

March 1, 2017 – 9:25 pm
dump truck

This is a follow-up to my previous wget notes (1, 2, 3, 4). From time to time I find myself googling wget syntax even though I think I’ve used every option of this excellent utility over the …