View hack.sh
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
#!/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 | |
# |
View pjax.rb
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
#encoding: UTF-8 | |
require 'rubygems' | |
require 'sinatra' | |
require 'erb' | |
require 'pp' | |
class Sinatra::Request | |
def pjax? | |
env['HTTP_X_PJAX'] || self['_pjax'] |
View pjax.rb
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
#encoding: UTF-8 | |
require 'rubygems' | |
require 'sinatra' | |
require 'erb' | |
require 'pp' | |
class Sinatra::Request | |
def pjax? | |
env['HTTP_X_PJAX'] || self['_pjax'] |
View pjax.rb
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
#encoding: UTF-8 | |
require 'rubygems' | |
require 'sinatra' | |
require 'erb' | |
require 'pp' | |
class Sinatra::Request | |
def pjax? | |
env['HTTP_X_PJAX'] || self['_pjax'] |
View lsyncd.lua
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
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" | |
} |
View gist:963520
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
#!/bin/bash | |
## | |
## are you root? | |
## | |
if [ "$(whoami)" != "root" ]; then | |
echo "You need to be root to run this!" | |
exit 2 | |
fi |
View setup-ubuntu-wp.sh
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
#!/bin/bash | |
cd | |
# | |
# fix locales | |
# | |
echo "en_US.UTF-8 UTF-8" > /var/lib/locales/supported.d/local | |
dpkg-reconfigure locales |
View nginx-vhost.conf
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
upstream php-fpm { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
server { | |
listen 80; | |
server_name www.example.com; | |
rewrite ^ http://example.com$request_uri?; | |
} |
View strace
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
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 |
View vcl.vim
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
" Vim syntax file | |
" Filename: vcl.vim | |
" Language: Varnish configuation Language, http://www.varnish-cache.org/wiki/VCL | |
" Maintainer: Elan Ruusamäe <glen@delfi.ee> | |
" 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 |
NewerOlder