Skip to content

Instantly share code, notes, and snippets.

View bscott's full-sized avatar
🏠
Working from home

Brian Scott bscott

🏠
Working from home
View GitHub Profile

This gist is the source code for http://gary.beagledreams.com/page/go-websocket-chat.html

Copyright (c) 2013 Gary Burd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@bscott
bscott / .tmux.conf
Created May 19, 2013 23:05 — forked from anonymous/tmux.conf
dotFiles
# Change the prefix key to Ctrl-a.
unbind C-b
set -g prefix C-a
# Set the screen to 256 colors.
set -g default-terminal 'xterm-256color'
# Change the last active window keybinding.
unbind l
bind C-a last-window
@bscott
bscott / server.js
Created December 16, 2012 08:27 — forked from anonymous/server.js
var http = require("http");
var port = process.env.PORT
function start() {
function onRequest(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
@bscott
bscott / heroku_style_baby.rb
Created July 13, 2012 18:32 — forked from gilesbowkett/heroku_style_baby.rb
Heroku-style dev on EC2 || Slicehost || whatev
require 'rubygems'
require 'sinatra'
require 'json'
class GitHubUpdater
def self.update?(json)
(JSON.parse(json)["ref"] == "refs/heads/master")
end
def run_pg_fouine():
info = host_info[env.host_string]
db_name = info.tags.get('Name')
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
time.sleep(30)
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt')
run('gzip -f /tmp/pgfouine.txt')
heroku config --long | ruby -pe "\$_ = \$_.gsub(/(\w+)\s+=> (.+)/, 'export \1=\2')" > /tmp/$$ && source /tmp/$$; rm /tmp/$$