Skip to content

Instantly share code, notes, and snippets.

View chinthakagodawita's full-sized avatar

Chin Godawita chinthakagodawita

View GitHub Profile
# PHP-FPM configuration
<IfModule mod_fastcgi.c>
Alias /php5.fastcgi /var/lib/apache2/fastcgi/php5.fastcgi
AddHandler php-script .php
FastCGIExternalServer /var/lib/apache2/fastcgi/php5.fastcgi -socket /var/run/php-fpm-apache2.sock -idle-timeout 610
Action php-script /php5.fastcgi virtual
# Forbid access to the fastcgi handler.
<Directory /var/lib/apache2/fastcgi>
<Files php5.fastcgi>
Warning: Your Xcode (4.5) is outdated
Please install Xcode 4.6.
==> Downloading http://curl.haxx.se/download/curl-7.28.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/curl-ca-bundle-1.87.tar.gz
==> perl mk-ca-bundle.pl
Use of uninitialized value in gmtime at mk-ca-bundle.pl line 89.
Couldn't open certdata.txt: No such file or directory at mk-ca-bundle.pl line 128.
Downloading 'certdata.txt' ...
Processing 'certdata.txt' ...
require 'rubygems'
require 'redis'
class RedisTrie
TERMINAL = '+'
def initialize(prefix)
@prefix = prefix
@r = Redis.new
end
@chinthakagodawita
chinthakagodawita / default.vcl
Last active January 3, 2016 13:09
Nginx config for a Drupal installation with Varnish.
# Demonz default Varnish config.
#
# Modified from:
# https://fourkitchens.atlassian.net/wiki/display/TECH/Configure+Varnish+3+for+Drupal+7
#
# Default backend definition. Set this to point to your content
# server.
backend default {
.host = "MYSERVER";
.port = "80";

Setting a wifi card to monitor mode

This is required before libtins/libpcap will get packets:

DEVICE=wlan0
sudo ifconfig $DEVICE down
sudo iwconfig $DEVICE mode monitor
sudo ifconfig $DEVICE up

Keybase proof

I hereby claim:

  • I am chinthakagodawita on github.
  • I am torpy (https://keybase.io/torpy) on keybase.
  • I have a public key whose fingerprint is F10D A51A F2F8 DB03 1838 54D2 D1F5 F672 6F9B 27CD

To claim this, I am signing this object:

@chinthakagodawita
chinthakagodawita / profile
Last active August 29, 2015 14:24 — forked from garthk/profile
wait4eth1() {
CNT=0
until ip a show eth1 | grep -q UP
do
[ $((CNT++)) -gt 60 ] && break || sleep 1
done
sleep 1
}
wait4eth1
@chinthakagodawita
chinthakagodawita / php-version.fish
Created July 21, 2015 13:12
`php-version` in Fish
function php-version
set -l env_file (mktemp -t php-version.fish.XXXXXXXXXX)
bash -c 'echo "$@"; source $(brew --prefix php-version)/php-version.sh; php-version "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
# apply php-version_* and *PATH variables from the captured environment
echo (cat $env_file)
# and eval (grep '^php-version\|^[^=]*PATH' $env_file | sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//')
# clean up
rm -f $env_file
end
@chinthakagodawita
chinthakagodawita / get-shasum.sh
Created August 25, 2015 13:23
Get SHA256 for a homebrew-dh release.
#!/usr/bin/env bash
set -o nounset
tag=""
echo "Enter version tag: "
read tag
curl "https://github.com/chinthakagodawita/docker-hat/releases/tag/$tag" | shasum -a 256