27 May 2009

Trunk port in VMware used by Ubuntu Server (Hardy)

Posted by Jacob Emcken Comments (0)

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: , ,

21 Apr 2009

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

Posted by Jacob Emcken Comments (0)

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: ,

03 Apr 2009

Gnome 3.0 – please integrate Gnome-Do

Posted by Jacob Emcken Comments (0)

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

19 Mar 2009

Scaleable icon for Pidgin – Gnome-Do

Posted by Jacob Emcken Comments (0)

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:

pidgin-gnome-do-before

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:

pidgin-gnome-do-after

YAY :D

Tags: ,

16 Mar 2009

Hacking WordPress MU – Part 3

Posted by Jacob Emcken Comments (0)

I found the first problem with running this WordPress installation on multiple domains. The installation generates a .htaccess filen in the installation directory. This won’t work when the blogs are in differet directory levels.

What I did was adding the rewite rules to the virtual host instead… that way all my domains could have different rewrite settings.

I also tried to move the upload directory away from the central WordPress installation and into the document roots for the different domains. But this seems to be impossible due to a bug in WordPress MU.

The last issue I found with my solution to the multiple domains with WordPress MU is that the site admin might not be able to see the blogs on the other domains but if you know the id of the blog you can just change that in the URL and gain edit access to the blog anyway.

Example:

The user domain1_admin is site admin for domain1.com. On the domain domain2.com the a blog with the id 3 is attached. So admin logs in on domain1.com and uses this url:

http://domain1.com/wp-admin/wpmu-blogs.php?action=editblog&id=3

The last few issues I can live with… so I wont be experimenting with WordPress for a while I guess. Hope someone can use this.

Tags:

27 Feb 2009

converting video to flv with gst-launch

Posted by Jacob Emcken Comments (0)

I had quite some trouble finding a way to convert an avi video file to flv. I really wanted to use gstreamer since it had worked very well for me for other conversions in the past. The reason for this conversion was that I had a video on my digital Canon camera (in avi format) and I wanted to publish it on the web using the defacto standard… flash video (flv).

After lots of googling I found FLV Conversion Tips by Brendan Howell so I’m not to take credit for this.

I didn’t want the sound so I removed it from Brendans original example:

gst-launch -v filesrc location=canon.avi ! decodebin name=d  ffmux_flv name=mux ! filesink location=output.flv d. ! queue ! videoscale !  video/x-raw-yuv,width=320,height=256 ! ffenc_flv ! mux.

I my search for a solution I found another link with some gst-launch examples you might find interesting.

Tags:

12 Feb 2009

phpBB module: WoW raid sign up

Posted by Jacob Emcken Comments (1)

Ever since my guild in World of Warcraft first introduced a system for raid sign ups I wished that it was integrated into the forum so I wouldn’t have to login to the forum with one user and the raid sign up system with another (and into the dkp system with a third).

Anyway a little over a year ago I became responsible for the guild forum and looked for a mod for phpBB so raid sign ups would integrate well with the forum. I couldn’t find anything usable at the time so I decided to try write my own phpBB raid sign up mod.

Apart from being fun this little project kept my php skills from rusting totally and I also learned to use Bazaar (a version control system).

Just wanted to blog about it because I think it turned out quite good even though its small. Sure there is room for improvements but hey… the source is there for everybody – change it if you like :D

Tags: ,

07 Feb 2009

Converting from Sendipity to WordPress

Posted by Jacob Emcken Comments (0)

Alright… my blog is now officially migrated from Serendipity (s9y) to WordPress. I created the new webdesign a while back and made a few small changes tonight just before the switch… let me know if you find any problems with it. The design was inspired by a WordPress theme by webdemar.com.

A while back I found a s9y importer on Michael Tysons weblog which worked pretty well. Since my last visit a german guy had made a few small changes to it to import extended posts. I had a few of those so I grabbed his script. I had to make a small change to the import script in order to get drafts imported as drafts (and not published). I also had to insert an extra newline before and after the more-tag (<!–more–>) in order to get my markdown working as intended.

To get Markdown support in my posts I installed the plugin ‘text-control’ (even though its fairly old). I had to get the newest markdown.php and replace the one provided by the plugin to make it work (to get rid of php errors).

I had a few posts which have been pretty popular, so I made sure that old links would still work by using “WordPress Permalinks – Custom Structure”:

/archives/%post_id%-%postname%.html

I had to make a “last minute” change which affects my WordPress installation in order to get it working. I will blog about that later in a “Hacking WordPress MU 2.7 – Part 3″.

I hope you like the change :D

Tags:

29 Jan 2009

“Hacking” WordPress 2.7 MU – Part 2

Posted by Jacob Emcken Comments (0)

This is my part 2 of my pursuit on howto host multiple WordPress blogs spreading over multiple different domains (not only sub-domains) on the same WordPress MU installation. You can read the first part here. It seems to be possible without using the Domain Mapping plugin which also creates the extra table to provide the functionality (which seems unnecessary).

So far my research shows that it possible using what’s already inside the WordPress MU 2.7 release. There is no web interface for some of these things but with a few manual inserts into the database it seems to work like a charm.

After my last post I was able to create multiple blogs spread over mulitple domains. But before the blog was moved to its own domain you had to attach the users for the blog because the blog would disappear from the admin webinterface as soon as the site id changed (as soon as the blog was bound to another domain).

It was possible to login on the new domain with the admin user but the user would only serve as a blog admin and not as a site admin on that domain.

With the following I was able to make the admin user site admin for the new domain as well:

INSERT INTO `wp_sitemeta`
    ( `site_id` , `meta_key` , `meta_value` )
VALUES
    ('2', 'site_admins', 'a:1:{i:0;s:5:"admin";}');

The number two (2) refers to the site_id your domain got in the table wp_site. If you want another user than admin to be the site admin you’ll have to modify the strange string. Its not as hard as it might look. You can read about how to interpret the string on the WordPress MU forum – capabilities explanation and the PHP function serialize

21 Jan 2009

“Hacking” WordPress 2.7 MU pre-release

Posted by Jacob Emcken Comments (3)

Alright… one of my good friends wanted a WordPress blog… I’ve been thinking of migrating this blog (Jacob’s Weblog – Time is always against me) along with another blog on my webserver to WordPress… that’s 1 2… 3 WordPress installations.

I went to the WordPress website and finds they recently released a new version (version 2.7). After downloading it and falling in love my good friend points me to WordPress MU Why maintain 3 WordPress installations when you can maintain a single probably 10x times as complex one?… I like a challenge.

The first part of the challenge was that WordPress MU hasn’t been released in a 2.7 version yet. Well I fetched it right from trunk (revision 1616) and installed. Then created two blogs on two different domains and created users for the blogs on the different domains. Second part of the challenge was that users attached to the second domain couldn’t login and was just redirected back to the login screen.

I described my problem in detail on the WordPress forum in the hope of some mighty WordPress MU guru would serve me the solution on a silver platter… that wasn’t the case.

I can get stubborn sometimes and the last 2 months we had a php development project on work so I figured: “How hard can it be?” After an a few hours (first spend googling for debugging WordPress) I ended up using lots of echo, if and exit – there is no school like the old school :D

Now I think I found a solution and it wasn’t code changes. I needed som changes to the data in the database. You will find a table named wp_site where you will need to add your second domain (and third… etc.) Now browse the table wp_blogs and change the site_id so it matchs the site id for the domain in wp_site.

I still need to test this out but so far it looks good :D

The third challenge will be to make my domains work with www. prepended. But I’ll save that for another time.