Category Archives: linux

Blogposts on blog.futtta.be about Linux; Ubuntu, Debian, VPS-servers, a few howto’s and some small quick hacks (bash- & php scripts mostly).

Cross-platform cloud storage with Dropbox

When a good friend of mine bought a Sony Xperia X10 Mini Pro (that small dude does have a keyboard) and couldn’t find JungleDisk in the Android market, I went looking for alternatives (I had already looked into cloud-based storage/ backup back in 2007) and found Dropbox.

Dropbox is an Amazon S3-based cloud-storage solution with client software for just about every system, Android included. Moreover it offers an API for platforms or applications that need Dropbox access as well. The basic account (with 2Gb storage) is free (sign up here and I’ll get some more free storage thank-you-very-much), so I installed it on the Windows laptop at work, on my Linux “disktop” and on my HTC Hero and (at first sight) all seems to work exactly as advertised (free, easy, cross-platform).

And now that I have external storage that allows sharing files with anonymous users, I could offload some files from my own server? But more importantly; I really should look into reworking that old backup shell-script again (I’ll have to get dropboxd up and running first though). Or maybe I’ll just install WP Time Machine to automatically back up just this blog to my Dropbox-account?

Impatiently flashing my HTC Hero into shape

the new android recovery image menu in actionI’m an impatient man, so although I heard rumors that Mobistar might be testing the HTC Hero update (which is Belgium-specific, as the YouTube application has to be removed because of privacy law concerns), I decided to go the “less official” way and root and flash the darn thing myself. The process was pretty easy (thanks for the info Thomas & Serge), the outcome is great; my phone is a better Hero for it!

So suppose you’re as impatient as I am, suppose you don’t care that this may void your warranty, suppose you’re not scared of bricking your brand new toy, suppose you’re a not entirely technically ignorant, then you could follow these steps:

  1. Root your HTC: by using flashrec.apk to flash a new recovery image on your HTC as described here. If you get a “backup failed” error in step 10 as I did, you just need to power off and on and try again (the backup itself isn’t used anyway, that step is just needed to have flashrec allow you to continue).
  2. Upgrade your rooted HTC: from the new recovery image menu flash MoDaCo custom ROM v2.x (I installed 2.2, 2.3 was released a couple of hours ago) to your system as described here. And don’t forget to wipe before flashing as I did.
  3. Update to the latest radio package to version 63.18.55.06EU_6.35.06.18 from the recovery image menu (you should know the drill by this step) for optimal radio performance.

But you could also wait for the official update, off course …

HTC-dude, where’s my keyboard?

In spite of my almost religious view on the ideal mobile phone, I bought a HTC Hero last week.

But let there be no doubt; it’s a great handset! My Hero sports a beautiful touch-screen, a nice -albeit young- Linux-based OS and a top notch webkit-based browser (with Adobe Flash 10, a first for a mobile device). The price is considerably lower then that of an iPhone and the platform is very open (esp. if you  compare it to the golden cage Apple created for its ecosystem). I’ve installed several free apps from the Android Market and downloaded and installed a great AR-application from outside the Market without having to jailbreak anything (more on Android-apps in a later post).

But there’s one thing I really miss on my fancy device; a physical keyboard. Because as ancient as my Nokia e61i might have been, I really was more productive (as in “writing mails”) on it thanks to the (small) physical QWERTY-keyboard it sported. And while friends and colleagues assure me that I’ll get used to the virtual keyboard, and I’m sure things will indeed get better, we should not kid ourselves; nothing beats a real keyboard. Ever! So let the quest for a small compatible bluetooth keyboard begin!

Crashing, teleporting and syncing Virtualbox

I’ve been playing around with Virtualbox over the last few days, trying to set it up just right for me. One of the hurdles was working around a bug in the 3.0.0 release that caused guests to crash when performing downloads in them. Changing the virtual network card from “PCnet-FAST III” to “Intel PRO/1000 MT Desktop” proved to be a good temporary solution, but the bug got squashed in version 3.0.2.

Next on my list was getting the “shared folder“, which I configured in Virtualbox (look ma, no samba), to automount in my Ubuntu-guest with read-write permissions for my non-root user. I ended up adding this line to /etc/fstab (the dmode and fmode-options did the trick eventually):

teleporter /home/frank/Desktop/teleporter vboxsf rw,dmode=777,fmode=777,uid=1000,gid=1000,auto 0 0

And to wrap things up I also installed the Mozilla Labs Weave-plugin, which syncs a.o. bookmarks and passwords in Firefox between my 3 environments. It caused me some headaches at first, synchronizing just seemed to take forever and no error was shown in the frontend. But I found some obscure messages (things like “Exception caught from onComplete handler of CryptoWrap__decrypt-57 generator”) in the verbose log and Google linked those to a post on the Weave Google Group which explained that the problem was with an incorrect “encryption passphrase”. And sure enough Weave was syncing happily after once I re-entered my -too complex- passphrase.

‘Cause I’m free, to do what I want, any old time

Freedom comes in many shapes and forms, but give me a computer which is not burdened by corporate software and enforced group policies and give me internet access that is not limited by proxies that prohibit you from using half of the web and I’m a happy little futtta. I cracked the proxy thingie problem at work some time ago already, but the computer/OS-part remained an issue up until now. I tried virtualization with VMWare and Qemu but wasn’t convinced and booting into my “disktop” (Ubuntu 8.04 intalled on an USB-connected external HD) while at work was far from efficient, so I kept jerking around in the uninviting environment which is the maimed Windows XP we have to put up with here.

But some time ago my laptop got a memory upgrade (from 1 to 2 Gb) and last week Paul Cobbaut wrote about Virtualbox on his blog. I installed this example of German craftsmanship (both a “free as in beer” and an open source version are available, version 3 was just released a few hours ago!) and my computer hasn’t been the same since. I’m now running a fullscreen (guest additions rock) Virtualbox virtual machine with Ubuntu 9.04, using an openssh-provided (with some help from corkscrew, off course) socks-proxy for unlimited internet access and I feel like a kid that has just been allowed in a playground.

a screenshot of virtualbox 3 on windows xp

Next to Ubuntu, I also installed Opensolaris (which seems to need a shitload of RAM) and a leaked version of the emulator of that much anticipated (well, by me at least) Palm WebOS. On my disktop I installed the Linux-version of Virtualbox and I’ve got OS-weirdness such as ReactOS, Haiku and Syllable running there. Hell, maybe I’ll even install (a clean version of) Windows XP in a virtual machine there, just to make it full circle. ‘Cause I’m free!

Soup Dragons – "I'm Free"

Watch this video on YouTube.

Joikuspot connection problem with Ubuntu Linux

This weekend I had to resort to Joikuspot (software that turns your 3G-cellphone into a wireless gateway to the internet) for my web-needs. Because I encountered a few problems setting up a connection from my Ubuntu laptop, here’s a quick recap for documentations sake.

The rather fundamental issue was that I couldn’t get my computer (a Dell D620 running Ubuntu 8.04 with the iwl3945 driver) to join the ad-hoc wifi-network which Joikuspot (on a Nokia e61i) created. As connecting from my wife’s Windows XP laptop did work, I googled around a bit and it turned out I had to specifically set the channel used by Joikuspot to 1 or 6 instead of “automatic” or 11. Although NetworkManager still seemed confused, this did allow me to connect from the command line (disabling wireless networking in NM first and then using iwconfig and dhclient). But why joining an ad-hoc wifi-network on channel 11 doesn’t work in Ubuntu, that I still don’t know.

Once connected to the wireless network, I found out that Joikuspot Light requires your browser to auto-detect a proxy. The proxy in Joikuspot seems to be used to limit the functionality of the free version and gently push you towards the non-free Premium product. As my normal web-connection came back soon after I figured this out, I didn’t bother to test if I could tunnel my way out of those limitations. But crippled or not, Joikuspot is great to have around when your broadband connection is down.

Fun with caching in PHP with APC (and others)

After installing APC, I looked through the documentation on php.net and noticed 3 interesting functions with regards to session-independent data caching in PHP;

When talking about caching, apc_delete might not be that important, as apc_store allows you to set the TTL (time to live) of the variable you’re storing. If you try to retrieve a stored variable which exceeded the TTL, APC will return FALSE, which tells you to update your cache.

All this means that adding 5 minutes worth of caching to your application could be as simple as doing;

if (($stringValue=apc_fetch($stringKey)) === FALSE) {
$stringValue = yourNormalDogSlowFunctionToGetValue($stringKey);
apc_store($stringKey,$stringValue,300);
}

From a security point-of-view however (esp. on a shared environment) the APC-functions should be considered extremely dangerous. There are no mechanisms to prevent a denial of service; everyone who “does PHP” on a server can fill the APC-cache entirely. Worse yet, using apc_cache_info you can get a list of all keys which you in turn can use to retrieve all associated values, meaning data theft can be an issue as well. But if you’re on a server of your own (and if you trust all php-scripts you install on there), the APC-functions can be sheer bliss!

And off course other opcode caching components such as XCache and eAccelerator offer similar functionality (although it’s disabled by default in eAccelerator because of the security concerns).