Skip to content

Instantly share code, notes, and snippets.


vandamon vandamon

View GitHub Profile
vandamon / enrolment_cuke_spec.rb
Created Jun 28, 2020 — forked from zetter/enrolment_cuke_spec.rb
Enrolment cucumber-like rspec feature spec
View enrolment_cuke_spec.rb
feature 'Enrolment' do
scenario 'Enrolling in a course' do
def given_there_is_a_course
@course = FactoryGirl.create(:course)
View install-postgresql-client-9.5-on-ubuntu-14.04.bash
# Ubuntu 14.04 repo
# For more repos see
# Install key
wget --quiet -O - | sudo apt-key add -
# 14.04 repo
sudo sh -c 'echo "deb trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
apt update
View golang-create-read-write-delete-file.go
package main
import (
var path = "/Users/novalagung/Documents/temp/test.txt"
vandamon /
Created Sep 15, 2018 — forked from AtulKsol/
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:




I believe Ubuntu 16.04 comes with PostgreSQL 9.5. Thats good for a start, but it is a matter of time before you have the need of a PostgreSQL 9.6 cluster. For me it was to import a PG backup from Heroku.

The procedure couldn't have been any easier and is described below. If you are interested in upgrading your old cluster to 9.6 afterwards, you may be interested in this.


vandamon /
Created Apr 22, 2017 — forked from tomas-stefano/
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above