Featured »

August 14, 2018 – 4:18 pm

The installation and configuration process for AWS CLI is fairly simple. The package itself is installed with pip (yum -y install python-pip):

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 Commands & Shells

AWS CLI Cheat Sheet

August 14, 2018 – 4:18 pm
bb3styfdt6jd861cmp7yt08l1dy

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

August 10, 2018 – 4:17 pm
ia2tligtgbuwpu9jmq6i45dw7op

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

August 8, 2018 – 4:15 pm
q5yhi1e570yliip0lf9srnrm6jh

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

August 7, 2018 – 4:14 pm
dztxi4tp1w58shuc1r6so6j9y5j

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

August 6, 2018 – 4:13 pm
217rvcg47is2ea039rna0gdwlnp

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

August 5, 2018 – 4:10 pm
xr89tucp33a2bjoopkqf67nq290

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

August 4, 2018 – 4:08 pm
ygtzk148sim2j4mgau6mkc2uur7

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

August 1, 2018 – 4:04 pm
dd1gh0yb7yzbkvf8cyjpd4j2adq

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

February 17, 2018 – 3:22 pm
odsiuofisdufohuodsifugoisdgf

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

February 17, 2018 – 2:59 pm
clock

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

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.

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 …

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 …

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 …