Anders Andreasen Blog

Just another weblog

Archive for the ‘Ubuntu’ Category

Flaky vpn connection with vpnc on Ubuntu 9.10

with one comment

I have had trouble keeping my vpn connection alive when connecting to the internal net of my company through the vpnc client. Usually I can be connected for, say, 5-10 min and then vpnc disconnects. I found out that by ticking the “disable dead per detection” box helped a lot. Goto “System -> Preferences -> Network Connections” choose the VPN pane and click “Edit”.

If vpnc is started from the command line do the following to disable dead peer detection
vpnc --dpd-idle 0
Once I disabled DPD I have been able to keep the vpn connection alive without disconneting for several hours. Btw
vpnc --version
vpnc version 0.5.3
Copyright (C) 2002-2006 Geoffrey Keating, Maurice Massar, others
vpnc comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of vpnc under the terms of the GNU General
Public License. For more information about these matters, see the files
named COPYING.
Built without openssl (certificate) support.

Supported DH-Groups: nopfs dh1 dh2 dh5
Supported Hash-Methods: md5 sha1
Supported Encryptions: null des 3des aes128 aes192 aes256
Supported Auth-Methods: psk psk+xauth

Written by aandreasen

April 15, 2010 at 6:36 pm

Posted in GNU/Linux, Ubuntu

Tagged with ,

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 -d /opt
  5. sqldeveloper can be started by the command
    sh /opt/sqldeveloper/ For convenience an alias can be added to .bashrc e.g.
    alias sqldeveloper='sh /opt/sqldeveloper/'

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- 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

pydb not working properly on Ubuntu 9.10

with 7 comments

I was trying to use pydb with ddd in order to debug a python script. However when invoking ddd with e.g.
ddd clamied that it could not find pydb. I tried running pydb from the command line and I was left with a message like
The program 'pydb' is currently not installed. You can install it by typing:
sudo apt-get install pydb
pydb: command not found

Ok, so I tried to install it
sudo apt-get install pydb
Reading package lists... Done
Building dependency tree
Reading state information... Done
pydb is already the newest version.

Hmmm, strange. Google, google, google……….
It turned out that some else had experienced the same problem as me and provided a fix. Apparently the link to pydb in /usr/bin is broken. The fix is
sudo rm /usr/bin/pydb
sudo ln -s /usr/lib/python2.4/site-packages/pydb/ /usr/bin/pydb

Written by aandreasen

March 18, 2010 at 8:46 pm

Posted in GNU/Linux, Programming, Python, Ubuntu

Tagged with , , ,

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 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
  5. The entire preconfig file can be viewed here
  6. then in a terminal run the following commands
    sudo make install
    source ~/setup_cantera
  7. If everything went well you should be able to import the Cantera module in python:
    >>>from Cantera import *

Written by aandreasen

January 28, 2010 at 11:06 pm

Telenor mobilt bredbånd på Ubuntu 9.10 m 3G Huawei E1752

with 10 comments

Her følger en kort gennemgang hvordan jeg har fået Huawei E1752 3G usb modem til at virke under Ubuntu 9.10 med Telenor mobilt bredbånd.

  1. Første skridt er at aktivere modem med PUK kode og sætte PIN kode (se vejledningen som fulgte med eller her). Dette kan gøres under Windows, hvis man har dette tilgængeligt. Det skulle efter sigende også kunne gøres ved at sætte kortet i en mobiltelefon, men har dog ikke prøvet det.
  2. Under Ubuntu er det nødvendigt at installere pakken usb-modeswitch,som findes i universe. Dette kan gøres i terminal med komandoen
    sudo apt-get install usb-modeswitch
  3. Derefter skal usb_modeswitch.conf konfigurationsfilen redigeres (findes under /etc) og følgende indsættes (opskrift fundet andetsteds)

    # Huawei E1752
    # Contributor:

    DefaultVendor= 0x12d1
    DefaultProduct= 0x1446

    TargetVendor= 0x12d1
    TargetProdct= 0x1001

    MessageEndpoint= 0x01

    MessageContent= “55534243000000000000000000000011060000000000000000000000000000”

  4. Indsæt modem i usb port
  5. Under System -> Indstillinger (Preferences) vælges “Network connections”  og vælg Tilføj/Add (ignorer forbindelsen som allerede eksisterer i screendumpet)
  6. Hvis modemet ikke figurerer i næste skærmbillede, så kør da kommandoen sudo usb_modeswitch
  7. Derfefter skulle modemet gerne figurere
  8. Vælg forward/videre og vælg land: Danmark
  9. Vælg Sonofon som udbyder
  10. Fra næste skærmbillede videre
  11. Indtast pin-kode i næste skærmbillede og Apply/Anvend
  12. Herefter skulle den nyoprettede mobile bredbåndsforbindelse optræde når der  klikkes på netværksikonet

Der kan åbenbart være problemer med at se modemet efter standby/suspend, hvorefter det kan være nødvendigt at køre ubs_modeswitch kommandoen igen


Written by aandreasen

January 24, 2010 at 11:55 am

Posted in GNU/Linux, Ubuntu

Tagged with , , ,

Getting Skype up and running on Ubuntu 9.04

leave a comment »

After having downloaded Skype for Ubuntu (ver. 9.04 and installed it, I found a problem when trying to make a test call. Skype simply displays a message saying “Problem with audio playback”. I found a solution to this problem on the blog of Kholid Fuadi. In brief the solution is (in a shell):

  1. killall pulseaudio
  2. sudo apt-get remove pulseaudio
  3. sudo apt-get install esound
  4. sudo rm /etc/X11/Xsession.d/70pulseaudio
  5. reboot

That brought me one step further in getting Skype to work. The next problem appearing was the fact that the internal microphone did not capture any sound/voice. Btw my laptop is equipped with an Intel AD1984HD codec device. I found a comprehensive step-by-step guide at Mage Blog.

Start alsamixer (from a shell). Turn up the gain on everything except those named something with “boost”. Press tab and turn up the gain on the capture devices. The input source is set to “internal” (in case you don’t plug in a mic in the mini-jack port).

In System -> Preferences -> Sound i have used the following settings
Play around with the setting e.g. make a test recording with the Sound Recorder in order to verify that the capture device is working properly. In Skype I found it necessary to also specify the input device manually:

That did it. Now I have Skype working (haven’t tried video yet – but the internal web-cam captures just fine, so I guess it should work out of the box).

Written by aandreasen

May 26, 2009 at 5:30 pm

Posted in Computers, GNU/Linux, Ubuntu

My life with Ubuntu 9.04: VPN and Citrix Receiver

with 2 comments

I have been using linux the last 8 years with different flavors (RedHat, Debian Gentoo, Suse). Personally I like the Debian based distros the best.
Now time has come that I wanted to install Ubuntu 9.04 on my home laptop. I have noticed all the buzz around this “relatively” new distribution and how easy it is to install/use and now I wanted to see it with my own eyes. The installation was like a breeze and everything was easy to set up (WLAN, audio, additional plugins like flash, java, Adobe reader etc.).

Since I work from home from time to time I need to access the internal network at work using a VPN connection (to a Ciscoserver). I found the tutorial at McMaster University for installing Cisco VPN client on linux very useful. See the tutorial yourself, however the steps are basically:

  1. wget
  2. tar xzvf vpnclient-linux-x86_64-
  3. cd vpnclient
  4. sudo ./vpn_install
  5. /etc/init.d/vpnclient_init start (loading vpn client module into kernel)
  6. Copy an existing VPN profile *.pcf to /etc/CiscoSystemsVPNClient/Profiles
  7. Fire up the vpnclient: vpnclient connect YOURPROFILE

Citrix Receiver
In order to connect to the Citrix MetaFrame XP I installed the Citrix Receiver from I downloaded the tar.gz file and followed the instructions . It seems as if the Citrix Receiver automatically adds itself to the firefox plugins.

Written by aandreasen

May 26, 2009 at 10:47 am

Posted in Computers, GNU/Linux, Ubuntu