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.

Home » Archive by Tags

Articles tagged with: bash

Selecting CMS Software

February 21, 2013 – 11:45 pm
wp-newspaper

If you are looking for an open-source content management system, your choices are likely to boil down to these three: Joomla!, WordPress, and Drupal. Professional CMS developers tend to disregard WordPress as a purely blogging …

Remove Duplicate Posts in WordPress

December 5, 2009 – 10:28 pm
wordpress_0004

Below is the SQL script that will attempt to identify and remove duplicate posts in your WordPress database. This script can be useful for autoblogging. If you use plugins like WP-o-Matic to pull full-text RSS …

WordPress Backup Script

October 23, 2009 – 1:04 pm
wordpress_0006

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
shell

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
shell_003

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 …

Automatically Validate HTTP Proxies

August 5, 2009 – 4:14 pm
computer_security_it_privacy_0002

Let’s say you downloaded a long list of Web proxy servers. Now you are stuck with the task of weeding out the proxies that are dead, slow, fake, or otherwise unusable. There are some applications …

Wget and User-Agent Header

June 29, 2009 – 12:41 pm
computer_security_it_privacy_0003

As you may already know, Wget is a popular (particularly in the Unix world) command-line downloader and Web crawler application. You can read more about Wget in one of my earlier posts on the subject. …

Duplicating WordPress Installation

June 25, 2009 – 2:51 pm
wordpress_logo

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
logo_mysql

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
logo_mysql

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
mysql_0002

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 …

Random Filename Chooser

June 17, 2008 – 9:02 pm
lock code

This is a rather peculiar little script with a purpose that may not be immediately apparent. The script will look for files in the specified folder; it will then pick one at random from the …

WordPress Quick Upgrade for Linux

June 13, 2008 – 6:22 pm
wordpress_0003

Never ever upgrade WordPress to the latest version as soon as it comes out, unless you want to be the guinea pig dealing with the new bugs and incompatible plugins. Even if the new version …

Useful SysAdmin Scripts: Search-and-Replace

June 1, 2008 – 3:03 pm
binoculars watch security rifle gun

Let’s say you moved your server to a new network and now it has a different IP address. You know your users have a habit of hard-coding the server’s IP into their scripts. So you …

Creating print.css for WordPress

May 24, 2008 – 6:35 pm
wordpress

Many WordPress theme designers choose to cut some corners with their creations. One of the more important things they skip over is print.css – the stylesheet that controls your blog’s appearance when you print it. …

Find and Replace in MySQL

December 28, 2005 – 11:34 am
mysql-logo

A simple one-line command to perform find and replace operations in MySQL:

Executing commands with ‘find’

November 21, 2005 – 11:47 pm
shell_0004

To executes commands with ‘find’ use the ‘-exec’ option. Example:

Find largest files

November 19, 2005 – 11:17 pm
shell

How to find the largest files in the directory tree on Solaris.

Count users with “last”

November 19, 2005 – 11:15 pm

Here is a quick example showing how to count users logged in on a particular date using the “last” command on Linux.

To display file’s modification, last access, etc

November 19, 2005 – 11:14 pm
shell_0005

Display a file’s modification, last access and other attributes on Solaris.