Quote of the day

The best file manager in unix is called `bash`.

Automate SVG to EPS with subversion

We use Inkscape for the diagrams in the book and keep them as SVG of course, but for inclusion in LaTeX, they have to be transformed to EPS.

Instead of trying to remember to save a copy in EPS format from within Inkscape, I've automated that task by periodically running an svn update command, followed by a make (with a nifty Makefile). I would have liked to do that in a post-commit hook, but you aren't allowed to modify Subversion's transactions.

Now, if only I'd thought of that months ago… :-(

TeX/LaTeX on Mac OS X

If you want to start with TeX and LaTeX on Mac OSX, I recommend the MacTeX Distribution, which supplies virtually all you need to start with in a single installer.

The bundle includes TeXShop a simple, yet practical GUI in which you write LaTeX and produce PDF at the click of a button.

How I got started with LaTeX

A comment posted the other day made me consider writing up a bit on how I got started with LaTeX, so here goes.

When the idea of writing a book was born, I dreaded the thought of using a typical word processor to do the job; I've used MS-Word (in umpteen versions except the latest: I refuse to) and OpenOffice.org on larger documents before, and the programs suck. Both programs are good enough to write up a shopping list or an invitation to a booze-up on the weekend but little else. I had a publisher (that's the guy who made me start writing the book), and he recommended I do it in LaTeX. His main arguments being I could use Unix tools to "manage" the creation of the book (grep, sed, etc.), and write it with my favorite text editor. That was the argument that really got me.

I ordered two books: Leslie Lamport's LaTeX: a document preparation system (Lamport invented LaTeX, so that is the reference), and Frank Mittelbach's The LaTeX Companion, 2nd ed (an excellent and very thick book that shows you how to use LaTeX' packages with a trillion examples). There are plenty more books, so take your pick. Oh, and I recently read (and loved) LaTeX Hacks which, to my knowledge, doesn't exist in English. The books took a while to be delivered by the post office, so I started off with some online resources.

There is an incredible amount of good stuff on LaTeX, and here are a few I liked best: start off on the LaTeX project page of course, where they tell you (in just a few words), what LaTeX is all about. This bit is very important to understand: LaTeX is a document preparation system for high-quality typesetting. Read that short page five times, go grab a coffee and read it again, and then go to their documentation page.

WikiPedia's LaTeX article gives a bit more insight and some goodish links. The next bit is: don't get confused by all the maths stuff: many clever people use LaTeX for typesetting mathematic formulae; now, that doesn't interest me in the slightest, but unfortunately a lot of documentation focusses on that (it is after all one of the many powerful facets of TeX, the underlying system in LaTeX). Anyways, just forget about those (unless of course, you are a mathematician and want formulae).

A goodish document is Getting Started with LaTeX, by Wilkins, available as PDF and as LaTeX source (is that cool?). Very good, because it is geared towards how you get started with the tools, is Talbot's LaTeX for complete novices (PDF). WikiBooks has a book on LaTeX (PDF) that is also worth looking at. Cambridge University has a good list of introductions, some as PDF, others as PostScript, most in HTML, so you'll be ok with that. And, last but not least, the FAQ. If you're conversant in the German language, consider listening to a podcast on the use of LaTeX, available for download at Pofacs: it is a bit long-winded, and I didn't like it very much, but you might. A Germany site for LaTeX is Dante where you'll find further links and literature, including a list of books.

So, and then? Well, LaTeX exists for most, if not all, Linux distributions, so there is no problem getting the software. You'll also find it for Windows, Mac OS X and probably for your toaster as well (BTW, Mittelbach's Companion has a CD on it, with a TeX/LaTeX distribution on it, but I didn't further look at that, as I had all I required to start with).

I started with your typical Hello World type document: nice and easy, to get a feel for the tools, the debug output (which sucks) and all the intermediate files LaTeX gives you. The first thing I did was create a small Makefile (you can use a shell script to do the same) which cleaned up all the stuff, just so I could start-over if I wanted to. After getting the hang of things (which takes an hour or two), I sat back and read the books.

And the rest? Well, the rest is history, as they say. I am certainly not proficient in LaTeX, but I fully understand what it can be used for, and let me tell you: you can use it for any writing. The most important to remember is to structure your text and use macros. For everything. The rest is easy.

As soon as I've completed this project, I'll be re-structuring my office. With that will come using LaTeX for all correspondence (yep, you can also write letters with it; packages g-brief, dinbrief, etc), and I'll report on that in due course.

LaTeX is really, really worth looking into.

Scared? I can imagine: I was.

Then why not start off easy? LyX is a document processor with a GUI-frontend to a LaTeX back-end. It runs on Linux and Windows (Win32 and Cygwin), and is probably a good way to start easy, with a bit of GUI support. There is another project known as Kile, an integrated LaTeX environment, which runs on a number of platforms. I've glanced at LyX, and it really looks very good, but I can't say much about either of these programs. If you do try them, or if you have experience with either, I'd be interested in your opinion.

Memorize this

Print this out!

[via]

Made me cry

Everyone has to start some place in IT, and we all went through some sort of learning curve, right? But this takes the bloody cake:

Guy sees documentation (note: I write sees; he certainly didn't read it), where it says he should run

./configure ...

He then comes back to the mailing list and writes:

We are supposed to put three dots after ./configure script to make it work.[] It doesn't work for me too.

Holy shit. How dense can you get?

If you want to write a book…

The first thing I recommend you do when you want to write a (technical) book is to find a publisher who doesn't force you to use MS-whatsit (or any other what you see is perhaps what you get system) to write your manuscript. Tell those that do to go take a hike, and continue looking for one that will allow, perhaps even encourage, you to use a text formatting system like LaTeX.

The next step, macroize everything. In case that isn't a word, what I mean is that you convert any reoccurring terms to macros. It is a bit of a pain at first, but it pays off. So, instead of using, say

LDAP

in your text, you use a macro and write

\LDAP

(note the backslash). After you've written the main content, you get to the irky bit: creating an index. Here is where the macroization pays off. If you did it well to start with, creating half the index is fully automated with the LaTeX tools. For example, in the PowerDNS chapter I use

\pdnsky{launch}

whenever I discuss the launch command. By altering that macro definition, I automatically create index entries that look like:

launch, PowerDNS, 123
...
PowerDNS directives
  launch, 123

Of course, there is still plenty to do, because you don't (well, at least I don't) just want a keyword index, but rather a concept index.

Not that I've finished my book yet, not by far, but let me tell you that using good tools means getting there in half the time!

Every three or four years

Every three or four years, depending on how a company writes off its hardware, you have machines to replace. Now, replacing a box with a few cables on it isn't hard: you rip the old cords out of the wall and throw the lot on the dump. After that, you place the new boxes in your data centre and plug in all the cords in their respective sockets.

But that isn't quite all there is to it, is it?

You then install a base operating system. If you are lucky, nothing much has changed and you load backup tapes (or whatever media you've used) and restore from that. If you aren't so lucky (as what happened to me), the machine you are replacing wasn't quite, shall we call it up to date?

In that case, it is more or less a start from scratch kind of operation. Software has changed, you decide to use a different IMAP server, the MTA configuration needs tweaking, Apache's authentication modules have changed (for the, it must be, trillionth and a half time), etc., etc., etc.

Oh, well, I'm all done.

Well: not quite. There is still half a load of utilities and stuff that need recompiling (new version of GCC, you know), but I should be getting there soon.

I hope. :-)