Python: show where a module was imported from
Published 19 May 2015 under python, software

After importing a module in python use the following to find out where it was imported from: import astroid astroid.__file__ '/usr/local/lib/python2.7/dist-packages/astroid/__init__.pyc' This is...

Read more →

How to force xfce-terminal to use inverse cursor colours
Published 28 March 2015 under xfce, terminal, xubuntu

In Xubuntu 14.10 xfce-terminal (the default Terminal application) and vim it's difficult to choose a cursor colour that doesn't obscure the text: The fix is to put the following into...

Read more →

Concatenating PDF files using ghostscript
Published 03 February 2015 under pdf, ghostscript, tips

If you ever find yourself with multiple PDF files that need to be combined into one single PDF you can use the following incantation on Linux: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite...

Read more →

Python str() or repr() on a float?
Published 29 January 2015 under python

We often need to convert objects into their string representation for nice output. To do this in python we can use the str() built-in function. However, it may not always be the best function to...

Read more →

How to cross compile a Raspberry Pi kernel Debian (Raspbian) package from source
Published 17 September 2013 under raspberry, pi, kernel, debian, raspbian, cross compile

Compiling a new kernel on a Raspberry Pi itself takes a longtime. This is how to cross-compile a kernel package. An Intel i7laptop does the job in 11 minutes.I am assuming that you are using an...

Read more →