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

However, when running “./activemq” without any task parameter, then it gave me a hint:
Configuration of this script:
The configuration of this script is read from the following files:
/etc/default/activemq /home/MY_USER/.activemqrc /home/MY_USER/git/activemq/assembly/target/apache-activemq-5.12.1-SNAPSHOT//bin/env
This script searches for the files in the listed order and reads the first available file.

To my surprise, there was actually a file at “/etc/default/activemq” – this was a leftover from a previous ActiveMQ installation (Ubuntu package) – I had forgotten to use the –purge option when I removed the ActiveMQ package:
sudo apt-get remove activeMQ --purge

I ran the remove command again with the purge option and now I can start ActiveMQ with no problems 🙂

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. power save mode) – here is a guide for your convenience and such that I don’t forget how to do it 🙂

This guide is only made for “HP ProBook 430 G2”. It might work for other computers, but the wireless netcard driver probably has a different name and different settings. Please tell me if you get it to work for other models 🙂

1. Find the wireless netcard model – open a terminal using CTRL+ALT+T and write the following command:
ls /sys/class/net/wlan0/device/driver/module/drivers

Mine says “pci:rtl8723be”, where “rtl8723be” is the driver name. If you have a different driver, then you need to replace “rtl8723be” in the rest of this guide with whatever your terminal outputs after the colon (pci:).

Now we need to check the driver settings – this requires the program sysutils that is not installed by default – try to write the following command in the terminal:
sudo apt-get install sysfsutils

Write the following command in the terminal to get the current driver settings (replace “rtl8723be” if you use a different driver):
systool -v -m rtl8723be

In the “Parameters:” section, there should be a number of settings. Look at the value that is written next to the power save settings “fwlps” and “ips” – if it says “Y” or “1” then that is probably the reason why your internet connection gets disrupted.

You can see what the two settings means by writing the following in the terminal (replace “rtl8723be” if you use a different driver):
modinfo rtl8723be

Disable power save by writing the following in a terminal (replace “rtl8723be” if you use a different driver):
echo 'options rtl8723be ips=0' | sudo tee -a /etc/modprobe.d/rtl8723be.conf
echo 'options rtl8723be fwlps=0' | sudo tee -a /etc/modprobe.d/rtl8723be.conf

Remove and add the wireless netcard driver by writing this in a terminal (replace “rtl8723be” if you use a different driver):
sudo rmmod rtl8723be && sudo modprobe rtl8723be

Verify the new settings by once again writing this in a terminal (replace “rtl8723be” if you use a different driver):
systool -v -m rtl8723be

In the “Parameters:” section, “fwlps” and “ips” should now be “N” and your internet connection should stop crashing. Feel free to post a comment 🙂

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 the non-opensource stuff (called pak0.pk3) from the quake 3 arena cd and then we have a fully functional Quake III Arena. This is not a weird Quake III Arena clone – it is the real thing – essentially just with a different installer. Here is what you do…

1. Download the engine and data files installers from link. You should get two files called something like:
ioquake3-1.36-7.1.i386.run and ioquake3-q3a-1.32-9.run
2. Open a terminal (press CTRL+ALT+T on Ubuntu) and navigate to the directory containing the installer files – use the “cd” (change directory) command – e.g. “cd Downloads” in Ubuntu to go to your Downloads folder.
3. Write “chmod +x ioquake3-1.36-7.1.i386.run” and “chmod +x ioquake3-q3a-1.32-9.run” to make it possible to execute the installers.
4. Install the engine by writing “./ioquake3-1.36-7.1.i386.run” and run through the wizard.
5. Copy the “pak0.pk3” file from the Quake III Arena CD to the baseq3 subfolder of the IOQuake3 install directory. On my computer I just copy “/media/<username>/Quake III Arena/Quake3/baseq3/PAK0.PK3” to “/home/<username>/ioquake/baseq3/PAK0.PK3”. You can copy the files using the “cp” command in the terminal or use the File Manager Nautilus on Ubuntu (start it by writing “nautilus&“).
6. Install the game files by writing “./ioquake3-q3a-1.32-9.run” and run through the wizard.
7. Run the game by writing “./ioquake3” from the IOQuake3 install directory – happy fragging 🙂

Please let me know if this guide was helpful or if you have any questions.

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) – it is actually really easy and it does not conflict with the Ubuntu Tex Live 2009 package. Below is a guide on how to install it – I got much inspiration from Quick Install Guide by the Tex Users Group.

Prerequisites
Make sure that you have got Perl installed. (Ubuntu should have this already) You can check it by opening a terminal (shortcut: “CTRL+ALT+T“) and write “man perl” which should open up the Perl Interpreter manual page (which you can quit by pressing “q“) – if there is no manual entry then you should be able to install perl by writing “sudo apt-get install perl“.

Also make sure that you have a stable internet connection and sufficient amount of available space, because you gotta download minimum 3.1 GB of Tex Live program data.

Download and installation
1. Download the installation archieve (Tex User Group Tex Live 2011 Download) and unzip it somewhere in your home folder.

2. Open a terminal (shortcut: “CTRL+ALT+T“) and navigate into the unzipped folder that starts with “install-tl” using the “cd” command.

3. Now we gotta start the installation. The default setting is to install Tex Live at the location “/usr/local/texlive” and that should not be a problem unless you have made a separate system partition (the one that contains the “/usr” folder) that is not big enough to contain minimum 3.1 GB data from Tex Live. – that was the case for me 🙁 (I use separate “/home” and “/” partitions to enable easier clean Ubuntu upgrades.)

3a) If you have plenty of space on the system partition then you can just install by writing “sudo ./install-tl”. (“sudo” has to be used because a normal user does not have permissions to change stuff in the “/usr” folder.

3b) Else you can specify the installation path of Tex Live by using the following command instead (replace “/home/USER_NAME/texlive” by what “/path/to/folder” you want, but remember “sudo” in front if you install outside of the “/home” folder): “TEXLIVE_INSTALL_PREFIX=/home/USER_NAME/texlive ./install-tl

If there are no warnings, then press “I” to start the download and installation. Now the Tex Live installation program will automatically download and install 3.1 GB of data – it will take quite a while.

Important post-installation (setup “PATH” environment variable)
Once the installation is complete, you must setup the “PATH” environment variable so the terminal knows where the Tex Live binary programs are located – e.g. when you run “latex fileName.tex” or “pdflatex fileName.tex” in the terminal then the terminal uses the “PATH” environment variable to find the “latex” and “pdflatex” programs.

Navigate using the “cd” command to the folder where you installed Tex Live. (The default folder is once again: “/usr/local/texlive“) Then continue navigating further down into the “2011/bin/” folders and finally navigate down into a folder with a platform dependent name (it is named “x86_64-linux” at my computer, but e.g. “i386-linux” on a different architectures). If you write the command “ls | grep ^pdflatex“, then it should find the “pdflatex” program and hence you have found the correct folder for the PATH environment variable.

Now write “pwd” to get the current folder path – on my computer that is “/home/USER_NAME/texlive/2011/bin/x86_64-linux“. Copy the path, lets call it “TEX_LIVE_BIN_PATH“.

Finally, you need to modify the “.profile” file (in other distributions than Ubuntu it might be “.bash_profile“) in your home directory by writing “gedit ~/.profile“. Add the following at the end of the file (replace “TEX_LIVE_BIN_PATH” by the path from the “pwd” command) and save: “PATH="TEX_LIVE_BIN_PATH:$PATH"” (The “.profile” file will be run every time you login, which will ensure that the “PATH” environment variable always contains the Tex Live path.)

Close the terminal, logout, login and now Tex Live 2011 should work.

Test
Start a new terminal (shortcut: “CTRL+ALT+T“), now if you write “echo $PATH” then the output will contain your “TEX_LIVE_BIN_PATH“-path, otherwise something went wrong in saving it in the “.profile” file (or “.bash_profile” for other than Ubuntu).

Finally, run this command to check that latex works as intended: “latex small2e” The output should start with something like “This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)“, where the important bit is that the bracket should say (“Tex Live 2011“) and not e.g. (“Tex Live 2009“) – if the latter is the case, then either you have not setup the “PATH” environment variable correct or the Tex Live 2011 installation failed.

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 for that here: LINK)

INSTALLATION:
1. Make sure that the HP LaserJet M1132 MFP is connected to the computer and power is turned on!
2. Open a terminal (pro-tip: press CTRL+ALT+T)
3. Run the following command in the terminal (pro-tip: paste the code into the terminal using CTRL+ALT+V, once you have copied the code from this website):
sudo hp-setup -i
4. Go through the setup process…
5. At some point, the program wants to download a proprietary binary file (hp-plugin) and that can take a couple of minutes to start downloading – be patient, it will start!
6. Once the setup has finished, printing should work without any problems…

Please write a comment if the guide works for you or if something does not work 🙂

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 guide for that here: LINK)

SCANNING GUIDE:
1. Make sure that the HP LaserJet M1132 MFP is connected to the computer and power is turned on!
2. Open a terminal (pro-tip: press CTRL+ALT+T)
3. Run the following command in the terminal (pro-tip: paste the code into the terminal using CTRL+ALT+V, once you have copied the code from this website):
hp-scan
(don’t worry about the following warning: “warning: No destinations specified. Adding ‘file’ destination by default.“, it just means that the resulting scanned JPG file will be saved in your home directory.)
4. Put whatever you want to scan inside the HP LaserJet M1132 MFP scanning area, facing downwards.
5. Then click the physical scan-button on the HP LaserJet M1132 MFP device – you can see the button on the following image:
HP LaserJet M1132 MFP Scan button
6. Now wait while the terminal receives the scanned image – once that is complete then you can find the scan result as an image file (“hpscan001.png”) in your home directory.

Please write a comment if the guide works for you or if something does not work 🙂

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 of it 🙂

Install HP LaserJet M1132 MFP printer drivers at Ubuntu 11.10 Oneiric Ocelot Linux hplib hp-setup hp-plugin

UPDATE: For Ubuntu 12.04 it has become much easier to install the HP LaserJet M1132 MFP – use this guide instead if you have Ubuntu 12.04: LINK.

Start your terminal by pressing: CTRL+ALT+T

SKIP IF YOU ARE NOT 64 BIT USER
1. Setup 64 bit libraries for current user:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/

Make this permanent:
gedit ~/.bashrc

Add these two lines to the end of the file and save it:
LD_LIBRARY_PATH=/usr/lib64/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

Setup t4 bit libraries for root user:
gksudo gedit /etc/ld.so.conf.d/lib64.conf

Add the following line to the file and save it:
/usr/lib64/

Now run this command to load the root libraries:
sudo ldconfig

CONTINUE HERE

Then follow this guide: http://hplipopensource.com/hplip-web/install/install/index.html

if a plugin is missing, then run (requires that your internet connection is working and that the hplib mirror is online):
sudo hp-plugin -g

You probably have to exit the installer to restart at some point, then run “hp-setup” from the terminal when the computer has restarted.

DONE – gotta love Ubuntu – feel free to comment 🙂

Unity Dash Privacy at Ubuntu 11.10 Oneiric Ocelot – hide porn folder

UPDATE: For Ubuntu 12.04 it has become much easier to hide a folder and in general keep things private – just go to “System Settings” and find the “Privacy” button at the “Personal” tab. If you have Ubuntu 12.04 or newer, then I will strongly recommend you to use the built-in Privacy system. However, if you are stuck with Ubuntu less than 12.04, then you can read the following guide:

The Activity Log Manager can exclude certain folders/files from showing up in the Unity Dash on Ubuntu 11.10 Oneiric Ocelot – e.g. your porn folder 🙂

1. Download latest Activity Log Manager from this site (look for the “Downloads” section to the right of the page): https://launchpad.net/activity-log-manager

Here is a direct link for the lazy geeks (but that link will be outdated when a new version of Activity-Log-Manager is released):
http://launchpad.net/activity-log-manager/0.8/0.8.0/+download/activity-log-manager-0.8.0.tar.gz

2. Unzip the activity-log-manager-0.8.0.tar.gz to somewhere convenient – e.g. your homefolder:
/home/YOUR_USERNAME/activityLogJournal

3. Now open a new terminal window by pressing CTRL+ALT+T and navigate to the unzipped folder:
cd /home/YOUR_USERNAME/activityLogJournal

4. Now make activity-log-manager executable:
chmod +x activity-log-manager

5. Run activity-log-manager using the following command:
./activity-log-manager

(If there is some .py error now, then please write a comment to my post including the full error message and then I will try to solve it – It is probably just a missing dependency but make sure that you are using Ubuntu 11.10.)

You should see the following window:
Activity Log Manager used to exclude certain folders/files from Unity Dash on Ubuntu 11.10 Oneiric Ocelot - e.g. your porn folder :)

6. Click the “Files” tab.

8. Click where your username (YOUR_USERNAME) is located (look at where the cursor is located on the previous screenshot).

9. Click “other” and find the folder you want to exclude from the Unity Dash history.

10. Click “Ok” and Click “Add” and from now on that folder will be excluded from the Unity Dash history.

11. DONE. You can also delete any existing Unity Dash history by navigating to the “History” tab (which can be seen on the screenshot above), select the desired timeframe and click “Ok”.

Comments
I covered this topic for ubuntu 11.04 in a previous post (), but as that does not work anymore in Ubuntu 11.10, so I thought that I should publish a new guide 🙂

You could also setup a new repository for activity-log-manager instead of downloading the source, but that seems overkill if you are only going to setup the blacklisting once like me.

Ubuntu 4 ever!!! 🙂 Please feel free to leave me a comment, so I know that my effort is not wasted 🙂

Ubuntu 11.04 Unity Dash Privacy

UPDATE: For Ubuntu 12.04 it has become much easier to hide a folder and in general keep things private – just go to “System Settings” and find the “Privacy” button at the “Personal” tab. If you have Ubuntu 12.04 or newer, then I will strongly recommend you to use the built-in Privacy system. However, if you are stuck with Ubuntu less than 12.04, then you can read the following guide:

GUIDE UPDATED FOR UBUNTU 11.10: http://www.andersaaberg.dk/blog/2011/unity-dash-privacy-at-ubuntu-11-10-oneiric-ocelot-hide-porn-folder/

Ubuntu 11.04 stores history in a component called zeitgeist. This history is also displayed when using the Unity Dashboard, which may show many irrelevant files or private files such as porn or microsoft love letters. Currently, the only way to avoid this is to install the gnome-activity-journal PPA, open it and add entries to its blacklist. Here comes the details:
Install the gnome-activity-journal PPA (the default in the 11.04 repository does NOT work):
sudo add-apt-repository ppa:zeitgeist/ppa
sudo apt-get update && sudo apt-get install zeitgeist gnome-activity-journal

Open gnome-activity-journal PPA -> Open “Preferences” -> go to the “Blacklist” tab and add entries such as:
file:///home/USERNAME/public_html/*
and
file:///home/USERNAME/Downloads/PORNFOLDER/*

Later a much better GUI called zeitgeist-global-privacy should makes this much easier.