Category Archives: Computer

Raspberry Pi

Out of curiosity and with a couple of different projects in mind I have been playing with a Raspberry Pi (a cheap, small, but slow linux computer) lately. Some observations:

  • It's small, but it does require quite a few bulky connectors that connect to three different sides of the board. If you wanted to enclose the board and cables in a case the connectors add a significant amount to the footprint.
  • Who came up with the idea of offsetting the two USB-connectors so they extend out of the board? This makes all the cases for the Pi have a funny shape to get the Ethernet and USB connectors flush with the side of the case.
  • It seems to run the raspbian distribution OK. But for a standard debian-desktop it's very slow. There are optimized lightweight X-environments that are supposedly faster and more responsive.
  • Since it's an ARM processor, not every package I am used to using on Ubuntu/Debian is available from the repositories.
  • The modern way to interact with a gadget nowadays is a touchscreen. But there doesn't seem to be any good consensus on what touchscreen to use with the Pi. Could we have something budget-priced with good existing drivers for both screen and touch please. Perhaps use the DSI-connector so the gadget screen won't tie up other resources (USB, HDMI, SPI, or GPIO).

Overall this means my ideas for various real-time instruments & gadgets may be better served by an Atom ITX-sized motherboard. The atom is a standard x86 architecture that runs everything a desktop or laptop will run. It's fast enough to run modern desktop environments. And it has a PCI or PCIE slot for e.g. a Mesa FPGA card. Given the cost of enclosures, (touch)screens, FPGAs, and the analog electronics I have in mind, it really will not matter much if the cost of the motherboard+cpu combo is 40 euros (Pi) or 140 euros (Atom). Someone suggested I'd have a look at BeagleBoard or BeagleBone, but right now I'm leaning towards the Atom.

Ubuntu One is very slow

Update5: Day 4 and it looks like this: laptop 18078 items (5.5Gb), desktop 17803 items (5.5Gb). I wonder why the file-count differs?

Update4: Day 3 of this experiment. Machines have been online for more than 72 hours. In total 50Mb have been uploaded from laptop today (since reboot in the morning). That might be a good sign. All the files should now be in the "cloud". But are they synced to my other machines? Laptop still shows 18800+ files, desktop now shows 17800 files. Getting close...

Update3: Here's another observation, when the laptop, which still has about 11000 un-synced files in the One-folder, boots up, ubuntuone-syncdaemon can take 1-3 minutes of 100% cpu and about 300Mb RAM. After that it settles down, but 100% cpu means the machine is slow and unresponsive for a while :(

Update2: Someone at canonical asked for my log-files (they are in ~/.cache/ubuntuone/log/), and I've sent them. Hope they find what is going wrong!

Update1: the sync does seem coupled to a reboot. This morning it appears about 400Mb more was synced after a reboot of the machine. I still have about 11000 files un-synced after 48 hours.

These days data wants to be distributed and in the cloud. This image shows my Ubuntu One folders on three machines. They are supposed to be in sync, but are far from that after being connected to a high-speed network for more than 24 hours :(

OK, so let's go buy 20Gb of space on Ubuntu One, and transfer my working-set of work/hobbies/etc files there and see how it goes. I use about three computers regularly, a new laptop at work, and a  desktop and an old laptop at home. The work machine is on the university network where bandwidth shouldn't be a problem, and I have 40Mbit broadband from welho at home. What could possibly go wrong?

Ubunutu One is very very slow. I didn't just dump all my files and pictures into the shared-folder at once, I thought I'd start with a subset which happened to be 18064 files taking up 5.5Gb. It appears that in the first 24 hours roughly 700 Mb of data was synced. Now I have rebooted the primary laptop and it has very rapidly sent out another 500 Mb - but then slowed down to a creep. Is there a bandwidth-cap? For paying users?

Does anyone use Dropbox for lots (10s of thousands) of files? Does it work? Fast?

Quassel notes

To keep myself "forever" logged onto IRC, I wanted to run quassel-core on my isp shell-account, and quassel-client on whatever computer I am using at the moment (home/work/laptop, etc).

I first downloaded the statically linked core quasselcore-static-0.7.3.bz2 and unzipped it onto the server.

To use SSL, a certificate on the server is needed, made by copy/pasting from the quassel-wiki:

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout ~/.config/quassel-irc.org/quasselCert.pem -out ~/.config/quassel-irc.org/quasselCert.pem

Then, my ISP doesn't have the port open that quassel uses (4242), so the connection needs to be tunneled through SSH. For testing a 'local port forwarding' tunnel can be opened like this (this is run on the client machine):

ssh -lmy_user -L 4242:localhost:4242 my.remote.server

If I understand correctly this redirects traffic trying to connect to 4242:localhost through SSH (port 22), and actually connects to 4242:my.remote.server. However it isn't convenient to always have to type in the password when opening the tunnel, so I set up SSH login without password.

Now we can go ahead and start the server, under screen, so that it stays alive when I log out of the server shell. The server-side (quasselcore) needs no further configuration through the server shell.

screen
./quasselcore-static-0.7.3
CTRL-A - d (to detach screen)
logout

Now we can connect with quassel-client, specifying 4242:localhost as the server. When doing this for the first time quassel-client will ask for some set-up data. It's possible to use an SQL server backend on the server-side, but I'm using SQLite.

Then I started googling for advice on how to automatically start and keep alive an SSH tunnel on Ubuntu. There seems to be no consensus on how this is best done, and two or three attempts I tried failed. Most seem to use autossh. Ry4an's blog suggests an upstart script (but I couln't get that to work, and it requires a special user with no password). Or should it be done with a script in /etc/network/if-up.d ? Since I only use the this SSH-tunnel with quassel-client, maybe the easiest solution is to create a launcher-script that first opens the SSH-tunnel, and then launches quassel-client (how do I kill the tunnel when quassel-client exits?). Suggestions? sshuttle?

For now quassel-core has been running OK on the server for a few hours, and everything seems to work. I'll be able to test connecting with more clients from home later... stay tuned.

Computer upgrade

A failed powersupply was my excuse to upgrade most of the other internals of the desktop computer too. Some notes on adding a disk to LVM, following Suji's notes from 2007 (all of these require sudo):

  • fdisk /dev/sdd

    (create a primary partition, type "8E" Linux LVM, exit with "w")

  • mkfs -t ext3  /dev/sdd1

    (this will create the file-system. option "-c" which checks for bad sectors is recommended by some, but takes ages to complete) (see comments)

  • pvcreate /dev/sdd1

    (this will create a physical volume)

  • pvdisplay

    will now list all the physical volumes and the newly created one should be visible.

  • vgdisplay

    will list the volume groups. On my machine there's one named "datadisk"

  • vgextend datadisk /dev/sdd1

    (this will extend the volume group with the new disk)

  • vgdisplay -v datadisk

    will now display info on the volume group. The new disk should show up in the list of physical volumes.

  • lvextend -l100%VG /dev/datadisk/data

    (this will extend the logical volume so that the new size is 100% of available space in the volume-group)

  • resize2fs /dev/datadisk/data

    (this will resize the logical volume. takes a long time to complete with big disks and there is no progress bar/display)

  • finally you can check that the mounted volume group is actually re-sized to the new size and has lots of free space:
    df -h
    

There is more info in the LVM-HOWTO.

View of hard disk with windirstat

Where does all that hard drive space disappear? Windirstat will draw you a picture (http://windirstat.info/ or on Linux http://kdirstat.sourceforge.net/)

This is the 78G windows-partition on my laptop. The size of pagefile.sys and hiberfil.sys probably scale with the amount of RAM (I have 4G). Matlab is just huge (and bloated?). I wonder if an 18G windows-folder is about normal for win-7 users, or if I have a lot of temporary stuff and installer-files etc. hiding in there?

40 Mbps broadband

Probably triggered by Sonera laying down optical fiber and offering 10 Mbps for 10eur/month initially (a 24 month contract, rising to 20eur/month for the second year) the local cable-TV company Welho was forced to rethink their products and pricing. I've upgraded to the M-option which is 40 Mbps for around 36eur/month.

At some point Finland was pretty cheap when it came to broadband and cell-phone contracts. Anyone want to comment how these speeds/prices compare to other parts of the world?