Skip to content

Instantly share code, notes, and snippets.

View johan--'s full-sized avatar

johan pretorius johan--

View GitHub Profile
@johan--
johan-- / psql-error-fix.md
Created February 25, 2019 06:20 — forked from AtulKsol/psql-error-fix.md
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:

from

@johan--
johan-- / Socket.java
Created February 2, 2019 08:17 — forked from AliYusuf95/OnEventListener.java
Websocket implementation using OkHttp3 with {event->data} message format to make your life easier.
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.ProtocolException;
import java.util.HashMap;
@johan--
johan-- / README.md
Created January 18, 2019 07:14 — forked from travist/README.md
Installing Form.io on Ubuntu Server

Installing Form.io Enterprise on Ubuntu Sever

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

@johan--
johan-- / README.md
Created November 25, 2018 11:54 — forked from NullVoxPopuli/README.md
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--
johan-- / angular_test.html
Created October 30, 2018 09:00 — 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.
<!DOCTYPE html>
<html ng-app="sasApp">
<head>
<title>AngularJS Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">
@johan--
johan-- / app.module.ts
Created September 20, 2018 08:14 — forked from trevor-hackett/app.module.ts
Example of using ngx-translate with ngx-toastr using a custom component
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
@NgModule({
declarations: [
AppComponent,
TranslateToast,
],
imports: [
@johan--
johan-- / nginx.conf
Created March 7, 2018 10:36 — forked from calebwoods/nginx.conf
Sample Nginx config for deployment of Angular.js app
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}
@johan--
johan-- / Dockerfile
Created March 6, 2018 07:37 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/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--
johan-- / nokogiri_libxml_homebrew_lion_installation.sh
Created February 12, 2018 08:57 — forked from vparihar01/nokogiri_libxml_homebrew_lion_installation.sh
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 bundle.open. Using homebrew on lion to install nokogiri and lixml
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
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
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
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz