Fix PDF line breaks for copy and paste

16 April 2013

Format text copied from a PDF to try and remove unwanted line breaks.

See the page to format text copied from a PDF.

Fix PDF line breaks for copy and paste - Comments

Ubuntu: Running a command in GNU screen on boot as another user

14 January 2013

Add to /etc/rc.local before the ’exit 0’ line:

mkdir /var/run/screen
chmod 775 /var/run/screen
chgrp utmp /var/run/screen
su USER -c 'screen -m -d -S SCREENNAME bash -c "COMMAND"'

Replace USER with the user you want the command to run as. SCREENNAME with any name you like, and COMMAND with the actual command to run in the screen.

The first three lines were necessary to work around a bug in screen on Ubuntu.

Ubuntu: Running a command in GNU screen on boot as another user - Comments

Getting URLs to line break in LyX

4 January 2013

LyX is generally pretty good, but sometimes things that should be simple can be a pain. I couldn’t successfully get long URLs to wrap over multiple lines rather than overflowing off the edge of the page until I read this obscure bug report after about 5 minutes of Googling.

What worked for me was using Insert->URL instead of Insert->Hyperlink. Simple as that, I didn’t even notice there were two different options previously.

As a bonus you can make URLs clickable in PDFs by going to Document->Settings->PDF Properties->Use Hyperref Support.

Getting URLs to line break in LyX - Comments

Organise digital voice recordings

29 December 2012

Recording lectures with a USB digital voice recorder left me with a lot of obscurely named files. Naming them according to what the lecture subject was by hand would have been very time consuming. I wrote a script to take an ical calendar file and match up recordings from the device with events on the calendar.

Given an input and output directory and a path to an ical calendar file (may be at a remote URL to use with Google Calendar or similar) the script will copy files and rename them according to corresponding events. Where there are multiple (or no) events occuring around the time of the recording, the script will name the recording as ‘uncategorised’.

It needs the icalendar module to run. The script can be downloaded here. See also the GitHub page.

It’s not limited to organising voice recordings and could be used to label any files with calendar events based on their modification timestamp.

Organise digital voice recordings - Comments

Export dates from ical using Python

28 October 2012

This script exports dates from an ical file, I needed it to put them into a spreadsheet. You need the icalendar module for this.

Export dates from ical using Python - Comments