Latest Entries »

Oh my… it is March and I am writing the first post of the year on this blog… I suppose I am not blogging here as much as I used to. And the reasons for that… my blogging has been decling for over the past 5 years I suppose…

Anyhow, this year, last month, I’ve been on vacation to the states. Last year I’ve gotten my master’s degree… and now… now I have been coding a bit… my little project, the OAuth plugin for WordPress… And there is a little bug that keeps me puzzled. I have an SQL query, and I have the WordPress database class. The WordPress Database class, it creates the query just fine (sort of prepared statements). I can print the query, and when I copy-paste it to mysql, it shows the results. However, when I ask the WordPress Database class for the results, it fails, no error message, nothing, just an empty Array is the result.

Anyone got any ideas what the fuck is going on? http://stackoverflow.com/questions/28797286/query-does-not-return-results-in-wordpress-but-running-manually-does

The end of the year is near. It’s time to look back in 2014. Looking back every year, a tradition I started in 2005. Now 2014 is coming to an end, what has happened this year?

One of the things that 2014 has brought is Beginhoven, my urban farming association, has obtained a lot from the municipality. So, in 2014, we have taken our first steps in actually growing some vegetables. The lot needs some work before it can produce food, and wild rabbits are eating our plants. However, we had some harvest nevertheless. We’re working on a toad pool and a storage hut. Beginhoven, urban farming, it’s an awesome project, but what I think is the most important thing about the project is the people, my friends, working together to archive a common goal. I am blessed to have friends like this. Something I have realised the past year on more then one occasion. Thank you everyone <3.

Apart from Beginhoven, 2014 has also meant the end of me being a student. A few weeks ago I’ve received my master’s degree. Working on my thesis project, well, scientific writing is tough, that I can tell you. Writing the code to do what they want, well, that’s rather straight forwards, but writing a thesis report about it, a whole different story.

In 2014 I’ve also met some amazing new friends, both in real life and online, inspiring people, beautiful souls. Ah… got to love festival season, right ;)

So… now I have arrived at the end of 2014, and at the end of a phase in my life. I am no longer a student. So…. I have arrived at a crossroad. Where to go from here? What road to take? What will the future bring? The future, a story yet untold. Where will I be next year? At this point, there is no way of telling. I welcome the unknown.

Happy 2015,
Love ya all <3

So, I was trying to compile an ancient Delphi 7 project in Lazarus. After running the import Delphi project wizard, and attempting to compile. After removing some Windows specific code (Windows version detection in OSinfo.pas has no meaning when compiling for Linux) ran into an error saying

Can't find unit exeinfo used by lnfodwrf

This error seems to be caused by the presence of a unit in my Delphi 7 project having a name clash with a Lazarus RTL unit, strings.pas. After renaming the unit, the problem went away. Now there is some other problem about a missing using TTcpClient. Oh well….

So, it’s Christmas Eve… time to write my Christmas Blog Post.So, tomorrow it’s Christmas, and what is it all about…

Christmas… a commercial event, tons of presents, a Christmas dinner big enough to feast for a week, is that what Christmas is really about?

Christmas is supposed to be about peace. Peace can only be archived by forgiveness. Forgive others who did you
wrong. Forgive the people who have hurt you. Sometimes they don’t even realise they’re hurting you, simply
because they experience the world differently, because they just can’t understand how you think and feel.
And sometimes, people have been hurt so badly they can’t act differently. So forgive them.

Forgive yourself for all the stupid things you did. Forgive yourself for the times you’ve hurt others. Forgiveness is the key to peace. It’s the only way.

My wishes for Christmas is that everyone can be happy, really, that’s all I wish for, all of you to be happy.

Merry Christmas,
Vrolijk Kerstfeest,
Frohe Weihnachten
God Jul!

So, I am working on this project. It’s written in Java and it consists on several web services (tomcat servlets) interacting. For the client part I am using Jersey. I have been writing a couple of servlets, and they’ve been interacting just fine, until yesterday, I ran into a problem.

The code to make a POST requests consist of the following form:

String myURL="http://localhost:8080/SomeService/someFunction";
UriBuilder uriBuilder = UriBuilder.fromUri(myURL);
FormDataMultiPart form = new FormDataMultiPart();

form.field("Field1", Field1);
form.field("Field2", Field2);

URI location = uriBuilder.build();
WebResource webResource = Client.create().resource(location);
String response= webResource.type(MediaType.MULTIPART_FORM_DATA)
.post(String.class,form);

Code written this form has been working fine until yesterday. Until this happened


SEVERE: Servlet.service() for servlet [SomeServlet] in context with path [/someFunction] threw exception
com.sun.jersey.api.client.ClientHandlerException: javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Missing body part entity of type 'text/plain'

raised by webResource.type(MediaType.MULTIPART_FORM_DATA).post(String.class,form);/

Google wasn’t very helpful solving this issue. The problem: one of the fields had a null value. So basically, this is a NullPointerException. If it said so, I knew what to look for, but… looking at this message, I hadn’t a clue what to look for. I was more-or-less expecting this meant the servlet being called returned nothing. But, after some debugging, including sniffing packets using WireShark, I had to make the conclusion no request was attempted. From there, I started thinking back about my changes. I realised on the the last steps I made was adding more fields to the request. So, I uncommented the fields I’ve added, and it made the (incomplete) request just fine. From there, I realised the issue must be with the newly added fields. That’s how I found out what the problem really was about.

Hello peoples,

Now that I am graduated, as mentioned in previous post, I am working on a project for my university. Well… today I also started working on one of my own projects again, the WordPress OAuth plugin. I am extending the plugin with features like sorting of buttons, and separating the OAuth code from the general code, to prepare support for other authentication schemes such as OpenID and Persona.

Once the separation code has been completes, it should result into two separate plugins BlaatSchaap Auth for the general code and BlaatSchaap OAuth for the OAuth specific code. This also introduces a problem. When current users upgrade to the next version, BlaatSchaap OAuth is upgraded, but then requires the BlaatSchaap Auth plugin. How to I install the BlaatSchaap Auth plugin automatically during the BlaatSchaap OAuth plugin upgrade. I have been googling about this issue, but without result. Is there an official way to do things like this or should I just hack some code together to do this trick?

Anyhow, tomorrow I’m having another party. Yeah, I am celebrating my birthday more then once this year. Party time! lol.

I have recently finished my master thesis project. Now I have been asked to integrate my project with another project my university is running. This project is a distributed Java project. Components of the project are implemented as Java Servlets, which run on a Tomcat server. The communication between the various components is implemented using the Jersey library.

So, the idea is that I implement the various components from my projects as Java Servlets, capable of running on a Tomcat server, using the Jersey library. In order to develop for this target, some set-up is required. First of all, as an IDE, not the regular version of Eclipse, but Eclipse for Java EE developers is required.

Once we have that edition up and running, we can create the set-up required for tomcat. Eclipse can download and install an installation of tomcat in a specified directory. I usually don’t like to install software outside the package manager, but since Eclipse will write configuration files, simply pointing to the system installation of Tomcat is not going to work.

So, let’s have a look at this Tomcat. Start Eclipse in a new workspace, and click the “Workbench” arrow in the top right.

1

Then, click windows -> show view -> servers. Now, a message appears at the bottom saying to servers have been configured. Click the message to configure a server.

2

3

Select Server type “Tomcat v 7.0” (listed under Apache). Please note that I am using Tomcat version 7 as this is the version used by my university. I suppose new projects should use version 8 instead.

4

In the next window, click Download and install, select a directory in your home directory, and wait until the

Finish

button is no longer gray. At the main window, right bottom, a progress indicator will be visible

5

Now, we follow this tutorial, section 6.1 and 6.2. For the jersey library, I’ll use the Jersey 1.18 zip bundle from the jersey website. I am using version 1.18 as this is used by my university. New projects should probably use an 2.x version. The JAR bundle should work as well but does not include all libraries. When using the bundle, the asm library should be downloaded separately.

Now, take a look at section 6.3. This example is written for the glassfish server, however, we are using the tomcat server. Replace org.glassfish.jersey.servlet.ServletContainer by com.sun.jersey.spi.container.servlet.ServletContainer.

Now, when we attempt to start the server, a configuration error message will appear.

7--

8

I am not quite sure what causes it, but when we delete the server and add it again, it will work. Now we’ve got a working Jersey Hello World running within Eclipse JEE.

Raspberry Pi and SD card file system corruption. I have been experiencing these issues and I can’t really pinpoint the source of the trouble. I decided to take one of my Raspberry Pi’s, install Raspbian on it, and then ISPConfig, to have a test server, with a similar configuration then the server hosting this blog, –production server– as you may. — anyhow — during the installation of some packages, the file system already got corrupted — therefore this was a never finished project.

At this point, I started to suspect the specific Pi. (I have two Model B revision 1 Pi’s) But, I cannot be sure. I have run the “Overclock stability test” script on both my Pi’s, on two different SD cards. Note: I am not overclocking, but it is a stability test, that reads and writes from the SD card. Everything seemed stable. (Also when I *did* overclock a bit)

One thing to notice about this test, it performs a series of sequential reads and writes. Perhaps that’s the difference. File system corruption occurs when writing to files. Keep in mind that SD cards are actually microcontrollers, and their programming might contain some FAT specific optimisations which cause corruption when running another file system. Keeping this in mind — the random writes method I have been suggesting earlier might not trigger the error. However… I am just speculating. In the end — it could be the power supply problem some people have been suggesting.

Anyway, enough about Pi’s, now it’s time for my ODROID U3 to do something: replacing my Raspberry Pi as NFS server. The Raspberry Pi has bad performance as an NFS server anyways. Therefore, in the past, I was about to replace it with my CubieBoard. Initial tests were promising, throughput was, –as far as I can recall– double the Pi’s. I went to sleep, to discover the next day, the CubieBoard was down. I assumed it crashed for some reason, and powercycled it. It didn’t come back up. No…. since that moment, I haven’t been able to get it to do anything. No boot from NAND or µSD card, nothing on the serial interface: it’s dead.

So… now it’s about time to replace my 8530w laptop — temporary playing server — with a more permanent solution: my UDROID-U3. I am not going to discuss the entire configuration. I have discussed configuring NFS servers before. However, there are a few things I would like to discuss. I problem I have encountered before: using new nfs-utils versions with older linux kernels. The kernel for the UDROID is 3.8.13.23-3-ARCH, which is rather old.

The problem is, when starting the nfs daemon, it requests the versions on NFS to use from the kernel. Starting at nfs-utils 1.2.9, it will include 4.1 in this request. Older kernels will not recognise this and generate an error. On my Pi, I reverted to nfs-utils 1.2.8, but now, I have a more permanent solution.

The problem:

[root@odroid andre]# systemctl status nfsd
● nfsd.service - NFS Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/nfsd.service; enabled)
   Active: failed (Result: exit-code) since Fri 1999-12-31 18:00:31 MST; 14 years 5 months ago
     Docs: man:rpc.nfsd(8)
  Process: 294 ExecStopPost=/usr/bin/exportfs -a -u (code=exited, status=0/SUCCESS)
  Process: 291 ExecStop=/usr/bin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 260 ExecStartPost=/usr/bin/exportfs -a (code=exited, status=1/FAILURE)
  Process: 233 ExecStart=/usr/bin/rpc.nfsd $NFSD_OPTS $NFSD_COUNT (code=exited, status=0/SUCCESS)
 Main PID: 233 (code=exited, status=0/SUCCESS)

Dec 31 18:00:31 odroid rpc.nfsd[233]: rpc.nfsd: Setting version failed: errno 22 (Invalid argument)
Dec 31 18:00:31 odroid exportfs[260]: exportfs: Failed to stat /srv/nfs4/grassroot: No such file or directory
Dec 31 18:00:31 odroid systemd[1]: nfsd.service: control process exited, code=exited status=1
Dec 31 18:00:31 odroid systemd[1]: Failed to start NFS Server Daemon.
Dec 31 18:00:31 odroid systemd[1]: Unit nfsd.service entered failed state.


Note to audience: I have no battery connected to the RTC, so “Dec 31 18:00:31” is a faulty date before it contacted an NTP server.
Note to self: image has an American default timezone: fix it! timedatectl set-timezone CET

The solution:
The configuration file for the nfs server is /etc/conf.d/nfs-server.conf. When you open time file, you see nothing that would suggest setting a version. No, the file only specifies command line options to nfs daemon. Putting NFSD_OPTS="-V 4" does the trick. You can specify multiple versions by comma separating them, for example NFSD_OPTS="-V 2,3,4", which would enable NFS version 2, 3 and 4.

Wishing everyone a happy midsummer!

From my previous post, you’re been able to read I am trying to cross compile and set up an AVR32 system. I have been trying some things and learning about cross compiling. I realise, last post was written from my notes, and may appear a little messy. I have make some progress, and learned how to do things, and realise I should have dome some things differently then my first attempt.

I have decided to create two kinds of posts for this topic. First will be a how-to guide. Just step-by-step guide to re-create the cross-compiler, the grasshopper root-fs, and possibly what I might create in my next steps. I am trying to set up a distcc based cross compile system, using ArchLinux’ pacman package manager and its package build utility makepkg, which has native distcc support. But it is still a long road before that works.

Apart from that, I will create a separate post with pitfalls. During this project I have come across certain error messages, which, of course, I have asked Google. Therefore I think it’s important to post those errors so it can be found.