Skip to content

Instantly share code, notes, and snippets.

@dwayne
Last active October 7, 2015 16:18
Show Gist options
  • Save dwayne/3192494 to your computer and use it in GitHub Desktop.
Save dwayne/3192494 to your computer and use it in GitHub Desktop.
HOWTOs

HOWTOs

How to prepare Ubuntu 12.04 LTS for installing from source

https://help.ubuntu.com/community/CompilingEasyHowTo

$ sudo apt-get install build-essential checkinstall

How to change the font or background colours of an embedded terminal in the gedit bottom panel

  1. $ sudo apt-get install dconf-tools
  2. alt+f2 and run dconf-editor
  3. go to org.gnome.gedit.plugins.terminal to adjust the colours

How to install and configure PostgreSQL on Ubuntu 12.04 LTS

Navigate to http://www.postgresql.org/download/linux/ubuntu/ and follow the instructions to use the apt repository:

  • Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository

      deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
    
  • Import the repository signing key, and update the package lists

      $ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
      $ sudo apt-get update
    

Once that setup is done, you can go ahead and install the latest version of PostgreSQL. At the time of this writing it is 9.2.4.

$ sudo apt-get install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2 postgresql-server-dev-9.2 pgadmin3 libpq-dev

To configure, just follow the instructions here.

Step 1 - Enable the TCP/IP connections

  • sudo subl /etc/postgresql/9.2/main/postgresql.conf
  • find and uncomment the line listen_addresses = 'localhost'

Step 2 - Set a password for the postgres user

  • sudo -u postgres psql template1
  • ALTER USER postgres with encrypted password 'your_password';

Step 3 - Use MD5 authentication with the postgres user

  • sudo subl /etc/postgresql/9.2/main/pg_hba.conf
  • change local all postgres peer to local all postgres md5

Step 4 - Restart the PostgreSQL service

  • sudo /etc/init.d/postgresql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment