Skip to content

Instantly share code, notes, and snippets.

View christopherdebeer's full-sized avatar

Christopher de Beer christopherdebeer

View GitHub Profile
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@christopherdebeer
christopherdebeer / index.js
Created July 17, 2012 15:59 — forked from aemkei/index.js
Obfuscate JS
// RUN THIS IN JAVASCRIPT
([]+{}+[])[!!{}+![]]+([]+
{}+[])[!!{}+!![]]+(!{}+[]
)[!{}+![]]+([][{}]+[])[!{
}+![]]+(!{}+[])[![]+!!{}+
!!{}+!![]]+({}+{})[(!!{}+
!![])*(!!{}+!![])+!!{}]+(
{}-{}+[])[!!{}+![]]+([]+!
!{})[!{}+![]]+([]+!!{})[!
@christopherdebeer
christopherdebeer / layout2.jade
Created July 9, 2012 15:23 — forked from kmiyashiro/layout2.jade
HTML5 Boilerplate Conditional comments in Jade
!!! 5
//if lt IE 7
html(class="no-js ie6 oldie", lang="en")
//if IE 7
html(class="no-js ie7 oldie", lang="en")
//if IE 8
html(class="no-js ie8 oldie", lang="en")
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <![endif]
@christopherdebeer
christopherdebeer / gist:2331687
Created April 7, 2012 19:56 — forked from mikeal/gist:2331127
safe .toJSON()
function getSafe (self, uuid) {
if (typeof self === 'object' || typeof self === 'function') var safe = {}
if (Array.isArray(self)) var safe = []
var recurse = []
Object.defineProperty(self, uuid, {})
var attrs = Object.keys(self).filter(function (i) {
if (i === uuid) return false
@christopherdebeer
christopherdebeer / scrape_tweets.rb
Created March 25, 2012 14:50 — forked from stefl/scrape_tweets.rb
Download all tweets from the twitter search API for a given search term (limited to their maximum of 1500)
#! /usr/bin/env ruby
search_term = ARGV[0]
if search_term
time = Time.now
directory_path = File.dirname(__FILE__) + "/tweets/" + search_term + "_" + time.to_i.to_s
Dir.mkdir_p(directory_path)
directory = Dir.new(directory_path)
(1..15).each do |i|
`curl "http://search.twitter.com/search.json?q=#{search_term}&rpp=100&page=#{i}&include_entities=true&result_type=mixed" > #{directory.path}/#{i}.json`
end
@christopherdebeer
christopherdebeer / LICENSE.txt
Created June 1, 2011 13:40 — forked from 140bytes/LICENSE.txt
RGB to Luminosity (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@christopherdebeer
christopherdebeer / LICENSE.txt
Created June 1, 2011 13:16 — forked from jed/LICENSE.txt
convert HEX to RGB
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@christopherdebeer
christopherdebeer / LICENSE.txt
Created June 1, 2011 13:16 — forked from jed/LICENSE.txt
convert RGB to HEX
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE