Eric D. Schabell

Saturday, May 19, 2007

Java on Guice - Dependency Injection (video)

A bit long (53 minutes) and informally presented, but still rather interesting video on testing. Some background on Guice for those not aware of it:

"Google Guice is an open source Dependency Injection framework from Google. Guice is based on annotations and generics unlike Spring which depends on XML of Java for wiring dependencies. Guice injects constructors, fields and methods (any methods with any number of arguments, not just setters). Guice provides support for custom scopes, static member injection, Spring as well as Struts 2.x integration and AOP Alliance method interception. Guice is available at Google Code. You can find the User guide and Javadocs from there."



Follow-up: Linux courses available online free!

This week I was Dugg on a page I have had on my site for some time now, an amazing experience to watch.

I put a new plug-in for Digg and Delicious on my site and was testing it by using my Linux courses available online free page. Well, this took off like a rocket and the web-server was straining very hard just to keep up (and failing to do so more often than not)… I was able to recover from the problems by turning on the site caching plug-in but it was still a very busy day.

The hit counter took off on the first day far above my normal average of around 200-250 visitors and peaked at 964 hits. Day two was the high point, 7314 hits! Day three saw a drop to 844 and day four (weekdays all of them) was back down to 292 hits. Today is Saturday and it is afternoon my time with the counter up to 1536 hits and counting.

The Digg.com site has a feature that ranks the top 10 most popular Dugg articles in the first 12 hours of their lives (from the point that they hit the status of ‘popular’). My courses hit the #3 spot before time ran out:


Ranked #3 on Digg.com

I have kept an eye on the comments as the material in the courses that was posted is a bit old. I teach these every so often and it has been some time since the last course was taught. I only update the material when on a paid assignment (so if hired I customize and update to the clients wishes). This was noted by a few people in the comments.

Other than that, was nice to see that there is apparently a big need of on-line free courses for Linux. Maybe a good idea to start an Open Source Project that provides this? Would there be enough interest in maintaining a set of courses on-line?

I wonder… ;-)

Tuesday, May 15, 2007

Wanna peek at United States Marines Boot Camp?

Friday, May 11, 2007

Gimp and 3D DVD box covers plugin

The blog, as days pass by as a nice plugin for Gimp to allow you to change any image you want into a ready to print 3D DVD box cover. You can download his plugin, dvdcoverdisplayer.py, "...and store it in the .gimp2.2/plug-ins/ directory in your home directory, and then make it executable. Then, get yourself a DVD cover image from somewhere, open it in the Gimp, and click Python-Fu ==> DVD Cover to get the pretty 3D version."

He would be happy to hear any comments you have over on his site. ;-)

Thursday, May 10, 2007

Ubuntu consoles missing (no F1-F6 consoles)?

This has been bothering me for some time, but not enough to sort out the problem. Today I got tired of looking at the pretty startup splash screen and wanted to have my console logins back so traced the problem to /etc/event.d/tty{1-6} files. The example file below shows a clear error in the last two lines (from the tty2 file, but same in all 6 files):

# tty2 - getty
#
# This service maintains a getty on tty2 from the point the system is
# started until it is shut down again.

start on runlevel 2
start on runlevel 3

stop on runlevel 0
stop on runlevel 1
stop on runlevel 4
stop on runlevel 5
stop on runlevel 6

respawn                                             <<< ERROR!
/sbin/getty 38400 tty2exec /sbin/getty 38400 tty2   <<< ERROR!
The last two lines are reversed for one and the last line itself is a mesh of two commands, just need to clean them up to look like this:
...
exec /sbin/getty 38400 tty2
respawn

Do this for all tty# files and you will have your consoles back under CTRL+ALT+{1-6}. ;-)

Tuesday, May 8, 2007

The Queen of the Netherlands opens Huygens building at Radboud University Nijmegen

A royal visit and a wave to us on the balcony as Queen Betrix stopped by today to open our new Huygens building. It was very exciting to see her in person after living her for over 15 years now. I have taken some pictures with my mobile so the quality is a bit less than normal, enjoy them here:







Queen opens Huygens building

There are some professional pictures in this slideshow and a very nice video report of the Queen’s visit.

Leaving the Radboud University Nijmegen

I have decided that after 3 years of working as the IRIS Scientific Programmer and more than 2 years previously as the PRONIR research project Scientific Programmer, it is time for a change. I submitted my resignation last week and signed my new contract today.

I have accepted a new job in the Java development team at the SNS Bank, in s-Hertogenbosch. This group has made a very nice impression on me and I like the atmosphere there. I will start at the end of the summer after finishing up a few things at the university.

This is the first time in my life that I leave a job due to no career advancement possibilities and not because I was unhappy (or the company went under). Very strange feeling but the winds of change are blowing and I am ready for a new challenge! ;-)

Monday, May 7, 2007

Trac setup mirror of SVN repo with SVK (includes sync)

I needed to get a mirror of my project repo (AbTLinux) on a machine hosting our Trac project software. Not much clear information on the web so here is what I finally did to get this working (assuming you have followed the previous posts to setup apache and subversion and setup trac.
#  login as root and create local svk depot.
#
$ svk mkdir //mirrors

# link the local mirror to our abtlinux repo.
#
$ svk mirror https://abtlinux.svn.sourceforge.net/svnroot/abtlinux //mirrors/abtlinux

# sync initial content over to local mirror. Just add this
# to a cronjob and you will have automated syncing to
# keep the mirror updated.
#
$ svk sync -a

# now we need to move the local repo out of our ~/.svk/local location and into 
# our svn web based location.
#
$ mv ~/.svk/local /var/svnroot/mirrors

# change the svk depotmap to point to new location.
#
$ svk depotmap

# change the file that opens to point to your svn location, mine
# looks like this:
#
---
'': /var/svnroot/mirrors
===edit the above depot map===

Finally we point our /var/lib/trac/abtlinux/conf/trac.ini at the local svn mirrror site and resync your trac with:
# my resync looks like this:
#
$ sudo trac-admin /var/lib/trac/abtlinux resync

Ubuntu Trac project management software setup

This is a bit of a howto for setup of Trac, with AbTLinux being the example target project that will make use of it. You can also follow the generic setup as described on the Trac site.

# first we need to install the packages.
#
$ sudo aptitude install trac libapache2-svn      \
libapache2-mod-python libapache2-mod-python-doc

Next we need to setup the Trac environment.
$ sudo makdir -p /var/lib/trac
$ sudo chown www-data.www-data /var/lib/trac

Now we need to setup an apache configuration with a new trac site, so add the following as /etc/apache2/sites-available/trac:


ServerAdmin [email protected]
ServerName trac.abtlinux.org
DocumentRoot /usr/share/trac/htdocs
ErrorLog /home/erics/logs/abtlinux-error_log
CustomLog /home/erics/logs/abtlinux-access_log combined
#Alias /trac-static /usr/share/trac/htdocs


SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/lib/trac/abtlinux
PythonOption TracUriRoot /



AuthType Basic
AuthName "AbTLinux Trac Server"
AuthUserFile /var/lib/trac/abtlinux/.htusers
Require valid-user

           

Now I am going to enable the new trac site (this will be pointed to with an A record as trac.abtlinux.org):
$ sudo a2ensite trac
$ sudo  /etc/init.d/apache2 force-reload 

This is a good point to go and setup Ubuntu Apache and Subversion setup with DAV support (includes SVN migration), this will get your subversion with authentication running.

With a working installation of our project, we can finish the Trac installation which will make use of our subversion setup.

$ sudo mkdir -p /var/lib/trac
$ sudo trac-admin /var/lib/trac/abtlinux initenv
$ sudo chown -R www-data /var/lib/trac/abtlinux

After all this, I opened the trac url (in my case, http://trac.abtlinux.org) and see nothing but error messages over neo_cgi.so:
Traceback (most recent call last):
File "/var/lib/python-support/python2.5/trac/web/main.py", line 387, 
in dispatch_request dispatcher.dispatch(req)
File "/var/lib/python-support/python2.5/trac/web/main.py", line 206, 
in dispatch req.hdf = 
HDFWrapper(loadpaths=chrome.get_all_templates_dirs())
File "/var/lib/python-support/python2.5/trac/web/clearsilver.py", 
line 135, in __init__ raise TracError, 
"ClearSilver not installed (%s)" % e
TracError: ClearSilver not installed 
(/usr/lib/python2.5/site-packages/neo_cgi.so: undefined symbol: 
Py_InitModule4)

Some research showed that this was a Feisty problem and upgrading to ClearSilver 0.10.4 solved the problem, so download this from http://www.clearsilver.net. Before building edit the configure.in file:

#  add 2.5 to variable python_versions.
#
python_versions="2.5 2.4 2.3 2.2 2.1 2.0 1.5 24 23 22 21 20 15"

Now we need to build and install correctly.

# just build normally.
#
$ sudo ./configure
$sudo make
$sudo make install

# then link the neo_cgi.so to the python2.5
#
$ cd /usr/lib/python2.5/site-packages
$ sudo ln -s /usr/local/lib/python2.5/site-packages/neo_cgi.so

Open the Trac url (http://trac.abtlinux.org in my case) and bingo! ;-)

As a side note, if you want to migrate Trac database data from one machine to another (as I want to here above), you need only to replace the /var/lib/trac/abtlinux/db/trac.db file with your original setup (ensure of course that your /var/lib/trac/abtlinux/conf/trac.ini file is adjusted from the defaults as needed) and resync your Trac setup as follows:

$ sudo trac-admin /var/lib/trac/abtlinux resync
$ sudo /etc/init.d/apache2 reload

Ubuntu screen backspace problem fix

Are you trying to use screen for some application and you have strange backspace behaviour? Mine was doing nothing when I hit the backspace except give me the famous Wuff --- Wuff ! To fix this you need to add something to either your /etc/bash.bashrc (global fix) or ~/.bashrc (local fix) like this:

alias screen='TERM=screen screen'

Sunday, May 6, 2007

Cycling in the Veluwe today!

Today I rode with a friend of mine who lives in Arnhem. He took me around the various hills and villages in the area plus we stopped by his new house in Ede. In totoal it was 60 km’s and I was pretty pooped at the end. We had quite a bit of wind on top of the hills so I was ready for some couch time when I got home. ;-)

Friday, May 4, 2007

Ubuntu Apache and Subversion setup with DAV support (includes SVN migration)

Today I spent some time migrating data from one subversion repository to another. The first thing I needed to do was to setup my Ubuntu machine (Feisty x86_64) with a new Subversion with DAV installation. I already had Apache2 installed so it was just a matter of getting the Subversion installed and configured as follows:

# first install subversion and apache libs.
#
$ sudo aptitude install subversion libapache2-svn

# next we need a repository, I like to store all my
# subversion repositories under /var/svnroot.
#
$ sudo mkdir -p /var/svnroot/projects
$ sudo chown www-data:www-data -R /var/svnroot
$ sudo chmod 770 -R /var/svnroot
$ sudo svnadmin create /var/svnroot/projects

Next we need to configure apache, so edit the file /etc/apache2/mods-available/dav_svn.conf, here are some of the basic things you need to set.

...
# Uncomment this to enable the repository
DAV svn
---
# no anonymous access.
Satisfy Any
Require valid-user
---
# path to repo's.
SVNParentPath /var/svnroot
.....
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
...

Now we need to setup a user with htpasswd and restart apache.

# provide a password when asked.
#
$ htpasswd -c /etc/apache2/dav_svn.passwd tester

# restart apache and after creating a new repository.
#
$ sudo /etc/init.d/apache2 reload

To setup a project, I just dumped and loaded from an existing project as follows.

# at existing project site we dump the repository (called 'projects').
#
$ sudo svnadmin dump /var/svnroot/projects > projects.dump

# move that to your newly setup subversion location and load.
#
$ scp remotehost:/path-to-dump/projects.dump .
$ sudo svnadmin load /var/svnroot/projects < projects.dump

# open url: http://hostname/svnroot/projects
# and supply user 'tester' and your password  should 
# allow you to browse the repo.

All comments are welcome, please post if you have any questions!

Thursday, May 3, 2007

Vim for your Macbook

As a long time Linux user and open source developer, this is one of the things that makes my Macbook feel like home. It is a ‘must have’ and you can find all you need to know at the Vim Mac OS X site.

It is also easy enough to install via the 'ports' if you have that installed:
# This will currently give you Vim v7.0.224.
#
$ sudo port install vim
Note that you need to be careful and ensure that you are using the ports version in /opt/local/bin/vim and not the Mac version I found in /usr/bin/vim (v6.2). I altered my PATH variable to point to first the /opt/local/bin before searching /usr/bin to solve this.