Missing LaTeX ‘Glossaries’ Package In Ubuntu
January 5, 2012
I had cause to use the glossaries package in LaTeX today to take care of all my glossary management needs. The idea of being able to create an external file to define all of my acronyms and definitions, and then include them as required in a separate section that is automatically included in a table of contents is very appealing. Unfortunately, the glossaries package isn’t installed as part of the Ubuntu texlive-latex-* packages, nor is it separately installable via Aptitude.
Continue reading
SSMTP Local MTA Using Google Apps Account
September 22, 2011
While there are plenty of MTAs out there, I find it quite handy to have SSMTP installed locally; it’s quick to install and configure and lacks some of the overhead of a more enterprise MTA such as Sendmail, Postfix, Exim etc. The following assumes you have a “Google Apps for Domains” user account — ssmtp_user@domain.com — through which you will relay all email. Additionally, the steps below work on Ubuntu 10.10, similar steps should work on other distributions.
Install SSMTP
sudo apt-get install ssmtp
Edit configuration in /etc/ssmtp/ssmtp.conf
# Backup the original first
sudo cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.out
# Truncate the file and add the following
mailhub=smtp.gmail.com:587
hostname=ssmtp_user@domain.com
root=ssmtp_user@domain.com
AuthUser=ssmtp_user@domain.com
AuthPass=
UseSTARTTLS=yes
UseTLS=yes
FromLineOverride=yes
Edit revaliases map in /etc/ssmtp/revaliases.conf
# Add a line for each local user who should be able to send email
root:smtp_user@domain.com:smtp.gmail.com:587
max:smtp_user@domain.com:smtp.gmail.com:587
Send Email!
You should now be able to send email, e.g. from the shell using
echo "Testing" | mail -s "Test Email" someone@example.com
Automating Internet Explorer VPC Images On VirtualBox
March 6, 2011
In order to facilitate testing of websites in different browsers, Microsoft have released what they call their ‘Application Compatibility Virtual PC Images‘. These time-limited V12n solutions are great for quickly bringing up a VM for a particular version of Internet Explorer but they are built for Microsoft’s Virtual PC (VPC) software.
I work predominantly with Linux and use Virtual Box as my V12n application of choice. Later versions of Virtual Box support VPC’s VHD disk image format. This means it’s possible to run these VPC images under VirtualBox, but it involves downloading and extracting files from the win32 executables; downloading drivers for the ethernet adapter and other time consuming steps that I’d rather not repeat every time my IE VM expires. I’m a programmer, therefore I’m lazy and don’t like doing things more than once; I’d rather script something to do it for me. In keeping with this virtue, I’ve written msie2vbox to automate this stuff for me. It’s on Github with a GPLv3 license. There’s some outstanding todo items but it does the job for me, and I thought it might be of use to others.
Manage Your Home Directory With Subversion
October 14, 2010
Revision control systems serve their purpose well for managing codebases, but they can also be used to good effect for configuration management. I’ll discuss how I’ve used Subversion to manage the configuration of my home directory. The same goal could probably be achieved just as easily with Git. While I use Git and Github for personal projects, I have employed this solution at work where we use Subversion.
Continue reading
Subversion And The Entropy Pool
October 4, 2010
I ran into an interesting little subversion problem earlier. I was trying to commit a change, and the commit just seemed to hang indefinitely. I couldn’t sent an interrupt, and eventually resorted to killing the process. I tried all sorts of command line options in case there was an authentication problem – with no luck. I then thought I had made a mistake when switching my working copy to a different branch. I checked the logs on the server to find nothing pertinent; it seemed as though svn didn’t get as far as taking to the server. At a loss, I thought there was nothing for it but to run the command with strace. Bingo!
Strace showed that subversion reads from /dev/random as part of the commit, and that’s where the problem seemed to be happening. After doing some research, I discovered that /dev/random generates random numbers using the so-called entropy pool. This entropy pool is just random bits of noise generated from things such as mouse movements, time between keystrokes and so on. For whatever reason, on the client server, this entropy pool was empty! Using /dev/random is cryptographically more random than using /dev/urandom; and /dev/random blocks when the entropy pool is empty, whereas /dev/urandom is non-blocking. Moving /dev/random to /dev/random.old and linking /dev/urandom to /dev/random solved the problem. There may be a better solution to this, and depending on your cryptographic requirements it might be better to find an alternative, but this did the trick for me. One svn commit later and all was well.