Setting global XFig defaults for working with LyX/LaTeX

15 May, 2009 - 10:26

When making a document with Lyx (or LaTeX), I often create figures and diagrams in XFig. I know, Xfig's user interface sucks big time. (I tried the Java port JFig, but that one even feels worse to me.) However, the main reason I bite the bullet is that it enables a work flow where the text you add to the XFig figure is typeset by LaTeX when you compile the document. This way, the text in the figure is in the same font as the normal text in the document and, maybe more importantly, you can use all the fancy LaTeX commands, e.g. to put mathematical expressions, symbols and formulas in your figure.

To make this work, one of the required things is to enable the "special" flag on the text objects in XFig, and use a LaTeX font. These things are disabled by default and manually setting for every text object is a bit tedious. To changes these defaults, you can start xfig from the command like with the following options:

Read more...

URL shortening chain reaction

13 May, 2009 - 12:54
Categories:

You know those URL shortening services like tinyurl.com, is.gd and bit.ly? Here is an example: http://twurl.nl/jvuncl. Looks like a pretty normal shortened URL, right? Now eat this:

Read more...

Subversion: undo committed changes

12 May, 2009 - 15:08
Categories:

How to undo/rollback a Subversion commit? A fairly basic question, but every time I need the answer, I can't manage to remember it from the previous time I did it. Asking Google helps eventually, but the signal to noise ratio of the top hits is a bit disappointing. This time I couldn't resist the urge to throw my own bot snack in the intertubes.

Say you just made a commit (revision 123 for file apple.py), you discovered (after the fact) that it was just crap and you want the previous version (revision 122) back.

Read more...

Color highlighted diffs with git, svn and cvs

4 May, 2009 - 08:57

At first, it seemed annoying, but now I really like that git uses a pager when it has to present something (e.g. a log or a diff) that is longer than your screen. Git even provides a built in option --color to show you a diff with helpful colors. I use this option all the time and made a shortcut dic for it with the following command

git config --global alias.dic "diff --color"

Also possible is to edit your ~/.gitconfig directly so you have something like the following in there:

[alias]
        di = diff
        dic = diff --color

Now I just do

git dic

and I get a nice paged and color highlighted diff.

Read more...

How to be a better grepper

28 April, 2009 - 17:37
Categories:

If you're not afraid of a a bit o' Unix/Linux/OSX command line delight, you're probably having grep hanging on your tool belt.

One option you'll wonder how you could live without is --color, which enables highlighting of the word or pattern you are grepping for. I find it so useful that I've put the following alias in my .bashrc:

alias grep='grep --color=auto'
Read more...

There's something wrong in Rue du Général Moulin

17 April, 2009 - 18:22
Categories:

The GoogleMapsMobile observed a time-space anomaly in Rue du Général Moulin, Caen, France

Update: the wormhole seems to be fixed now. Phew!

Funny spam

6 April, 2009 - 11:31
Categories:

From time to time I check my spam folder to see if some legitimate emails ended up there. The subject lines of those mails are pretty boring most of the time. Sometimes however, the ones trying to sell you viagra and related crap are so grotesque that it is funny in a (sad) way.

A selection:

  • Get your giant pilot into her cockpit
  • She will lick her lips when you pop out your salami
  • Rise from the dead, ye little head...
  • Welcome to wiener wonderland
  • Statue of Liberty, Eiffel tower, then your tool

Accented characters with qwerty keyboard (Ubuntu Linux)

23 March, 2009 - 10:25
Categories:

I prefer a qwerty keyboard for programming, but to write in my native language (Dutch) I need sometimes accented characters like ë, ï, é, etc, which do not have dedicated keys on a qwerty layout.

A handy way under Linux is to use a "compose key" ([Alt Gr] on my setup), which allows you to compose accented characters by entering the accent (umlaut, accent grave, ...) and the unaccented character separately.

Read more...

Flag a PDF file as binary for Subversion

11 December, 2008 - 01:05

Sometimes, Subversion thinks that a PDF is a text file, instead of binary data. This can hurt during commits or diffs, because Subversion tries to do textual diffs with binary data.

Solution: you can explicitly flag the file as PDF data and Subversion will handle it as binary from then:

svn propset svn:mime-type application/pdf yourPDFfile.pdf

localhost webdev: virtual host setup on Mac OS X with MAMP

23 October, 2008 - 11:28

Reminder to self: how to set up a virtual host for localhost webdevelopment on OS X with MAMP

  1. DNS setup: add an entry for the local domain name in /etc/hosts, e.g.
    127.0.0.1     foo.localhost

    and flush DNS cache with

    dscacheutil -flushcache

  2. Apache config (/Applications/MAMP/conf/apache/httpd.conf): add a virtual host entry like
    <VirtualHost *>
      ServerName foo.localhost
      DocumentRoot /Users/eddywally/Sites/foo/localhost-dev/drupal
    </VirtualHost>

    and restart webserver, e.g. with

    /Applications/MAMP/bin/apache2/bin/apachectl restart

  3. Connect to http://foo.localhost:8888 (don't forget the nonstandard port number, unless you configured MAMP to use standard port 80).
Read more...