After four and a half years, I am turning LFS2 off for good.
According to the “/var/log/OSInstall.custom” log, “Native install completed 2005-08-14 18:55:58 -0700,” which is just under four and a half years ago. I have finally migrated all of the data and functionality (print, file, and LDAP) from Lund File Server 2 (LFS2) to Athos. LFS2 held up surprisingly well considering it was only a 533 MHz G4 with 768 MB RAM. When I set it up, I installed three used 120 GB Western Digital hard drives. After four and a half years of running continuously, all three drives still appear operational.
Ars Technica has a nice writeup about “Dropped DSL and missing e-mail: two tales of moving woes.” I think one of the authors sums up technical support for any company perfectly:
If there were any doubts that Verizon has helpful dedicated people, this experience put them to rest. Unfortunately, I know that I’ll never encounter any of them the next time that I have a problem that requires me to dial in to the standard tech support line.
I rarely encounter competent technical support, whether it is at Embarq/CenturyLink, AT&T, Comcast, Time Warner, or Apple. What should take five minutes regularly takes multiple calls and even more tech support agents. On occasion, I do get someone helpful, but it is unfortunately not the norm.
Because I use Mutt, any mailbox that has new mail tends to get my attention when I check my email. This became particularly annoying because I kept opening my spam mailbox to check a single spam message. Therefore, I decided to come up with a way to delay the delivery of my spam to once per day.
I started by changing my “.procmailrc” to deliver spam messages to a different mailbox that Mutt does not check.
MAIL=`echo $HOME/Mail`
[...]
:H
* ^X-Spam-Status: Yes
$MAIL/delay_spam
[...]
Then I created a new procmailrc file called “spam.procmailrc” that would deliver mail to my checked spam mailbox.
MAIL=`echo $HOME/Mail`
:0
$MAIL/spam
Next, I wrote a short Bash script to use Formail and Procmail to deliver all of the messages in the delayed delivery spam mailbox to the normal spam mailbox.
#! /bin/bash
FORMAIL=/usr/bin/formail
PROCMAIL=/usr/bin/procmail
PROCMAILRC=$HOME/.procmail/spam.procmailrc
MAIL=$HOME/Mail
DELAY=$MAIL/delay_spam
TEMP=$MAIL/.spam
LOCK=$TEMP.lock
# Make sure there is delayed mail and we can get the lock (retry once)
if ( test -s $DELAY && lockfile -r 1 $LOCK 2>/dev/null ); then
# Add the delayed mail to the temp mailbox and empty the delayed mailbox
cat $DELAY >> $TEMP && cat /dev/null > $DELAY
# Process each delayed message
$FORMAIL -s $PROCMAIL $PROCMAILRC < $TEMP && rm -f $TEMP
# Delete the lock now that we are done
rm -f $LOCK
fi
Finally, I set the script to run daily using Cron. Now I am only interrupted by spam when I choose to be instead of every time a new message arrives. I have used the same technique to delay the delivery of emails to unimportant mailing lists so I only read them hourly instead of every time a message arrives.
In my previous post, I described how to set up tab completion for many common commands using these Bash completion files. This works well for established commands, but it doesn’t work so well for commands that I have written myself.
I use a command called “hc12-console” to connect to 68HC12 microcontrollers over a serial port. The command takes two arguments: the name of a microcontroller to connect to and a file to load. I only have two microcontrollers called “dragon1″ and “dragon2″. Therefore, I want to be able to tab complete the first argument to one of those values only. The second argument should be the name of a file that ends in “.load”.
I do this with a function that checks the argument number and then completes it based on a specified list or by limiting the types of files that will be listed.
_hc12console ()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
# First argument completes with either dragon1 or dragon2
if [[ $COMP_CWORD -eq 1 ]] ; then
COMPREPLY=( $( compgen -W "dragon1 dragon2" -- $cur ) )
return 0
fi
# Second argument completes with only files matching *.load
if [[ $COMP_CWORD -eq 2 ]] ; then
COMPREPLY=( $( compgen -f -X '!*.load' -- $cur ) )
return 0
fi
# All other arguments will not auto-complete
return 0
}
complete -F _hc12console hc12-console
I added the script above to a file that my bashrc sources. It associates the function with the shell command, and then instead of manually typing out:
hc12-console dragon1 file.load <enter>
I can type:
hc12<tab> <tab>1 <tab> <enter>
I had a directory of BMP image files that I wanted to convert to EPS (Encapsulated PostScript). Since I was planning on adding files to the directory, I did not want to hard code the names of the files into the makefile that would do the conversion. Therefore, the trick was to run a shell command inside of the makefile. The first line lists all of the BMP files and assigns it to “BMP_FILES”. The next line replaces the “bmp” extension with “eps”. The complete makefile is below.
BMP_FILES = $(shell ls *.bmp)
EPS_FILES = ${BMP_FILES:%.bmp=%.eps}
all: ${EPS_FILES}
%.eps : %.bmp
convert $*.bmp $*.eps
All that is left is to type “make” in the directory, and all of the BMP files will be converted to EPS.
I prefer to do all of my Subversion work from the command line, but I realize that not all people are like me. Clarissa and I have been using a wiki to keep track of most of our shared information (including our wedding preparations), but our wiki does not work well for content like spreadsheets. Therefore, I decided to try out a Subversion repository. After some initial searching for graphical clients, I found ZigVersion. It is a simple graphical Subversion client for Mac OS X. It took a little bit to explain how it worked and how to use it to Clarissa, but now we have been sharing and editing non-wiki-friendly files for a few weeks.
I regularly use the Marquette University PrintWise Canon copiers to scan paper documents into PDF files. These files are delivered to me via email where I manually save each PDF attachment, rename it, and move it to the appropriate directory. Using Procmail and Munpack, I was able to eliminate some of the tedium of this problem.
I inserted the following block of code into my .procmailrc file. It looks for emails that were sent from me and to me by a Canon copier. When it finds one, it copes the email and pipes it to Munpack which extracts the attachments into my attachments directory.
ATTACH=`echo $HOME/attachments`
:0 c
* ^To:.*me@email.com
* ^From:.*me@email.com
* ^X-Mailer: Canon imageRUNNER
| munpack -q -C $ATTACH
After the attachment has been extracted, I can rename it and move it to the appropriate directory, and I still receive the email in my inbox so I know I have attachments to deal with.
My iTunes Web Application project shows up on the first page of results for most relevant search. More than 60 people clicked on search results for it on Google in September 2009. I would say this is a good thing. However, I doubt it is what most people are actually looking for. I really do recommend Subsonic or even Sockso over my own project. Unless someone is looking to continue work on my project. I would recommend that, too.
I had a several page scanned document stored in PDF format that I needed to convert to PNG so I could upload it to a PayPal account to resolve a limited access problem. I found several solutions for Linux that produced inadequate image files. When I switched to my Mac OS X laptop, I opened the PDF in Preview. I selected “Save As…” from the File menu, selected “PNG” from the drop down menu and set the resolution to 300 pixels per inch. I hit the Save button, and the newly created PNG opened up. The quality was adequate, and the problem was solved.