Skip to content

Instantly share code, notes, and snippets.

@tjstein
tjstein / hack.sh
Created April 2, 2012 06:03 — forked from stammy/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@tjstein
tjstein / pjax.rb
Created March 22, 2012 15:15 — forked from kazu69/pjax.rb
Pjax(pushState + Ajax) with Sinatra and BackboneJs
#encoding: UTF-8
require 'rubygems'
require 'sinatra'
require 'erb'
require 'pp'
class Sinatra::Request
def pjax?
env['HTTP_X_PJAX'] || self['_pjax']
@tjstein
tjstein / pjax.rb
Created March 22, 2012 15:15 — forked from kazu69/pjax.rb
Pjax(pushState + Ajax) with Sinatra and BackboneJs
#encoding: UTF-8
require 'rubygems'
require 'sinatra'
require 'erb'
require 'pp'
class Sinatra::Request
def pjax?
env['HTTP_X_PJAX'] || self['_pjax']
@tjstein
tjstein / pjax.rb
Created March 22, 2012 15:15 — forked from kazu69/pjax.rb
Pjax(pushState + Ajax) with Sinatra and BackboneJs
#encoding: UTF-8
require 'rubygems'
require 'sinatra'
require 'erb'
require 'pp'
class Sinatra::Request
def pjax?
env['HTTP_X_PJAX'] || self['_pjax']
@tjstein
tjstein / lsyncd.lua
Created August 29, 2011 16:26
lsyncd conf for multiple targets
settings = {
delay = 1,
maxProcesses = 3,
logfile = "/var/log/lsyncd.log",
}
targetlist = {
"10.0.1.24:/var/www/thomasjstein.com",
"10.0.1.26:/var/www/thomasjstein.com"
}
#!/bin/bash
##
## are you root?
##
if [ "$(whoami)" != "root" ]; then
echo "You need to be root to run this!"
exit 2
fi
@tjstein
tjstein / setup-ubuntu-wp.sh
Created May 5, 2011 03:19
WordPress auto-setup for Ubuntu (ve)
#!/bin/bash
cd
#
# fix locales
#
echo "en_US.UTF-8 UTF-8" > /var/lib/locales/supported.d/local
dpkg-reconfigure locales
@tjstein
tjstein / nginx-vhost.conf
Created April 5, 2011 00:47
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
root@thestartupcafe:/etc/nginx/sites-available# strace -s 128 -p 23999
Process 23999 attached - interrupt to quit
epoll_wait(6, {{EPOLLIN, {u32=245678976, u64=245678976}}}, 512, 4294967295) = 1
accept4(8, {sa_family=AF_INET, sin_port=htons(56494), sin_addr=inet_addr("72.10.62.12")}, [16], SOCK_NONBLOCK) = 3
epoll_ctl(6, EPOLL_CTL_ADD, 3, {EPOLLIN|EPOLLET, {u32=245679329, u64=245679329}}) = 0
epoll_wait(6, {{EPOLLIN, {u32=245679329, u64=245679329}}}, 512, 60000) = 1
recvfrom(3, "GET / HTTP/1.1\r\nHost: thestartupcafe.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefo"..., 1024, 0, NULL, NULL) = 954
stat("/var/www/thestartupcafe.com/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/var/www/thestartupcafe.com/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/var/www/thestartupcafe.com/index.php", {st_mode=S_IFREG|0644, st_size=397, ...}) = 0
@tjstein
tjstein / vcl.vim
Created October 12, 2010 02:43
vcl.vim
" Vim syntax file
" Filename: vcl.vim
" Language: Varnish configuation Language, http://www.varnish-cache.org/wiki/VCL
" Maintainer: Elan Ruusamäe <[email protected]>
" Version Info: $Revision: 1.7 $
" Last Change: $Date: 2010/04/06 08:24:28 $ UTC
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600