Installing uw-imapd on Ubuntu 14.04

Today I had to rescue an old server which was running Debian 3.0 Woody. Basically had to (or have to, since I’m still working on it) install a new server, and restore the users, and data, including mail. The easiest way to restore mail messages, mail folders, etc was to use the same IMAP server software, which is UW-Imapd. Unfortunately the latest LTS Ubuntu (14.04) doesn’t provide it, so I had to work around this problem.

It’s really not hard to do so, just had to take the following steps:

First of all, install dependencies

apt-get install inetutils-inetd libc-client2007e mlock

Then grab UW-Imapd from an earlier version of Ubuntu, from this page: http://packages.ubuntu.com/precise/uw-imapd

wget http://cz.archive.ubuntu.com/ubuntu/pool/universe/u/uw-imap/uw-imapd_2007e~dfsg-3.2ubuntu1_amd64.deb

…and install it!

dpkg -i uw-imapd_2007e~dfsg-3.2ubuntu1_amd64.deb

Voil√°! Now the mail can be read in the new system!

 

Advertisements

KDevelop – Checker framework

Hi there!

So I got a slot for GSOC2015 to implement a “Checker framework” for KDevelop, therefore I have been and I will be working on it during the summer.

The project has 3 phases

  1. Create a framework that problem checker plugin developers can push issues into, so that they don’t have to create their own infrastructure for it (like models, views, toolviews for the views, etc)
  2. Update some of the already existing plugins to use this framework (kdev-krazy, kdev-cppcheck, kdev-valgrind)
  3. Implement 2 new checker tools using the framework (clang-check, pylint).

A little bottom-line explanation:

This framework will basically mean a common (obviously subclassable) model that can be used for storing problems, some infrastructure for holding such models, and views. The model will be a refactored, cleaned up version of the current ProblemModel that is used by the problem reporter plugin. The toolview of that plugin will also be cleaned up and refactored, and provide a better view for the model(s).

Up to now I’ve been already working on creating this framework.

  • Now it is a tabbed view, and the tabs show the number of problems in the currently shown view
  • I’ve also created a class that holds problem models, and those models automatically get a view in a tab in the problem toolview

I am now in the process of refactoring the ProblemModel.

Here are two screenshots comparing the “old” toolview with the “new” one:

20150327_000002297 20150531_000002772

Diagrams with draw.io

Right now I am writing up network / system design paper for school, and I desperately needed a diagram tool, that I can use on any platform, and it can create pretty network diagrams. Guess what I’ve found a really good one!

http://www.draw.io

( NOTE: The picture is NOT my actual diagram, just a sketch )

20150418_000002467

asterisk-gui on Ubuntu 14.10

Good news everyone!

While Ubuntu doesn’t seem to have asterisk-gui in their repository. It’s certainly possible to get it working! All one has to do first is follow this guide.

When that’s done ( the installation part, basically check out from SVN, configure, build, install, no big deal ), you are just a few commands away from a working asterisk-gui!

Unfortunately the make install command installs the web site to the wrong place ( on asterisk at least ). So will have to correct that, and also correct the permissions afterwards:

rm /usr/share/asterisk/static-http
ln -s /var/lib/asterisk/static-http /usr/share/asterisk/static-http
chmod asterisk /var/lib/asterisk -R
chgrp asterisk /var/lib/asterisk -R

Then restart Asterisk, and navigate to the following URL:

http://127.0.0.1:8088/static/config/index.html

After logging in, and start-up configuration, you should see something similar to this:

20150417_000002457

That’s all folks!

 

Latest KDevelop plugin improvements

Hi there!
Let’s review what I’ve done to KDevelop’s kdev-cppcheck and kdev-valgrind plugins lately.

JSONized kdev-cppcheck and kdev-valgrind

This is fairly straightfoward: These plugins were still using the old .desktop plugin manifest files. Now they are using the embedded JSON manifests. This isn’t something user visible, but it’s needed as the old .desktop method is now deprecated.

Added the number of calls to the callgrind output of kdev-valgrind

Until now the callgrind output has only shown the IR and Inclusive IR fields. Now is shows the number of calls as well. Take a look at the pictures!

Before:
cg_before
After:
cg_after

Reorganized the output of memcheck in kdev-valgrind

Until now kdev-valgrind’s memcheck output unfortunately didn’t show enough of the callstacks to be really useful. You couldn’t see where the problem exactly occured, or where it was stemming from! Now it shows the full backtrace + the auxilliary trace as well, so you can see what actually causes the problems. See the pictures!

Before:
mc_before
After:
mc_after

 

Graphisoft meetup

Today I participated in a meetup with Graphisoft‘s technical lead at LOffice Budapest.

All in all it wasn’t that interesting. Mostly it was about their hiring practises and the personal interview experiences of the speaker. Their interview practises aren’t that different from other top tech companies, however they don’t have n+1 rounds of interviews, only one 1-1.5 hours long one, with 30 minutes of technical interview. Like other top tech companies they don’t look for coders, but creative, smart software engineers with a software architectural vein. According to the speaker in the technical part they give you a 1 page long code piece, which you have to read, understand, explain, and criticise. If you know what you are talking about, and they get the impression that you could work together, they will hire you.

Some interesting numbers:
Archicad has 17 MILLION lines of ( mostly ) C++ code.
In the past years they got about 2000 CVs, they interviewed 500 people, and hired 50.

Also on Windows they use Visual Studio, on OS X they use XCode with LLVM and LLDB. For version control they use Perforce.

Lastly,  the audience got some PR gifts:

P3190311

Java applet woes with https

Last year I created a simple Asterisk ( a VOIP server software ) extension monitor java applet for a client. It worked fine, but there was a problem when trying to load it from a https URL. It kept throwing exceptions.
Since it doesn’t send or receive any sensitive information, and it works inside an office in a closed system, it wasn’t a problem, just had to make sure the applet is loaded from http.

However today I had to deal with the applet again, and I wanted to solve this problem this time. On Windows 8 ( Windows 7, and Linux with OpenJDK IcedTea plugin doesn’t seem to be affected this time ) it kept throwing me these exceptions:

java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.security.jca.ProviderConfig$2.run(Unknown Source)
at sun.security.jca.ProviderConfig$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at javax.net.ssl.SSLContext.getInstance(Unknown Source)
at com.sun.deploy.net.protocol.https.Handler$Initializer$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.net.protocol.https.Handler$Initializer.<clinit>(Unknown Source)
at com.sun.deploy.net.protocol.https.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.<init>(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.<init>(Unknown Source)
at sun.plugin.net.protocol.jar.Handler.openConnection(Unknown Source)
at java.net.URL.openConnection(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Caused by: java.security.AccessControlException: access denied (“java.lang.RuntimePermission” “loadLibrary.sunec”)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkLink(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.ec.SunEC$1.run(SunEC.java:60)
at sun.security.ec.SunEC$1.run(SunEC.java:58)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ec.SunEC.<clinit>(SunEC.java:58)

While I was googling around, I found this stackexchange discussion, that is about basically the same exception. So I tried the offered solution, and guess what? It worked.
So apparently the JRE doesn’t have permission to access it’s own libraries while running an applet from a https URL.

So to reiterate the solution: If for whatever reason you encounter this exception, try adding the following to your java.policy file in the JRE’s lib/security directory:

grant codeBase “file:${{java.ext.dirs}}/*” {
permission java.security.AllPermission;
};

Interestingly enough, on Windows 7 the policy file already has this entry! Which is plain weird.

kdev-valgrind at work

I’m happy to report that it works! I didn’t have to actually change anything anymore, just set it up and run it using an example program.

Here are some screenshots, showing the KDevelop integrated memcheck, massif and callgrind tools at work:

20150311_000002217

20150311_000002216

20150311_000002215

KDevelop plugins, debug lessons learned

While working on kdev-valgrind, I learned some debug lessons about them, and kinda made up a smaller checklist for problems I’ve encountered.

Problem: plugin doesn’t load

  • Is the plugin installed to the right directory?
  • Is the plugin path set correctly? ( QT_PLUGIN_PATH )
  • Is the kdevelop version in the plugin manifest correct? ( .desktop file in KDE 4 style manifest )

Problem: when starting KDevelop KDE complains about missing .rc file for the plugin

  • Is the .rc file installed to the right directory? ( e.g.: /usr/share/kxmgui5/plugin/plugin.rc )
  • Is the .rc file named correctly and is it the same as set with setXMLFile in the plugin?
  • Is the .rc file named the same as the plugin’s name in IPlugin’s constructor?

Problem: plugin menu items don’t show up

  • Is the plugin loaded?
  • Check the possible problems in the section above

 

Upgrading kdevelop’s valgrind plugin to KF5

I’ve started to upgrade KDevelop’s valgrind plugin ( kdev-valgrind ) to KF5 so that the KF5 version of KDevelop can use it.
In short ‘Valgrind’ is a dynamic analysis tool that allows you to check your programs for memory errors, threading errors in runtime. It also allows you to cache and call profile. So it’s very useful. Without such tools it would be almost impossible to detect and debug these kinds of errors. ( other than reading all the code and spotting it of course )

Kdev-valgrind is a plugin for KDevelop, that integrates some of this functionality into KDevelop. I did not create the plugin I am just merely updating it, because it is very very important to have!

It took me some time, but finally I can compile and load it as the screenshots below will show. All I had to do was basically update it’s cmake project file with the KF5 libraries instead of the KDE4 ones, change some class/call references ( ok, lots of them ), and move away from the deprecated KDE widgets, in favor of the Qt ones. Very soon I will test it througly and then submit my changes for review to the KDevelop guys.

20150310_000002213

20150310_000002212