Tag Archive for 'linux'

Experiments with the eee

It’s been a while since I last handled the eee.

I haven’t gotten around to changing the default Xandros OS to either Ubunty or Fedora. Frankly, the OS works just fine for me. And as long as I can get a command-line and an internet connection, I’m a happy camper.

But it’s been an unusually quiet weekend so I decided to focus a bit more on this cute little monster.

First off, an upgrade. It was a simple matter of doing a sudo apt-get update && sudo apt-get upgrade. The bad side is, since the OS uses unionfs, the 4GB storage is now down to only ~260MB free (or around 83% in use). I’ll have to look at the repackaged updates from the XEPC project, if the storage factor becomes critical, but for now, I can live with this.

Next, the OS change. I did attempt to install Ubuntu Hardy Heron on the eee, but hit a snag while creating a USB bootable flash disk. I had a spare 1GB flash disk at hand, and was able to dump the netboot image from the Ubuntu archives. For some reason, the eee cannot recognize it. Again, I’ll have to dig into this later, but as I’ve said, Xandros works fine for me for now so I’ll stick with it at the moment.

Since I cannot change the OS, I opted to optimize whatever I have for now. One major “annoyance” is the screen real estate (i.e., the lack thereof). Firefox, for example, have large chrome properties that need to be slimmed down. I’m using the basic display mode for Xandros, so there’s desktop screen space is not a primary concern. Since I mostly use the eee for browsing, I need to trim the fat off Firefox.

I had to download the TinyMenu extension. This reduced the menu to a vertical one, which is nifty since I was able to move the navigation bar buttons alongside it. I reduced the space even further by using a minimalist theme called Mini Firefox. I then hid navigation bar buttons that are currently disabled through some tweaks in userChrome.css:

#back-button[disabled="true"], #forward-button[disabled="true"],
#stop-button[disabled="true"], .search-go-button-stack { display: none !important; }

The result:

Reduced Firefox chrome

Playing with the eee

I have been messing around with the Asus eee PC. Here are my first impressions (sorry for the bullet points, I really am having trouble typing with the dwarfish keyboard {more on this later}).

eee in the garden

The good:

  • Low cost. This subnotebook has an amazing price point. Asus really outdid itself with this. At about USD 490, this proves to be an attractive proposition for budget-conscious consumers.
  • Open source. This is really a win. Aside from being customizable, this really proves that Linux and open source software can significantly compete in the desktop space. In no time, I was able to add new repositories, enable full desktop mode, and insstall Beryl, among others. The peripherals Just Work ™ — no need for modprobe and other CLI voodoo to detect USB storage, for example.
  • User interface. I have a strict usability testing regimen: if my six-year old son cannot browse the web in under two minutes, the interface has failed miserably. This one passed with flying colors. The easy mode’s tab-and-button interface was intuitive enough, and provided ease-of-navigation. It’s very difficult to get lost with the customized KDE UI.

The not-so-good:

  • Small form-factor. Okay, I admit this may not be a device for me, but the keyboard and screen size are killing me. After squinting for about an hour while playing FrozenBubble and TuxRacer, Gab gave up, saying, “maliit ang monitor, saka may mga ganun o” (pointing to the horizontal and vertical scrollbars). Rant: Why did they place the Up arrow between the “?|/” and right Shift keys? Touch typists will despair with the eee keyboard.
  • Heat. My “crown jewels” (as Jim Ayson so eloquently described it) almost got cooked. The eee generates way too much heat for its size. Heck, it gets even hotter than my Dell.

Despite the negatives, however, the eee shines as a low-cost powerful ultraportable device. (There, three superlatives — shows how much I like it.) So far, I have installed a quite-useless but still very cool Beryl on the native Xandros OS that came with it. Contemplating on installing Ubuntu, if I can spare a USB flashdisk. I still can’t get Smart 3G to connect through my phone, though, but it’s most likely because of my settings rather than eee’s fault.

Quick directory switching

At work, I do a lot of directory traversal: going from one location to another within the whole (global) filesystem structure. So, to conveniently go back to a previous directory, I use pushd and popd, aside from the usual cd:

$ pwd
/home/iandexter
$ pushd /etc/sysconfig
$ pwd
/etc/sysconfig
$ popd
$ pwd
/home/iandexter

You can even echo $DIRSTACK to list the current directories in the stack, and push multiple directories.

‘Inside the OLPC’ video

OLPC video

It’s not a product at all — it’s a global humanitarian cause.

Downloading Flickr photos, part 2

I made several improvements in the previous script:

#!/usr/bin/python

import flickr
import urllib
import time
import re

flickr.API_KEY = 'Flick API goes here'
print "Registered using API key"
user =  flickr.people_findByUsername(u'username')
print "Found user %s - username" % user.id
try:
        photos = flickr.people_getPublicPhotos(user.id, 500)
        print "Found the photos"
        total = 0
        for photo in photos:
                p = flickr.Photo(photo.id)
                title = re.sub('\s+', '-', p.title)
                title = re.sub('[^-\w]', '', title)
                title = "%s_%s" % (title, p.datetaken.split()[0])
                for s in p.getSizes():
                        url = s['source']
                        photoFile = "%s_%s" % (title, url.split("/")[4])
                        data = urllib.urlretrieve(url, photoFile)
                        total = total + 1
                        print "Retrieving %s ..." % photoFile
                        time.sleep(1)
except AttributeError:
        exit
print "%s photos retrieved." % total

Python is pretty simple, once you get the hang of it. It also helps that the source for flickr.py is open — I got to fetch some more info regarding the photos I’m downloading, thus incorporating them in the code.

The code could use some more improvement, though: I should have opted for the Flickr error code (flickr.FlickrError) instead of AttributeError. The regex can certainly use more trimming. Perhaps I can save the photo information in a database instead of glomming them in the filename (so I can include tags, group and set memberships, etc.),

This should be elementary to Python devs out there, but for me, it’s just a hobby. ;)