Colored MAN pages August 18th, 2008
In ~/.bashrc:
export LESS="-R" export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;31m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' export LESS_TERMCAP_so=$'\E[01;44;33m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m'
Permanently exclude a package from Yum installs/updates April 8th, 2008
In /etc/yum.conf add:
exclude=kernel*
With the above, yum won't install/update any kernels automatically (actually: any package that begins with kernel).
ORDB.org blacklisting all IP addresses April 2nd, 2008
Urgent FYI:
Apparently the old and crufty realtime blacklist server relay.ordb.org that was retired in 2006 has the entire world blacklisted. Any mailserver still using this rbl is now effectively blocking ALL email traffic. Remove it from your configurations ASAP.
See http://groups.google.com/group/news.admin.net-abuse.email/browse_thread/thread/c45f42a8621c60fc/8fb6e83837759ffe and http://www.dnsbl.com/2007/02/status-of-relaysordborg-dead.html for more info.
Kickstarting Red Hat Enterprise Linux or CentOS onto a Dell Poweredge using IPMI console redirection and Cobbler provisioning April 2nd, 2008
(Re-)Installing Linux on a bare-metal Dell Poweredge server using CD's/DVD's is so passé. Instead use your servers network card to perform a PXE-boot and install it over the network.
Since all Dell Poweredge servers come with an IPMI BMC controller you can do this remotely from the office on a server in your datacenter. This how-to covers a remote install of a Dell Poweredge 2850 with an IPMI 1.5 BMC controller. This means we will use Serial-Over-Lan console redirection through a proxy program called Solproxy. If you've got a recent Poweredge server this step is not necessary.
This post assumes you have a working RHEL5/Centos5 install to serve as your provisioning server, and your bare-metal server has a working IPMI configuration. See this post by Lone Sysadmin how to configure the BMC on a Dell Poweredge if you have an OS running on it. Else you need to configure the BMC controller in the BIOS.
Here's how you use Cobbler to manage the TFTP boot server and DHCP server, and optionally build a mirror for several distro's from installation media or rsync mirrors...
Read the rest of this entryQuerying RPM for 32bit and 64bit versions April 2nd, 2008
Query all:
[root@server ~]# rpm -qa --qf '%{name}.%{arch}\n'
hdparm.x86_64
rootfiles.noarch
basesystem.noarch
libsepol.x86_64
gmp.x86_64
...
Query specific packages:
[root@server ~]# rpm -q --queryformat='%{n}-%{v}-%{r}.%{arch}\n' glibc
glibc-2.3.4-2.39.x86_64
glibc-2.3.4-2.39.i686
BIOS escape sequences over Serial Console April 1st, 2008
Note to self: works on Dell Poweredges using IPMI console redirection. So to attempt a PXE boot use the ESC-@ escape sequence when using the serial console.
Defined As
F1 F2
F3 F4
F5 F6
F7 F8
F9 F10
F11 F12
Keyboard Entry <ESC>1 <ESC>2
<ESC>3 <ESC>4 <ESC>5 <ESC>6 <ESC>7
<ESC>8 <ESC>9 <ESC>0 <ESC>!
<ESC>@
From IPMI on Debian
Escape sequences for Serial-Over-Lan sessions using IPMITOOL March 19th, 2008
Supported escape sequences: ~. - terminate connection ~B - send a BREAK to the remote system ~C - open a command line ~R - Request rekey (SSH protocol 2 only) ~^Z - suspend ssh ~# - list forwarded connections ~& - background ssh (when waiting for connections to terminate) ~? - this message ~~ - send the escape character by typing it twice (Note that escapes are only recognized immediately after newline.)
RPMForge update problems March 5th, 2008
If you're using http://rpmforge.net/ or Dag RPM packages you might have noticed there seem to be some problems with the mirrors. A quick snoop on the mailing-list shows us the reason from Dag himself:
HEAnet is having problems again. For some reason they still offer files (repoview) that have been removed a few weeks back. And for some reason they did update the metadata but not the packages (which cannot happen if the update process was using --delay-updates). And that is in this case the result of yum trying to update packages that are not available (while they should have). I think they once again have major NFS problems. But, I have no access to that system and that system is used by all the other mirrors. So we are basicly doomed... until it gets fixed.
Centos 5 kernel 2.6.18-53.1.6.el5xen initrd missing xenblk modules February 6th, 2008
Update: newer kernel & initrd 2.6.18-53.1.13.el5xen doesn't have this problem.
If you're running Centos5 and recently upgraded a Xen domU kernel to 2.6.18-53.1.6.el5xen you maybe got burned by the following problem:
Loading xenblk.ko module XENBUS: Timeout connecting to device: device/vbd/51712 (state 3) Scanning and configuring dmraid supported devices Creating root device. Mounting root filesystem. mount: could not find filesystem '/dev/root' Setting up other filesystems. Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory Kernel panic - not syncing: Attempted to kill init!
Apparently the initrd is missing the xenblk module and any domU that's using tap:io in its Xen config can't connect to it's virtual disk image.
Here's the fix:
Change tap:io into file: in your xen configs and boot the domU.
disk = [ 'tap:aio:/var/lib/xen/images/domU.img,xvda,w', ]
into
disk = [ 'file:/var/lib/xen/images/basestar.img,xvda,w', ]
In your booted domU:
cd /boot rm /boot/initrd-2.6.18-53.1.6.el5xen.img mkinitrd -v --with=xenblk --omit-scsi-modules --omit-raid-modules /boot/initrd-2.6.18-53.1.6.el5xen.img 2.6.18-53.1.6.el5xen
Now you can change back to tap:io in your domU config and reboot the domU. You'll need to do this for every domU that has been upgraded to the 2.6.18-53.1.6.el5xen kernel.
See http://bugs.centos.org/view.php?id=2083 and http://bugs.centos.org/view.php?id=2543 for more info
Silence Anaconda confirm messages using clearpart when Kickstarting December 13th, 2007
Wouter found this one around the net:
"If you start out with a unpartitioned disk, or a virtual machine on a unpartitioned image, use the --initlabel parameter to clearpart to make sure that the disklabel is initialized, or Anaconda will ask you to confirm creation of a disklabel interactively. For instance, to clean all partitions on xvda, and initialize the disklabel if it does not exist yet, you could use:"
clearpart --all --initlabel --drives=xvda
My favourite Dstat November 9th, 2007
Dag Wieers' Dstat is the ultimate live monitoring tool to catch your servers in the act.
My favourite Dstat command:
dstat -l -c -p -y -m -p -d -n
Which will paint this pretty picture on a wide-enough terminal:

Note the periodical repeating header at the bottom! Dstat is even smart enough to truncate the columns if your terminal can't handle the heat because it's to narrow - marvelous...
