Featured »

mysql_0001

Parallel MySQL Queries

January 19, 2016 – 12:38 am

Unlike Oracle, MySQL has no support for parallel SQL queries. A bummer for sure, in light of all the awesome multi-coreness we enjoy these days. There’ve been some attempts (1, 2) to get around this …

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.

Commands & Shells »

Run Cron Jobs at Arbitrary Intervals

January 27, 2016 – 10:24 am
time clock watch

Current versions of cron support sophisticated syntax making creating weird schedules a breeze. With older versions of cron you normally had to schedule multiple jobs to fill every time slot in a complex schedule. The most common of uncommon requirements is to run a cron job every so many minutes.

To run a cron job, say, every 55 minutes, these days you can just schedule “ */55 * * * * ” you’ll be good to go. On older Unix systems you’ll encounter an error, such as “unexpected character found in line” in Solaris 10. The solution is to create a wrapper script and rely on epoch time to calculate time intervals.

Here’s a simple example: let’s say every 55 minutes you need to “ date >> /var/adm/messages “. First, you create the wrapper script (say, /var/adm/bin/date_cron_wrapper.sh):

The weirdness you see with “truss” and “nawk” is due to lack of epoch option for the “date” command on Solaris 10. On systems that do support “ date +’%s’ “, you can simply do this:

Now you can schedule the cron job:

The script will run a modulo operation on the current epoch time to see if the remainder after dividing by 3300 seconds (55 minutes) is zero. If that’s the case, then 55 minutes have passed and the wrapper script will execute its payload. You can get away with running this cron job every five minutes, instead of every minute.

 

Diff on Output of Remote Commands

January 25, 2016 – 1:47 pm
shell

Let’s say you run the same command on two remote servers and you want to compare the output. Here’s a quick example:

Show NIC Bandwidth Utilization

January 15, 2016 – 12:43 am
network switch

Just a quick script that will measure bandwidth utilization in KB/s for all NICs on your server over the specified period of time. You can call the script with an optional time wait parameter in seconds.

Find + Rsync + Xargs

December 22, 2015 – 11:09 am
968780_94091618

Just some quick syntax for running multiple rsync threads in parallel using find and xargs. In many cases (especially if NFS is involved)  this can greatly speed up the copy operation.

Taking Linux Temperature

December 14, 2015 – 12:21 am
termometer_001

Just some notes on setting up temperature monitoring and alerting on CentOS/RHEL running on HP ProLiant. The first step is to install lm_sensors:

Bash and Expect Snippets

November 25, 2015 – 1:12 pm
shell

A small collection of maybe helpful examples of how to use expect with Bash. This is a very useful tool, especially when writing a better script is just too much work, but the funky syntax …

Deleting Lots of Files Quickly

November 17, 2015 – 9:03 am
machine-gun-001

I am not talking about hundreds or thousands of files. I am talking about hundreds of thousands. The usual “/bin/rm -rf *” may work, but will take a while. Or it may fail with the …

When Was that Server Built?

November 11, 2015 – 11:49 am
shell

Just a quick note on how to (sort of) figure out when a server first came online. This can be useful to various folks in your bean-counting department working on maintenance contact renewals and whatnot. …

Testing Email Server Response

November 7, 2015 – 5:37 pm
colorful shells

A little while ago I ran into a situation when connections to the relay email server would occasionally time out. The issue seemed sporadic resulting in a controversy regarding its source. The perimeter email server …

Tuesday Morning Rant

October 27, 2015 – 11:27 am
centos_linux_0003

So I just got around to installing CentOS 7. What a pile of shit with bugs all over it. The installation GUI completely messed up network configuration. On the first try, the network config I …

Oracle Sun SPARC Server Quick Configuration

October 20, 2015 – 6:03 pm
sun_solaris_0003

In the following example we’re using a SPARC T4-2. These systems ship from the manufacturer with pre-installed Solaris 11. After the system has been racked and connected to primary and ILO networks, the first step is to …

Detecting Sun ILOM with NMap

October 13, 2015 – 10:57 am
sun_solaris_0002

This is an oddball tech note: how to detect Sun ILOM interfaces on the network using nmap. I needed to connect to one of the Sun boxes that dropped off the network, but couldn’t remember …

Upping the Soft nproc Limit

October 5, 2015 – 11:12 am
overloaded_0004

This is just a quick note to myself about increasing the “soft nproc” value. On one of the RHEL 6 Tomcat servers I got the following error when trying to “su – tomcat”:

Hold Off on iOS 9 iPhone Upgrade

September 21, 2015 – 2:16 pm
apple_0006

If you haven’t updated your iPhone 6/6 Plus to the recently-released iOS 9, I’d suggest you hold off for a few weeks. Several bugs – including a significant security hole – have surfaced that will …

Removing Metadata from Images

September 8, 2015 – 12:09 pm
binoculars watch security rifle gun

Phones and cameras record a surprising amount of personally-sensitive information with the photos they create. This data includes timestamps, GPS coordinates, software used to process the images and lots of other details you may not …

Reduce SNMPd Logging Level

September 8, 2015 – 11:01 am
overloaded_0003

By default, (on RHEL/CentOS, at least) snmpd will log all connection attempts, which can turn your /var/log/messages into a giant mess, looking something like this…

Arthemia jCarousel Number of Posts

September 4, 2015 – 3:45 am
wordpress_0001

This is primarily just a note to myself on how to change the number of visible items in the jCarousel implementation for the WordPress Arthemia theme. Recently I finally updated to the current version and …

Tuesday Night Rant: LED Light Bulbs

September 1, 2015 – 9:51 pm
Row of light bulbs

An off-topic for sure, but after a brief conversation about LED bulbs with a friend – an electrician – I found I had more arguments then I was willing to spill on Facebook. I am …

Collectl & Colplot Sytem Performance Analysis Tools

August 26, 2015 – 11:17 am
linux_penguin_0002

It is not often that I run into Unix performance analysis tool that, a), I haven’t seen before and, b), is worth my attention. Collectl is both. It is a very useful combination of iostat, …

Installing Perl Modules with YUM

August 17, 2015 – 5:30 pm
centos_linux_0003

Just a quick note on how to install Perl modules with YUM. Due to differences in the naming conventions, YUM package name for a Perl module may differ from the the module’s native name in …

Brief Guide to PDSh

August 17, 2015 – 12:53 pm
shell

PDSh (Parallel Distributed Shell) is a high-performance parallel remote shell utility allowing you to execute commands on multiple remote hosts simultaneously. The utility was originally developed by LLNL and is currently available under GNU CPLv2. …

Find Available IP Addresses

June 18, 2015 – 10:58 am
shell_0005

After a while, available IP addresses on the subnet may become hard to come by. Whatever spreadsheet you used to track IP allocations is likely out of date. Here’s a simple script that will scan …

Multi-Cluster Ganglia Configuration

June 17, 2015 – 11:28 am
ganglia_002

I’ve discussed Ganglia configuration and RHEL/CentOS installation in the past. The usual structure is where every node belongs to one cluster. Recently I ran into a requirement to have nodes assigned to more than one cluster. …