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 »
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.
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. …
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 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 …
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 …
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 …
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. …
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.
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 …
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.
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 …
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 …
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.
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 …
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, …
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 …
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.
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 …
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 …
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 …
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 …
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 …
Latest Comments