Monday, August 30, 2010

File sync with unison

Since Ubuntu One has proved to be so brittle, I'm going to try doing the same thing by hand with unison

$ sudo apt-get install unison

on both client and server

Now, say I'm john on both client and server, and I'd like to synchronize the unison directories on the desktops in both the machine I'm working on, and on 192.168.1.2.

$ unison /home/john/Desktop/unison ssh://john@192.168.1.2//home/john/Desktop/unison

I've already set up these two machines for passwordless ssh, so that just does it.

Ubuntu One

The Ubuntu One file syncing service appears to be a bit beta still.

It completely borked, and screwed up my files. I ended up deleting all computers from the account, then cleaning up the carnage by hand.

When I wanted to reconnect the computers so that I could use it again (not going to trust it with anything I care about any more, but it is still handy for synchronizing bookmarks and notes), there appeared to be no way to add the computers back to the account.

It turns out that there's a set of command line tools

$ sudo apt-get install ubuntuone-client-tools

then:

$ u1sync --authorize

will add the computer back in.

ssh without typing passwords

You can give an account on one machine (the client) permanent access to an account on another machine (the server) using ssh without always having to type a password.

You need to generate an ssh keypair on the client
Add the public key to the server's list of authorized keys

On the client

$ ssh-keygen

which should result in the creation of a .ssh directory containing id_rsa.pub and id_rsa
(you can specify a passphrase here which will be used once per session to unlock the key)

Copy id_rsa.pub to the server

On the server

$ cat id_rsa.pub >> $HOME/.ssh/authorized_keys

And you're done. Now ssh from client to server should not require a password.

Sunday, August 29, 2010

Transferring Files

How do I transfer files between one Ubuntu box and another?

Simple Answer:

Install an ssh server on one box, and then use nautilus (the file manager) to drag and drop files.

In detail:

Decide which box will be client and which will be server [1].

Go to the server and install ssh

$ sudo apt-get install ssh

Now use ifconfig to find out the network address of the server.

$ ifconfig

On the client select Connect to Server on the Places menu.

Use SSH as the service type, and put in the server's ip address you found above, then press Connect

You'll be asked for a username and password for the server.

And you're done.

You should now have a nautilus window open showing the files on the first machine.

[1] It doesn't actually matter. You can connect to a server from any box in the world.
And if you like, you can set up both boxes as servers.

Wednesday, August 25, 2010

Which version of Ubuntu am I running?

$ cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

So you're running 10.04, otherwise known as Lucid Lynx

Tuesday, August 24, 2010

Sitecom Wireless WL-608 54g USB dongle under Ubuntu

I bought one of these USB dongles, and it didn't work.

$ lsusb

gave (amongst other lines)


Bus 001 Device 003: ID 0df6:003f Sitecom Europe B.V.


The identifier for the chipset is this bit:

0df6:003f 


A quick google found this page:

http://www.linuxquestions.org/questions/linux-wireless-networking-41/fedora-13-cant-connect-to-wireless-network-in-networkmanager-815638/

Which is talking about Fedora.

Someone here suggests

"That card needs the rt2870sta driver, according to this: link. I have the same problem on my box because the system automatically also loads in the rt2800usb driver, which conflicts."



$ lsmod | grep rt

$ sudo rmmod rt2800usb && sudo rmmod rt2x00usb && sudo rmmod rt2x00lib

$ sudo modprobe rt2870sta


This all seemed to work, but nothing happened.

Eventually it occurred to me to remove the dongle and then plug it back in.

At that point, the kernel recognised the dongle, the network manager app noticed that it had a new interface, and reported a list of available wireless networks, and all was well.

I note only that the list of wireless networks is not as long as the one reported by my Dell Mini 10v, so it seems the dongle isn't as sensitive as my netbook. But you can't really blame it since it's attached to the back of a mains powered device.


Now I add these lines to the bottom of  /etc/modprobe.d/blacklist.conf:


# To stop bad drivers blocking the correct driver for usb wireless dongle
# See http://johnsunixtips.blogspot.com/2010/08/sitecom-wireless-wl-608-54g-usb-dongle.html
blacklist rt2800usb
blacklist rt2x00usb
blacklist rt2x00lib

Reboot after that, just to check it will all work from a standing start. My machine now starts up and connect instantly to our house network.