A public note book... Wed, 05 Oct 2011 11:35:40 +0000 en hourly 1 SDU m-drive Personal Network Folder on Linux Machines Tue, 04 Oct 2011 09:08:14 +0000 I’ve written this guide before somewhere, but always fails to find it when I need it, so here is again. A guide for students and employees at University of Southern Denmark SDU for mounting their personal folder, the m-drive, on a Linux machine.

First step is to figure out what the path to your m-drive is… on a Windows machine find the folder, right click and select properties. On the tab “DFS” there is a full path to the folder. The path displayed in the title bar, which includes something like “\dfs\data” in it, is not the right one. For employees of the Technical Faculty the path currently is: “\\\tekansatte”

You need “smbfs” and “cifs-utils” installed on your machine. On an Ubuntu machine write: “sudo apt-get install smbfs” in a terminal and you’ll get all the necessary components.

You can now mount the m-drive from a terminal with the following command:

sudo mount -t cifs -o username=<username>,domain=<domain>,password=<password>,iocharset=utf8,codepage=unicode,uid=1000,gid=1000 //<username> /mnt

where you need to change <username>, <password> and <domain> to reflect your information. Also the path, in this case “//<username>” should be changed to what you were seeing in the properties of the m-drive. Notice the backslashes have been changed into forward slashes.

For a permanent mount add the following to fstab:

//<username>       /var/m-drive    cifs    credentials=/root/.smbpasswd_mdrive,_netdev,iocharset=utf8,codepage=unicode,uid=1000,gid=1000

where the credentials are stored in a file in the /root folder.

See here, here and here for more information, including credentials, _netdev and isocharset.

]]> 0
Reflection problem in the Netbeans Nodes API tutorial Tue, 27 Sep 2011 09:44:35 +0000 I’ve been following the Netbeans tutorial on using the Nodes API to implement a tree structure with some information in it.

In the second part of the tutorial the author shows how to set up and show a property sheet sheet when an element in the tree structure is selected. Most of the examples work pretty straight forward, but when I tried to adapt the example to my own code, I got a problem with the way the tutorial uses the Java reflection to set the fields of the property sheet. Here is the line in the tutorial:

APIObject obj = getLookup().lookup(APIObject.class);
Property indexProp = new PropertySupport.Reflection(obj, Integer.class, "getIndex", null);

When ever I try to do that with my own implementation of an APIObject, I get a NoSuchMethodException. After trying to work out why that was happening, without any success, I figured another way to create the property sheet, based on this blog post: by Geertjan Wielenga from the Netbeans group.

The code becomes like this instead:

APIObject obj = getLookup().lookup(APIObject.class);
Property indexProp = new PropertySupport.ReadOnly("objIndex" Integer.class,"Index","Object index") { 

public Integer getValue() throws IllegalAccessException, InvocationTargetException {
 return obj.getIndex();

While that is not really a solution to the non-working reflection, it is still a workaround that can be used.

]]> 0
Adding javadoc to JAR files in a Netbeans project Fri, 16 Sep 2011 11:45:06 +0000 The other day I was working on a Netbeans project where I had to create a new module that was dependent on a external JAR file. From the platform document I found out that you can add a JAR file in two ways: Using the Library Manager or using a Library Wrapper Module. First I tried the second option, and it worked fine except for one thing – there was no javadoc attached to the jar, and no way to attach it.

Project Properties
There is no way to edit the jar file properties

Then I tried the other option, adding the JAR as a library using the Libraries option from the Tools menu. Using this method it was possible to add both the javadoc and the source to the library. Unfortunately there was no way to include the library in a project, which kind of renders the whole ting useless. I still don’t know what the Library Manager is supposed to be used for, but apparently not for including JARs in projects.

After Googling for a while, coming up blank on what to do, I got in touch with a Netbeans expert Andrzej Olszak – author of the cool Featureous tool. He already knew the problem from his own work and also knew a work-around:

  1. Select the main module suite, click the New Project… option in the file menu and add a new Library Wrapper Module
  2. Select the JAR file to be included and complete the forms as needed. When you press OK, the new module should be opened along with your other modules.
  3. Right click on the module in the list of projects and select Properties at the bottom of the menu. Select the Libraries node on the left side, and click on the Wrapped JARs tab to the right.
  4. Now you see the same options as on the image above, with the Edit… button disabled. Here comes the trick:
  5. Select the JAR and press Remove, then press the Add JAR button and re-add the same JAR file again… and watch what happens to the Edit… button. Suddenly it is enabled! That is it…

Now you can include the wrapper module as a dependency in any module you like, and the javadoc will be available.

Javadoc for an included JAR file in Netbeans
Now the javadoc is visible...
]]> 0
Recovering encrypted home folders in Ubuntu Fri, 02 Sep 2011 09:55:58 +0000 Yesterday was my first day back in the office after a 6-months stay at UCSC and some leave and obviously my computer insisted on having a number of updates installed immediately when I got it started. A distribution upgrade to Ubuntu 11.04 was available, so I decided to go with that. After the download was done, and about halfway through the installation of the updates the computer ran out of disk space… and got completely stuck. Lots of I/O errors flooding the consoles, the installation process not getting anywhere, unable to open and close programs etc. I left the computer running, but eventually it crashed completely and rebooted. Next step was kernel panic… so it was time for a reinstall.

I booted into Ubuntu 11.04 Live from a CD and got access to the machine. Next step was to get the files out of my encrypted home folder. The home folder contained two files, a .desktop file and a readme file. The desktop file did nothing but make Nautilus complain about something untrusted and the readme tells you to run ecryptf-mount-private. That resulted in an error, basically saying that the home folder is not set up correctly, but no information on what is wrong, or how to correct that. Instead your left on your own. After googeling and trying several suggested solutions I found a method to get access to the encrypted folder. All you need is your old username and login password. No need for the encryption key / mount password.

First mount the partition with your home folder somewhere, for example in /mnt:

sudo mount /dev/sdXXX /mnt

Then move the existing home folder of the live system to somewhere else:

sudo mv /home /cdhome

Now make a symbolic link from the old home folder in the mount you did and to the root of the live system:

sudo ln -s /mnt/home /home

Then create a new user with the username that matches the username you had on the system with the encrypted home folder:

sudo adduser xyzw

and go through all the questions. Finally, su into that username:

sudo su xyzw

and with a little luck, you will be asked for the login password that matches the encrypted folder. That password is the last login password you had on the system the folder came from, not the password you just made when you created the user in the previous step.

]]> 1
Review: The war after armageddon Tue, 14 Dec 2010 10:25:53 +0000 The War After ArmageddonThe War After Armageddon by Ralph Peters

My rating: 4 of 5 stars

Great book on the war that follows when fanatics on all sides of a conflict spin out of control. The book’s battle scenes and depiction of warfare reminds me of Tom Clancy’s “Red Storm Rising”, but with a more thoughtful angle on the political and human realities of a war of religion, a holy war, being fought in the Middle-east between modern armies.

View all my reviews

]]> 0
Android Email Setup at University of Southern Denmark Wed, 07 Jul 2010 08:01:14 +0000 Android Email Setup at University of Southern Denmark

It is possible to get limited access to Exchange server provided by the university, even when outside of the university network. Simply add

as the exchange server address. Unfortunately this will only give you access to receiving mail (and maybe seeing your calendar?) but not sending mail, accessing the email directory or adding new appointments to the calendar.

Using IMAP

Instead of using the Exchange setup, I recommend you to use the following IMAP setup. This will allow you to receive and send emails no matter your connection type and location. Add a new IMAP account and fill the account name with something appropriate. User name includes your domain e.g. tek\myusername or sdu\myusername. The IMAP server is the same as the above exchange setup: The important part here is to choose the right connection security type, which must be set to SSL and port 993.

Sending Mail

Next you setup the outgoing server. Click the login needed check box, and fill in the same user name as for the incoming IMAP server. Again, remember the domain part. The outgoing server address is Again the connection security part is important. Choose TLS and port 587.

What About the Calendar?

If there is a way to make the Exchange calendar sync with your android phone, with out being connected directly to the university’s network, I haven’t found it yet. My recommendation is to use Google Calendar instead, which works perfectly with my HTC Desire phone. If you really need to use the Exchange calendar as well, because you use on your normal computer, I would suggest using Googles Sync services. This allows you to install a client on your PC that syncs your Outlook/iCal etc. calendar with your Google Calendar.

And the Contacts?

I don’t really know what to do about your Exchange contacts. My recommendation is not to use them, instead using Google Contacts for example. If there is a good way to sync the Exchange contacts with Google Contacts, it would like to know it.

]]> 9
Requirements for Ultimate Photo Management Tool Fri, 04 Jun 2010 12:20:15 +0000 What is the requirements for the ultimate photo management tool? I have tried Digikam, Flickr, Picassa, FSpot and lots of other tools. Some are better than others, but none are the ultimate tool.

So far Digikam comes closest (and I already have 10000+ photos there, so it is hard to change), but I find my self lacking important features. One of the features I use extensively is tagging. And the tagging system in Digikam is more or less my biggest problem with the program…

This post will be updated with new requirements as a I think of them.


The first step in finding the ultimate solution, must be to formulate my requirements. Requirements are not the same as wishes. These list only contain functionality that must be present. There might be other stuff that are practical, like Flickr integration, but it is not really a requirement.

System features

  • Windows and Linux compatible
  • Central image repository – images should be stored centrally, so I can get access to them on all my computers. Not necessarily from the Internet, but at least when I’m home. I don’t want to move images around on USB disks or similar.
  • Repository version control – When I edit an image, I want to keep the original. So when I do color correction, I want to see the edited image in my gallery, and know that I still have the original.
  • Store copies locally on machines – I want to be able to transfer images to my local machine, so I can bring my laptop and show those images to offline friends and family.
  • Synchronize changes back in repository – If I work on those images, I want the changes to go back into the repository. If somebody else changed the image in the repository, I want those changes transferred to my local copy.

Image meta-data

  • Tagging – Add tags to images with information. Tags are typed as free text, not selected from a list. Previous tags are suggested.
  • Geo-information – Store coordinates of where the image was taken (or just some other coordinates).
  • Descriptions – Text describing the image.
  • Rating – I want to assign ratings to images. Images must be shown specifically as non-rated, until I assign them a rating from 0-?

Image sorting / viewing

  • Categories – Images can be assigned one or more categories. Like vacation, diving etc. This is more or less specialized tagging.
  • Albums – Albums can shown group as albums.
  • Sub-albums – Albums can have sub-albums.
  • Filters – Views can be filtered by tags, date, album, category and rating.
]]> 0
Using Evolution Mail Client With Exchange At University of Southern Denmark (SDU) Wed, 28 Apr 2010 08:56:26 +0000 It is possible to connect to and use the Exchange hosted mail and calendar at University of Southern Denmark (SDU) with the Evolution mail client under Ubuntu.

You will need the Evolution client and the Evolution MAPI plugin, as well as a VPN connection to SDU’s network if your computer is not on the local network. I have described my VPN connection setup here (in Danish, ask for translation).

Evolution is installed by default in all Ubuntu versions, and probably on any system that uses Gnome. Since 12/2009 SDU is using Exchange 5.5 which is not supported in Evolution. Instead you will have to rely on the Evolution MAPI plugin. In Ubuntu this can be installed with the following command:
sudo aptitude install evolution-mapi

After installing start Evolution and add a new account. Select the Exchange MAPI type and fill in the appropriate fields. You will need the host name of the mailbox server, which can be found by logging in to your webmail account. When logged in to the webmail system, follow the settings link, and select the about menu option. In my case the information is listed under the entry mailbox server name. Put the server name in the Server field. The username is your normal domain username, and the domain is your normal logon domain e.g. TEK, SDU etc.

That is it…

]]> 3
Blanketter og digtial selvbetjening Mon, 01 Mar 2010 12:18:24 +0000 Jeg er normalt en begejstret bruger af det digitale selvbetjeningssystem i Danmark. Jeg har på fornemmelsen at det ikke altid sparer mig for en masse tid når det kommer til at udfylde oplysninger i diverse formularer, tværtimod nærmest, da man ofte skal scanne og vedlægge diverse bilag, i stedet for bare at sende en fotokopi.

PÃ¥ den anden side, sÃ¥ bliver man jo heldigvis forskÃ¥net for at lede efter en postkasse til ens breve (tror ikke engang jeg ved hvor der er en postkasse i nærheden), og bruge halve eller hele timer pÃ¥ at lede efter frimærker i alle mulige skuffer og kasser. For slet ikke at tale om hvis man skulle risikere at skulle indfinde sig ved borgerservice… sidst jeg var der, var da jeg brevstemte til valget. Det gik heldigvis ret hurtigt, da de havde Ã¥bnet en kasse kun til valg, men bare det at se pÃ¥ de lange trøstesløse køer tog næsten livsmodet fra mig.

I dag skulle jeg sÃ¥ udfylde en blanket om ægteskabserklæring. Den er selvfølgelig tilgængelig elektronisk pÃ¥ kommunens hjemmeside. Lækkert nok. Vil jeg udfylde den automatisk og vil jeg sende den elektronisk? Ja og ja! Det kræver bare digital signatur…. ikke noget problem. Bortset fra at min signatur Ã¥benbart netop var udløbet. Ikke kommunens skyld, og fornyelsen gik da ogsÃ¥ fint. Jeg har ikke den store fidus til den nye model med Dan-ID, men pyt nu med det, nu skal jeg bare bruge en signatur.

NÃ¥r man vil indsende blanketten elektronisk skal man ogsÃ¥ lige fortælle kommunen sin emailadresse. Er det ikke indholdt i den digitale signatur? To gange, bare sÃ¥ man ikke skriver forkert. Hver gang et felt er udfyldt dukker smÃ¥ røde bogstaver op og fortæller at emailadressen er ugyldig… man skal bruge formen xxx@yyyyyyyy.zzz. Ja… det er ogsÃ¥ det jeg gjorde, og man kan bare trykke OK, felterne er Ã¥benbart godt nok udfyldt, nÃ¥r siden skal evalueres.

Forfra igen… Vil jeg udfylde den automatisk og vil jeg sende den elektronisk? Ja og ja! Efter lang tids download og indlæsning dukker blanketten endelig op i Acroread. Med alle mine oplysninger udfyldt i “kvindefelterne”! Not so great. Kan man flytte oplysninger til “herrefelterne”? Næh!

Forfra igen igen… Vil jeg udfylde den automatisk og vil jeg sende den elektronisk? Nej og ja! Efter lang tids download og indlæsning dukker blanketten endelig op i Acroread. “SSL Error!!! Please install the CA Certificate(s) for SSL communication”. SÃ¥ nice! Tre udrÃ¥bstegn… en sikker indikator af sindsyge! “Der kunne ikke etableres forbindelse til serveren”. Skod… sÃ¥ mÃ¥ jeg jo printe den Ã¥ndsvage blanket!

Heldigvis kan man stadig udfylde elektronisk, så det er bare i gang, og så printe. Eller dvs. man kan udfylde den første person elektronisk. Den anden halvdel er åbenbart til manuel udfyldelse. Nu bliver jeg snart gal, men jeg overlever jo nok at denne ene blanket ikke virker. Udskriv, og så begynder jagten efter frimærker og konvelutter.

Nu mangler jeg bare lige at udfylde blanketten omkring navneændring… jeg har en dÃ¥rlig fornemmelse.

Blanketten er i HTML, direkte pÃ¥ hjemmesiden. Smart, ikke noget med at være afhængig af det Ã¥ndsvage Acrobat. Hvis sÃ¥ bare blanketten var lidt smart ogsÃ¥… men man skal udfylde bÃ¥de fødesogn, nuværende sogn, og stedet man skal giftes. Med adresse. Hvorfor skal jeg først skrive kommunen hvor jeg skal giftes, og sÃ¥ finde kommunes adresse? Hvad er der nu galt med en liste over alle kommuner i DK, og sÃ¥ vælger jeg bare en fra en drop-down liste? Det samme for sogn. Hvorfra skulle jeg vide mit sogns adresse? Jeg er ikke engang medlem i den store forening, sÃ¥ hvorfra skulle jeg overhovedet indblande i hvilket sogn jeg bor? Hvad med at have en liste? SÃ¥ kan jeg lige overkomme at vælge det rigtige fra en drop-down liste.

NÃ¥, men færdig med at udfylde den blanket ogsÃ¥. SÃ¥ skal den udskrives… hvilket vil sige man fÃ¥r den i PDF format. Suk! Uden de oplysninger om navn, CPR og fødesogn som man lige har udfyldt. Hvad fanden er nu det!?! Nyt forsøg giver samme resultat. Det er sgu for meget.

Nu har jeg haft nok kontakt med det offentlige i dag. Nu skal jeg bruge resten af eftermiddagen på at finde frimærker, konvolutter og en postkasse. Og så har det bare at fungere, de skal ikke ringe til mig eller noget. Så meget for selvbetjening.

]]> 2
Wolfram|Alpha Blog : Step-by-Step Math Thu, 03 Dec 2009 08:30:07 +0000 Wolfram|Alpha Blog : Step-by-Step Math.

Wolframs Alpha search engine (don’t know if you really can call it a search engine any more) can now do all the stuff that you need for passing high level algebra courses at high school level, and probably also basic university courses. Now we just need a practical way of integrating this directly into the brains of mathematical students…

wolfram|alpha solve and show steps

]]> 0