TL;DR
Install Postgres 9.6, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
require "pg" | |
require "time" | |
PG_EPOCH = Time.gm(2000,1,1).to_i | |
conn = PG.connect | |
tm = PG::TypeMapByOid.new | |
tm.add_coder PG::BinaryDecoder::Integer.new(oid: 1184) | |
conn.type_map_for_results = tm | |
def parse_text(r) |
# Other settings have been omitted, the below changes are relevant | |
machine: | |
pre: | |
- sudo service postgresql stop | |
- sudo apt-get purge -y postgresql* | |
- sudo apt-get update | |
- sudo apt-get install postgresql | |
- sudo service postgresql start | |
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql" | |
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql" |
# HTTP crawler inside nginx. | |
# | |
# start crawling by curl http://127.0.0.1:18080/?host=<START URL> | |
# | |
worker_processes auto; | |
events { | |
worker_connections 16384; | |
} |
TL;DR
Install Postgres 9.6, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
-- Installs "file_fdw" extension and creates foreign table to work with data from CSV file. | |
-- See also the comment below which helps to automate the process for Google Spreadsheets | |
-- Another option would be using Multicorn for Google Spreadsheets, but it requires additional steps | |
-- (see https://wiki.postgresql.org/wiki/Foreign_data_wrappers). | |
create extension file_fdw; | |
create server "import" foreign data wrapper file_fdw; | |
create foreign table "table1" ( | |
col1 text, |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Draw psql output as iTerm2 v3 inline graph using matplotlib | |
# Author: Alexander Korotkov <[email protected]> | |
import sys | |
import re | |
import warnings | |
import matplotlib | |
matplotlib.use("Agg") |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
TL;DR
Install Postgres 9.5, and then:
sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
# install openjdk | |
sudo apt-get install openjdk-7-jdk | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
tar -xvf android-sdk_r24.2-linux.tgz | |
cd android-sdk-linux/tools | |
# install all sdk packages |
So I just found ZFS on my test Linux ubuntu system, and gave my perf-tools (https://github.com/brendangregg/perf-tools) a spin.
Per-second zfs* calls:
# ./funccount -Ti 1 'zfs*'
Tracing "zfs*"... Ctrl-C to end.
Tue Aug 5 00:51:41 UTC 2014
FUNC COUNT