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.

Remounting Active NFS Filesystems

January 23, 2013 – 12:57 pm
switch_003

Here’s a scenario: you have an NFS client mounting a filesystem from server1. You need to migrate this data to NFS server2 and remount the filesystem from the client to point to the new server. The problem is that there is a user application on the client system that uses the NFS mount, preventing you from unmounting it.

Uninstall PostgreSQL from Ubuntu

January 4, 2013 – 1:22 pm
postgresql_logo01

Ok, so this is a very simple one: uninstall PostgreSQL running on Ubuntu. There are a bunch of pieces to the database server and just running “apt-get remove postgresql” will still leave you with with a bunch of leftovers

Quick BTRFS Test on OpenSuse 12.2

December 13, 2012 – 11:08 am
chameleon_01

The recent announcement from Suse Enterprise Linux that Btrfs was production-ready raised some suspicions. The last time I tested btrfs (not very long ago) the primary issues were excessive CPU utilization and filesystem space that seemed to disappear into nowhere. So, as a quick test, I put together an OpenSuse 12.2 (3.4.6-2.10-desktop, OpenSuse 12.2) 64-bit VM (ESX) with one dual-core vCPUs, 4GB RAM, the OS disk and a 6GB striped LVM filesystem consisting of 4 4-GB virtual disks.

A Faster Way to Delete Many Folders

October 24, 2012 – 11:00 pm
shell

This issue is particularly annoying when dealing with expansive directory structures mounted via NFS. Let’s say you have a directory with ten thousand folders and each of them has more subfolders and files. And you …

Fixing the mount.nfs: rpc.statd is not running Error

October 22, 2012 – 4:11 pm
linux_penguin_0002

The rpc.statd service is used by NFS client to help it recover from loss of connectivity to the NFS server. When rpc.statd is not running, NFS is not able to handle remote file locking. You …

System Recovery: Useful Tools

October 18, 2012 – 9:48 pm

The following is a brief collection of open-source and/or free tools I regularly use for various system recovery tasks. If the servers you work with have CD drives, I would recommend burning these images onto a CD or DVD. This would save you the trouble of messing with the boot options in the BIOS. More advanced versions of BIOS can mount remote ISO images and boot from those. In most cases, however, this approach requires using the dreaded Internet Explorer an requires Windows.

Dealing with Blank Lines in WordPress functions.php

October 17, 2012 – 1:06 am
wordpress_0003

This is an annoying little problem plaguing many WordPress themes: blank lines in the themes’ functions.php cause various random issues. The most common manifestation of this condition is the failure to save the “image” custom field. Below are a few commands to apply a quick fix. Unfortunately, these steps would need to be repeated every time you upgrade your theme, until the developers catch on. To simplify this task, I arranged the commands into a little script that will create a backup of your original functions.php and make the necessary changes.

Searching Large Network-Mounted Filesystems

October 16, 2012 – 4:14 pm
shell

Recently I ran into a small problem: I needed to find recently-modified files in a very large NFS filesystem. One of the high-level folders contained dozens of sub-folders with thousands of files in each. There is a significant performance penalty associated with placing such directory structures on network-mounted filesystems. Running the “find” command at the top of the filesystem would have taken over an hour and the problem here was not available bandwidth, but the time it takes for the “find” to request and receive attribute information for each folder and file.

Simple Shell Random Password Generator

October 2, 2012 – 10:54 am
shell_0002

A very simple script to generate a random secure password of desired length. This can come in handy when setting up multiple user account and/or lacking imagination.

Solaris 10 SVM/SDS Mirrored Root Disk Replacement

September 25, 2012 – 3:08 pm
sun_solaris_0001

The following is a standard process for replacing a failed boot disk mirrored with SVM on a Solaris 10 Sun server. Your hardware must support hot-swappable disks for this process to be performed without booting into single-user mode.

Generate Encrypted Password for /etc/shadow

September 16, 2012 – 12:46 pm
Internet Security System

Here is a simple way to generate an encrypted password string for use in Linux /etc/shadow, among other things. This is just in case you don’t wish to use the usual tools for changing the password (passwd, chpasswd).

Import CSV into Excel Spreadsheet via OLEDB

September 6, 2012 – 2:53 pm
spreadsheet

The following is a quick how-to explaining the process of importing an external CSV file into an existing Excel spreadsheet. This approach can be very handy if your CSV data is updated regularly by some external application. Keeping the formatting in the spreadsheet and pulling fresh data from a separate CSV is the way to go. The instructions below are for Excel 2010 running on Windows 7 64-bit. Command syntax for other versions of Excel and other platforms may differ.

Use wget with Your Rapidshare Account

July 8, 2012 – 10:40 pm

If you have a Rapidshare premium account, you can use wget to download files. The process is two-fold: first, you need to use wget with your Rapidshare username and password to obtain and store the Rapidshare cookie; then, you can use wget with the cookie file to download a list of links.

Configure Postfix to Use Gmail for Sending

May 16, 2012 – 12:52 pm
Postfix_logo

Here is a simple script to help you configure Linux postfix to use your Gmail account for sending emails. The script has been tested on OpenSuse 11.4 and 12.1, but should work find on any recent Linux disro. The only requirement is that you have postfix insalled.

Show Allocated / Used Filesystem Space Summary

April 17, 2012 – 9:31 pm
shell

On servers with many filesystems calculating filesystem space utilization summary can get very tedious. Below is a simple script that will summarize all filesystems and provide you will the totals for allocated and used space in GB.

Linux LVM: Reduce Filesystem and Logical Volume

March 14, 2012 – 5:07 pm
hard_disk_drive_hdd_0002

The following example shows how to reduce the size of a filesystem mounted on an LVM logical volume. The instructions below are only for non-root filesystems. No reboot is required, but the filesystem will need to be unmounted. So, if there are any user applications using this filesystem, they will need to be stopped and the users will need to log out.

Playing With Time in Bash Shell

February 24, 2012 – 11:38 pm
time clock watch

The “date” command in Bash shell offers a remarkable array of features that can be very useful in performing many system administration tasks. As you will see below, it is easy to determine date, time, day of week for any interval of time. This can be very useful for system automation tasks with “cron” and “at”.

A Simple Process Monitoring Script

February 22, 2012 – 11:28 am
968780_94091618

Let’s say you are running a data restore. Things are moving along, but network is congested and the backup server is overloaded. You really don’t feel staring at the restore status for the next several hours and just want to be notified when the process completes. The simplest method of monitoring for processes starting or ending on Unix systems is by using “ps” with a “while” loop.

Compress Old Log Files on Linux

January 12, 2012 – 6:06 pm
hard drive disk

Most log files located in /var/log are part of the log rotation and will be compressed automatically. However, in many cases various user applications maintain log files outside of /var/log. These logs are not managed …

Testing SSH Connectivity to Multiple Servers

December 27, 2011 – 2:46 am
shell

Imagine a hypothetical scenario: you support hundreds of remote servers and you need to check which server you can access via SSH and which servers are not letting you log in. Doing this manually is a tedious process that many sysadmins choose to skip. The inevitable outcome is inability to quickly access a system when it really counts.

Quick Review: Boxee Box

December 27, 2011 – 12:22 am

Some of the technical issues with Boxee Box could have been fixed if the dev team was paying more attention to addressing the bugs rather than adding “features” of dubious value. In the final analysis, for the price and ease of use, Boxee Box is the best in its class and price range. You just need to be mindful of its limitations and buy it in hope of future improvements to its usability.

Be a HERO and Help STOP SOPA Now!!

December 23, 2011 – 12:24 pm