Logs

These logs are random snippets of information that have been useful to me in the past. Hopefully they help you too!


Export syntax-highlighted pdf files from vim

If you want to export from vim to a pdf file with syntax highlighting, hardcopy does not seem to use the correct syntax highlighting file. Or rather, it uses...

Making vim display italicised text

To make vim display italicised text, see this wonderful blog entry. Essentially, we need to manually map the escape sequences to the keywords sitm and ritm, ...

Extending Python using C

For an introduction to extending python using C, via PyObject and the like, take a look at this tutorial.

Which which is which

The which program used by Fedora/CentOS/RHEL is far more advanced than that used by Debian/Ubuntu. Get the Fedora version here. I have also created an alias ...

Get ls to sort by file extension

Get ls to sort by file extension using ls -X. I have added this to .bashrc so this is now the default. If you want the usual directory listing, for instance ...

Short tutorial on screen

Take a look at this for a nice, short tutorial on screen. Be warned: screen and my shortcuts in vim do not seem to interact very well.

Place pdf pages side-by-side in linux

To convert a pdf document into one containing two pages per side, simply man pdfnup. This is a convenient frontend to the more complex pdfjam. For most purpo...

Making sudo pip use a different HOME

Test whether or not sudo is using the environment you expect by creating a small test script with echo $HOME for instance, and then running it as sudo bash t...

PEP8-style indentation in vim

How do you automatically get vim to do PEP8-style indentation for python code? Look up this blog post which references this vim script. It has also been adde...