Server and Network Monitoring with iPhone
February 25, 2010 – 6:53 pm | No Comment

What is a Unix sysadmin doing with an iPhone, you ask? It was a birthday present, if that’s all right with you. I know, I should have gotten something odd with a beta version of …

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 and 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 Scripts

Windows Network Troubleshooting Script
January 20, 2010 – 10:15 pm | One Comment
Windows Network Troubleshooting Script

I try my best to stay away from Windows. I wish my clients did the same. The usual difficulty of troubleshooting elusive network performance problems is amplified many-fold when there is a Windows computer at the end of the line. With Unix it’s relatively simple: run tests “a”, “b”, “c”, etc and follow the familiar process of elimination. With Windows in the picture the number of steps uses up all of the English alphabet and spills over well into the Russian one. And when you finally reach step “я”, you have to pull out your Chinese dictionary.

WordPress File Upload Size Limit
December 25, 2009 – 9:24 pm | No Comment
WordPress File Upload Size Limit

By default, WordPress will not allow you to upload a file larger than 2Mb. This limit is not set by WordPress itself, but by detaul PHP configuration. This configuration file is usually /etc/php.ini, but normally …

WordPress Backup Script
October 23, 2009 – 1:04 pm | No Comment
WordPress Backup Script

Whenever a new WordPress version comes out, I get an itch to upgrade as quickly as possible. Generally, this is not a good idea, unless you enjoy working out new software bugs and dealing with …

Shell Scripting for HPC Clusters, Part 2
October 23, 2009 – 12:30 pm | No Comment
Shell Scripting for HPC Clusters, Part 2

This is the second installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters. You can view the first part of the guide here.
Searching, Replacing, Comparing
Try to work with a large cluster and …

Shell Scripting for HPC Clusters, Part 1
October 10, 2009 – 12:59 am | One Comment
Shell Scripting for HPC Clusters, Part 1

This is the first installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters.
“For” and “While” Loop Constructs
The main challenge of supporting a Linux cluster is ensuring a homogeneous environment. Aside from small …

Shell Random Number Generator
August 4, 2009 – 2:58 pm | No Comment
Shell Random Number Generator

Sometimes, in the course of writing shell script, a need arises for some random input. Using the built-in $RANDOM shell variable will give you a random number from 0 to 32767 . Let’s take a …

Duplicating WordPress Installation
June 25, 2009 – 2:51 pm | No Comment
Duplicating WordPress Installation

Whenever you upgrade your WordPress installation or do development work, it is always a good idea to be working on a copy of your main site and not on the real thing. Copying WordPress installation …

Restart Apache, MySQL When Low on Memory
June 25, 2009 – 4:27 am | 4 Comments
Restart Apache, MySQL When Low on Memory

Heavy traffic, hungry SQL queries, leaky applications will eventually leave your server low on memory. Apache will go on a hunt for swap space and MySQL will start freezing in thoughtful contemplation. Your hard drives …

MySQL Global Search and Replace Script
June 25, 2009 – 3:53 am | No Comment
MySQL Global Search and Replace Script

A day will eventually come when your need to find and replace a string of text in your database. You don’t know which row, or which column, or which table. Heck, you may not even …

Passing MySQL Commands from Shell Script
June 25, 2009 – 3:30 am | No Comment
Passing MySQL Commands from Shell Script

Running MySQL commands from a shell script is a relatively simple task that has a lot of people baffled. Some say its too complicated and suggest using PHP or Perl, others claim doing so is …

Controlling Process CPU Utilization
March 9, 2009 – 12:36 pm | No Comment
Controlling Process CPU Utilization

Let’s say there is a process on your Unix/Linux system that sometimes tends to consume all CPU resources and become unresponsive. At the same time, you do not want to terminate the process at the …

Korn Shell Arrays
January 24, 2008 – 11:13 am | No Comment
Korn Shell Arrays

Here are a few useful examples of how to use data arrays within Korn shell. Arrays are a great tool for storing user input and other data for quick, on-the-fly access. If, for example, you …

Script to modify Veritas HA Cluster Resource Configuration
December 7, 2005 – 11:10 am | No Comment
Script to modify Veritas HA Cluster Resource Configuration

The following interactive Korn shell script can be used to make common changes to the configuration of Veritas HA Cluster resources. The script enables you to view the listing of available resources; view resource configuration; …

Bounce Veritas HA Cluster resource
December 7, 2005 – 11:01 am | No Comment
Bounce Veritas HA Cluster resource

The following is a Korn shell script that can be used from command line or cron to bounce a Veritas HA Cluster resource. This can be useful to resolve certain problems with Oracle databases running …

Solaris boot disk copy using dd
November 22, 2005 – 6:40 pm | No Comment
Solaris boot disk copy using dd

The following Korn shell script will make a bootable copy of the boot disk on a Solaris system. The script uses dd and requires that the source disk and destination disk have the same geometry.

#!/bin/ksh
 
#### …

NetBackup statistics, Part I
November 21, 2005 – 4:59 pm | One Comment
NetBackup statistics, Part I

The following script will calculate total size of data backups for each Veritas NetBackup client over the past week (or as defined by the “daysago” variable in the script). The final output will be uploaded …

Solaris boot disk copy
November 20, 2005 – 2:24 am | One Comment
Solaris boot disk copy

The following script will duplicate a Solaris boot disk. The script uses ufsdump/restore as opposed to dd, so disks of different sizes can be used.

#!/bin/sh
 
EMAIL=admin@domain.com
SUBJECT="Boot disk copy on `hostname`"
 
if [ "$#" != 2 ] ; …