Installing pgAdminIII for PostgreSQL 9 on Ubuntu

pgAdmin is the best GUI you can use to administrate PostgreSQL, unffortunately the Ubuntu default packages still offer only PostgreSQL 8.4 and an older version of pgAdmin III that does not support PostgreSQL 9.0.x. Thanks to Martin Pitt who maintains the latest packages you can run and maintain the latest PostgreSQL versions.

If you run Maverick:

  • sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 8683D8A2
  • sudo apt-get update
  • sudo apt-get install pgadmin3

Check here for latest or other releases of Ubuntu.

Touchscreen Notebooks using Ubuntu

I purchased 2 notebooks with swivel-touch screens last weekend. Both coming with Windows 7 which I clonezilla’d, wiped out and installed Ubuntu immediately. Both are not an iPad killer whatsoever, but it suits my requirements: you can touch it, you can turn it (read books), it comes with a keyboard and I can load almost any application, even do some development work.

  • Asus EEE T101MT
    1.66 GHz Atom N450 CPU with hyperthreading
    10.1 inch screen, multi-touch resistive display with 1024 x 600 pixels resolution
    2 GB RAM and 320 GB HDD at 5400 RPM
    WiFi 802.11n
    4 cell 2400 mAh and 35 Wh battery pack, removable
    0.3 megapixel webcam
    3 USB ports,  VGA output, Ethernet, Kensington Lock, Mic and Headphones jack and SD Card reader 

    Installing Ubuntu: A breeze with 10.10 (Maverick). All info here.

  • Acer Aspire 1825PTZ
    Intel Pentium processor SU4100 (1.3 GHz, 800 MHz FSB)
    2GB Memory
    Graphics Controller: Intel GMA 4500MHD
    11.6″ Acer CineCrystal LED LCD With (capacitive) Multi Touch(1366×768)
    320GB HD
    0.3 megapixel webcam
    3 USB ports,  VGA output, HDMI Port,Ethernet, Kensington Lock, Mic and Headphones jack and SD/XD/MS Card reader 

    Installing Ubuntu: Basic Installation straight forward, but requires some hacking to get the touchscreen properly running and the auto-rotate screen. But you find all answers in this thread. And some more tricks here.

How to run a ftp server on an Amazon Micro Instance

A micro instance which runs for your with Linux at 0.025 U$ per hour (around 18 U$ a month) is just right to operate a FTP server. Plus the data transfer which costs you 0.1U$ IN and around 0.15U$ OUT.
There is only a minor challenge to get started, the elastic IP assignment which makes it impossible to connect to the ftp server in passive mode out of-the-box.
This short tutorial describes how to get started and covers also the use of virtual users (we skip the basic art assuming you are familar with creating instances and the handling of key-files etc.).

I advise to create a separate volume in EC2 if you plan to ftp large amount of files or eventually opt for a bigger instance.

How to add a volume:

  • Create a new volume specifying a suitable size (you pay for the size you allocate not for the size you use inside the volume!)
  • Attach it to the instance (define a device, eg. /dev/sdf)
  • Login to you instance format the volume (mkfs -t ext2 /dev/sdf)
  • Create a mountpoint (mkdir  /mnt/ftpvolume)
  • Mount the volume (mount /dev/sdf /mn/ftpvolume)
    Be aware: you need to mount every time you restart the instance ! There are scripts to do it automatically, but this is not straight forward in EC2)

How to install and configure the ftp service:

  • Look for an Ubuntu i386 server AMI in your preferred region and create a new instance.
  • Use a security group with an open port 21 and the passive ports (eg.62222 to 63333 as configured below).
  • Create an elastic IP and attach it to the new instance.
  • Login the instance (using ssh and your private key).
  • Add the ftp server vsftpd package (sudo apt-get install vsftpd.conf)
  • Add the libpam package which we need to maintain the virtual users (sudo apt-get install libpam-pwdfile)
  • Add the mini-httpd package which contains the hptasswd command we need to enter the passwords (apt-get install mini-httpd)
  • Configure PAM (vi /etc/pam.d/vsftpd)
    Remove other content in this file.

    auth required pam_pwdfile.so pwdfile /etc/ftpd.passwd
    account required pam_permit.so
    
  • Configure vsftpd (vi /etc/vsftpd.conf)
    This shows only the important changes and new entries

    ...
    local_enable=YES
    ...
    write_enable=YES
    ...
    local_umask=022
    ...
    chroot_local_user=YES
    ...
    virtual_use_local_privs=YES
    guest_enable=YES
    user_sub_token=$USER
    local_root=/mnt/ftpvolume/ftphome/$USER {or whatever your ftp root folder is going to be}
    hide_ids=YES
    pasv_min_port=62222
    pasv_max_port=63333
    pasv_address={your Elastic IP}
    
  • Restart vsftpd (service vsftpd restart)
  • Create the root directory for the ftp service as defined in the config file
  • Create user and user directory
    For the first user you add
    htpasswd -c /etc/ftpd.passwd Username
    subsequent users
    htpasswd /etc/ftpd.passwd Username
    mkdir /mnt/ftpvolume/ftphome/username
    chmod 777 /mnt/ftpvolume/ftphome/username
  • Create a superuser ftpadmin with access to all user directories
    Instead of creating own folder, create a link
    ln -s /mnt/ftpvolume/ftphome ftpadmin

Remarks: This might not be best practice, but
a) for the EC2 instance you open only port 32
b) vsftpd is the best choice for secure ftp
c) each virtual user is locked into his home-folder.

Feel free to add comments in regards of security.

DDMS on Ubuntu throws exception ?

I downloaded the latest Android SDK and connected my Nexus One. Once starting DDMS, it throws up this
[codesyntax lang=”xml” title=”DDMS error”]
user@wanaka-ubuntu:~/android-sdk-linux_x86/tools$ ./ddms

(ddms:10868): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
04:37:36 E/ddms: shutting down due to uncaught exception
04:37:36 E/ddms: java.lang.UnsatisfiedLinkError: Can’t load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1649)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)

[/codesyntax]

If you read the log, you realize it tries to use the openjdk version, but we want to use the SUN (ahem Oracle) JRE.

Open the ddms script file and change the line (around line no.65)

javaCmd=”java”

to

javaCmd=”/usr/lib/jvm/java-6-sun-1.6.0.22/bin/java” (adapt it to your proper path to the java binary!)

There we go ! Lets snoop inside the phone

Dalvik Debug Monitor (DDMS)

and we can even create screenshots !

Android Screenshot

Installing PostgreSQL 9.0 on Ubuntu

Thanks to Martin Pitt , who maintains the packages for Ubuntu, nstalling the latest version of PostgreSQL on Ubuntu (Lucid) is nothing more than updating your /etc/apt/sources.list with

deb http://ppa.launchpad.net/pitti/postgresql/ubuntu lucid main
deb-src http://ppa.launchpad.net/pitti/postgresql/ubuntu lucid main

plus

apt-get update

and

apt-get installpostgresql-9.0

I recommend reading the release notes and he outstanding good postgresql documentation.

Release Fever Update

Quite a number of new releases (that bother me) hit us the last few days (weeks) and more to come.

  • Ubuntu 9.10 (the broken Koala) (link)
  • Netbeans 6.8 BETA (link)
  • Java EE6 in NB 6.8B (official release eventually in December) (link)
  • ZK 3.6.3 (link)

Switch to Ubuntu

Using a fairly powerful Dell Vostro 1500 notebook running a Intel® CoreTM2 Duo Mobile Processor T8300 with 4 GB of RAM I decided to switch over from running fulltime XP PRO to Ubuntu ! I bought a sep. harddisk with a bezel and can switch between the 2 fulltime OS anytime. I still need Windows for some simulation and games using the NVidia 8600 horsepower.

Installing Ubuntu Desktop 8.10 (intrepid) tooks less than 15min plus another 20min downloading all the actual updates and patches.
Additional installed software:

  • JDK 1.6.10  (How to install: Open Terminal and “$ sudo apt-get install sun-java6-jdk“)
  • Netbeans 6.5 (How to install: Download from www.netbeans.org, make the netbeans-6.5-ml-linux.sh executbale (chmod +x fiename) and start it $ ./filename)
  • Skype
  • Virtualbox (link)

Using VirtualBox I run Windows XP (thanks to the licence that came with the notebook), Solaris 10, OpenSolaris 2008.11 smoothly and do development in Netbeans (which starts up much faster compared to Windows). Using Windows XP PRO with dedicated 2GB is smooth (except the NVidia card) at the same time I use Ubuntu.

I installed also third harddisk with a fulltime OpenSolaris, but I use USB harddisks for storage and OpenSolaris wont mount them (at the moment).

The only thing missing: JavaFX ! I will have a look at the receipe to do it (link) or just wait for the official release (whenever that gonna happen..?).