Local PostgreSQL Setup

Shell configuration (~/.bashrc, ~/.zshrc, …)

export PGDATA=~/anywhere/postgresql_data # PostgreSQL data directory
export PGHOST="/tmp"
alias pgstart="pg_ctl start"
alias pgstop="pg_ctl stop"

Initial setup

$ initdb -A md5 -E UTF8 -U $USER -W

$ vim $PGDATA/postgresql.conf

listen_addresses = 'localhost'

$ vim $PGDATA/pg_hba.conf

# TYPE DATABASE USER ADDRESS METHOD
# ADD THE FOLLOWING LINE AND REPLACE 'YOUR_USER' by $USER
local all YOUR_USER trust

Start/Stop PostgreSQL

$ pgstop
$ pgstart

Important commands

$ createdb database_name # create new database
$ dropdb database_name # drop database
$ psql -p # list all available databases
$ psql database_name # connect to database

psql console

\? # help
\d # list tables (and other things)
\d table_name # show table schema

Kanbanery overview with banery_stats

I’ve created a very simple gem called banery_stats to view my #tasks for every project for my kanbanery account.

It’s very simple to use. First you have to manually get your kanbanery api token. Afterwards it’s as simple as:

$ export KANBANERY_API_TOKEN=my_token
$ banery_stats
WORKSPACE name0 #projects: 2
0 project1
3 project2
WORKSPACE name1 #projects: 3
3 project3
12 project4