Using JSON in Postgres by example.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
#!/bin/sh | |
# AUTHOR | |
# DANIEL E. GILLESPIE (2016) | |
# https://github.com/dantheman213 | |
# DESCRIPTION | |
# Export your app's table schemas and stored functions from a PostgreSQL | |
# database into individual *.sql files for easy management and source control. |
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
#!/bin/bash | |
OUT_DIR="/home/simon/manpages" | |
DATABASE="/home/simon/commands.db" | |
sqlite3 $DATABASE "PRAGMA encoding='UTF-8';" | |
sqlite3 $DATABASE "drop table if exists commands;" | |
sqlite3 $DATABASE "create table commands (_id integer primary key, category numeric, name text, description text, manpage text);" | |
path=( "man1" "man2" "man8" "man6" ) | |
categories=(1 2 8 6) |
First create ec2 Ubuntu instance
Then install all the things needed for Mirth Connect (following this video: http://www.youtube.com/watch?v=omZyAO2naqs)
# Update Ubuntu
sudo aptitude update
# Safe upgrade of Ubuntu
sudo aptitude safe-upgrade
Press minus + shift + s
and return
to chop/fold long lines!
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?