Archive for September, 2007

store.exe

Monday, September 17th, 2007

I noticed my Exchange 2007 server was paging. Store.exe (the Exchange information store) was using over 1.5GB RAM.

The official exchange team blog says this is normal.

Exchange Store will grab as much RAM as it can if it thinks it needs it, yes. But - we constantly monitor the performance of the system in regards to memory usage and we can use this data to infer when we need more memory and when other applications or the OS needs more memory. We then use this data to act accordingly. This scheme allows the system to act as if there is explicit control when in fact it is actually a few autonomous applications cooperating in a disconnected manner. That means that we should NEVER see a “out of memory” message by any application on the server because of the Store - unless there is a leak on the server, of course… or the page file is too small. If there was a malfunction in this Store mechanism it would cause a lot of paging. That is a big performance problem, but shouldn’t cause actual errors.

I also run Flash Media Server on this machine (its a dual quad core). Video streaming seems sluggish. The event log show FMS complaining that it has no RAM. Thank you Microsoft! Below is my RAM usage:

RAM Usage

Unix Home Directories with winbind

Tuesday, September 11th, 2007

At work we have some Unix machines that authenticate with the Win2k3 domain. Problem is, when new users are created on the domain, Unix home directories are not created. You could set PAM to created the home directory upon first SSH login. However if the user logs in via SFTP or SMB the home directory would not be created. Below is a script I wrote (runs in cron) to create home directories for new users. Basically it checks the contents of “/home” against “wbinfo -u”.

#!/bin/sh
# Steve Horbachuk 2007
# Creates home directories for users that don't already have them

# Remove these:
# Administrator
# Guest
# krbtgt
# SUPPORT_388945a0
# IUSR_SERVER
# IWAM_SERVER
# stu
# fac

WBINFO=/usr/bin/wbinfo
SED=/bin/sed
LOG=/var/log/my-mkhomedir

# check if winbind is working
$WBINFO -u > /dev/null
if ! [ $? = "0" ]; then
echo "Get user list failed!"
echo "Is winbind running?"
exit 1
fi

LIST=`$WBINFO -u | $SED -e '/Administrator/d;/Guest/d;/krbtgt/d;/SUPPORT_388945a0/d;/IUSR_/d;/IWAM_/d;/fac/d;/stu/d'`

for USER in $LIST; do
if [ ! -d /home/${USER} ]; then
echo `date` Created ${USER} >> $LOG
mkdir /home/${USER}
cp -R /etc/skel/* /home/${USER}
chown -R ${USER} /home/${USER}
chgrp -R 'Domain Users' /home/${USER}
chmod 711 /home/${USER}
fi
done
exit 0

Kernel Packages

Tuesday, September 4th, 2007

I had to recompile my Debian Etch (4.0) kernel to include the Layer7 filter (and ipp2p) source patch as well as include Netfilter support.

Here are the prebuilt kernel packages:
http://stevehorbachuk.com/kernels

You can add then to a Debian system by doing this:

dpkg -i linux-image-2.6.22.5-custom2_2.6.22.5-custom2-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.22.5-custom2_2.6.22.5-custom2-10.00.Custom_i386.deb

This will automatically add this custom kernel to /boot/grub/menu.lst.

pcns221lnx.bin & Red Hat Enterprise Linux 4

Monday, September 3rd, 2007

pcns221lnx.bin is the APC Network Shutdown installer for Linux. It took me a while to figure out how to install this software on Red Hat Enterprise Linux 4, so I figured I’d drop a note here.

PCNS is poorly maintained and is a few years old now. Additionally Red Hat ships with GCJ java, which is shit. Upon execution it would throw cryptic error messages such as:

Preparing wizard…
Searching for JVM…
Starting the wizard…
Error: You need Swing 1.1 or 1.2 in your classpath to run this program.

And:

Preparing wizard…
Searching for JVM…
Starting the wizard…
See errors.log for other possible causes.out of disk space?

The biggest problem I had was that the installation documentation does not mention that the installer requires an X Server! Thanks a lot APC!

Here’s what I did to install it:

ssh steve@server

su
Change to root

rpm -e java-1.4.2-gcj-compat-1.4.2.0-27jpp
rpm -e java-1.4.2-gcj-compat-devel-1.4.2.0-27jpp
Remove old Java packages

rm -rf /usr/local/bin/jvm
Clean up if needed

mkdir /usr/java
Make new installation directory

cd /usr/java
Change to that directory

wget -O jre.bin http://javadl.sun.com/webapps/download/AutoDL?BundleId=11284
Download the JRE binary installer

chmod a+x jre.bin
Change permissions to allow execution

./jre.bin
Execute the JRE installer and follow the prompts

export PATH=$PATH:”/usr/java/jre1.6.0_02/bin”
Include the JRE binaries in the PATH where “jre1.6.0_02″ is the JRE version you installed

vi /root/.bash_profile
Change line that begins with “PATH” to this “PATH=$PATH:$HOME/bin:/usr/java/jre1.6.0_02/bin” where “jre1.6.0_02″ is the JRE version you installed

which java && java -version
Check if everything is working

up2date -i xorg-x11 xterm
Install X11 (if not already installed)

Launch a SSH session with X-Win32:

su
Change to root

cd /usr/local/src
Change to our source/installer directory

wget ftp://ftp.relline.ru/pub/unix/apc/pcns-221/pcns221lnx.bin
Download the PCNS binary installer

chmod a+x pcns221lnx.bin
Change permissions to allow execution

./pcns221lnx.bin
Execute the PCNS installer and follow the prompts

PowerChute Network Shutdown

ps -ef | grep “jre”
Make sure the PCNS process is running

EuroTrip

Saturday, September 1st, 2007

Here is the EuroTrip sound clip of Mr. T saying “Mail, Motherfucker!” If you use Windows and Outlook or Outlook Express you can set it as your new mail notification in the Control Panel. Both are under 60KB in size.

Here are the sound files:
Mail, Motherfucker! | Mail, Motherfucker! (Loops twice)
Audio Info:
Bit Rate: 140kbps
Channels: 2 (stereo)
Sample Rate: 48 kHz
Format/compression: LAME MPEG Layer-III
Extension: .WAV (Microsoft)
Copyright: EuroTrip, DreamWorks Home Entertainment