Background:
At work we are currently in the process of creating a general data hub which is easily expendable and configurable. It’s already in use exchanging EDI messages (EDIFACT) for a supplier on the danish electricity market.
For the configuration we settled on a GUI where you could drag different kinds of data manipulations into the data flow and this is all implemented in HTML with jQuery.
The problem:
Upon drop I had to use Ajax to ask the server if it was ok to drop the draggable. Since Ajax is asynchronous the drop event would return before the Ajax actually had finished. I decided that I didn’t want to force the request to the server to be synchronous instead I wanted the ajax success callback to be able to do the reverting.
Upon searching the net, the closest thing I came to a solution was defining a callback function for revert on the draggable, and this functionality isn’t even documented by the time of this writing.
The solution:
After playing a bit around I found an acceptable solution. I’ve created a small example reverting a drop using a confirm where you can test it (and see the code).
Tags: draggable, droppable, jquery, revert

Gnome global menu and Gnome Do in action
My last laptop was the IBM Thinkpad x40 with a 12″ screen and a resolution of 1024×768. I used it both private and for work for over five years several hours a day and wore down three batteries in that time. With such a little screen you find yourself exploring ways to get the most out of your screen. Since I prefer the keyboard over the mouse any day I’m not forced to have big icons and menus all over the place.
Here are the steps I’ve taken (things I’ve removed) and how get things done (without them).
Firefox
Press “View / Toolbars / Customize…” and remove anything except from the back, forward, location bar and search bar. Also select “Use small icons”. To stop loading a page just hit escape, to reload use F5 and home use Alt+Home. To get to the location bar hit Ctrl+L and to get to the search bar hit Ctrl+K. I also hid the Bookmarks toolbar (because the suggestions in the address bar usually gives me what I want… alternative you can give bookmarks tags (keywords) which you can type in the address bar to open the bookmark.
Bottom panel
I’ve removed the bottom panel on my Ubuntu installation since it had nothing I’d ever use. Hide all open windows or “Show desktop” is easily accessible using Ctrl+Alt+D. I never used the Trash icon i really rarely delete anything and when I do I usually hold shift while doing so (which skips the trash can) which leaves me with the “Window list”. The window list show the open windows on all workspaces and although I use tabs whenever I can get away with it (Gedit, firefox, terminal and sometimes Nautilus) I still usually have about eight open windows spread over my six workspaces. I’ve come into the habit of using the same workspaces for the same tasks (often one application). Example:
- Workspace 1: Email
- Workspace 2: Browsing
- Workspace 3: Terminal
- Workspace 4: Virtual machines
- Workspace 5: Documents using OpenOffice or PDF using Evince
- Workspace 6: Editor (mostly emacs but somtimes gedit).
This way I alwas know where the application I want for the task at hand is. I use the keyboard shortcuts (Ctrl+Alt+arrow keys) to get to it. I always know where to look for an application. Having all applications on the same workspace and use Alt+Tab or the window list I would have to use my eyes to locate and identify the application I want. So I find this method much faster. Just to be on the safe side I put an other applet called “Window Selector” in my panel in case I ever found myself in need of being able to select a window with the mouse. I sometimes use to show me a list of all the applications I’ve opened.
Gnome do
I can’t remember excatly how why or when I started using Gnome-Do but it is one of those things you didn’t know you needed until you started using it. It is one of the most powerful and versatile tools I’ve ever used on my desktop. Although its not there yet it certainly could be for the desktop whan a terminal is for a server. At the moment I’ve mostly use it to start applications, play, pause and skip music and start, stop, suspend and snapshot virtual machines in Virtualbox. Though I’m pretty sure the use of Gnome-Do will keep growing on me.
Global panel
After I found my self not using the application menu to start stuff anymore I decided to remove it from my top panel to get the extra space and test gnome-global-menu. I belive the gnome-global-menu project was inspired by Mac but whether Apple came up with the idea themselves or they got inspired somewhere else I don’t know. I the top of this post you can see how my desktop looks at the moment (just installed Ubuntu Lucid).
Informative error message… NOT.
I’ve installed php-gtk on a machine and got the above error when trying to start php from cli via ssh.
After a while it suddenly hit me that I hadn’t forwarded X when I logged in via ssh. After that I was able to use php again.
php with php-gtk is unable to start without a X server.
Tags: php-gtk
At work I was assigned to package some software to make it easier to distribute and update. One of those software packages was php-gtk which with one patch to the build/configure files now cleanly builds on Ubuntu. You will be able to find the package on my Ubuntu PPA. You will be able to find builds for both 32bit and 64bit platforms.
I’m also in the process of uploading packages for FriFinans which is an Open Source economy / accounting application. This should be easier… lets see how it goes
I’m a proud adventure game fan boy and have enjoyed countless hours in the company of Monkey Island, Day of the Tentacle, Legend of Kyrandia among others. ScummVm have helped to re enjoy many of these titles after replacing my preferred desktop system with Linux.
When the news reached my ears about “Tales of Monkey Island” I was very exited. But also nervous if would be able to play these episodes without Windows… but fear no more.
It is possible!
My system:
- Nvidia graphic card
- Ubuntu Karmic 64bit
- Wine from special package archive (to get native pulse audio support)
The episodes install on all Wine versions I’ve tried on so far (several guides on the internet suggests not to check for DirectX, though I haven’t personally experienced any difference).
When the game starts you are asked to provide the serial number. In this phase I’ve encountered trouble several times. Earlier providing the serial number only worked in old versions of Wine (like version 1.0) but this time I got it working with the newest version of Wine (which at the time was 1.1.32). Also I had to delete my .wine folder in order to reset wine because I apparently had some IE6 leftovers in there which otherwise would mess up the registration.
After activating the episodes you need to install D3DX941.dll into .wine/drive_c/windows/system32. Remember Linux is case sensitive so it is possible to have several different files with the same name except for the case. If it still doesn’t work make sure you only have one d3dx941.dll and that it’s not the one provided by wine (which won’t work).
Now the game starts… but for me the sound jittered. After looking around I found that it was ALSA interface in Pulseaudio which kept loosing the “connection” re initiating it. My saviour was Neil Wilson who have packaged Wine with a native pulseaudio audio plugin. This did the trick for me and Tales of Monkey Island is now very much playable at least for me
After using Boxee for some time now I tried to find an European alternative and landed on Lovefilm. Sadly Lovefilm isn’t accessible through Boxee.
Lovefilm at least supports Firefox users… if I would ever find the time to try write a plugin myself this is the links I would use:
First of I’m not alone thinking Lovefilm for Boxee would a great idea
Next I would need some information about developing plugins for Boxee (incl. a tutorial).
Lastly I would probably need some stuff for Emacs which I’ve been using for a while now.
Tags: boxee, emacs, lovefilm, python
For a long time I thought the only way to restore something deleted on ext3 was to cat the device and grep for known strings from the deleted files.
Which:
- only worked for text files like like config and code files.
- was very cumbersome and error prone.
Anyway thanks to Carlo Wood, ext3grep and this fine tutotial about HOWTO recover deleted files on an ext3 file system which has proven me wrong. Not that I need it right now but I’ve been there and will probably end up in the situation again.
Tags: ext3, restore, undelete
Today I updated Wordpress which went smooth so I decided to fix a problem on my blog which appeared when I first migrated to Wordpress. I’m using the plugin Markdown for WordPress and bbPress so I can write posts with Markdown syntax and I use code sections heavily. The problem was that using special characters like: & ” ‘ within code paragraph would look like this:
& ” ‘ < >
For now I just reverts posts upon displaying so the html entities are replaced by special characters. I know this is not the right way but its temporary
I asked on the Wordpress IRC and a nice guy called ‘ansimation’ gave me this to work with:
function reconvert_pre_entities( $d ) {
return preg_replace_callback('/<pre>(.*?)/sim', create_function('$matches', 'return( html_entity_decode($matches[0]) );'), $d );
}
add_action('the_content', 'reconvert_pre_entities' );
When I get a little time I’m going to incorporate this into the Markdown plugin so it wont affect any of the other blogs not using Markdown.
Tags: markdown, plugin, wordpress
At work I had to setup the network on Ubuntu Server (Hardy) so it was able to scan several networks with nmap as if they where local networks (and thus able to get MAC addresses). Until now the networks was scanned through a router which means the MAC addresses was lost. The reason for the importance of the MAC addresses was to identify whether a machine was likely a virtual machine or a physical machine.
The machine scanning is a virtual machine in VMware. Seven networks needed the ability to scan MAC adresses. VMware has a limitation of only 6 hardware devices (at least in ESX 3.5) which meant that having two harddisks it was only able to scan four out of the seven networks giving the machine a virtual NIC in each network.
The ESX server separated the networks with VLAN tags so to work around this we created a virtual trunk NIC.
Notice: The VLAN ID is optional but an empty VLAN ID means it cannot see VLAN tags. If you want a VMware NIC. To see all VLAN tags the VLAN ID must be 4095 (this might be VMware specific). This gave me and a colleague quite a headache before we figured it out.
To create trunked NIC in VMware:
- Click on the ESX server you want to create it on.
- Click on the “Configuration” tab to the right.
- Find the virtual switch in which the trunked NIC should reside in and click on “Properties…”.
- Click on the “Add…” button at the bottom to start the wizard.
- For “Connection Types:” select “Virtual Machine” and press “Next”.
- Give the NIC a name ie. “Trunk” and set the “VLAN ID (Optional):” to 4095 and press “Next”.
- Now just press “Finish” and notice the right information pane now indicating VLAN ID is set to “All”.
For Ubuntu Server (Hardy) to play nice with this new trunked NIC I found some help on the Ubuntu forums on how to setup VLAN.
First you have to install the vlan package:
sudo aptitude install vlan
Now enable the module:
sudo modprobe 8021q
And make sure it gets automatically loaded the next time the machine starts up:
sudo sh -c 'grep -q 8021q /etc/modules || echo 8021q >> /etc/modules'
Now configure your NIC in the following file:
/etc/network/interfaces
The following example sets up the ip 192.168.1.100 with 8 as a VLAN tag on eth0:
auto eth0.8
iface eth0.8 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
Now bring up the interface with:
sudo ifup eth0.8
Tags: nmap, vlan, vmware
I like that fact that development of towards Gnome 3.0 seem to be minimal but realistic. Preparing the platform for ease of development will pay off in the other end. I think they are focusing the energy the right places to get off the ground.
After 3.0 is released I hope they will look into this problem:
I have multiple computers and I can imagine the number will grow considerably over the years.
- Workstation (currently using)
- Laptop (currently using)
- Mediacenter (currently using)
- HTC Phone with Android (planing to buy)
- Computer in Kitchen (planing to buy)
I would like to access my contacts, calendar, notes, todo, file area (dropbox like), rss feeds, bookmarks etc. no mater what which computer I’m sitting at, or even via a browser if I’m not on one one of my own computers… or worse in Windows. I don’t want to manually sync stuff around, it is in efficient and is bound to go wrong at some point. Some effort have been made in order to store ie. Tomboy notes centrally via ssh or webdav which is acceptable because there is no alternative. Similar is Tasque able to store the todo online using an online service called Remember the Milk and Firefox plugins have been created to sync bookmarks across computers.
The real solution:
Create a service which can store all these information and host it. Now people could create a “Gnome Account” if they wanted to use this service. This kind of service would generate considerable amounts of data which is why the free Gnome service might have to have limitations on ie. how many contacts a user can have sync’ed or how much space the shared file area can take up. I also wouldn’t rule out the possibility of having commercials integrated in some way for this free service ie. like in Gmail.
For all those who cannot live with the limitations the “Gnome Account” has or just don’t like the commercials they can install the service on machine them selves or use the service from another provider. Ie. Ubuntu might want to provide the service to their users but want to sync bookmarks from Firefox instead of Epiphany. Or a company installs the server software and provides the service for a monthly fee without the same limitations than the “Gnome Account”.
Perhaps even companies could install their own sync service for all their employees.
To sum up this would ease the pain moving between several devices. Also when upgrading or installing a new device all you had to do is enter the “Gnome Account” once and all supported applications would instantly be in sync.
Tags: gnome, sync