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.

Tuesday, January 5, 2010

Ubuntu wireless debugging hints

have a look at

http://ubuntuforums.org/showthread.php?t=571188
https://help.ubuntu.com/community/LinuxLogFiles

test

ping www.google.com
ndislookup www.google.com
ping 209.85.227.99

debug network manager
sudo /etc/init.d/NetworkManager stop
sudo NetworkManager --no-daemon

disable/give up dhcp lease
sudo ifconfig eth1 down
sudo dhclient -r eth1

unencrypted by hand
sudo iwconfig
sudo iwlist eth1 scan

sudo iwconfig eth1 channel 1
sudo iwconfig eth1 mode managed
sudo iwconfig eth1 essid KP
sudo dhclient

wpa-psk [TKIP]
sudo wpa_supplicant -Dwext -ieth1 -c/etc/wpa_supplicant.conf -dd &
sudo dhclient eth1

--------contents of /etc/wpa_supplicant.conf
ap_scan=1
ctrl_interface=/var/run/wpa_supplicant

network={
ssid="KP"
scan_ssid=0
proto=WPA
key_mgmt=WPA-PSK
psk="password here"
pairwise=TKIP
group=TKIP
}
---------------------------------------------------------

Tuesday, December 29, 2009

Making Windows the Default Boot with Grub 2

Having installed Ubuntu 9.10 on my mother's computer, I wanted to fix the boot process so that if she didn't do anything, it would boot into Windows as usual.

I went to edit menu.lst, as I have done time out of mind, and it wasn't there.

It turns out that Ubuntu now uses grub2, which has a different way of doing things.