Skip to content

Instantly share code, notes, and snippets.

Had to add line to pg_hba.conf:
You need to open file called /var/lib/pgsql/data/pg_hba.conf. Login as postgres user using su command:
$ su - postgres
$ vi /var/lib/pgsql/data/pg_hba.conf
Now append following line. Let us say you would like to give access to 192.168.1.0/24 network:
host all all 192.168.1.0 255.255.255.0 trust
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(200) NOT NULL
);
insert into users (name) values ('bob'), ('tom'), ('jane'), ('mary');
CREATE TABLE sales (
id SERIAL PRIMARY KEY,
user_id int references users(id),
@ajkovar
ajkovar / psql-issue.sh
Last active June 30, 2020 01:14
psql issue
#Received this error recently
psql
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/Cellar/postgresql@10/10.6_1/lib/libpq.5.10.dylib
Reason: image not found
Abort trap: 6
# Based on this post
#https://stackoverflow.com/questions/59006602/dyld-library-not-loaded-usr-local-opt-openssl-lib-libssl-1-0-0-dylib
# I hade to change homebrew's versino of openssl
docker-machine create default
# this I think not needed because it was started on create?:
# docker-machine start default
eval $(docker-machine env default)
# create/start docker containers based on docker-compose config files
docker-compose up
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
sudo apt-get install rng-tools gpgv
{
init: function(elevators, floors) {
var capacity = 4;
var step = Math.floor(floors.length / elevators.length)
var getClosestElevator = function(elevators, floor){
return elevators.reduce(function(closest, current){
var distance1 = Math.abs(closest.currentFloor()-floor.floorNum())
var distance2 = Math.abs(current.currentFloor()-floor.floorNum())
if(distance1 > distance2){
return current
# 'ag' command - search for text
sudo apt-get install silversearcher-ag
#!/bin/bash
# needed for compiling emacs
sudo apt-get install -y libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff4-dev libncurses5-dev qjackctl qsynth
# misc
sudo apt-get install -y aptitude rlwrap grc
# work
sudo apt-get install -y mysql-server git git-gui openjdk-7-jdk openjdk-6-jdk curl
sudo apt-get install libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff4-dev libncurses5-dev