This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set fileencoding=utf8 | |
''' | |
References | |
- http://stackoverflow.com/a/1966188 | |
- http://en.wikipedia.org/wiki/Tree_(data_structure) | |
$ python suggest.py prefix | |
''' | |
import sys | |
import redis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.kutukupret.com/2011/05/10/graphing-apachebench-results-using-gnuplot/ | |
# collect data | |
# $ ab -n 100 -c 4 -g imagemagick.tsv url | |
# $ ab -n 100 -c 4 -g gd.tsv url | |
# $ ab -n 100 -c 4 -g imlib2.tsv url | |
# plot data | |
# $ gnuplot template.p | |
# output as png image | |
set terminal png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo yum install -y libunwind perl-ExtUtils-Embed gperftools gperftools-libs gperftools-devel libxslt libxslt-devel GeoIP GeoIP-devel | |
$ ./configure \ | |
--add-module=./ngx_small_light \ | |
--prefix=/usr/share/nginx \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body \ | |
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set fileencoding=utf8 | |
# http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html | |
# http://aws.typepad.com/aws/2014/01/amazon-sqs-new-dead-letter-queue.html | |
import json | |
import boto | |
from pprint import pprint | |
conn = boto.connect_sqs() | |
q1 = conn.create_queue('test_q1') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE EXTENSION cstore_fdw; | |
CREATE SERVER cstore_server FOREIGN DATA WRAPPER cstore_fdw; | |
create foreign table users( | |
userid integer not null, | |
username char(8), | |
firstname varchar(30), | |
lastname varchar(30), | |
city varchar(30), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table users( | |
userid integer not null, | |
username char(8), | |
firstname varchar(30), | |
lastname varchar(30), | |
city varchar(30), | |
state char(2), | |
email varchar(100), | |
phone char(14), | |
likesports boolean, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy users from '/tmp/s3/allusers_pipe.txt' with null as '' delimiter '|'; | |
copy venue from '/tmp/s3/venue_pipe.txt' delimiter '|'; | |
copy category from '/tmp/s3/category_pipe.txt' with null as '' delimiter '|'; | |
copy date from '/tmp/s3/date2008_pipe.txt' with null as '' delimiter '|'; | |
copy event from '/tmp/s3/allevents_pipe.txt' with null as '' delimiter '|'; | |
copy listing from '/tmp/s3/listings_pipe.txt' with null as '' delimiter '|'; | |
copy sales from '/tmp/s3/sales_tab.txt' with null as '' delimiter '\t'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy users from '/tmp/s3/allusers_pipe.txt' with null as '' delimiter '|'; | |
copy venue from '/tmp/s3/venue_pipe.txt' delimiter '|'; | |
copy category from '/tmp/s3/category_pipe.txt' with null as '' delimiter '|'; | |
copy date from '/tmp/s3/date2008_pipe.txt' with null as '' delimiter '|'; | |
copy event from '/tmp/s3/allevents_pipe.txt' with null as '' delimiter '|'; | |
copy listing from '/tmp/s3/listings_pipe.txt' with null as '' delimiter '|'; | |
copy sales from '/tmp/s3/sales_tab.txt' with null as '' delimiter '\t'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
escape ^Z^\ | |
vbell off | |
# don't show startup messages | |
startup_message off | |
# detach on hangup - if my dial-up session fails, screen will simply | |
# detach and let me re re-attach later. | |
autodetach on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 2, | |
"waiters": { | |
"DataSourceAvailable": { | |
"delay": 30, | |
"operation": "GetDataSource", | |
"maxAttempts": 60, | |
"acceptors": [ | |
{ | |
"expected": "COMPLETED", |