Andrew Stacey


About
Andrew Stacey
Information about my research, teaching, and other interests.

By: Andrew Stacey
Contact details


Andrew Stacey


blosxom icon


Fri, 27th Jun 2008 (HowDidIDoThat :: Unix)

Unix Hacks

This is sort of a catch-all section as just about all the hacks here are related to Unix in one sense or another. These are those that don't fit in a better category.

[Full link]
Last modified on:
Fri, 27th Jun 2008


Thu, 25th Oct 2007 (HowDidIDoThat :: Unix)

Generating a Genealogy Graph

On this entry I'll document what I did to generate a genealogy graph. I'm doing this after having done one for the department of pure mathematics in Sheffield whereas what I should have done is started documenting when I started doing that graph. Ah well, better late than never. This is the steps for generating the graph of an Important Mathematician.

See more ...

[Full link]
Last modified on:
Thu, 25th Oct 2007


Thu, 7th Dec 2006 (HowDidIDoThat :: Unix)

Make Emacs Transparent

I found that I spent ages deciding exactly which picture to have as my backdrop but then never saw it as there were too many windows on top. However, those windows tended to be Emacs or Xterms and so thanks to this version of Emacs and to Mrxvt I can make both of those transparent.

This is not true transparency but only pseudo-transparency. That is, if there is another window behind the Emacs one then it does not "shine through". I prefer this as my main reason for having transparency is not so that I can see the other windows but so that I can see the background image. There is an experimental line of the XWindow system which does true transparency but it was really slow on my system the last time I tried it.

See more ...

[Full link]
Last modified on:
Thu, 26th Mar 2009


Mon, 11th Dec 2006 (HowDidIDoThat :: Unix)

Changing XPdf Keys

Documents produced by LaTeX tend to have a lot of whitespace around them when produced with a "standard" paper size such as A4 or USLetter. When viewing such documents on the screen I tend to zoom in to make the actual text fill the window. When changing the page it is nice if the viewer program displays the next page in the same position as the previous one. With XDvi this is achieved with the resource xdvi.keepPosition (and toggling this feature is usually bound to the key k). GV can also be easily configured to do this. However although XPdf has this feature, it is only enabled when the NumLock is on. Who uses NumLock these days? Not me. This behaviour is coded in so to alter it required altering the source code. Here's how to do it.

See more ...

[Full link]
Last modified on:
Mon, 11th Dec 2006


Tue, 27th Sep 2011 (HowDidIDoThat :: Unix)

Copying to VFAT with safe filenames

Script for copying files from a Linux filesystem to a memory stick with a VFAT filesystem that gets rid of accented characters nicely and eliminates other non-standard characters.

find . -type f |  \
 perl -MFile::Path::Tiny \
      -MFile::Copy \
      -MText::Unaccent::PurePerl \
      -lne \
        '$orig = $_;
         $st = unac_string($_);
         $st =~ s%[^-\./[:alnum:]]%_%g;
         $st =~ m%(.*)/%;
         File::Path::Tiny::mk("/media/Kingston/Music/" . $1);
         copy($orig, "/media/Kingston/Music/" . $st);
        '

[Full link]
Last modified on:
Tue, 27th Sep 2011


Mon, 11th Jan 2010 (HowDidIDoThat :: Unix)

Generating Lecture Filenames

My lecture presentations are contained in one big LaTeX file. To produce each individual lecture, I use symlinks to this particular file. The LaTeX code looks at the \jobname command to see how it was called, and produces the corresponding lecture. Part of this involves generating the symlinks - automatically of course.

See more ...

[Full link]
Last modified on:
Tue, 27th Jul 2010


Thu, 14th Jan 2010 (HowDidIDoThat :: Unix)

Inserting Hard Lines in Emacs

To insert hard newlines in Emacs from within the minibuffer, the simplest method is to turn off the longlines-mode, then use C-QC-J for the newline character, and then turn longlines-mode back on.

In slightly more detail, suppose you wanted to replace all those ^Ms in a document by newlines. Then one simple way is:

replace-string C-QC-M C-QC-J

but with the longlines mode, this creates soft newlines. The only way I can find to create hard newlines is to turn off longlines-mode, do the above, and then turn longlines-mode back on.

[Full link]
Last modified on:
Thu, 14th Jan 2010


Tue, 8th Jul 2008 (HowDidIDoThat :: Unix)

Transparency Revisited

My latest Linux installation came with Compiz Fusion. It's too much fun to not use. However, using Compiz to set the background image seems to mess up the pseudo-transparency that I have with emacs and urxvt. The problem is twofold. Emacs uses its own picture for the backdrop which just happens to be the same as the picture on the background; no difficulty there except that using Compiz I can set this to something different on each face of the cube so Emacs needs to know which face it is on. On the other hand, urxvt figures out its backdrop from what it considers to be the program in charge of the root desktop. This is Nautilus which conflicts with reality.

Fortunately, I figured out a solution.

See more ...

[Full link]
Last modified on:
Tue, 8th Jul 2008