Skip to content

Instantly share code, notes, and snippets.

johan pretorius johan--

View GitHub Profile
johan-- /
Created Feb 25, 2019 — 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:


johan-- /
Created Feb 2, 2019 — forked from AliYusuf95/
Websocket implementation using OkHttp3 with {event->data} message format to make your life easier.
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
johan-- /
Created Jan 18, 2019 — forked from travist/
Installing on Ubuntu Server

Installing Enterprise on Ubuntu Sever

This is a complete installation script of a standalone server within Ubuntu Server. You must upgrade one of your projects to Enterprise to get this working.

johan-- /
Created Nov 25, 2018 — forked from NullVoxPopuli/
MeshRelay Action Cable Tests

Automated Message Sending

run in seperate terminals in this order:

  • mesh_relay_user_1.rb
  • mesh_relay_user_2.rb
    • sends a message to user 1
  • mesh_relay_user_3.rb
    • sends a message to user 1
johan-- / angular_test.html
Created Oct 30, 2018 — forked from commercial-hippie/angular_test.html
AngularJS 101: Trying to figure out how to make clone-able or duplicate-able form inputs and input groups.
View angular_test.html
<!DOCTYPE html>
<html ng-app="sasApp">
<title>AngularJS Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
johan-- / app.module.ts
Created Sep 20, 2018 — forked from yarrgh/app.module.ts
Example of using ngx-translate with ngx-toastr using a custom component
View app.module.ts
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
declarations: [
imports: [
johan-- / nginx.conf
Created Mar 7, 2018 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
View nginx.conf
server { listen 80;
access_log /var/log/;
error_log /var/log/;
root /var/www/apps/;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
johan-- / Dockerfile
Created Mar 6, 2018 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
View Dockerfile
# set the base image to Debian
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
johan-- /
Created Feb 12, 2018 — forked from vparihar01/
How to fix: Nokogiri Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0. dlopen Using homebrew on lion to install nokogiri and lixml
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
ERROR -: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
View ubuntu16.04-command-line-install-android-sdk
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jre
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
You can’t perform that action at this time.