latexdiff with multiple files

This is very useful:
http://dropbearcode.blogspot.co.nz/2011/09/multiple-file-latex-diff.html

Posted in Uncategorized | Leave a comment

Proton precession magnetometers

Missed another aurora last night. Should build myself a proton precession magnetometer.

This looks like a nice design: http://www.gellerlabs.com/PMAG%20Docs.htm

Another one http://www.ilotresor.com/prospection/pro_magn_protons.html

Posted in Uncategorized | Leave a comment

Mutt

Mutt seems to be the best curses based email client around, but it’s documentation is pretty dense to say the least.

I found this article http://www.linuxuser.co.uk/tutorials/get-started-with-mutt/1 veru good.

This http://www.ucolick.org/~lharden/muttchart.html useful too.

Posted in Uncategorized | Leave a comment

Raspberry Pi as printserver

I have recently bought myself a raspberry pi, and it seems to have found two uses. One as mpd-based jukebox and the other as a print server.

Our printer is a ZJS based HP-Laserjet-1020. Everything seems to work fine with raspian except that the firmware doesn’t get downloaded automatically. To get round this you have to run “hp-firmware” to load it. The first time it complained about a missing firmware file, but I just copied the file over my desktop system.

Update: To get the firmware to autoload copied the appropriate file “/etc/udev/rules.d/86-hpmud-hp_laserjet_1020.rules” over from my ubuntu desktop

The files contents were:

# Load hp firmware for this printer.
ACTION!="add", GOTO="hpmud_rules_end"
# hp_laserjet_1020 for Suse 10.3
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="2b17", PROGRAM="/bin/sh -c 'logger -p user.info loading hp_laserjet_1020 firmware $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c '/usr/bin/hp-firmware -y3 -s$env{BUSNUM}:$env{DEVNUM} &'"
# hp_laserjet_1020
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="2b17", PROGRAM="/bin/sh -c 'X=%k; X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; logger -p user.info loading hp_laserjet_1020 firmware $$B $$D; printf %%03i:%%03i $$B $$D'", RUN+="/bin/sh -c '/usr/bin/hp-firmware -y3 -s%c &'"
LABEL="hpmud_rules_end"

 

 

Posted in Uncategorized | Leave a comment

Using camera as scanner for text and lineart

A quick way to add a diagram to lecture notes is to take a picture with your camera, you then have the problem of converting the photo into a monochrome image. To speed this up I wrote a gimp plugin to do this. It basically follows the method outlined in http://www.gimp.org/tutorials/Sketch_Effect/ and uses Otsu’s method to decide on the threshold.

To install it put the python file into ~/.gimp-2.8/plugins and make sure it is set executable. To use it select “Make monochrome” from the “Image” menu.

Some examples are:

tap tap

pistonpiston

texttext

Posted in Uncategorized | Leave a comment

Māori, macrons and LaTeX

My employer is encouraging everyone to use and promote the use of the Māori language. Of course you it’s easy to make vowels with macrons in LaTeX but all those \= don’t exactly make for an easy to read text file. This is a little style file I wrote which tells latex what to do when it sees a unicode character corresponding to a vowel with a macron.

Save it to a textfile called maori.sty …

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{maori}[22/3/2013]

\usepackage[utf8]{inputenc}

\DeclareUnicodeCharacter{0100}{\=A}
\DeclareUnicodeCharacter{0101}{\=a}
\DeclareUnicodeCharacter{0112}{\=E}
\DeclareUnicodeCharacter{0113}{\=e}
\DeclareUnicodeCharacter{012A}{\=I}
\DeclareUnicodeCharacter{012B}{\=\i}
\DeclareUnicodeCharacter{014C}{\=O}
\DeclareUnicodeCharacter{014D}{\=o}
\DeclareUnicodeCharacter{016A}{\=U}
\DeclareUnicodeCharacter{016B}{\=u}
Posted in Uncategorized | 2 Comments

more on git and latex

If you want to display git info (version number etc) in your finished latex file put

\usepackage{gitinfo}

in the headers for the tex file.

Then  you need to add code to the scripts to .git/hooks/post-checkout, .git/hooks/post-merge and .git/hooks/post-commit which put a file called gitHeadInfo.gin all the folders with latex files.

The code should be something like

prefixes="lectures/01-first_year_review"  
#prefixes="." # Default --- in the working copy root
for pref in $prefixes
 do
 git log -1 --date=short \
 --pretty=format:"\usepackage[%
 shash={%h},
 lhash={%H},
 authname={%an},
 authemail={%ae},
 authsdate={%ad},
 authidate={%ai},
 authudate={%at},
 commname={%an},
 commemail={%ae},
 commsdate={%ad},
 commidate={%ai},
 commudate={%at},
 refnames={%d}
 ]{gitsetinfo}" HEAD > $pref/gitHeadInfo.gin
 done

More info at http://www.ctan.org/tex-archive/macros/latex/contrib/gitinfo

Posted in Uncategorized | Leave a comment

Snowbird – Utah

Snowbird - Utah

Posted in Uncategorized | Leave a comment

Vendee Globe comes to town

 

Bernard Stamm has stopped of near Dunedin to fix his boat. He’s currently anchored off Allans beach. We decided to take the dog for a walk and have a look.

ImageImageImageImageImage

Posted in Uncategorized | Leave a comment

New Camera

My mum recently gave us one a hand-me-down camera. We went camping this weekend and took it and some old lenses I had from pre-digital days.

Not bad eh,  although I have to say that I think bell-birds are much more beautiful when you can’t really see them.

Image

ImageImageImageImage

Posted in Uncategorized | Leave a comment