I recently wrote how difficult it was to read a fully marked up latex document. XML is, in my view, worse despite all the hype that it's human readable; mostly it's not.
Usually when you're writing something, you don't need a whole lot of markup, because the document's are not normally that complex. What's important is that whatever format you choose to finally display that document, works for that document. Lightweight markup is ideal for this end.
Another advantage of lightweight markup is that you don't need any bloated word processor or other complex programme; it can be edited in your favourite text editor.
There are plently of good lightweight markup languages that do the job and plenty of tools to convert them into formats for publication, such as Latex or HTML.
These are a few of the most popular. At the moment I'm using Textile, chiefly because it doesn't require long urls in the text, but allows them to be put at the bottom (or anywhere else) in the document.
Posted: 20 August 2008 @ 12:02 BST
When people see 'The Latex Companion' on my book shelf, they think I'm a bit kinky. They're right of course, but not quite in the way that crosses their dirty little minds.
I really do love beautifully laid out pages and none is better at this job than Latex. Those laid out in Microsoft Word are just plain ugly - in fact it is usually very easy to tell when something has been laid out using Microsoft World, because the spaces are all the wrong size.
I also have a few problems with Latex. As much as I love the beautiful layouts, Latex can be really complicated. I mean really, really complicated. It can take a long time to learn and because, if you, like me don't use it everyday, all those commands, that are so painstakingly learned are quickly forgotten.
Here are some other problems that I have with Latex:
For these reasons, I stopped using Latex and started using Abiword or OpenOffice when I wanted to produce a document with a reasonable layout and by this I mean, a letter. If I'm not writing a letter then usually I'm writing an email and there
However, this discussion thread, started me looking at Latex again. Here are some tips from it:
After reading that thread, I've been inspired again to look at Latex and will certainly keep it in mind when I want to layout a longer work.
Posted: 14 August 2008 @ 15:17 BST
I used to never give a thought to cron. Now, I think, it's the best thing since sliced bread.
It's one of those simple little software tools that just sits on your hard drive and goes about its work silently in the background with barely a complaint.
Usually, a slew of cron jobs are installed when you install your Linux system. These jobs, rotate log files, clear caches and mail queues.
But cron isn't just for the installers to worry about, it's also a useful tool for you to use in your day-to-day.
Here are five things that can be done with cron:
0 22 * * * rsync -a --delete ~/Maildir/ ~/backup/Maildir/ This backs up my Maildir directory to a backup folder at 10 p.m. everyday. The directory ~/backup is symlink to another disk.mysqldump and pg_dump commands.Cron is a fantastically flexible tool, think creatively to see how it could help you.
Posted: 11 August 2008 @ 21:20 BST
Since the rather moronic posts of LinuxHater have spread across the internet, the meme that Linux is not easy to use has started to proliferate, once again.
LinuxHater pointed to this four-year old post, which ridicules Eric Raymond and his difficulty in setting up a shared CUPS printer. I remember when I couldn't set up a CUPS server either and abandoned it in favour of good old lpd.
That ridicule is just stupid. It was stupid four years ago, it is even more stupid now when CUPS is a breeze to set up and Linux is being installed by newbies around the world every day.
With KDE and GNOME, a system can be administered with point and click. And it is certainly no more difficult than Windows or Mac.
As to the Mac, yes, the OSX interface is beautiful. Yes, for most simple tasks the icons are there for people to click and set up. But that's where it ends.
Most people prefer Firefox to Safari; they have to find it, install it and make sure there's an icon they can find easily when they want to run it. It doesn't come with an office suite. Microsoft Office is expensive. And when you install it, it doesn't quite integrate with the Apple desktop experience.
Then there's Windows. Normally, you don't install it, because the PC you buy has it already installed. Which is lucky for you, because I find installing Windows a nightmare.
Windows in itself does nothing. It has Internet Explorer, Microsoft's rapacious, buggy, standards-noncompliant browser. It also has a cut down mail client in the form of Outlook Express. But it doesn't do anything else. How do you make it do something? I presume Aunt Tillie calls up her geeky nephew to come around and install Microsoft Office.
Then we have 'configuration'. Some seem to believe that Windows' 'Control Panel', makes it easy to configure Windows. Nonsense.
The 'Control Panel' is badly laid out, unintuitive and confusing. Usually, you are looking for some 'properties' panel and even when you find it, you are still confused as to what to do with it.
If people like Windows' Control Panel, it's only because after scaling the sheer mountain face of figuring out how to configure something in Windows, they don't see why they should learn another way.
Nowadays, of course, you can configure by pointing and clicking in Linux too, if you want to.
But Linux gives you the option of editing text-based configuration files. Granted, if you're not used to it, it can be confusing. And there's more of a chance you could enter some value that could crash your system, that a point and click configuration wouldn't allow.
But text based configuration files are easier. Not sure what config file you're looking for? Try 'locate'. Want to find a configuration file that contains a certain option? Use 'grep -r'. Want to know what config file a particular service uses? Try 'man'.
Once you know a way around the system, you will find that text-based configuration files are far better than point-and-click. Complaining that 'Aunt Tillie' or 'Grandma', or whoever can't get her head around text based configuration files is a red-herring. Aunt Tillie, doesn't configure servers. Sure, the things she wants to do - connect to the internet and share a printer - should be easy, but that's where it ends.
As far as configuration goes, the "Windows-is-easier" meme put out by the astroturfers should be consigned to the waste bin.
Posted: 10 August 2008 @ 16:15 BST
What mouse behaviour makes you most productive?
Ever since the original MacOS, which gave the world point and click, there have been some rules as to how you interact with the desktop. One of these is that you double-click an icon to launch an application or open a document.
Another rule is that, on the computer desktop, to make a window the one you wish to work on - to make a window 'in focus' - you need to click on it.
I often find this behaviour really annoying, though. It's especially annoying if you want to read something off a web page and type notes into another window, or if you want to type some notes while watching YouTube videos in a browser window.... and so on.
I prefer 'Focus Under Mouse'. That is the window 'in focus', or your working window, is the one directly under the mouse pointer. In KDE you can change this behaviour in the 'Control Center' and choosing Desktop > Window Behaviour.

This can get annoying if your mouse pointer moves by itself and suddenly you find you're typing in some other window. This rarely happens on desktops, but on laptops with those nasty track-pads... but then I don't much like track-pads.
Posted: 8 August 2008 @ 12:57 BST
Because of spammers, I'm sorry to say that I've had to turn public/anonymous comments off again.
I need to set up a moderation system and will turn on public comments once that is done.
Posted: 4 August 2008 @ 16:48 BST
Linux is a Community. It's the sort of community that arises spontaneously from people coming together.
People in this community engage in conversations. Some are trivial, but some are momentous. Some conversations can foreshadow major changes in computing.
During these conversations people exchange ideas, sometimes these ideas are turned into code. Some of the code finds its way into major projects, some of it stays on hard drives, on a web sites, or never gets merged to a trunk.
Sometimes, people push for a major change in the direction that software development is taking; these new ideas can gain traction and transform a project. Sometimes, people go off and do their own thing - they fork projects.
FOSS is, therefore, not just software. Its an ecosystem, made of a number of people with different interests doing different things. This makes it a community. When you run free software you are part of this community.
I was moved to write this after the uproar that was caused by the release of KDE 4.0:
what Seigo and the rest of the KDE community may have failed to realize is that, with the recent popularity of FOSS, many KDE users lacked this historic sense -- and, therefore, did not have the sense of trust he expected.
In addition, he says, "There's still very much a consumer model in people's minds and not a participatory one." In other words, some users, rather than trying to contribute to the project, reacted more as customers who had a right to demand satisfaction, and as though the only way they could get their complaints addressed was by causing a disturbance."
This is exactly the point. Usually, anything we participate in, we participate in as consumers. Our goods and services, whether high or low value, come from huge, anonymous, impersonal corporations. We expect bad service from them and lousy products. This causes many people to be hyper-vigilant; we expect complaining to be pointless. Complaints therefore become shriller and more bitter. If we email the company, we expect a form reply of no value, if we get a reply at all. If we ring a 'customer service' number we expect to speak to a drone who has no authority, knows nothing and will certainly not sort out our problem.
Linux and FOSS are not like that. The individuals who take part in the community take pride in their work and often take criticism personally. Sometimes, they take the very human recourse of lashing out in response.
Many new users are starting to use Linux because modern distributions have become far, far easier to use and install. These new users are not used to feeling part of a community. They act as if they've brought a product from a huge corporation.
Some of these new users will come to understand the community nature of FOSS. Many will not. They will never be part of the community, they will be Ubuntu users or RedHat users.
Occasionally, the users will have bought support packages. Then and only then have they bought a commercial product and only then do they have the right to complain that it doesn't do what it says on the box.
Posted: 1 August 2008 @ 19:10 BST
Often I need to scan a document of several pages and send those pages to someone by email.
Rather than send them several image files, often it is better to convert those image files into one PDF.
First scan the images:
scanimage --format=tiff --resolution=300 > scanX.tif
Where 'X' is a number that you increment every time you scan a page.
Then, concatenate the various tiff images into one using tiffcp:
tiffcp scan*.tif scan-all.tif
Finally, use tiff2pdf to turn the tiff file into a pdf.
tiff2pdf scan-all.tif > scan.pdf
tiff2pdf comes with quite a few useful options. The -j switch turns the images into jpegs so saving space. The -z switch compresses the images.
Posted: 24 July 2008 @ 13:39 BST
Linux users are free, except when we're not. We're not free when we rely on hardware manufacturers to come up with the goods. We're particularly not free when there is one monopoly supplier of the hardware. We're in danger of seeing that in the CPU market.
Advanced Micro Devices (AMD), a key and innovative maker of CPUs, has posted its 7th consecutive quarterly loss. Its balance sheet is shot to pieces. This means the company is not in a strong financial position and is in real danger of going down.
The collapse of AMD would be a disaster.
In the desktop PC market there's only one CPU type and that's the CISC type made by Intel and AMD. If AMD goes down then Intel will have a strangle-hold on this market.
Such monopoly power is bad. It means CPU prices will rise and quality will decline. Unfortunately, we've been able to avoid this situation because AMD and Intel have competed against one another forcing each other to innovate. As a result we as the consumers of CPUs have been able benefit from better and cheaper computers.
That's how it's supposed to work and that's the way it will continue to work as long as there are two chip manufacturers.
AMD, though, is in danger of disappearing. That would leave Intel as the only supplier of chips to desktop PCs. Chip prices, and therefore the prices of computers would increase, whilst the innovation decreases.
Personally, I'm processor-agnostic. I want the best processor for the job. My interest is to ensure competition to drive continual innovation.
There's little that the individual Linux user can do, but hope that AMD makes it through its hard times and continues to innovate.
Posted: 23 July 2008 @ 10:27 BST
I don't administer postgresql very often. Normally, I use it as a back-end to something, so I often forget how to do some of the most basic things, like ... er... login.
Consider a recent experience. I tried to login:
psql mydb
Pg responded:
FATAL: role "paul" does not exist
So, I try to create 'paul' using createuser, but I can't until, I realise that I can create users if I su as user postgres. Again I try to log in:
FATAL: Ident authentication failed for user "paul"
This is really annoying, but it's supposed to be an aid to security. Postgres is installed in such a way that you can only log in with the same user name as your Linux account. A line in pg_hba.conf does this:
local all all ident sameuser
One way to fix the problem is to amend that line. The other is not to connect through a Unix socket rather through an IP address. So, whereas this will fail to login to the database mydb:
psql -U dbuser mydb
This will succeed:
psql -U dbuser -h 127.0.0.1 mydbPosted: 14 July 2008 @ 18:32 BST
Postgresql databases default to an encoding style of ASCII. Although this is traditional, UTF8, an encoding that can handle almost any language and character set, is preferable. This is how to convert an existing postgresql database to utf8:
pg_dump asciidatabase > ascii.sql
iconv -f iso8859-1 -t utf-8 < ascii.sql > utf.sql
createdb --encoding=unicode utfdatabase
psql utfdatabase < utf.sql
It worked for me, anyway!
Posted: 24 June 2008 @ 11:18 BST
Say you have an output of a program and need to email it. It is easy to pipe it to the mail command. Take for example this:
cat file.txt | mail some@person.com
This sends the contents of file.txt to some@person.com. I find this far quicker than firing up Thunderbird and then copying and pasting the text in from an editor. This technique really comes into its own when you want to email the out of the program. For example, say you're developing something on one system and want to email the changes you've made to a colleague:
svk diff | mail my@colleague
This takes the changes you've made in the local repository and emails them to your colleague. This is quick and easy and something I'll be doing a lot more of in the future.
Posted: 16 June 2008 @ 11:32 BST
When you work on a remote machine to which you have SSH access, it can be a real nuisance to have to continually enter the password every time you want to do something. This is particular true when editing files on the remote machine, say, using Emacs's "tramp" functionality.Here's how to access SSH without typing in a password.
First generate the key for the client on the client machine:
ssh-keygen -t rsa
This generates a public/private key pair. The '-t' switch indicates that you are doing it to produce a key for ssh version 2. Do not enter a passphrase.
Copy the key across to the remote machine typing the password when prompted:
cat .ssh/id_rsa.pub | ssh user@remote.host 'cat >>
.ssh/authorized_keys'
Now you should be able to ssh to the remote host without entering a passphrase.
Posted: 15 March 2008 @ 09:57 GMT
Having a remote server to send email through is really, really useful, especially, if you are travelling around with a laptop and need to send email while you're on the road.
A main reason for this usefulness is that usually, your ISP's SMTP server won't acccept email from you if you're not connecting through their network, which, when you're roaming, you won't be.
You'll be able to connect to your server from anywhere and send mail through whether you're connected through a friend's ADSL network, through a Wi-Fi connection is a cyber cafe. Of course, the server has to be configured and you need to run a mail transfer agent, such as sendmail, postfix or exim. My choice is exim because it is the Debian default.
The MTA needs to be configured correctly so that it doesn't become a relay for spammers. In particular it needs to be password protected. When I tried this, I found the the Exim documentation not complete.
There needs to be a password file on the server to store the password. This should be in "CONFIG/passwd", which on my system is /etc/exim4/passwd.
The password has to be hashed and the way to do this is use the command:
htpasswd -d -c passwdfile usernameforsmtp
where "usernameforsmtp" is the user name you wish to connect to exim with and "passwdfile" is the name of the file in which you wish to store the password.
You also need to use a TLS certificate. This must be enabled in the exim configuration files with this line:
MAIN_TLS_ENABLE = true
Finally, you need to be careful that the service provider you are connecting through doesn't block outgoing connections on port 25. ISPs often do this because port 25 is used by computers hijacked by spambots. You can get exim to listen on the normal secure, TLS port 587 with this line:
daemon_smtp_ports = smtp : 587
Now, all you have to do is get your email programme, say Thunderbird, to point to your remote server, port 587 as its outgoing server and supply your user name and password.
Posted: 5 March 2008 @ 08:01 GMT
My T23 died and I managed to get a T43. Of course, the first thing to do was to install a real operating system on it: GNU/Linux.
The laptop came with Windows XP. I wanted to keep it for the few occassions where I need to run a Windows-only program. So I needed to shrink the partition.
My favourite way of doing this is the Gparted "live" CD. Initially, gparted just wouldn't shrink Windows XP's NTFS partition. The answer was to boot back into Windows and defragment the hard disk. I did this twice, just to be sure, and because I read on some website somewhere that it was a good idea.
After this, I used gparted to partition the hard disk.
/dev/sda1 10GB Windows XP
/dev/sda2 IBM recovery partition
/dev/sda3 788M /
/dev/sda8 29G /home
/dev/sda6 190M /tmp
/dev/sda5 4.9G /usr
/dev/sda7 3.9G /var
My favoured system is Debian. I usually use 'unstable' on desktops and laptops because I get the latest software and the bugs and issues are not so serious that they prevent me from getting on with work.
I used the Debian Net install CD to install a base system, which brings me to a little rant against the Debian installer.
If you already have a partitioning scheme set up, the Debian installer doesn't believe you and forces you to use its partitioning program and follow the installation in the steps that it deems are necessary rather than the ones that you know are needed. This is nonsense.
You should be allowed to set up a partitioning system anyway you want and then reboot with the Debian installer and just assign the partitions to mount points. The Debian installer won't let you do this. Fortunately, the operation called "write partition table to disk" is not destructive to data already there.
Also, the wireless network card did not work out of the box. This was a problem as I did not have a wired connection point available for a while. In Windows I was able to download, across the wireless connection, the live CDs for Knoppix, Gnoppix and Ubuntu. Knoppix is my favourite of these, but only in Ubuntu did the wireless network come up.
If I had been thinking properly I would have mounted the various hard disk partitions at appropriate mount points and chroot-ed to the root partition and install Debian that way, while running the Ubuntu live CD.
Instead, I examined the hardware, found that my T43 had the atheros wifi chip not the Intel Pro/Wirelss one that everyone else seems to have. I waited again until a wired connection was available and was able to download the non-free madwifi package and compile it for the kernel. Once the madwifi drivers were installed the wireless network came up flawlessly.
In summary:
Posted: 24 October 2007 @ 14:56 BST
I had some data in a postgres database on a laptop that died. Stupidly I didn't back up that data. However, using some hacker-jitsu (i.e. buying a hard drive-to-USB coverter) I had access to the data. However, there were further problems.
The documentation says that postgresql data files are not compatible from each major version to another. So 7.4 data are not compatible with 7.5 data let alone 8.2. Hence forcing 8.2 to read the 7.4 data files was bound to fail. In any case, the command line utiltites 'pg_ctl' and 'pg_ctlcluster' did not seem to respond to the -D switch which set the data directory.
To move data from one postgresql version to another the documentation advises to use postgres's pg_dump and pg_restore utilities. Alternatively there is the pg_dumpall utility.
There also seems is a 'pg_upgrade' utility, but I couldn't get my head around the documentation.
So, I mish-mashed all this information in my head and came up with a strategy.
The first thing I did was to install the old postgresql:
apt-get install postgresql-7.4
I then stopped the postgresqls from running.
/etc/init.d/postgresql-8.2 stop
/etc/init.d/postgresql-7.4 stop
I copied the data from the usb drive to the current drive. I guessed (correctly as it turned out) that, on a Debian system, the postgres data are in /var/lib/postgresql/7.4/. Your system might be different.
rsync -avz /media/disk-1/lib/postgresql/7.4/ /var/lib/postgresql/7.4/
Made sure that the owners are right:
chown -R postgres.postgres /var/lib/postgresql/7.4/
Now, time to get the database data. Note the use of the 'su' command as I can't be arsed to struggle with postgresql's authentication system, especially for one operation.
Start the pg server:
/etc/init.d/postgresql-7.4 start
Get a dump of the old data:
su -c 'pg_dumpall > outfile.sql' postgres
Stop the old server and start the new one:
/etc/init.d/postgresql-7.4 stop
/etc/init.d/postgresql-8.2 start
Finally, load the data into the new server:
su -c 'psql -f outfile.sql' postgres
And there you have it.
Posted: 23 October 2007 @ 22:29 BST
These days with big hard drives, there is some sense in using the highest possible audio quality when ripping your CDs. The best audio quality is provided by FLAC (Free Lossless Audio Codec).
Previously, I've always used Grip to rip CDs to mp3 or ogg. However, when ripping to Flac I noticed that the meta-data such as track title, album title and so on were disappearing! The data were not being written to the Flac file and therefore were not being displayed by any player, whether Amarok or xmms.
The reason for this is that Flac does not use the same type of tagging system that mp3 files do. Instead Flac files use something called "Vorbis comments" to store the data.
To get the players to display information like 'song title', the Grip configuration options must be changed so that Grip writes these data to the flac file when ripping.
I fixed this by clicking on the 'Config' tab and then on the 'Encode' tab. In the box called 'Encoder command-line', the correct options must be entered.

For me these are:
--best -V -o %m %w -T "ARTIST=%A" -T "TRACKNUMBER=%t" -T "ALBUM=%d" -T "TITLE=%n" -T "GENRE=%G" -T "DATE=%y"
All works fine now!
Posted: 8 October 2007 @ 10:13 BST
Some comments are missing. This is because some prat has discovered a url that could be submitted to the site that deleted comments, but only comments.
I have to thank that the said prat for bringing my attention to a bug in the site. The bug is now patched. A more serious fix will be provided in due course.
To those who have submitted comments only to see them disappear into the ether, I can only apologise. The comments still exist in backups and I will drag them out and put them back up onto the site as soon as I write a little script to do so.
Posted: 27 September 2007 @ 08:01 BST
I've got a Hewlett Packard L1940T. It was flickering both in Vista and Linux. The flicker was so annoying that I was going to send the monitor back.
The monitor is not, I suppose, of the highest spec and the manufacturers recommended resolution is 1280 x 1024 @ 60 Hz.
I figured that playing with xorg.conf, the file that configures the video display might help. These settings stopped the flickering:
Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 60
VertRefresh 43-60
EndSection
Unfortunately, with these settings, some of the fonts became slightly blurry. I can live with that, but the flickering was driving me bananas. It still flickers in Vista, but in Linux it's fine.
Posted: 2 August 2007 @ 15:50 BST
Recently, I installed Debian on a new system. It came pre-loaded with Vista. I used the gparted to shrink the Vista partition and create some new partitions. Thusly:
/dev/sda1 49G NTFS /mnt/windoze /dev/sda2 981M ext3 / /dev/sda6 5.8G ext3 /var /dev/sda7 587M ext3 /tmp /dev/sda8 229G ext3 /home /dev/sda9 4GB swap
After partitioning I installed Debian using the Netinst CD.
Unfortunately, Vista wouldn't boot after the partition resize. So I had to reinstall it from the install DVD. But then I couldn't boot Linux, because Vista had clobbered my master boot record. Grr...
I hoped that Debian was still on the disk. I booted using the Knoppix live CD and went to the terminal.
First, get the grub shell.
grub
Type:
find /boot/grub/stage1
This returns the location, in my case (hd0,1). Now type:
root (hd0,1)
Or whatever your location was. Then setup the MBR:
setup (hd0)
Now type 'quit' to quit grub. This restored my MBR. It allowed booting of both Windows and Linux. Luckily, Vista hadn't zapped my entire Linux installation.
Posted: 27 July 2007 @ 19:59 BST
ACPI administration advocacy advocacy opinion apache audio authentication bash calendar commandline cron database debian desktop development disk dvd emacs email exim files firefox firewall ftp fun grub hardware hardware html images installation ipod kde knoppix laptop latex mplayer multimedia mysql network nfs openoffice opinion opinion pdf perl php postgresql printing scripting scsi security shell sitenews slackware spam ssh subversion svk t23 t43 text thinkpad thunderbird time users windows wine wordpress xwindows xwindows