Tuesday, March 31, 2009

Using ssh as a SOCKS proxy

SSH makes an awesome socks proxy for tunneling whatever, but particularly web. The nicest way to do it is to create a ~/.ssh/config file with:

host mysocks
dynamicforward 9988
hostname mysocksbox.domain.name
user blah

You can put any options in that config file that are listed in the ssh_config man page. So now all you need to do is
ssh mysocks
and it will set up a listener on local port 9988, traffic forwarded over ssh to mysocksbox.domain.name. You can then use the firefox switchproxy add on or foxyproxy to point to localhost 9988 SOCKS5. You also want to set network.proxy.socks_remote_dns to true in about:config to get DNS to go through the proxy too. Simple!

Friday, March 20, 2009

HOWTO convert docx, docm, xlsx, pptx office 2007 "open" xml docs to open office

There is a commandline tool you can use to convert docx, docm, xlsx, pptx Office 2007 "open" xml docs to Open Office.

HP Proliant raid - ubuntu intrepid won't boot after install

I've had a problem with HP Proliant SAS raid drives and ubuntu intrepid. The OS installs fine, but won't boot after installation. HP says something about attempting to boot from C: drive. I love how HP assumes I have a C: drive. It seems plenty of people are having the same problem in this thread. The solution is to boot into rescue mode using the installation media and do:
grub-install /dev/cciss/c0d0

or just use the re-install grub rescue menu option with
/dev/cciss/c0d0

Thursday, March 19, 2009

Network bridging broken on Dell Poweredge 850 BCM5721

I couldn't get network bridging to work on a Dell Poweredge 850 with the inbuilt nic (Broadcom BCM5721) on Ubuntu intrepid.

The bridge was created fine, brctl showed eth0 joined properly. No iptables on host or guest. Routing rules correct.

The behaviour was very similar to this bug. When using DHCP, the vm guest would make DHCP requests that reached the DHCP server, but never get any replies sent by the DHCP server. If a static IP was set the box continually arps without receiving any of the arp replies being sent by other boxes. If you look at the arp cache it shows all entries as incomplete.

I eventually gave up, copied to different hardware, and it worked perfectly - same vm, same xml definition, same version of the installed host OS.

Migrating a libvirt/kvm virtual machine between hosts

Migrating a libvirt/kvm virtual machine between hosts is possible, but not with the version of libvirt in ubuntu intrepid. You get something like:
libvir: error : this function is not supported by the hypervisor: virDomainMigrate

The help is also appalling, would it kill you to include an example?
migrate myimage qemu+ssh://mynewhost/system

Thursday, March 12, 2009

Virt Manager

Older versions of virt manager have a bug that only allows you to ssh as root (in newer versions you can use the user@hostname syntax in the hostname box). A workaround for the old versions is: use gconf-editor to change the xml under Apps|virt-manager|connections.

Monday, March 9, 2009

HOWTO check an SSH host key

Check an SSH host key with:

ssh-keygen -lf /etc/ssh/ssh_host_rsa_key
Or, as a one-liner for both RSA and DSA:
find /etc/ssh/*{dsa,rsa}_key -exec ssh-keygen -lf {} \;
This also works with known_hosts, which is handy:

ssh-keygen -lf ~/.ssh/known_hosts