Category Archives: Hacks

Set Trackpad Sensitivity for Thinkpad on Ubuntu

On a Lenovo Thinkpad the trackpad is the red button that acts as a mouse. To set the sensistivity and speed of your trackpad on for ubuntu/debian linux do (as root): echo -n 180 > /sys/devices/platform/i8042/serio1/speed echo -n 250 > /sys/devices/platform/i8042/serio1/sensitivity To have these applied every time you user the computer (probably what you want!) […]

Also posted in *nix | 1 Response

Reverse Proxying to WordPress.com

I wanted to do a reverse proxy to wordpress.com in order to integrate an existing wordpress.com blog into an existing site. This turned out to be a little trickier than I’d thought due to wordpress.com’s usage of gzip deflation of their output. Figured this out thanks to sound advice here and here: … <Proxy *> […]

Also posted in Code, Sysadmin | Leave a comment

Subversion Hacks

Automatically Adding or Removing Files Especially useful when, for example, versioning /etc/: Files to remove: svn stat -q | grep ‘^!’ svn stat -q | grep ‘^!’ | sed -e ‘s/^!\s*//’ | xargs | svn rm Files to add: svn stat | grep ‘^?’ svn stat -q | grep ‘^?’ | sed -e ‘s/^?\s*//’ | […]

Also posted in Sysadmin | Leave a comment

Some Notes on Converting From Subversion to Mercurial (hg)

Distributed versioning systems (VCMs) have now matured to the point that I’ve been planning to switch from subversion for quite a while — at least for own personal repositories where there are no coordination issues. Having chosen mercurial (hg) as my DVCM of choice the next step was to actually convert. While there is quite […]

Also posted in Software | Leave a comment

External Monitors with Ubuntu and Intel GMA X3100 integrated graphics

I recently took delivery of a Novatech X40r system (Novatech are one of the few suppliers who allow me to get a machine without Windows). The most recent version of Ubuntu (Gutsy) installed without any issues — though I couldn’t quite seem to get the display resolution to match the screen resolution. Next step was […]

Also posted in *nix | 2 Responses

svk Sync Bug “Bad URL passed to RA layer: Malformed URL for repository”

I record briefly my experience resolving this issue in case it helps others. As background I note that I use svk to allow local commit and replay for some of the subversion repos I use and over the last week I’d started encountering problems when trying to svk sync on one of these receiving the […]

Also posted in Openness, Software | Leave a comment

Counting Words in a Latex File

Much of this was inspired by this blog post. Having tested on my own set of files I would suggest that these methods could be ranked in order of accuracy as: TexCount.pl untex + wc wc pdf file wc $ wc -w file.tex This is very simple but is pretty inaccurate since wc has no […]

Also posted in *nix, Command Line | 1 Response

Running OpenOffice from the Command Line on Mac OSX

This is a simple hack to enable you to start OpenOffice and, more importantly, open documents with it from the command line. I’ve got the standard X port of OpenOffice 2.0 installed, so if you have something different you may need to change the path to soffice given below (to find soffice on your machine […]

Also posted in Command Line | 2 Responses

Dump Python Interactive Session to a File

import readline readline.write_history_file(‘my_history.py’)

Also posted in Python | Leave a comment

Merging Subversion Repositories Together

Have repository {start-repo} and want to merge into {old-repo} at {some-dir-name} # if you just wanted trunk replace with this # svndump {start-repo} | svndumpfilter include trunk svnadmin dump {start-repo} > my-dump # copy file to main server and change to web-user svnadmin load –parent-dir {some-dir-name} {old-repo} < my-dump

Also posted in Command Line | Leave a comment