Anonymous FTP server under Solaris
August 11th, 2008
Setting up an anonymous FTP server under Solaris, when using the built-in in.ftpd daemon, is a little bit different than setting it up under GNU/Linux using WUftpd.
First, let’s create the ftp user and ftp group. Then, let’s create the home directory for the ftp user:
mkdir -p /export/home/ftp groupadd -g 99 ftp useradd -u 99 -g 99 -s /bin/false -d /export/home/ftp chgrp ftp:ftp /export/home/ftp
If you want anonymous users to upload files under /pub, add the following line to /etc/ftpd/ftpaccess:
upload class=anonusers /export/home/ftp /pub yes ftp ftp 0600 nodirs
Next, copy the minimal set of dynamic libraries and binaries to make possible browse and list files for anonymous users:
mkdir -p ~ftp/bin
mkdir -p ~ftp/usr/bin
ln -s ../bin ~ftp/usr/bin
cp /usr/lib/{ld,libc,libdl,libgen}.so.1 ~ftp/usr/lib
cp /bin/ls ~ftp/bin
To enable the FTP server, uncomment the following line in /etc/inetd.conf:
ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -a
and notify the inetd daemon of the change by sending the HUP signal to it:
pkill -1 inetd
Getting the MAC address of the WiFi interface on Symbian
August 10th, 2008
You can get the MAC address of the WiFi interface on a Symbian phone by typing *#622099526# (which is the same as typing *#mac0wlan#).
PCA – Patch Check Advanced
August 10th, 2008
If you are in charge of administering Solaris machines, you might want to take a look at PCA – Patch Check Advanced.
From its Web page:
pca is a perl script which generates lists of installed and missing patches for Sun Solaris systems and optionally downloads and installs patches. By default, if run without any option or operand, pca shows a list of all patches which are not installed in their most recent revision.
The output of the pkginfo, showrev and uname commands is used to gather information about the system. Sun offers a patch cross-reference file called patchdiag.xref which contains information about all available patches. This file is downloaded by pca automatically to /var/tmp/ and kept up-to-date. If the file exists and is not writable, pca uses it and won’t try to update it.
The beauty of pca lies in its simplicity and effectiveness. I’ve always found Solaris patching procedures to be complicated, hard to automate and well beyond patching of GNU/Linux systems. Even Windows and Mac OS X systems are easier to patch than Solaris, in my opinion. I think that pca pretty much closes the gap. Kudos to Martin Paul for creating and maintaining pca.
Linux, mplayer and ipcrm
August 9th, 2008
For the past few days, and after a few hours of uptime, mplayer refused to play videos. It was hanging while trying to open the ALSA audio. I could verify this because using -ao none as a command-line argument to mplayer fixed (as in being able to play a video with no sound) the problem.
Tired of this, I decided to strace mplayer. I could see it was hanging on the semop() system call for a semaphore with an ID of 32768. Looking at /proc/sysvipc/sem I could see that semaphore ID 32768 existed even when mplayer was not running, and that this IPC resource was created by a process running as me.
I used the ipcrm -s 32768 command to kill this IPC resource, and I saw that this fixed the problem: I could listen to audio and videos again. I haven’t been able to determine if mplayer has a bug that prevents it from freeing/destroying IPC semaphores or if this is a bug of the ALSA library, though.