Thursday, February 11, 2010

xxdiff with mercurial and git, hg view with mercurial

Enabling xxdiff with mercurial

You can link xxdiff into mercurial, but you have to modify the hgrc file

add to: $HOME/.hgrc

[extensions]
hgext.extdiff =

and then we can say

hg extdiff -p program -o options

e.g.

$ hg extdiff -p xxdiff -o -r

which causes xxdiff -r to run

or

 
$ hg extdiff -p kdiff3

We can be even more subtle by adding an explicit command for xxdiff -r

[extdiff]
cmd.xxdiff = xxdiff
opts.xxdiff = -r

which allows us to use

$ hg xxdiff

to call xxdiff directly in its recursive mode.


xxdiff with git

For me,

$ git difftool

Runs xxdiff automatically, but file by file, which is not as good.
I don't know if that's the default, or whether I configured it accidentally whilst trying various ways to add it.



Enabling hg view

While we're messing about with .hgrc, add

[extensions]
hgext.extdiff=
hgk=

which will enable the hg view command.

Tuesday, February 9, 2010

Software Suspend on old box with Ubuntu 9.10

Software suspend just didn't work on my old box, although hibernate did. So I had a go at fixing it. It didn't quite work, although I can now suspend. l made notes in case anyone else is having similar problems.

Friday, February 5, 2010

Mounting Encrypted disks with loop-aes

prerequisites

$ sudo apt-get install loop-aes-utils
$ sudo modprobe cryptoloop


to mount the encrypted device /dev/sdg

$ sudo mount /dev/sdg /mnt -o loop,encryption=AES128


the long way round (useful for understanding what's going on, fscking etc)

$ sudo losetup -e AES128 /dev/loop0 /dev/sdg
$ sudo mount /dev/loop0 /mnt
$ sudo losetup -a
$ sudo losetup -d /dev/loop0


to actually create an ext4 filesystem on /dev/loop0:

$ sudo mkfs -t ext4 /dev/loop0


to check it:
$ sudo fsck /dev/loop0



Ubuntu: talk to me

When ubuntu boots it displays a pretty pulsing ubuntu logo until it boots into glorious X.

This is great, until it goes wrong, and anyway I prefer to see what it's doing.

Under 9.10, which uses the new grub2 boot loader:

$ sudo vi /etc/default/grub

change
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to
GRUB_CMDLINE_LINUX_DEFAULT=""

and run 

$ sudo update-grub

to update the boot menu.

Monday, February 1, 2010

Blank video, Dual screens, Mini 10v, Ubuntu 9.10

I recently found that videos wouldn't play properly on my netbook. The screen was just black.

After spending hours installing codecs, I finally noticed that the nautilus thumbnailer was dealing fine with them.

It turns out that the problem is that I've currently got my little Dell connected to a second screen.

Changing the display mode to be one screen only cures the problem (It doesn't matter whether it's the laptop screen or the external monitor, as long as one of them's switched off).

Weird.

Using mplayer, you can also make it work by changing the video driver

$ mplayer -vo gl film.mov

Uses the gl driver instead of the default xv, which appears to work better.
the x11 driver also works, but you can't resize the picture.

Just for reference, my netbook is a Dell Mini 10v, running Ubuntu 9.10.