Among the elite hacker community it is sometimes considered cool to have an unstyled website. I’m not certain what makes this cool, but I respect it none-the-less. However a few absolutely minimal styles can make your site easier to read. Here they are:
body {
font-family: sans-serif;
line-height: 130%;
font-size: 91%;
}
The [Beagle Board](http://beagleboard.org/) is getting a lot of [attention](http://blog.makezine.com/archive/2009/01/tis_beagleboard_and_dlp_pico_projector.html) lately. It should, it’s an awesome platform. How does it compare to the [Tin Can Tools Hammer](http://www.tincantools.com/) (discussed in a [previous blog post here](http://www.bearfruit.org/blog/2008/06/25/cheap-arm9-embedded-linux-platform))? Well, the Beagle is faster and cheaper for one thing, it also has excellent video and audio output capabilities. But that doesn’t necessarily make it better. It all depends on the application.
If I were wanting to do something like port Ubuntu to Arm and develop or test desktop apps on an ARM based computer, I’d chose a Beagle Board. However the Beagle just doesn’t have the i/o ports I’d want if I were doing embedded hardware/firmware development. The Hammer fits into a standard 40 pin dip socket and gives tons of i/o flexibility so I could do things like build a wifi connected robot or run a CNC.
As a matter of fact, imagine that: [Run EMC](http://www.linuxcnc.org/) on the CNC itself! I’ve not heard anyone discuss this but it would be a cool idea. Just plug a wifi usb card into your CNC machine and send jobs by email or the web. Or maybe it could appear as a network printer and you hit the print button from eagle and it spits out a circuit board (far fetched, I know). It would be entirely possible to use something like the Hammer and interface it to your FETs and a nice power supply and have it control your motors directly (assuming EMC ports cleanly to ARM). However a Beagle would need to use a serial port and a traditional microcontroller based motion controller to do the same.
Alas my hardware hacking free time is becoming quite infrequent. Therefore there’s no way I’m going to pull off anything like the above. You folks will have to try it and tell me how your hacking goes. I’d love to see what people are doing with clutter or android on the beagle or what kinds of cool hardware apps you’ve rigged up to the hammer.
By the way, for some reason I’m getting thousands of hits to my blog in the last couple weeks for the [Hammer Board blog post](http://www.bearfruit.org/blog/2008/06/25/cheap-arm9-embedded-linux-platform). I wonder why…
OK, I’m making my own meme, though I’ve not googled it, someone may have come up with it before me.
1. Click in your firefox address bar,
1. delete what’s there,
1. type the letter “w” and list the first four or five entries that firefox suggests
(feel free to use whatever web browser you like if they offer the same functionality)
Mine are:
1. Google Analytics – [www.google.com/analytics](http://www.google.com/analytics)
1. Canonical Homepage – [www.canonical.com](http://www.canonical.com)
1. Netbook Redirect Page – [www.canonical.com/netbooks](http://www.canonical.com/netbooks)
1. Bearfruit.org comments moderation page – hidden page on this site
1. Ubuntu.com homepage – [www.ubuntu.com](http://www.ubuntu.com)
Post yours in the comments or a link to your blog post that continues the meme.
I get three kinds of email from launchpad generally:
1. Regarding bugs I’ve reported or specifically subscribed to
2. Those assigned to a team I’m a member of
3. A very occasional question or notification about a code branch I’m subscribed to
Of these above the second is the most voluminous and the first group is the most important. However sometimes items from group 2 can be important, depending on the project. Launchpad includes headers for filtering email which I’ve used in thunderbird. I’ve not been able to create sophisticated filters in Gmail though. Until now.
In the past I just grouped all launchpad email into a folder. This folder fills up very quickly though and it becomes a burden to identify which items need my action and decreases the effectiveness of Launchpad’s bug tracking. By creating a label for different kinds of bug email I can better attend to the messages in the proper order.
Here’s my set-up: I use Evolution to access Gmail via IMAP during the work day. Otherwise I use the Gmail web interface. I want the filtering to happen all the time so I use Gmail’s filtering, not Evolution’s. This limits our capabilities significantly. Well, maybe not… read on.
The trick is to look at the emails for something that Gmail can search on and are constant among emails you want to group by. This prevents us from using the subject or the sender or the recipient. :-/
My end result is to have a label for Bugs assigned to or reported by me (including bugs I’ve subscribed to) and one label for each group or project I’ll get bug notifications from. I’m naming the labels Bugs/me, Bugs/artteam (for the Ubuntu Art Team), Bugs/website (for the Ubuntu website) and etc.
I found that all bug email is shown if I search for bugs.launchpad.net. So I’ll use it for all of my searches. I also noticed that the bottom of each email tells me why I got the message. For example, “You have received this email because you are a member of the group Ubuntu Website Editors.” That is the key. Therefore I can do a search like this:
bugs.launchpad.net “Ubuntu Website Editors”
This will show me all of the bugs for that team. I can then create a filter and put that search string in the “Has the words:” field and do a test search.

We’re set. I click next and set the rules:
“Skip the inbox” is checked
“Apply the label” -> Choose “new label” -> Name my new label Bugs/website
“Also apply filter to x conversations below” is checked
Then I click “create filter.” The interesting thing above that I’ve not mentioned yet is the label I chose. By creating a label with a / in it then when accessed via IMAP it will appear as a folder. So if I go on to create labels called Bugs/artteam and Bugs/me my IMAP client will show a “bugs” folder with three sub folders.

Speaking of Bugs/me, this filter is different than the others. The search string I used here is:
bugs.launchpad.net (“direct subscriber” | “bug assignee”)
Any bug that gets assigned to me or to which I subscribe is put in the “me” folder. Because Gmail’s labels are different than true IMAP folders it means that some email threads will show up in multiple places.
I’ve only implemented this solution today so no long-term testing has been done yet, but already I’ve been able to burn through a huge backlog of bug emails simply by marking as read the bugs in entire folders and focusing my concentration on the “me” folder.
There are a few emails (about 20 in the last year or so) that didn’t get caught by the filter. A couple pre-date changes in the way launchpad sends its emails. Others were related to “answers” and subscribed branches. The volume is so small that I foresee being able to deal with these special cases as they appear in my inbox. Maybe you have more of these special cases than I do. I hope that my explanations above are clear and you can adapt the solution to your own mailbox. Feel free to leave comments about your adaptations so that others can benefit from them.
The new Ubuntu 8.10 release is out. It was geared to be the smoothest release I’ve done yet but at the last minute an emergency popped up – the animations for the homepage didn’t work properly in Firefox! Fortunately, a very helpful community member, Emilio Lopez, a student from Argentina, stepped in to help. For the record, he found that jquery’s default frame rate which is 1000/13 (about 76fps) was the culprit and lowering it to 1000/100 (10 fps) made our animations very smooth, even in firefox.
But the most interesting part of this release to me is the launch of the new download page. A lot of thought was put into it and we incorporated feedback from several sources, including some students doing user testing for their university classes. Here’s what we changed and why:

When I first started at Canonical my main task was to emphasize downloading Ubuntu. At that time a high percentage of users were using shipit which for many was not the best option because it meant a delay of many weeks. Also the cost of sending CDs is quite high. Therefore we wanted to ensure that everyone who could download the cd image was choosing that option by default. (of course Canonical is happy to send CDs via shipit to those who will not get a satisfactory download experience – that service is there for a reason)
The old page:

I’ve been trying to improve it ever since. This time around, we got feedback that some users were surprised that when they downloaded the installation file that they couldn’t just run it like other installation files they downloaded for Windows. To install Ubuntu you currently need to burn the disk image to a CD and boot off of it. Therefore we changed the heading to clearly communicate that you’re downloading a CD. We also listed a summary of the system requirements that tell you a blank cd and a burner is required.
We heard from the students doing usability testing that some people were downloading server because they thought it was the more powerful version of Ubuntu. If you’ve used Ubuntu server you’ll know that these users would be seriously disappointed. So we killed two birds with one stone by creating a tabbed interface that shows a visual representation of the desktop and server release. The desktop tab shows a laptop running Ubuntu desktop and the server tab shows a stack of servers and a console window.
By using tabs we help users visualize what they’ll be getting but we also make it appear that there are less options on the page. Before there were four radio buttons, newest-desktop, newest-server, LTS-desktop, LTS-server. Now only two are shown. Hopefully this will make it easier for people to make their decission.
Along those same lines, the architecture choice was moved out of the main form area to below the download button. For most users the standard 32bit installation is perfect. Those needing 64bit almost certainly know it and will be looking specifically for it.
We also removed the alternate installer cd option. This was a contentious decision. In early mockups it was listed in a box similar to the architecture box. Now it’s been moved off to an entirely different page.
That leads me to the final major change. Before there was a generic and overly wordy paragraph at the very bottom of the page telling users about more download options. A single link lead them to a very lengthy page. The lengthy page is still there but it has a table of contents on it now so that users can click a link and jump directly to the place they need to go to get the alternate installer (which is also explained in more detail and includes a screenshot), Bit Torrent and more options.
Looking at the download page you’ll probably notice the giant green download button. Believe it or not, quite a bit of time was spent on this button. We wanted it to be clear and obviously clickable. I think we’ve achieved that.
For the future I’d like to make a few more changes:
Use geoip to make the “choose a location” box unnecessary. Later on in the year or beginning of next I hope to implement this in a testing basis so that an ajax call will locate the nearest/best download location and pre-select that option from the list. Once we’re sure that works nicely we’ll take the next step by hiding the selection box entirely. I can’t wait to get rid of that.
Also, we realized that the selected tab needs to be more obvious. The fact that the we have the words “currently selected” on the tab means we’ve failed. One option was to make the selected tab and form background a light colour – I’m not sure I like that but some experimentation will be needed.
A long term goal is to create an embeddable and translatable version of the download form so that official local ubuntu websites can embed the download page into their own site using an iframe, similar to the way kubuntu’s download page works. This is a long-term goal, don’t get too excited about it just yet.
Oh, here’s an interesting little bit of information: If you look at the source of the download page you’ll see that a lot of javascript was used to make it work. You might think then that javascript is required. Nope. This page works in lynx and other non-javascript browsers just fine. The form is re-organized using javascript to make the tabs appear and the options to re-arrange themselves appropriately. If you do not have javascript you’ll see four options all together (server-lts, server-newest, desktop-lts and desktop-newest).
I’d love to hear your feedback. Leave a comment here or consider the Ubuntu Web Presence Team if you’re passionate about this kind of stuff and want to help out.
I love buying mp3′s on Amazon. It’s easy and the files work with any mp3 player or software. The songs are $0.99 and the albums are pretty reasonable – cheaper than the CD bought new, more expensive than the used CD store, but you get to listen to it instantly.
Amazon offers a Ubuntu installer on their website for the downloader software so when you make your purchase the song can begin downloading in the background. Its nice that they consider Ubuntu important enough to invest the time into making an easy to use client. When it runs the first time you tell it what folder to drop the songs into. I put it right into my Music folder and rhythmbox picks it up. Anyway, this is very nice alternative for people who don’t use iTunes – which is most Ubuntu users.
The most recent song I purchased was one I heard on a Lincoln car commercial – it’s kind of funky and different, “Technologic” by Daft Punk. Check it out.
I used to install apache, mysql, etc on my laptop for local testing. However having all these extra services caused my computer to start slowly. I disabled them from starting automatically but that became tedious because I needed to remember to start them (generally 3 or so) before I used them. Here’s a better idea – use Virtual Box (recently renamed to Sun xVM) to run an instance of Ubuntu Server (or whatever) locally. When you’re ready to do some dev work, fire up the vm (it boots in about 30s).
The problem is, if you’re on a laptop then you probably use wifi, and that means you’re probably going to need to use a NAT connection for your Ubuntu Server to have network access. Unfortunately, with a NAT connection no one, not even your laptop, can see the guest services running on the Ubuntu Server. Fortunately the Virtual Box developers provided a solution, if you know where to look.
Using a command line tool you can configure port forwarding. The documentation explains this quite well if you know to look there.
(I asked in IRC and was politely directed to the fine manual page) It’s in chapter 6.4.1 titled, “Configuring port forwarding.” You should read it, but in case you don’t want to, here’s what you do.
1. Know the name of your VM. Mine is called “Ubuntu Server”
2. Shut down the VM – it cannot be running for this to work (according to the manual)
3. Know the ports of the services you want to forward, for example 80 and 443 for web, 22 for ssh and 3303 for MySQL
4. Open a terminal and run these commands (I’m assuming you’re running Linux as your host and using one of the “PCnet” emulated network adapters – replace pcnet with e1000 if you’re using an “Intel” emulated network adapter) – you run these on your host pc, not the guest – remember you shut the guest down in step2:
VBoxManage setextradata “Ubuntu Server” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol” TCP
VBoxManage setextradata “Ubuntu Server” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort” 80
VBoxManage setextradata “Ubuntu Server” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort” 2080
These three commands set up one rule that forwards incoming TCP traffic on port 2080 to the http port 80 on the virtual machine called “Ubuntu Server.” So above, change the text “Ubuntu Server” to be your virtual machine’s name in ”all three lines”. Change TCP in the first line to UDP if necessary (ICMP won’t work). In the second line change 80 to something else if you’re not working with the http protocol. For example, maybe you want a mailserver in which case you’d want port 25. And in the third line, change 2080 to the port you want to use to access this service. I used port 2080 which means to view the site I’d have to go to http://localhost:2080/. (I have this thing against running development servers on standard ports on my PC)
One special note above, each port I’m forwarding (called a “rule”) has to have a unique name. In the example above the rule is called “guesthttp.” All three lines that set the rule use that same phrase. If I were going to forward another port, say 443 for https, then I’d use a different name for the rule, maybe “guesthttps.” Make sure that all three lines that make up the rule use the same name though.
If you want to delete a rule just repeat those three lines with the last option blank. Using my example above, exclude TCP, 80 and 2080 from the commands.
I believe you can run multiple servers and forward different ports. Just make sure that you use different ports on the host. So for example, the first guest may use 2080 for http, the second guest you may want to use 3080, and the next 4080. That way you can run three different web servers at the same time, each in their own guest.
Good luck, I hope this helps.
**Edit:** Thanks to Nathan Stein for pointing out that the rules need to be modified if you’re using an emulated Intel PRO/1000 network card. See the note above for details.
I have a contact form that has been sending me data via email. It was quick and dirty and I didn’t expect to get nearly as many responses as I did. The data really needs to be in a spreadsheet but the thought of manually doing this bothered me so I wrote some python code to do it. Here it is. Note that:
* it is quick and dirty
* change the gmail user name to whatever, this should work on any imap server so change server name if not gmail
* change the name of the imap folder containing the messages – mine go into a folder called P/package-registration
* once I’ve downloaded a batch of messages I mark them as read using my email client so that they won’t download again when the script runs (that’s what the “UNSEEN” bit is for)
import imaplib, base64, re, getpass def parseline(line): data = line.split('||||') results = {'product': '', 'fname': '', 'lname': '', 'company': '', 'email': '', 'phone': ''} for i in data: k = re.match(r"A new (?P<product>[^ ]+) registration", i) if k: results['product'] = k.group(1) elif i: j = i.split(': ', 1) if len(j) == 2: results[j[0]] = j[1] return results mail = imaplib.IMAP4_SSL('imap.gmail.com', 993) mail.login('yourloginname', getpass.getpass()) log = open('emaillog.txt', 'w') log.write('product\tfname\tlname\tcompany\temail\tphone\n') mail.select('P/package-registration') typ, data = mail.search(None, 'UNSEEN') for num in data[0].split(): typ, data = mail.fetch(num, '(RFC822)') body = data[0][1].split('\r\n') b = False msg = '' for line in body: if not line and not b: b = True if b: msg += line email = base64.b64decode(msg) e2 = email.replace('\r\n\r\n', '||||').replace('\r\n', '||||').replace(',||||','||||') e3 = parseline(e2) try: log.write('%s\t%s\t%s\t%s\t%s\t%s\n' % (e3['product'], e3['fname'], e3['lname'], e3['company'], e3['email'], e3['phone'])) except KeyError: print e3 log.close() mail.close()
I’m not proud of the messy code but at least I can justify it… I started out using a simple regex, then I realized that the fields in the email sometimes were in different order and my regex started growing big and ugly. Then the project started taking too long and I just wanted to get it done. Voila, you get a tangled mess.
Now if I could just get a system in place for pasting code to my blog in a way that comes out looking pretty…
I was recently chatting with the programmers of [inkscape](http://www.inkscape.org) and lamenting the [lack of font hinting](https://bugs.edge.launchpad.net/inkscape/+bug/170392). The developers responded that font hinting didn’t seem applicable because Inkscape is a vector application used to create resolution independent graphics and it didn’t really make sense to add a resolution dependent feature. This is logical and the conclusion is that font-hinting belongs in your raster application, such as the GIMP.

(font hinting is the magical property of high quality fonts to manually adjust their size and shape in very minor ways so that they line up with pixel boundaries and avoid [blurred or invisible portions of the text](http://bearfruit.org/blog/2007/09/14/fuzzy-lines-and-text-in-web-graphics))
So this leads to the problem of how to get your work from inskcape to a raster application. Right now, it’s not possible to make use of hinting, but someone with GIMP fu skills could make it happen. There is a plugin for inkscape that lets you [export to GIMP's xcf](http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/share/extensions/gimp_xcf.py?view=markup) format while maintaining layers. It’s functional but it currently works by exporting each layer as a png.
Ideally this could be improved in a couple ways:
* __Preserve type layers as type__: This means that if a layer is made up of only one or more text objects when it gets exported, instead of exporting it as a png, create type objects with the same coordinates. This could be very challenging because some coordinate translation would need to be done. And while we’re at it,
* __Allow resolution selection when exporting__: Right now it appears to export at a fixed 90dpi, which is fine for web graphics but nothing else.
The benefit of this is that GIMP, which does have font hinting support, could be used to slice and export the graphics and hopefully have better results with the typography.
The code is a combination of python and gimp-fu (see the source of the plugin which is linked above). It’s pretty easy to read through and understand what is happening, but I am unable to do more than research the problem and encourage someone to help out. So, if you are the person that just needs a little encouragement and someone to point you in the right direction, have at it!
If I were doing it, I’d attack it this way:
* Use GIMP-fu to create an image with a text object using a specific type-face and size and try to target a specific coordinate. Experiment with different alignment options such as left, right or center.
* Try to do the above multiple times in the same image and get predictable results
* Try to adjust the gimp_xcf.py plugin so that type objects show up in GIMP as type objects (though maybe not in predictable locations with the correct font face or size)
* Try to get the font objects in the correct place and with the right size and alignment.
* Revel in the glory of your major accomplishment!
Is anyone up for it?
We crea_t_ed a new banner for Debian’s birt_h_day. At 15 y_e_a_r_s th_e_y_’_re one of the olde_s_t distros still in _a_ctive usage. What has made Debia_n_ uniqu_e_ is that its m_a_intainer_s_ are passiona_t_e about two things – fr_e_e softwa_r_e and the OSS philosophy and also about t_e_chnical excelence. Debian is the foundation of Ubuntu so of course we’d have to do something to celebrate their birthday. The banner itself was created by Kenneth Wimer. I took it and overlaid it onto an existin_g_ Ubuntu banner so that it looked more like a real banner hun_g_ up over a doorway like you might do for a birthday party.

Oddly enough, the night before I put the banner up I had this crazy dream that a bunch of Debian developers were chasing me shouting about LZW compression algorithm patents and I was trying to justify myself by pointing out that the patent expired and that LZW was ok now. It’s always funny when you wake up remembering your dreams.
If you have no clue what I’m talking about that you haven’t looked closely enough or you just aren’t clever. Sorry. :-/ If you do get it then be sure to post a comment here so I know.



