Tuesday, September 24, 2013

Change ubuntu apt-get mirror site

sudo vi /etc/apt/sources.list

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu precise main restricted
universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu precise main restricted
universe multiverse

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu precise-updates main
restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu precise-updates main
restricted universe multiverse

:wq

sudo apt-get update

(e.g.) sudo apt-get install maven

Allow remote access to postgres sql

edit /etc/postgresql/9.1/main/postgresql.conf

listen_address = '*'

edit /etc/postgresql/9.1/main/pg_hba.conf

replace the config with:

host all all 0.0.0.0/0 md5

Check 32 bit or 64 bit Ubuntu version

uname -a

Result for 32-bit Ubuntu:

Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC
2011 i686 i686 i386 GNU/Linux

whereas the 64-bit Ubuntu will show:

Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux

Wednesday, September 4, 2013

Backup postgresql using pgdump

>sudo su - postgres
>pg_dump some_database_name > somename.sql