This file contains 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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
This file contains 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
-- Show all running querys | |
SELECT user, pid, application_name, query, age(clock_timestamp(), query_start), state | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query |
This file contains 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
import argparse | |
import boto3 | |
import os | |
import threading | |
from fnmatch import fnmatch | |
# S3 multi-part upload parts must be larger than 5mb | |
MIN_S3_SIZE = 6000000 | |
LOG_LEVEL = 'INFO' |
This file contains 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
class InitializationError(Exception): pass | |
class StateMachine: | |
def __init__(self): | |
self.handlers = [] | |
self.startState = None | |
self.endStates = [] | |
def add_state(self, handler, end_state=0): | |
self.handlers.append(handler) |
This file contains 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
require 'csv' | |
require 'json' | |
require 'pp' | |
if ARGV.length < 2 | |
puts "usage: csv_to_struct.rb <in.csv> <out_name(no extension)> *[json|ruby] *symbolize_keys(bool)" | |
exit(1) | |
else | |
csv_file = ARGV[0] | |
output_file = ARGV[1].dup |