Wednesday, June 19, 2013

Ignite at GeekOut 2013


On the 13th and 14th of June Ignite has been to GeekOut conference in Tallinn. This was a 2-day JVM conference, organized by ZeroTurnaround guys at Salme Kultuurikeskus.


Last years conference was a success, so this year Ignite delegation was huge, 6 people. Huge for a company of that size of course :)


GeekOut is one of a kind event in Estonia and number of participants grows each year. On the other hand, there is one important difference from conferences that happen in other countries - it’s local and local means that there are many familiar faces.

Conference was quite nicely organized. Networking was really brought to the front line. There was enough time between talks to meet colleagues from other companies as well as new interesting people. One of the best parts of the conference was networking event - party at F-hoone.


On Day-one Geert Bevin from ZeroTurnaround was entertaining the audience with his Eigenharp in a speech “Programmers are way cooler than musicians”. Java-world celebrity presenter Juergen Hoeller gave us insight on the future of Spring & Java in his “Spring 4 on Java 8” speech.


Second day will be remembered by hilarious presentation from Sven Peters (Atlassian) on the topic of “How To Do Kick-Ass Software Development”.

Beside these there were many other interesting talks.


Trade show organization was quite unusual. Vendors did not hide in the booth and took the stage during breaks between main talks.

Thanks to ZeroTurnaround guys for organizing such a great event!

Sunday, March 31, 2013

Eclipse and WebKit on Ubuntu 64


Yes, Eclipse does crash sometimes, but we still love it, for some reason :)

If your crash report says something like:

# C  [libwebkitgtk-1.0.so.0+0x426915]  webkitWebViewRegisterForIconNotification+0xb5

then today is your lucky day. I have a solution for you.

First of all, about the problem

Looks like Eclipse does not play nice with libwebkitgtk-1.0, it wants libwebkitgtk-3. At least on Ubuntu 64. Most probably, you do have both of them installed, but for some reason Eclipse picks version 1 instead of version 3.

Solution

Well, first solution is quite obvious - remove bloody libwebkitgtk-1.0. Easy shortcut to happy place without any crashes. However, there is a small issue with that approach. If you do have  package installed, then probably there is a reason and you would have to remove some other packages that depend on libwebkitgtk-1.0. In my case, Gimp was the cornerstone. It does not work with libwebkitgtk-3.Too bad.

Second solution is a bit more sophisticated. It is the reason why I like Ubuntu and at the same time reason for many jokes and criticisms from other OS users. If something does not work the way we want - let's recompile it :D

If you take a look at WebKit source, you will notice that webkitWebViewRegisterForIconNotification is called only #if ENABLE(ICONDATABASE). What?! I'm getting crashes because of some icons?! I hardly care if I have those icons in my main browser, not speaking about browser integrated in Eclipse or Gimp. Let's kill icons!

I will not describe in details how to recompile the package, there are lot's of materials on that topic. When you get WebKit source, search Debian configuration files for keys that disable icon database. Unfortunately, there is trick. Looks like disabling of icon database was not tested by developers. There are some places in code that do not have correct compile instructions and will complain about missing methods. I suppose if you got to that point, then surrounding some lines of code with compiler instructions is not a problem for you :)

If it sounds too scary for you, here is my version of package.

Now you just have to install it: 

dpkg --install libwebkitgtk-1.0-0_1.10.0-0ubuntu1.1_amd64.deb

There is one issue with my package. I did not change version. When you install it, synaptic will show that there is an update available. Next time when you will install a bunch of updates - it will be replaced with the one from repository. Best solution is to use "lock version" in synaptic or something similar, but if custom package version is the same as version in repository - it will not help. This means that you would have to check the list of updates that you update manager is going to install and make sure that WebKit will not be updated. Ugly, but works, as a temporary solution. If you will compile own package - don't make my mistake - change version.

Saturday, January 5, 2013

Using WiFi and network cable at the same time in Ubuntu

Did you ever have to switch between WiFi and network cable several times a day? If yes, than this blog post is for you.

DISCLAIMER: Check your security policy before trying out solutions from this blog post.

Actually, it does not have to be a WiFi and a network cable. It can be two WiFi connections or two network cable connections. The point is, that you have 2 (or more) network interfaces.

Usually, I have this situation when I need to use intranet resources, which are available for local network and this network has "issues" with connecting to outside world.

By default, Ubuntu allows you to have multiple network connections at the same time. The problem is, that it needs some help on deciding which one to use in certain circumstances.

On this screenshot you can see two active connections:

"Wired connection 1" - default name for wired network connections in Ubuntu. Let's assume that this is a local network that does not have access to internet.

"aleksz-wifi" - wireless connection. Has access to internet resources, like Skype.

How does Ubuntu know which one of those connections should be used to access public web? Simple, there is a routing table. You can see it with "route" command.



The Routing Table


That's what I get. I did not configure anything yet. You can assume this routing table to be more or less random.

Probably, you would not be reading this post if you would understand how routing table works, so I will try to explain it a bit. In last column ("Iface"), you see interface name. eth0 is for "Wired connection 1" network and wlan0 is for "aleksz-wifi". First column ("Destination") together with third column ("Genmask") form the range of IP addresses for which this interface should be used. That's actually what we need. By changing routing table, we can say that one range of IP addresses should use one interface, and another range should use the other interface.

In given scenario, we need two ranges. On screenshot, you might have noticed that there is a "default" destination. This means, that we actually have to define rule for one range and all other addresses will be using "default" rule.

Default interface

Now you should think what interface will be "default". In given scenario, there are two facts that make us choose wlan0 as a default interface:

  1. We are going to use Skype on that interface. As Skype uses P2P network, it will be quite hard to identify destination IP range.
  2. If routing table hits some unknown IP, then most probably it will be an external resource.
If you pay attention, then you will notice that routing table on screenshot puts eth0 as default interface.

Changing configuration

There are many ways to  configure routing table, but we are going to use the easiest one.

Open "Edit Connections..." dialog


Open "Wired" tab and click "Add" button. We are going to create a new configuration that can be enabled manually 
Enter some "Connection name" and choose "Device MAC address" . Dropdown should contain MAC for eth0 interface. Uncheck "Connect automatically" check box if this is not your primary setting for wired connections.
Next go to "IPv4 Settings" tab (or v6, depending on your network). Click "Routes..." button.

In case if you are going to use this connection to access only resources available on local subnet - check "Use this connection only for resources on its network". Save your new configuration.

Now you can choose "my intranet" for wired connection
Let's check the routing table:


Here you go, default interface is wlan0. eth0 is still used for local connections.

That was easy. However, in real world it is highly possible that your local network structure will not be as plain as in my example. You might need access to resources on other subnets. This requires a bit more complex routing configuration:


Except for local subnet addresses, this configuration resolves addresses in other subnets through gateway.