Resizing /tmp on Red Hat 5.3 (ext3, LVM)

This is how to do a simple file system increase in Logical Volume Manager. For example, increasing /tmp from 512 Mb to 1 Gb.

/tmp is a logical volume:

# df -h /tmp
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg00-tmpvol
                      496M   19M  452M   4% /tmp

Running “vgdisplay /dev/vg00” showed that volume group vg00 contained 3.5 Gb of free space. Extended the logical volume with lvextend: Continue reading

How to disable LDAP Authentication in Linux

After a customer had performed some bad edits on various LDAP configuration files, users were locked out and unable to access the system. Root could still login however.

I logged in as root, and rather than mess with various config files, eg under /etc/pam.d, ran this command to disable LDAP authentication and enable “normal” authentication using /etc/shadow: Continue reading

SSH Authentication and Directory Permissions

Running sshd in the foreground can be an effective way to debug ssh problems. In the following example, a user was unable to access a remote system using ssh keys. Running sshd in debug mode provided a quick resolution. Both source and target systems were Solaris, but the same method applies equally to Linux. Continue reading

Connect to Sheevaplug USB from Red Hat Linux

The Sheevaplug is a small ARM based “plug computer” manufactured by GlobalScale. This post explains how to connect over the serial connection for out-of-band access. A bit like connecting to the server processor of a unix server, or the alom/ilom of a Sun/Oracle box, or the Vsphere console of a vmware system.

Connect a USB cable from your PC to the sheevaplug’s micro USB port (also called the “JTAG” port) and proceed as below. Continue reading

Huge Apache Error Log from Solaris 10 LicenseWatcher

Working on a client site recently, I noticed their Apache error log had grown to 32 Gb in size. The file was being written to at a rate of a quarter of a million lines a day, propelled by various cron jobs set up to run every 5 minutes. A PHP reconfiguration fixed the problem.

The box was a Solaris 10 system running “License Watcher“, and those messages was all coming from the License Watcher php code. Not genuine errors, just repeated diagnostics. I edited /usr/local/php/lib/php.ini and changed this line Continue reading

Quick Script to Find Duplicate Files

Here’s a quick script to show duplicate files on Linux. It should cope with arbitrary spaces in file names, and to save time and CPU resources, it will checksum only files of the same size.

Usage: Save the script to dups.sh or whatever, then run it with no arguments. A list of duplicated files is output.

Continue reading

Check Free Memory on an LDOM Server

How to find the memory on a Solaris system hosting primary and guest LDOMs

For capacity planning, it is useful to know how much free resource is available on a given LDOM server. That is, a “parent” system hosting several guest LDOMs. For example, if you want to know how many more LDOM’s the server could support. Continue reading