Skip to content

Instantly share code, notes, and snippets.

View snaga's full-sized avatar

Satoshi Nagayasu snaga

View GitHub Profile
@snaga
snaga / gist:5954434
Last active December 19, 2015 12:19
Top 10 Reviewers (and more) for this CF. (as of July.9 12:00pm JST) Generated by rank_top_reviewers.pl
Top 10 Reviewers (and more) for this CF. (as of July.9 12:00pm JST)
9 reviews: Robert Haas
8 reviews: Heikki Linnakangas, Andres Freund
7 reviews: Hitoshi Harada
6 reviews: Szymon Guz
5 reviews: Greg Smith, Fabien Coelho
4 reviews: Satoshi Nagayasu, Abhijit Menon-Sen, Jeevan Chalke, Andrew Dunstan
3 reviews: Robins Tharakan, Amit Kapila, Steve Singer, Simon Riggs, Dimitri Fontaine, Fujii Masao, Rushabh Lathia, Dean Rasheed
2 reviews: Fabrízio de Royes Mello, Jeff Janes, Jeff Davis, Álvaro Herrera, Pavel Stehule, Peter Eisentraut, Cédric Villemain
@snaga
snaga / gist:6006449
Created July 16, 2013 07:08
Top 10 Reviewers (and more) for this CF. (as of July.16 16:00pm JST)
Top 10 Reviewers (and more) for this CF. (as of July.16 16:00pm JST)
9 reviews: Robert Haas
8 reviews: Heikki Linnakangas
7 reviews: Hitoshi Harada, Andres Freund
6 reviews: Szymon Guz, Greg Smith
5 reviews: Fabien Coelho
4 reviews: Satoshi Nagayasu, Abhijit Menon-Sen, Jeevan Chalke, Andrew Dunstan
3 reviews: Amit Kapila, Steve Singer, Simon Riggs, Dimitri Fontaine, Rushabh Lathia, Dean Rasheed
2 reviews: Robins Tharakan, Fabrízio de Royes Mello, Jeff Janes, Jeff Davis, Álvaro Herrera, Pavel Stehule, Peter Eisentraut, Fujii Masao, Cédric Villemain
@snaga
snaga / gist:6534305
Created September 12, 2013 08:10
provision file for postgresql93 with vagrant
#
# provision file for postgresql93 on vagrant
#
sudo rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
sudo yum install -y postgresql93 postgresql93-server postgresql93-contrib postgresql93-libs
sudo -u postgres /usr/pgsql-9.3/bin/initdb -D /var/lib/pgsql/9.3/data --no-locale -E utf-8 -k
sudo /sbin/chkconfig postgresql-9.3 on
sudo /sbin/service postgresql-9.3 start
@snaga
snaga / gist:7495184
Created November 16, 2013 02:35
postgresql.conf @ RDS for PostgreSQL
testdb=> SELECT name,setting,unit FROM pg_settings;
name | setting | unit
---------------------------------+---------------------------------------------+------
allow_system_table_mods | off |
application_name | psql |
archive_command | /etc/rds/dbbin/pgscripts/rds_wal_archive %p |
archive_mode | on |
archive_timeout | 300 | s
array_nulls | on |
authentication_timeout | 60 | s
@snaga
snaga / EzParallel.pm
Created November 11, 2014 09:45
EzParallel.pm - A Simple Library for Parallel Processing
package EzParallel;
use strict;
use POSIX;
our $pidfile = ".ez.pids";
our $lockfile = ".ez.lock";
our $lock_fh;
sub _log {
@snaga
snaga / EzParallel.py
Last active August 29, 2015 14:10
EzParallel.py - A Simple Library for Parallel Processing
# -*- coding: utf-8 -*-
# EzParallel.py
#
# Copyright(C) 2014 Satoshi Nagayasu
# Copyright(C) 2014 Uptime Technologies, LLC.
import fcntl
from time import strftime, localtime
import os
@snaga
snaga / install_pgxl.sh
Last active August 29, 2015 14:14
install_pgxl.sh
#!/bin/sh
# install_pgxl.sh
#
# Copyright(c) 2015 Uptime Technologies, LLC.
PGXL_HOME=/opt/uptime/pgxl
PGXL_DATA=/var/lib/pgxl
PGXC_CTL_HOME=${PGXL_DATA}/pgxc_ctl
@snaga
snaga / pgxc_ctl.conf.template
Created January 25, 2015 10:39
pgxc_ctl.conf.template
#!/usr/bin/env bash
#
# Postgres-XC Configuration file for pgxc_ctl utility.
#
# Configuration file can be specified as -c option from pgxc_ctl command. Default is
# $PGXC_CTL_HOME/pgxc_ctl.org.
#
# This is bash script so you can make any addition for your convenience to configure
# your Postgres-XC cluster.
#
@snaga
snaga / test_brin.sql
Last active August 29, 2015 14:17
test_brin.sql
-- for more details, visit below.
-- http://michael.otacoo.com/postgresql-2/postgres-9-5-feature-highlight-brin-indexes/
\timing
CREATE TABLE brin_example AS SELECT generate_series(1,100000000) AS id;
CREATE INDEX brin_index ON brin_example USING brin(id);
EXPLAIN ANALYZE SELECT id FROM brin_example WHERE id = 52342323;
CREATE INDEX btree_index ON brin_example(id);
@snaga
snaga / pg_filedump_95.diff
Last active August 29, 2015 14:24
pg_filedump_95.diff
diff -rc pg_filedump-9.3.0.orig/pg_filedump.c pg_filedump-9.3.0/pg_filedump.c
*** pg_filedump-9.3.0.orig/pg_filedump.c 2014-06-11 02:23:06.000000000 +0900
--- pg_filedump-9.3.0/pg_filedump.c 2015-07-03 13:46:07.920639843 +0900
***************
*** 3,9 ****
* formatting heap (data), index and control files.
*
* Copyright (c) 2002-2010 Red Hat, Inc.
! * Copyright (c) 2011-2014, PostgreSQL Global Development Group
*