Skip to content

Instantly share code, notes, and snippets.

View tsabat's full-sized avatar

Tim Sabat tsabat

View GitHub Profile
@tsabat
tsabat / nginx_websocket.txt
Last active December 30, 2015 20:59
nginx websockt
upstream backend {
server 127.0.0.1:8001;
server 127.0.0.1:8002;
}
server {
listen 80;
access_log /var/log/nginx/yoursite.access.log;
error_log /var/log/nginx/yoursite.error.log;
@tsabat
tsabat / A-Pen-by-Tim-Sabat.markdown
Created January 14, 2014 21:14
A Pen by Tim Sabat.
@tsabat
tsabat / A-Pen-by-Tim-Sabat.markdown
Created January 14, 2014 21:17
A Pen by Tim Sabat.
function gpush() {
gc .; gp origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
}
function gpull() {
gc .; git pull origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
}
@tsabat
tsabat / for_dee.md
Last active August 29, 2015 13:55
rails stack from start to finish
  • create a root user >
  • Install ruby via rbenv >
  • Install phusion passenger >
  • Set up capistrano in your project's Gemfile >
  • change your nginx/default server
  • set up capistrano
  • install node >
#!/bin/bash
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev \
libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev -y
@tsabat
tsabat / nginx.conf
Last active May 2, 2018 09:13
Install nginx and phusion passenger
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@tsabat
tsabat / nodejs.sh
Created January 31, 2014 16:30
install nodejs on ubuntu
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
@tsabat
tsabat / unused.py
Created February 22, 2014 20:42
delete unused ebs volumes
#! env python
from boto import ec2
conn = ec2.connect_to_region('us-west-2')
vols = conn.get_all_volumes(filters={'status': 'available'})
for vol in vols:
print 'checking vol:', vol.id, 'status:', vol.status, 'attachment_id:', vol.attach_data.status
conn.delete_volume(vol.id)
'''
@author Bommarito Consulting, LLC
@date 20120622
Identify and, if requested, remove orphaned snapshots from an EC2 account.
'''
# Imports
import boto