Skip to content

Instantly share code, notes, and snippets.

johan pretorius johan--

View GitHub Profile
@johan--
johan-- / psql-error-fix.md
Created Feb 25, 2019 — forked from AtulKsol/psql-error-fix.md
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)
View psql-error-fix.md

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 Feb 2, 2019 — forked from AliYusuf95/Socket.java
Websocket implementation using OkHttp3 with {event->data} message format to make your life easier.
View Socket.java
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 Jan 18, 2019 — forked from travist/README.md
Installing Form.io on Ubuntu Server
View README.md

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 Nov 25, 2018 — forked from NullVoxPopuli/README.md
MeshRelay Action Cable Tests
View README.md

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 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">
<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 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);
}
@NgModule({
declarations: [
AppComponent,
TranslateToast,
],
imports: [
@johan--
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;
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 Mar 6, 2018 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
View Dockerfile
# 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 Feb 12, 2018 — 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
View nokogiri_libxml_homebrew_lion_installation.sh
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
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
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
You can’t perform that action at this time.