Anders Andreasen Blog

Just another WordPress.com weblog

Archive for the ‘Computers’ Category

Install and run GNU/linux Mint 11 from a usb memory stick

with 2 comments

In this post I will briefly go through the steps of creating a Mint 11 installation on a memory stick. Some of the things may be specific for my own setup i.e. hardware, choice of distro etc. However, most of it will be of general applicability I hope. Basically there are three ways to run a linux installation off a usb memory stick/SSD memory card etc.

  1. Make a live usb from an installation medium by using e.g. Universal USB installer  from windows or Start-up disk creator on Ubuntu/Mint. Any changes made during a live session will be lost upon reboot.
  2. Make a live usb, but also enabling persistence. This way it is possible to store files, chages to the profile, add additional packages with apt etc.
  3. Make a “real” installation on the usb stick as if it was just another hard disk.

Although the second point seems to work surprisingly well, due to security reasons I chose a real installation. Actually I started off with method 2 and installed from one usb to another (no cd-rom/dvd drive in my laptop). The first usb was prepared from my windows installation with the universal USB installer. The second usb was prepared with the gparted tool from within Mint (running from the first usb). An ext2 extended partition was made covering the entire 8 GB disk space.

Installation was started from the Mint 11 Live desktop icon. Once the installer is running choose to do a manual disk partition. In the first Try I chose to install alongside Windows, but it was not possible to control the size of the swap space. Swap ended up taking up 4 GB space (equal to ram amount), leaving too little room for the installation (with 1 GB reserved for a fat  partition). This made the installation incomplete rendering the usb un-bootable.

Remember to place the boot loader on the usb device

Add a ext2 primary partition iwth the “/” (root) mount point.

Do not bother making a swap partition if you have a sufficient amount of RAM. The installation was ended (self-explanatory). On reboot  GRUB would not boot into the newly installed Mint system on my usb stick since it was now /dev/sdb insted of /dev/sdc during installation (Live USB was /dev/sdb). In  order to change that I followed the steps outlined here.  I basically follwed the steps outlined (except booting from the Mint Live usb stick used for the original installation). Before running  update-grub2 I corrected the file /mnt/etc/defaults/grub and corrected any references to sdc to sdb. This seemed to fix the boot problems.

After the installation I made the following modifications based on advice found on the web, in order to improve system response and memory stick lifetime (minimizing writes).

  1. Changed /tmp to RAM. Add the following line to /etc/fstab:
    tmpfs /tmp tmpfs nodev,nosuid,noatime,noexec,size=1G 0 0
    Change the size to whatever seems fit.
  2. All entries in /etc/fstab are added the noatime option. The should eliminate file system writes for files that are read.
  3. To minimize disk write during browser session the cache can be located in RAM e.g. for chromium the following line is added to /etc/fstab
    cache-chromium /home/username/.cache/chromium tmpfs rw,noatime 0 0
    Delete already existing cache and recreate:
    rm -r /home/your_user/.cache/chromium
    mkdir /home/your_user/.cache/chromium
    See also this page.
  4. The also applies to firefox. See e.g. the description here (3. point).
  5. It is recommended in several places to use the noop scheduler (or deadline) instead of the default (completely fair scheduler) for solid state storage. I have tried this but didn’t find any positive difference.
  6. I also considered adding some of the /var stuff into RAM, but I haven’t come so far yet.

This was my steps in getting a Mint 11 sysstem up and running from a USB stick.

Written by aandreasen

November 19, 2011 at 9:09 pm

Posted in Computers, GNU/Linux

Tagged with , ,

The Arch Way

leave a comment »


I have recently replaced ubuntu 10.10 on my home laptop with Arch Linux. I have been wanting to try this distro for a while, but as I am getting older the need for long nights struggling with new linux installations, configurations, package installations, tweaking and fine tuning this and that is getting much smaller. I just want something that works. Then again I am still curious, and I still remember the good things about Gentoo (although it took almost one week of compiling X, gnome, openoffice, firefox etc. back in 2004), the bsd-like portage system, I also like apt, and the high availability of pre-built binary packages, but I am not sure I agree 100% with the direction of Ubuntu. Furthermore I have been looking for a distro that supports the gnome 3 desktop.

A long story short, although the installation of Arch is not as polished as e.g. Ubuntu, OpenSuse, etc., and the fact that only a base system is installed from the beginning (no X, no desktop, no GUI browser etc), it is not that difficult thanks to the great documentation (
Official installation guide and Unofficial beginners guide). One thing to mention which I missed in my first attempt was to include the wifi driver in the packages to be installed, this caused some confusion, but in the second try everything went fine. With Arch some of the system configuration must be done by editing a few configuration files (again this is very well described in the documentation), the most common and pivotal being /etc/rc.conf. Basically it is about setting the hostname, specifying DHCP or static IP for network adapters, specifying kernel modules, specifying which daemons to start at boot etc.

The thing I am most impressed by is the pacman package manager/dependency handler. I mean if you like apt, you will probably also like pacman. The build system is also very easy to get familiar with (again good documentation is the key). It is very easy to build packages (including dependency handling by pacman) from so-called PKGBUILDs (see e.g. AUR for additional user supplied package build instructions for building packages). I was impressed to find a PKGBUILD for the Citrix Receiver (ICAClient). I found that this PKGBUILD specified openmotif as a dependency. Set this to lesstif instead, else some dependency issues may occur with applications specifying lesstif as a dependency (e.g. xpdf, xmgrace and other legacy stuff), since either one or the other should be used.

It was very easy to get Gnome 3 thanks to these easy basic steps. Install gdm as well and start the daemon on boot (edit /etc/rc.conf) in order to have graphical login screen after boot-up. I also like the NetworkManager applet in Gnome, which makes wireless networking a breeze. I installed vpnc and the netwokmanager-vpnc packages to connect to a cisco VPN. As with previous attempts in Ubuntu, Fedora, and Centos, it seems necessary to log out and in again in order for it to work properly in the applet.

Should I also mention that installing plugins (flash, java, video etc) and codecs etc is also accomplished in a very easy way. Other things to like is that default python is 2.7.

Written by aandreasen

May 18, 2011 at 8:19 pm

The wayback machine to the rescue

with 7 comments

Years ago I made some on-line material available on my (old) website in order to supplement some of my publications. In the meantime I have closed down the old website, and guess what, now the material has been requested (cough!). What to do now? Use the the internet archive/waybackmachine.
“Browse through over 150 billion web pages archived from 1996 to a few months ago. To start surfing the Wayback, type in the web address of a site or page where you would like to start, and press enter. Then select from the archived dates available. The resulting pages point to other archived pages at as close a date as possible. Keyword searching is not currently supported.”

The material which is related to some publications in Applied Catalysis and the Linux Gazette. The material in question can be found here, and is even shown below:

Supplementary material

From Andr

This page contains supplementary material to some of my publications

Table of contents [showhide]

Linux gazette 114

In order to try out Example 3 in the article Python for scientific use. Part I: Data visualization in Linux Gazette 114 (2005) (http://linuxgazette.net/114/andreasen.html) a number of data files are needed.

These data files are contained within the 3ddata.tar.gz (http://andr.dk/lg114/3ddata.tar.gz) file. In order to extract all datafiles do:

  tar xvfz 3ddata.tar.gz

in the directory from which the python script is run.

Linux gazette 115

In order to try out Example 3 in the article Python for scientific use. Part II: Data analysis in Linux Gazette 115 (2005) (http://linuxgazette.net/115/andreasen.html) a number of data files are needed.

These data files are contained within the 3dtdata.tar.gz (http://andr.dk/lg115/3dtdata.tar.gz) file. In order to extract all datafiles do:

  tar xvfz 3dtdata.tar.gz

in the directory from which the python script is run.

Octave files

The kinetic models published in Simplified kinetic models of methanol oxidation on silver are all implemented in a number of octave (http://www.octave.org) scripts. You can see all individual files in the table below. All files can be obtained either by downloading octavefiles.tar.gz (http://andr.dk/octavefiles/octavefiles.tar.gz) or by

  wget -i FILELIST.txt

from the directory to which the files should be downloaded. First, download the FILELIST (http://andr.dk/octavefiles/FILELIST.txt).

List of octave files
File name Description
MeOH_test.m (http://andr.dk/octavefiles/MeOH_test.m) Main file
Keqsel.m (http://andr.dk/octavefiles/Keqsel.m) Reaction step equilibrium constants calculated using statistical thermodynamics
K_HandS.m (http://andr.dk/octavefiles/K_HandS.m) Reaction step equilibrium constants calculated using enthalpies and entropies
fullrateorig.m (http://andr.dk/octavefiles/fullrateorig.m) The original rate law from quasi equilibrium approximation and stat. therm. with a plug-flow reactor model included
fullrate.m (http://andr.dk/octavefiles/fullrate.m) The original rate law from quasi equilibrium approximation and classical thermodynamics with a plug-flow reactor model included
marirate.m (http://andr.dk/octavefiles/marirate.m) The MARI approximation
israte.m (http://andr.dk/octavefiles/israte.m) The IS approximation
powerlawrate.m (http://andr.dk/octavefiles/powerlawrate.m) The clean surface approximation
qtransA.m (http://andr.dk/octavefiles/qtransA.m) Calculation of the translational partition function
qvibA.m (http://andr.dk/octavefiles/qvibA.m) Calculation of the vibrational partition function for a single vibration (cm-1)
qvibAJ.m (http://andr.dk/octavefiles/qvibAJ.m) Calculation of the vibrational partition function for a single vibration (J/mol)
qrotA2D.m (http://andr.dk/octavefiles/qrotA2D.m) Calculation of the 2-D rotational partition function (cm-1)
qrotA2DJ.m (http://andr.dk/octavefiles/qrotA2DJ.m) Calculation of the 2-D rotational partition function for a single vibration (J/mol)
qrotA3D.m (http://andr.dk/octavefiles/qrotA3D.m) Calculation of the 3-D rotational partition function (cm-1)
qvibtotA.m (http://andr.dk/octavefiles/qvibtotA.m) Calculation of the total vibrational partition function for a molecule (cm-1)
HvibA.m (http://andr.dk/octavefiles/HvibA.m) Calculation of the vibrational enthalpy of a single vibration (cm-1)
HvibAJ.m (http://andr.dk/octavefiles/HvibAJ.m) Calculation of the vibrational enthalpy of a single vibration (J/mol)
HvibtotA.m (http://andr.dk/octavefiles/HvibtotA.m) Calculation of the total vibrational enthalpy for a molecule (cm-1)

?

Written by aandreasen

September 29, 2010 at 9:28 am

Using Oracle SQL developer as a GUI front-end for MS SQL server

with 3 comments

In my previous post I described how to use OpenOffice Base as a MS SQL server GUI front-end. On some occasions I have experienced OObase to hang when executing queries or otherwise communicating with the SQL server. For a more professional experience the Oracle SQL developer can be used instead. Oracle SQL developer can be downloaded free-of-charge from the Oracle website.

Download and install Oracle SQL developer

  1. Goto Oracle website
  2. Accept the license agreement
  3. Unless you have an rpm based distribution choose the Oracle SQL Developer for other platforms(this will be assumed throughout this how-to)
  4. Unzip the downloaded zip archive to e.g. /opt or /usr/local. Assuming pwd is the directory to which Oracle SQL developer was downloaded to
    sudo unzip sqldeveloper-2.1.1.64.45-no-jre.zip -d /opt
  5. sqldeveloper can be started by the command
    sh /opt/sqldeveloper/sqldeveloper.sh For convenience an alias can be added to .bashrc e.g.
    alias sqldeveloper='sh /opt/sqldeveloper/sqldeveloper.sh'

Install jTDS JDBC driver

As with OOBase the jTDS JDBC driver is required for connecting to MS SQL server. Here’s how-to make it work.

  1. If not already downloaded, download the latest JDBC driver from sourceforge
  2. Unpack the archive and copy the jtds-1.2.5.jar into your java environment. On ubuntu 9.10 with Sun Java this is somewhere like /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/ext/ This should enable Oracle SQL developer to locate the driver
  3. Start sqldeveloper. You should see the following screen
  4. Click the big green plus in the connections pane and the following window will pop-up
  5. If, for some reason, the (MS) SQLserver pane/entry is not there (only the Oracle) them the jTDS JDBC driver was not successfully loaded (perhaps copied to the wrong destination). The JDBC driver can be installed manually by choosing Preferences in the Tools menu
    Click “Add enty” and located the jtds-1.2.5.jar file on your system
  6. Enter the address of the MS SQL server and your log-in credentials and you’re ready to go. Read more in the documentation on the Oracle website

Written by aandreasen

April 6, 2010 at 9:54 pm

Installing cantera 1.8 on Ubuntu 9.10 (32 bit)

with 35 comments

Note: I just checked that the procedure (svn) given below also works for Ubuntu 10.10, and it does.

Here’s a brief description on how I managed to compile and install cantera 1.8 on Ubuntu 9.10 (32 bit), with the full python interface. However, first a little description of what cantera is (taken from the website):

Cantera is a suite of object-oriented software tools for problems involving chemical kinetics, thermodynamics, and/or transport processes.

Cantera is written in C++, and can be interfaced also from python, matlab and Fortran.

  1. First step is to install any dependencies. This is handled by apt-get:
    sudo apt-get install subversion g++ gfortran python2.6-dev python-numpy libsundials* graphviz
  2. Next step is to get the source for cantera. This can be done by either downloading the cantera-1.8.0-beta-tar.gz from the cantera site our checking the latest version from svn
    svn checkout http://cantera.googlecode.com/svn/cantera18/trunk/ cantera
  3. change to the cantera directory (either the svn checkout or the untarred/gunzipped cantera-1.8.0)
  4. Edit the file named preconfig and make sure the following lines are included by uncommenting/editing
    PYTHON_PACKAGE=${PYTHON_PACKAGE:="full"}
    USE_NUMPY=${USE_NUMPY:="y"}
    SUNDIALS_VERSION=${SUNDIALS_VERSION:='2.3'}
  5. The entire preconfig file can be viewed here
  6. then in a terminal run the following commands
    ./preconfig
    make
    sudo make install
    source ~/setup_cantera
  7. If everything went well you should be able to import the Cantera module in python:
    python
    >>>from Cantera import *

Written by aandreasen

January 28, 2010 at 11:06 pm

Fedora 12. Probably the best GNU/Linux distro in the world?

leave a comment »


I have recently installed Fedora 12 on my computer (laptop). I have used Linux for many years, and my best experience has been with Debian derived systems like Debian itself, Ubuntu and Mint, so far. However, when I started out using Linux it was on RedHat 6.2, although I jumped the RedHat wagon after 8.0. Nevertheless, I thought it was a good time now to see the current state of the RedHat upstream development.
To jump to the conclusion rigth away, I really like Fedora 12. To be more specific:

  1. Installation was very easy just as easy as Ubuntu, in my opinion
  2. Very good and professional documentation
  3. The amount of scientific packages is very good. Numpy, Scipy and Matplotlib is included. Other useful apps: Xmgrace/Grace, Octave, DX, R, hdf5, maxima, paraview
  4. The Gnome NetworkManager comes with good stuff preinstalled e.g. vpnc (Cisco VPN client) and for some reason it seems to connect to my home router faster than on Ubuntu/Mint. Although this is only a subjective impression.
  5. Eclipse comes with many useful plugins e.g. pydev, valgrind. Unfortunately the eclipse sql explorer plugin is not one of them. However, installation is easy,
  6. Compiz works very well. It has caused me some trouble to make it work on OpenSUSE 11
  7. Gnote instead of Tomboy. I have never been a fan of .Net/Mono. Again this is my personal opinion
  8. The default configuration of Gnome is good, and pleasant
  9. YUM is very easy to use. Very much like APT. The yum history command is very useful

In order to get a full installation, even with applications such as Adobe Reader, VLC, Google Earth, Google Picasa, Skype, RealPlayer, I can recommend to go through the step-by-step guide on HowtoForge. It is extremely useful. Cadeau!

However, I have found a few things I do not like so much about Fedora 12, which has pushed me towards CentOS 5.4 instead

  • For some reason when resuming from suspend/hibernate Xorg crashed leaving me with a new gdm login screen leading to a blank desktop with all my apps gone (Intel MobileGMA 965). I haven’t found a fix, according to the mailinglists/bugzilla the issue should have been resolved (but obviously its not). Works out of the box in CentOS.
  • Couldn’t find a way to get CPU throttling to work i.e. the “On demand” mode. Whenever trying to force this mode I was always reverted to “Performance” i.e. full speed. No problem for workstation doing heavy calculations all the time, but for a laptop it’s really a nive feature. This works out of the box in CentOS.

The post is brought to you by lekhonee v0.7

Written by aandreasen

December 5, 2009 at 8:35 pm

Posted in Computers, GNU/Linux, Python

Poor WiFi connection data performance with Intel PRO/Wireless 3945ABG Network Connection

with one comment

On my Lenovo T61 equipped with Intel PRO/wireless 3945ABG network card I have had an issue, a PITA to be more precise, for some time now. I have experienced very poor performance of the wireless networking when running Windows XP SP3, despite the fact that signal  strength was “excellent”  at a speed of 54 Mbit/s.

I tracked down the problem, after extensive searching on the internet, to be related to so-called “Power-save Polling”after reading an Intel note on the issue (PSP is described at TechRepublic in more detail, and also why PSP may be no good at all). The issue seems to appear when the wireless router does not properly support power-save polling. I have a Zyxel P-2602HW-D1A wireless router, and I have not been able to find any info on power-save polling for this hardware. So Intel may be correct that the router does support this feature.

In order intelto disable power-save polling on the Intel wireless adapter go to   Control Panel -> Network Connections -> (Right click) Wireless Network Connection -> Properties  and press the “Configure” button for the wireless adapter.  In the “Advanced” tab choose the “Power management” property and set the slider to the highest value for maximum performance i.e. no PSP. This certainly did the trick (at least temporarily) – I could now browse the internet at full speed. However, my new found happiness was soon spoiled when I realized that the problem resurfaced after some time (actually after being in standby mode etc.). After reopening the previous configuration utillity I could also see that the power management had been reset to the lowest value (i.e. PSP on). I guessed it might be related to some kind of power save management between win XP and the Intel driver (since the issue never occured when running Ubuntu 9.04). Nevertheless, I could not find any configuration for this particular “feature” literally driving me nuts. I noticed that I had the Lenovo ThinkVantage Power Manager installed. After removing this everything worked fine, and my settings was not reset after standby. Btw. the driver for the Intel adapter is version 12.4.0.21. Updating the driver did not make any difference.

Written by aandreasen

August 20, 2009 at 8:22 pm

Posted in Computers, Windows

Tagged with , ,