It’s almost too easy with a Raspberry Pi

No Gravatar

I am part of Overskrift.dk – a local social media monitoring service built on a LAMP stack. We are the server itself, but also quite a few older laptops. They do have a couple of downsides though:

  1. Big (-ish)
  2. Clunky
  3. Noisy
  4. Power consuming
  5. Have mechanical harddisks


They each need PHP, cUrl and a MySQL client library installed in order to function – but then they are actually able to support our aggregation tasks quite nicely.

So the other day when a harddisk crashed, I came to think of the Raspberry Pi (popularly dubbed the $25 computer) – It actually set me back DKK 638,- including P&P from a danish webshop (a little more over $100), but that was only because I insisted on a cabinet, a power supply and an SD card. Still I can get three of these for the same price as 1 very low-end netbook. An our after the postman delivered the envelope, it was up and running aggregating away.

Raspberry Pi

From my laptop I downloaded the Raspian “wheezy” SD card image – it downloads a .zip file to unzip into a .img-file. On Mac and Linux the image can easily be copied to the SD card (but taking about 20 minutes). I used this process.

Once the image was downloaded I moved the SD card to theRaspberry Pi unit, plugged a keyboard into one of the USB ports, connected my TV through the HDMI connector and powered up. First boot took about 30 seconds and took me directly to a very nice configuration UI, I set the locale and timezone and asked the ssh-daemon to start on boot.

raspi-config
The Raspi Config UI

Next step was to shut down and move the box over to a LAN connection by my modem. Now only the LAN connection and the power supply was connected.

Coming from the Ubuntu world, installing PHP, cUrl and the MySQL client libraries was a question of logging on,  running

sudo apt-get update
sudo apt-get install php5 curl php5-curl php5-mysql mysql-client

Now I could simply copy my PHP code to the filesystem and set up cron jobs just as I would in Ubuntu.

UPDATE 2014-02-21: It has been almost a year since we started using Raspberry PI’s for our aggregation purposes. Since then, we’ve added a couple of pi’s for this specific purpose and retired all other aggregations machines, probably saving quite a bit on our power bill.

 

Ubuntu 10.4 – up with only one quirk so far

No Gravatar

This morning I let my Ubuntu 9.10 upgrade itself to 10.4. The upgrade itself ran fine with only a few interruptions where I had to confirm or deny changes to configuration files for PHP etc.

As I landed at the office and hooked up the laptop (Thinkpad T61P) however, my external monitor was flickering a lot. Tried booting into Windows and everything was fine. Google’d and found this post on Ubuntu Forums.

The post suggests making changes to menu.lst in /boot/grub. This is a somewhat short term solution, because the problem will probably reappear at the next kernel upgrade (which could be just around the corner). The fix may be on it’s way in an actual Ubuntu fix, but i chose a different approach which may also seem hack’ish – the fix could be more robust though.

Disclaimer: If you are not sure what you are doing, be very careful. Misspellings or deviations from the description below may lead to an unbootable system. This worked for me and doesn’t have to work for you. Make sure to back up any files you change.

OK? Let’s go..

First start a terminal (ALT-F2, enter “gnome-terminal”):

cd /etc/grub.d

Then:

sudo nano 10_linux

which will open an editor. Around line 96 inside the linux_entry-function is a line that looks like this:

linux    ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}

and it should be changed to:

linux    ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro radeon.modeset=0 ${args}

Having done this, you should ask grub to rebuild it’s configuration files with:

sudo update-grub

Reboot and go on without the flicker..

Offtopic: The future of the gas station

No Gravatar

This is not about the usual geekyness – it is about a change I am sure is about to happen. Once the benefits are clear – I am quite sure everybody will want an electric car instead of their gas/diesel-one. The concept of having an energy-buffer, in the shape of the cars in a region, to collect surplus energy in low usage periods for use in high usage periods are so compelling. Windmills are cool, but still inefficient in comparison with other sources if the surplus energy isn’t stored. This is in a broad perspective what Better Place wants to do.

I passed a long line of gas stations the other day – What will happen to them? I know the change will not happen overnight – if at all. But how would we prepare for the future if we had a gas station? Better Place says they will prepare the stations for the transition of becoming a battery station, but as I see it – many people will not need them anymore. Why? Because many commuters drive less than 160km per day. According to Better Place, that will be the range of one battery charge – and a key part of the new model is that drivers charge their car at home when the energy is cheap/green – also offering the battery in their car to the common energy buffer.

So – in Denmark anyway – if the gas stations will no longer sell gas and only (let’s guess – unable to find numbers) 10% of the current customer base (those driving more than 160km a day) will need to recharge their cars/switch batteries at the old gas station – can the gas station survive merely as a 7-Eleven store only closed at night?

My guess is that they are looking at a pretty big change in their business model – and I think they can if they embrace the change. If they fight the change they only have to look at the news papers to see how that works out..

What they need to do? Dunno – but one thing that has bothered me for ages now is the inability to find stuff for my car in the shops. If i want chewing gum, porn or soda – the gas station is where to get it. But light bulbs, fuses, polish is hidden away in the far corner of the shops. I think that stuff needs to move up ahead in the shop, so the mindset of the customers in five to ten years won’t be: “The gas station? Ahh – you mean the 7-Eleven that is closed at night!”

Javascript performance on current browsers

No Gravatar

Found this little test which gives an indicator as to Javascript performance in your browser.

On my system (Windows XP on two year old Lenovo T60p laptop) i tried to run it ten times on my browsers with all plugins disabled (lower is better):

Google Chrome: 297,7
Firefox 3.5 beta 4: 340
Firefox 3.0.10: 408,9
Internet Explorer 8: 631,3

As the score is time, lower is better. This is interesing because sites uses Javascript more and more, and as we work more and more online with more applications in the cloud, the Javascript engine has a lot to say about our perception of overall performance.

I got a bit disappointed about my Atom-based netbook – specifically Ubuntu 9.04 on that machine. It never went below 1800 (Firefox 3.0.10) and on the same hardware, the Windows-browsers gives me minimums of 1500 and 2800 for Firefox 3.0.10 and IE8 respectively. Gotta find some tweaks there.

Netbooks – the necessary new design test-tool

No Gravatar

Writing this on my Lenovo S10e netbook, I am furious. It’s before mid-day and yet I have had two experiences of software designs that did not consider netbooks a platform – or at least the new low screen resolution these computers imply. And before you call me a whiner (besides the fact that you’d be somewhat right), this is just a description of the changes I will make to include netbook users as an audience of software and website in the future.

Whine #1: Twice I’ve been cripled by software that saw the low screen resolution as a handicap – one of them on purpose. First I installed Pidgin – the cool cross-platform/cross-protocol IM and IRC client. I like it a lot, but on Windows some dialogs are too big and will not allow me to navigate to the OK/Cancel buttons at the bottomof the settings dialog. Fortunately this is Open Source stuff, so I can just participate and actively fix this myself.

Whine #2: I had to install a printer driver for my HP Photosmart 2575 printer – the install took over one hour because of some “ingenious” package system. That obviously poor user experience decision aside – the minimum requirement for the printer driver is a screen resolution of 800×600 pixels. My S10e runs at 1024 x 576. The consequence – I cannot print from my netbook in Windows because the printer driver won’t finish installing, as it has an irrelevant requirement. Fortunately I am dual-booting with Ubuntu, which has excellent support for my printer (without the requirement)

I’ve read somewhere that 20% of all computers that will be sold in 2009 will be netbooks. Some producers (including Asus) will stop production of 8.9″ -screen netbooks. The 10-inchers seems to dominate right now, and probably for the rest of the year (note: my guess only). Every company designing software will have to take this into account before they ship the next version of any product with a user interface.

I’ve worked on so many web projects with art directors saying: “Nobody runs 640×480 or 800×600 anymore”. Hey we know – but do you know how many users run with their browser maximized because a designer thought up a design that required it? Web designers don’t own the real estate of the users screen resolution – they can only hope to own the area the browser is sized to – and you have to count on users having at least one open history/bookmarks sidebar and/or plug-in and/or Google/MSN/Web developer toolbar enabled.

My point should be rather obvious: It is vital to include netbooks as testplatforms for serious UI-designers or your product will no longer be compatible with the equipment of the customers you want. The rules have changed – live with it.

You may argue that netbook users are asking for it, but if the competing website or software support the netbooks and you don’t – the users is no longer making the decision of leaving you.

Testing: WP Super Cache

No Gravatar

Seems like a very cool plugin to enhance the userexperience – performance wise, plus it seems to prepare WordPress blogs for high traffic spikes.

Bug found: Links to posts from archives seems to cache PHP-code – not the resulting HTML. There’s gotta be a simple fix. Was a bit quick there. The bug is in my theme – not in WP Super Cache.

Edit: Also – the issues may have to do with my host who seems to mess with their user database right now..

Netbooks growing up

No Gravatar

ideapad s10_red

This post is written on my new netbook – a Lenovo ideapad s10e. Actually I had given up on netbooks. My first one was an Asus EEE PC 900 with SSD and that machine was a serious disappointment. I have always liked Asus hardware, mainly because it is extremly well updated with software. That was also the case with the eee 900, but in order to make it cheap enough a cut was made on the CPU and on the keyboard. Actually I think I could live with the somewhat slow Dothan CPU (Celeron’ish), but combined with the poor keyboard the experience was like:

I don’t know if the machine refuses to react on my keypress because the stroke wasn’t registered on the keyboard or because I am waiting for the CPU.

That is of course not acceptable. So the too-cheap netbook has been gathering dust for a while now.

Some colleagues also purchased netbooks. One of them a Medion Akoya (looks very much like the MSI Wind – which 95% of the hardware probably is). It had an Intel Atom processor, which seems to do A LOT for these small laptops. The price did get an extra nudge compared to the Asus eee PC 900, but that can actually mean the difference between a usable and an unusable netbook.

The Lenovo machine is Atom-based, responsive and so far a really really nice piece of machinery. I dual-boot Windows and Ubuntu Linux on it and have yet to encounter missing drivers or missing responsiveness from the keyboard.

As with anything, you get what you pay for and you actually don’t have to pay that much more for a netbook that actually behaves as you would expect.

Ubuntu two-finger scrolling

No Gravatar

My brother is now a fairly long time Mac-user. I haven’t gone down that road (yet). Last night he was here and i showed him my Asus EEE (which is currently running Ubuntu 8.10).

“Cool” – he said. “It supports two-finger-scrolling”. I didn’t know, but he is right. Googling for it found me this. Apparently the touchpad is new enough in the Asus EEE to support two finger scrolling. Nice to find hidden coolness.

What goes on in my registry when…

No Gravatar

Process Monitor

Ever asked yourself what actually happens when you perform a certain thing in a certain program? Which files are read, created, updated and what goes on in my registry.

The Sysinternals Process Monitor tool does this. Filter the events any way you need and you will be able to release registry updates quickly. I just used it to identify the registry changes performed as I changed the cache settings of IE, so a registry update file can be made and distributed to anyone who needs the same settings. It took about 10 minutes to learn to use Process Monitor and identify the key in question.