Adding @GrailsCompileStatic to all production grails code (not test grails code)

When coding Groovy, @CompileStatic can help to spot errors and improve performance of production code. Unfortunately, @CompileStatic is optional and hence easy to forget, but thankfully Groovy has documented a way to make @CompileStatic for all production code: http://docs.groovy-lang.org/latest/html/documentation/#_static_compilation_by_default (Test code is not affected, because it is nice with flexibility when testing.) However, with Grails […]

How to start local ActiveMQ (build from source) on Ubuntu when the ActiveMQ package has previously been installed

This is the frustration of the day. I downloaded the ActiveMQ source and compiled it with no issues – however I could not start ActiveMQ (using ./activemq start) and the console output did not really explain what was wrong: ./activemq: 344: ./activemq: “/usr/bin/java” -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//conf/login.config -Dactivemq.classpath=”/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//conf:/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//lib/” -Dactivemq.home=”/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT/” -Dactivemq.base=”/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT/” -Dactivemq.conf=”/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//conf” -Dactivemq.data=”/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//data” -jar “/home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//bin/activemq.jar” : not found […]

Getting wireless to stop disconnecting on HP ProBook 430 G2 on Ubuntu 14.04 (Linux)

The default wireless driver settings for the HP ProBook 430 G2 on Ubuntu Linux 14.04 makes the internet connection drop frequently and the wireless connection first works again when the machine has been rebooted (or the wireless netcard driver has been removed and added again). The solution is to change the driver settings (disable e.g. […]

Add after body hook hack in wordpress (e.g. for Facebook Like button SDK) without modifying header.php

I wish to add the Facebook Like button to my wordpress – this requires that I add the following code right after <body&lt: <div id="fb-root"></div><script>(function(d, s, id) { … }(document, ‘script’, ‘facebook-jssdk’));</script> My solution Make a functions.php file in your child theme and add the following code (or append it to your main functions.php if […]

Installing Quake III Arena for Linux (especially x64 bit)

The original installer for Quake III Arena will not work on my Ubuntu 12.10 x64 – I have tried many solutions with no luck 🙁 However, Quake III Arena is opensource (except data such as music and graphics) now and some nice people have made a great installer (link) where we only need to add […]

Install Tex Live 2011 on Ubuntu 12.04

The default Tex Live package in Ubuntu 12.04 is very outdated (version 2009) which is bad because it does not contain e.g. the paralist package that is great for making compact lists. This is easy to fix, just install the newest Tex Live directly from the source (Tex Live 2011 @ Tex Users Group) – […]

Install HP LaserJet M1132 MFP printer for Ubuntu 12.04

With Ubuntu 12.04, HP LaserJet M1132 MFP Printer/Scanner almost works out of the box – the device is detected correctly but HP-setup must be run to enable printing/scanning. Here is what you gotta do: (if you are looking for a guide on how to use the built-in scanner, then I have also made a guide […]

Scanning with HP LaserJet M1132 MFP for Ubuntu 12.04

I also just recently discovered that Ubuntu 12.04 actually supports scanning with the HP LaserJet M1132 MFP and that it is really easy to use – here is what you do: (if you are looking for a guide on how to actually install the HP LaserJet M1132 MFP device, then I have also made a […]

MySQL/PHP character encoding errors (e.g. æ,ø,å) – import, connection, table encoding and html meta header

Today I’ve got four hints that usually solves the character encoding errors I encounter with MySQL and PHP (usually triggered by the special Danish vowels æ,ø,å): PhpMyAdmin import: use the official import function rather than executing crude sql inserts – because then you can specify the character encoding instead of using the default one which […]

Gnome Nautilus bookmarks/favorites backup (in Ubuntu)

Nautilus (default file manager in Ubuntu) saves bookmarks/favorites in the following file in the home folder: ~/.gtk-bookmarks or home/YOUR_USERNAME/.gtk-bookmarks You might need to make hidden files (those that starts with a .) visible by pressing CTRL+H in Nautilus in order to find the file. Just copy the file to another location to make a backup […]