Netiquette book published
Just a quick announcement. My new book – Netiquette: Internet etiquette in the age of the blog – has been published. You can see all the details on the Software Reference website (http://www.swref.com).
Installing PHP5 and its dependencies on a Godaddy virtual dedicated server
I have recently developed the first version of a book price comparison website,
booksmarts.co.uk. It's fairly simple, but it does depend on the simple XML parser built into PHP5.
I wasn't sure what version of PHP was already running on my server, so I was hoping that I would just be able to drop the PHP files in and they would work straight away. As is often the case, things turned out to be more complicated than they first appeared to be. This blog entry explains what I did to upgrade PHP and its dependencies. It is primarily a record for myself, but might prove to be useful to other people trying to achieve something similar.
(Note that what follows is the order that the steps actually need to be carried out in, not the 'try it, find unexpected dependency, install that first' route I actually took!)
binutils
This step might not be necessary after all, but I did do it and it shouldn't hurt.
Get the latest version of
binutils, needed to build the C++ compiler.
su -
mkdir archive (or whatever)
cd archive
wget ftp://ftp.gnu.org/binutils/binutils-2.17.tar.gz
tar -zxvf binutils-2.17.tar.gz
cd binutils-2.17
./configure
make
make install
gcc/C++
wget ftp://mirrors.laffreycomputer.com/pub/gcc.gnu.org/gcc/releases/gcc-4.1.1/gcc-core-4.1.1.tar.bz2
wget ftp://mirrors.laffreycomputer.com/pub/gcc.gnu.org/gcc/releases/gcc-4.1.1/gcc-g++-4.1.1.tar.bz2
tar -jxvf gcc-core-4.1.1.tar.bz2
tar -jxvf gcc-g++-4.1.1.tar.bz2
cd gcc-4.1.1
export CFLAGS=-O0 (turn off optimisation to save memory -- try building without this first)
./configure
make (had to shut down tomcat, which was still running, to free up enough memory for the compilation)
make install
flex
cd ~/archive
wget http://prdownloads.sourceforge.net/flex/flex-2.5.33.tar.gz?use_mirror=superb-west
tar -zxvf flex-2.5.33.tar.gz
cd flex-2.5.33
./configure
make
make install
apache
PHP5 requires apache > 0.0.44, so build latest 2.0.* one [.so extensions aren't compatible with later ones and I don't want to rebuild these [in retrospect, I had to do this anyway, so might have been better off with a more recent apache]].
wget http://mirrors.dedipower.com/ftp.apache.org/httpd/httpd-2.0.59.tar.gz
tar -zxvf httpd-2.0.59.tar.gz
cd httpd-2.0.59
./configure --enable-rule=SHARED_CORE
--enable-so
--enable-suexec
--with-suexec-docroot=/home/httpd/vhosts
--with-suexec-caller=apache
--enable-rewrite
--enable-cgi
make
/usr/local/apache2/bin/apachectl stop
make install
libxml
cd ~/archive
wget ftp://ftp.xmlsoft.org/libxml2/libxml2-2.6.27.tar.gz
tar -zxvf libxml2-2.6.27.tar.gz
cd libxml2-2.6.27
./configure
make
make install
ldconfig
PHP (finally!)
cd ~/archive
wget http://uk2.php.net/get/php-5.2.0.tar.gz/from/www.php.net/mirror
tar -zxvf php-5.2.0.tar.gz
cd php-5.2.0
(./configure --help to see options)
./configure --with apxs2=/usr/local/apache2/bin/apxs
--enable-force-cgi-redirect
--enable-discard-path
--with-mysql
--with-pear
make
make install
ldconfig (may not be necessary)
edit
/usr/local/apache2/conf/httpd.conf to use PHP5 instead of PHP4.
Mail, etc. for PHP (i.e. PEAR)
cd ~/archive
lynx -source http://go-pear.org/ | php
pear install --alldeps Mail
[Hack – not the correct way to do this]
mv /usr/local/lib/php /usr/local/lib/php.old
ln -s /usr/share/pear /usr/local/lib/php
[/Hack]
mod_perl
Other sites on the same server use a small amount of perl, so need to update mod_perl.
cd ~/archive
wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
tar -zxvf mod_perl-2.0-current.tar.gz
cd mod_perl-2.0.3
perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
make
make install
Fixing FreeMind on Suse 10.1
I've been a keen user of
FreeMind, a tool for creating mind maps, both on Windows and on Linux. For some reason, it was broken on my Suse 10.1 linux desktop.
When running
freemind at a command prompt, I was getting the following error:
Exception in thread "main" java.lang.Error: can't load com.birosoft.liquid.LiquidLookAndFeel
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1176)
at javax.swing.UIManager.initialize(UIManager.java:1257)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1245)
at javax.swing.UIManager.getUI(UIManager.java:851)
at javax.swing.JPanel.updateUI(JPanel.java:104)
at javax.swing.JPanel.(JPanel.java:64)
at javax.swing.JPanel.(JPanel.java:87)
at javax.swing.JPanel.(JPanel.java:95)
at javax.swing.JRootPane.createGlassPane(JRootPane.java:482)
at javax.swing.JRootPane.(JRootPane.java:313)
at javax.swing.JFrame.createRootPane(JFrame.java:247)
at javax.swing.JFrame.frameInit(JFrame.java:228)
at javax.swing.JFrame.(JFrame.java:195)
at freemind.main.FreeMind.(FreeMind.java:107)
at freemind.main.FreeMind.main(FreeMind.java:647)
There is a
liquidlnf.jar in
/usr/share/java, but it wasn't being picked up in the
CLASSPATH. Therefore, as root, I edited
/usr/share/freemind/freemind.sh, adding the highlighted line:
CLASSPATH="${ADD_JARS}:${CLASSPATH}:${freedir}/lib/freemind.jar:${freedir}/lib/ant/lib/jaxb-api.jar:${freedir}/lib/ant/lib/jaxb-impl.jar:${freedir}/lib/ant/lib/jaxb-libs.jar:${freedir}/lib/ant/lib/namespace.jar:/usr/share/java/relaxngDatatype.jar:/usr/share/java/xsdlib.jar:${freedir}/lib/ant/lib/jax-qname.jar:${freedir}/lib/ant/lib/sax.jar:${freedir}/lib/ant/lib/dom.jar:${freedir}/lib/forms-1.0.5.jar:/usr/share/java/commons-lang-2.1.jar:/usr/share/java/liquidlnf.jar:\
${freedir}"
After this, everything seemed to work OK.
MS Office Bug/Feature #13: Autocorrect to dashes
Microsoft Word uses autocorrect to change a double hyphen into a dash. There are two types of dash: a short
en dash (–) and the longer
em dash (—).
Traditionally, unspaced em dashes were used to separate paranthetical remarks—such as this one—from the rest of a sentence. Nowadays, it's more common to use spaced en dashes – like this – for the same purpose. Because of this, when you are typing, if you key in
-- then Word will replace these two characters by an em dash if they were not preceded by a space, or by an en dash if they were.
The problem arises when you want to type number ranges. These should use unspaced en dashes, such as 33–45. However, if you type
33--45 then this will be converted to 33—45, which is not what you want.
At present there are two alternatives:
- type the following long-winded sequence of keystrokes
33 -- 45[left][left][backdel][left][backdel]
[right][right][right]
- use the keyboard shortcut for an en dash (Ctrl+Number_pad_-).
OpenOffice.org has inherited the same behaviour. It would be useful if the autocorrect could detect the numbers and use en dashes instead.
MS Office Bug/Feature #12: Relationships in Access
When you create a table without a primary key, Access displays the following message:
Although a primary key isn't required, it's highly recommended. A table must have a primary key for you to define a relationship between this table and the other tables in the database. Do you want to create a primary key now?
The text I have emboldened is simply incorrect. Primary keys are required if referential integrity is to be turned on, but Access is happy to create an indeterminate relationship between fields in tables without primary keys. Primary keys are necessary if referential integrity is to be turned on, but that's not necessary (or even desirable) for all relationships.
Of course, primary keys are generally A Good Thing, but that's no excuse for misinformation. I suspect that it was true once upon a time, and Microsoft never got around to changing it.
Skweezing the web onto your mobile phone
I've recently set up the website
predictionleague.co.uk for the forthcoming
FIFA World Cup 2006. People can create accounts and predict the results of the matches, competing against one another to come top of the league!
The downside is that I have to manually enter the results of each game. It would be nice if I could do this soon after the end of each match, but I won't always be in front of my PC. In fact, I'll probably be in the pub for some of these.
I can access the Internet through my mobile phone (some ancient Motorola model), but it bombs out on any pages over a certain size (say about 50K). I tried calling Orange for advice, but they didn't really know what the answer was. I thought that perhaps it was an account setting to protect me against high mobile phone bills, but I guess it's just built into the phone (presumably the size of the cache). Incedentaly, Motorola's site gives instructions about how to find out the model number of your phone – they didn't work on my model, which just goes to show how old it is.
Anyway, to cut to the chase, I've found the website
skweezer.net which will, free of charge, chop up any website into manageable chunks. Furthermore, it will strip out the images as well. It seems to work very well.
☺ A service so good that, if it didn't already exist, I'd have to invent it ☺
Errors on external USB drive
On my new Ubuntu Linux machine, I was having difficulty writing to my external FAT32 Buffalo USB hard disk. Although my pen drive was mounting read-write, the larger Buffalo drive was mounted read-only. Since I use this for backups, it wasn't much good.
Unfortunately, I didn't make a note of the errors at the time to be able to include them here. Part of it was a disk panic, which caused the switch to read-only. After much faffing about with Eventually I figured that there might be an error on the disk (although most of the other people reporting similar things seemed to be having problems connecting their ipods).
I tried to run fsck.vfat, but that crashed out with a segmentation fault every time I tried it. So instead I connected the disk to my XP laptop and ran a thorough scandisk on it. This seems to have done the trick. I've now used the Simple Backup tool to create a backup, and it went without a hitch.