Skip to content

Instantly share code, notes, and snippets.

View elithrar's full-sized avatar
🌐
Helping make the Internet better.

Matt Silverlock elithrar

🌐
Helping make the Internet better.
View GitHub Profile
@mahmoudimus
mahmoudimus / fabfile.py
Created April 30, 2010 07:43 — forked from cyberdelia/fabfile.py
fabric deployment example
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
@mikhailov
mikhailov / installation.sh
Created November 23, 2010 15:18
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@zed
zed / parallel_stdout_processes.py
Created November 27, 2010 01:49
Run all processes in parallel. Group output by process groups and order within groups
#!/usr/bin/env python
"""Run all processes in parallel.
Group output by process groups and order within groups
"""
import shlex
import subprocess
import sys
import threading
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@derek-watson
derek-watson / tumblr.rb
Created March 12, 2011 18:47
Tumblr to Jekyll migration
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
# Supports post types: regular, quote, link, photo, video and audio
# Saves local copies of images
require 'rubygems'
require 'open-uri'
require 'nokogiri'
@joshdick
joshdick / email_obfuscation.htm
Created May 8, 2011 05:50
Elegant E-Mail Address Obfuscation
<!DOCTYPE html>
<!-- Created by Josh Dick <http://joshdick.net> -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<title>Elegant E-Mail Address Obfuscation</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
</head>
@bemasher
bemasher / Castle.xml
Created September 18, 2011 03:46
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@cjolly
cjolly / rewrite.rb
Created October 15, 2011 18:22
SEO on Rails or Rack
# As a general rule, I despise all things SEO with it's witchery and voodoo ways.
# However, these two practices are confirmed semi-non-witchcraft SEO best practice.
#
# 1. Serve your content from a consistent domain (www vs. non-www, Doesn't matter. Just be consistent)
# In addition this is nice for Heroku and other cloud based deployment environments that leave your app
# accessible from a url like http://myapp.herokuapp.com
#
# 2. Believe it or not, trailing slashes matter. The google machine interprets http://domain.com/about
# as a different page than domain.com/about/
# (source: http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html )
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/