error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory

I received this dependency error a few times while running some pre-compiled software. I found different solutions on the internet, but I’d like to share the easiest one with you.

The easiest one is creating a symbolic link to libudev.so.0. First you have to found out where your libraries are located, this cloud vary depending on your system.

I can’t guarantee that everything works as it should but it works for me.

Find out your library path

The bold text is your library location:
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa157868000)

 

Link them all!

Now we link libudev.so.1 to libudev.so.0, and your application with the missing dependency should work just fine.

That’s it, enjoy your running application!

 

Tested on Elementary OS Luna, 64-bits(based on Ubuntu 12.04).

Club-mate in Kleve, Germany

I’ve got some good news for Dutch(or German) people living near Nijmegen, Arnhem or Kleve. I got tipped by a friend that a shop has club-mate in stock. So a month later we headed to Kleve, Edeka E-Center to get some crates. The price is E16.99 a crate, reasonable in my opinion.

Address

Edeka E-Center Schroff
Hoffmann-Allee 35
47533 Kleve

Enjoy it!

Club-mate edeka kleve

 

PS: Looking for a place nearby who sells Hermann Brause.

Force maven to download it’s dependencies

Maven automatically caches it’s dependencies on your local repository for one day. This could be really annoying, especially when using snapshots and continuous integration. There are two ways for solving this problem, a temporary and a permanent.

Temporary

This solution requires Maven to be installed on your computer.

The -U argument forces a check for updated releases and snapshots on remote repositories. It overwrites the local repository which is based in your home directory( in my case ~/.m2/repository/).

Permanent

You will need to modify your pom.xml for this solution. Here is a sample using an update policy which always fetches it’s latest dependencies. Depending on if you are using releases of snapshots this is how your repository should look like in your pom.xml.

Now everyone in your team automatically fetches the latest dependencies. The default setting for the updatePolicy is daily.

 

Maven downloading the internet

Oppo Find 5 root zip

My find 5(X909) is rooted like many Oppo Find 5 owners’ devices. When rooting my own find 5 I used http://www.oppoforums.com/threads/how-to-root-find-5.1196/ which worked very well.

Today I had to root a friends phone as well. Sadly enough I could not find the Find5_ROOT.zip file easily, many links expired. While looking for the zip online I found out that the zip was still on my phone.

Download Find5_ROOT.zip

My find 5 and my friend’s have been successfully rooted with this zip, fun guaranteed!
Good luck.

ps: tested on the Find 5 international version.

Host your own email using iRedMail and DigitalOcean

There are several reason why you would host your own email. With iRedmail and DigitalOcean you could host your own email server starting from $5 a month, unlimited domains and accounts. Key features are:

  • Unlimited emails and domains
  • IMAP, POP and roundcube webinterface
  • Anti-spam

Pre-requirements:

You should own at least one domain name.
The required skill is that you are a bit familiar with the Linux terminal and SSH.

Creating the server

Go to DigitalOcean and login or sign up if you aren’t already a customer. You should add some money from your paypal or credit card to your account if you haven’t already.

There are two types of servers available:

  • Low traffic/user email server without virus scanning
  • Medium/High traffic/user email server

Choose what suits your needs, although I recommend  Medium/High. Different configuration apply based on the server you’ve chosen.

Add a droplet(VPS/server).
If you’ve chosen for Low traffic, choose the cheapest one. The cheapest one  is currently $5 a month and contains 512MB memory and 1 CPU. Medium/High traffic requires at least 1GB of ram.

Enter a valid hostname, when in doubt check http://en.wikipedia.org/wiki/Fully_qualified_domain_name

Choose for CentOS 6.x x64 as Linux distribution.

You should receive an email when the creation finished. The email contains the ip address  and root password.

You can now connect to your fresh installed server.

Continue reading

Ubuntu’s Dash opens Chromium tabs on search

As a long term Linux user I am not that fast annoyed by any bugs until recently. I’ve upgraded Ubuntu to 13.04(also appears to affect 12.10) with Chromium as default browser. It all looks very fancy but there has been one downside.

The problem

When searching in Unity’s Dash Chromium starts opening empty tabs. The amount of tabs opening when searching varies from one to sometimes four.

The fix

The solution is very simple.

  1. Open the application “System settings”
  2. Go to “Privacy”
  3. Toggle the “Include online search results” to “OFF”

ubuntu-dash-toggle-search-online

Thats it, no more tab spawning when searching in Unity’s dash. Hope this saves you some frustration.

EDIT 9 June 2013: Jonathan Leaders and Ruben Bakker found the solution for this bug. Quoted from AskUbuntu:

I believe found a fix.

If you have “Online Accounts” authorized for Ubuntu/unity system (the gear icon in the upper right -> System Settings -> Online Accounts) and there is a access issue (Shows a red gear icon and throws a warning on boot) then this bug happens.

The fix is to re-authorize your existing accounts (Perhaps it occurred because I had changed my google password, and so they became unauthorized?) which can be done from

System Settings -> Online Accounts. Correct any errors listed.

In any case, re-authorizing my Google accounts seems to have fixed the problem for me. Hope this helps.

– Jonathan Leaders

Django URL redirection

Legacy URL redirection can hard sometimes. Recently I migrated a Joomla! CMS to Django.  The migration involved URL changes because some Joomla extentions didn’t produce very nice URL’s. Since I didn’t want to loose the site’s page rank I dived in Django’s code and redirect the URL’s myself.

The django way

At first I tried catching the URL, passing it to views.py and redirecting it.

This is common practice in Django but didn’t feel good to me. Editing two files for just a redirection?

Redirecting the easy way with lambdas

A lambda is an anonymous function. A lambda can even contain parameters. Lambda’s exist in multiple programming languages. If you want to know more about lambda’s I suggest you should read this.

Lets have a look if we can achieve the previous result in a simpler way. A function in view.py expects a request parameter and returns a http response.

And voilà, you are now redirecting http requests in just a single line of code. You can copy/paste the url() line and let your legacy URL’s point to your new ones. Hope this helps you keep your application code clean and still hold your current page rank.

Read the docs for more information about redirect options.

note: at the time of writing Django always returns a permanent redirect(301),  even while the permanent argument is false.

Java apps, from ugly to stunning

Java desktop applications aren’t very famous for their beauty. Recently I wanted to give my GTD app a little make over. My first Google search on changing the look and feel of Java apps  came up with “How to Set the Look and Feel“. After trying a few the Nimbus look and feel came very close to what I wanted.

Meet Web Look And Feel

Web Look And Feel is a cross-platform look and feel for swing created by a Russian(correct me if I’m wrong) guy named Mikle Garin. I fell in love with the look and feel on first sight. There is also a demo provided with many effects.

Getting your hands dirty using Eclipse

Web Look and feel is really easy to implement. Just download the binary jar file and add it to your project’s library.

Go to “Package Explorer” right click on your project and go to “Properties”.

Add Web Look and Feel to Your project with Eclipse

Add the JAR file to your project

Now we are going to actual use the library. Import the package and initiate in your Java code.

Thats it! No exception catching like you would with the UIManager class. Just enjoy the modern look on your Java desktop applications. See the source function at the demo app for example code using Web Look and Feel.

 

PS: Web Look and Feel is free to use on personal and open source projects but requires a  paid license for commercial use.

Method overloading in Java and C#

Sometimes you need methods which has very similar parameters. Method overloading comes in handy instead of creating methods with duplicate code.

The case

Car overloading UML example

Lets make this more clear by using an example. A car can drive the road’s max speed limit or the user can override this by passing a parameter to the drive function.

The class diagram of this case is shown on the right. As you can see there are two different methods to do this. They both have the same name but expect other parameters.

Overloading in Java

Java supports overloading based on parameters. Duplicate method names with the same type, amount and order is not allowed. The compiler does not support overloading based on return type.

 

For more information about method overloading in Java visit the docs.

Overloading in C#

Method overloading like Java works in C# as well. Note that there are only a few small language convention differences compared to Java.

In C# you can set a default value for a parameter if not set which is pretty nifty and reduces your total lines of code. The default parameter value makes the parameter itself optional.

 

Conclusion

Java and C# are both great with method overloading. In C# you can also do a nifty trick by using optional parameters but that doesn’t always work in all cases. Use method overloading and avoid duplicate code.

And here it is, a first blog post!

After spending ages on the web it’s now time to contribute. I’ve been planning to start a blog it for a while now and made it come true today. Let me explain what you can expect from this blog and why.

The blog’s main focus will be IT based posts since I’m a CS (Computer Science) student. I currently study CS at Avans Hogeschool ‘s-Hertogenbosch in The Netherlands which I enjoy. My interest is mainly focused on open source, programming and sysadmin, although there can always be more to blog about.

Hope you will enjoy my future posts and post a comment with feedback or questions!

– Tim Slot