Wordpress with Markdown

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.

Trunk port in VMware used by Ubuntu Server (Hardy)

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:


The following example sets up the ip with 8 as a VLAN tag on eth0:

auto eth0.8
iface eth0.8 inet static

Now bring up the interface with:

sudo ifup eth0.8

The future of Gnome 3 - If I had something to say

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.

Gnome 3.0 - please integrate Gnome-Do

After reading the the Gnome 3.0 announcements (Vincent Untz, Andre Klapper) yesterday and reading The Plan, I don’t really know if I got exited or dissapointed :)

Anyway Gnome works very well for me already (version 2.26) so I guess the limited amount of visible changes is a plus for me after all. But one thing I would like to see integrate and officially backed by the Gnome Team is Gnome-Do. My desktop experience took a great leap forward after getting used to this way of interacting with my computer. I while back I read a very exiting blog post about incorporating Gnome-Do to the very core of Gnome.

Now THAT would ROCK HARD for something to include in Gnome 3.0 :D

Scaleable icon for Pidgin - Gnome-Do

I like my desktop to look good (cool effects not needed) and I’m a heavy Gnome-Do user so it has been annoying me for quite some time that when starting Pidgin it looks like this:


So I started searching Launchpad for a bugreport and actually found 2:

Thos bugs led me to a bug report in Pidgins own trac about the same issue. Which led me to download the source code and an usable svg file which I manually copied to my system:

sudo cp ./pidgin-2.5.5/pidgin/pixmaps/icons/hicolor/48x48/apps/scalable/pidgin.svg /usr/share/icons/hicolor/scalable/apps/

Long story short… now launching Piding from Gnome-Do looks like this: