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 πŸ™‚

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 is NOT UTF-8.
  • Set encoding for PHP-MySQL connection: Here is an example:
    $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    mysql_set_charset('utf8',$conn);

    Link to php.net reference.

    If you use the (much better) PDO db access layer, then you can just add an argument to the connection call:
    $conn = new PDO('mysql:host=' . $hostname . ';dbname=' . $dbname, $username, $password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));

  • Make sure that the MySQL database and tables are UTF-8 encoded: Use the following SQL-commands:
    ALTER DATABASE db_name
    CHARACTER SET utf8
    DEFAULT CHARACTER SET utf8
    COLLATE utf8_general_ci
    DEFAULT COLLATE utf8_general_ci;

    ALTER TABLE tbl_name
    DEFAULT CHARACTER SET utf8
    COLLATE utf8_general_ci;

  • (x)HTML meta header character encoding: add this in the head section of the HTML code:
    <meta http-equiv="Content-type" value="text/html; charset=UTF-8" />

If you have got a question or more tips then please post it below, then I will update my post πŸ™‚

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 πŸ™‚

False Science: The Comparative Anatomy of Eating by M.D. Milton R. Mills

I am not an expert on the topics “diets”, “anatomy” and “evolution” – but still I know how real science works and hence I can discard false science such as the article “The Comparative Anatomy of Eating” by M.D. Milton R. Mills. Creationists (Intelligent Design) have also created many such articles that claims to be scientific research – but real scientists can easily spot that they are wrong. There is no scientific evidence to support the hypothesis “human are herbivores”, so please stop corrupting the real science by spreading false science such as the article by M.D. Milton R. Mills. That is just vegan propaganda:

  1. No recognised scientific institution has published the article into e.g. a scientific journal – i.e. no significant body of experts believes that it is correct.
  2. As the article is not published in a scientific journal, no one has spent time to do a proper scientific peer review on it. In other words: no group of scientists has thoroughly checked whether it’s claims are justified.
  3. There are no references to existing publications and no are experiments conducted – i.e. it is neither based on existing research nor on creating new research. So there is no evidence to prove its claims.

This alone should be enough to stop believing that the article is science.

However, if we really need more dirty details, then a background check on the author reveals that: 1) he is not an expert on the topic and 2) he is biased by being involved with pro-vegetarian organisations.
1) The author is M.D. (from Stanford University link), but that only makes him a doctor, not an expert on this particular topic. I have tried to look for research conducted by him, but neither Google, Google Scholar nor PubMed yielded any relevant results. (Only pubMed actually had an article from him and that was not relevant: PubMed publication) Without having published any relevant research on the topic, M.D. Milton R. Mills is not an expert on the topic – in fact he just works as an outpatient doctor. He is just as much an expert on this topic as an average physics teacher is an expert on Quantum Physics without having published scientific articles on that topic.
2) He is involved in multiple vegetarian propaganda organisations:
Speaking at NY Vegetarian Expo
Advisor for Mid-Hudson Vegetarian Society
Member of Physicians Committee for Responsible Medicine (PCRM), which has strong connections with PETA: PCRM and PETA
Speaking at Healthy Lifestyle Expo 2007 with many comments about animals even though he is just a doctor which deals with human.

The “background check” section was rewritten to reflect feedback from comments, thank you.

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

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

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:Β Unity Dash Privacy at Ubuntu 11.10 Oneiric Ocelot

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. 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/my_secret_folder/*

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