Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
filename = case ARGV.size
when 0 then '.env'
when 1 then ARGV.first
else raise 'Too much arguments'
end
envs = File.read(filename).split("\n").join(" ")
sudo tcpdump -s 1024 -l -i eth0 -n -A host $DOMAIN and port 80 -w $OUTPUT
@jney
jney / gist:1562752
Created January 4, 2012 23:14
recipe
# Application Generator Template
# Modifies a Rails app to use Mongoid and OmniAuth
# Usage: rails new APP_NAME -m http://gist.github.com/path/to/this/raw/gist -T -O
# Information and a tutorial:
# http://github.com/RailsApps/rails3-mongoid-omniauth/
# Generated using the rails_apps_composer gem:
# https://github.com/RailsApps/rails_apps_composer/
@jney
jney / nokogiri.sh
Created September 20, 2011 14:08 — forked from retr0h/gist:1001477
RVM + HomeBrew + Nokogiri
#!/bin/sh
##
# to install :
# $ curl -L "https://gist.github.com/gists/path/to/raw/gist/nokogiri.sh" | sh
set -e
echo "installing libraries"
brew install libxml2
@jney
jney / LICENSE.txt
Created June 21, 2011 11:01 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
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
@jney
jney / less-math.js
Created April 25, 2011 12:08
get every Math constants and functions in less.js
if( '__proto__' in {} ) {
tree.functions = Math.__proto__;
} else {
var mathFn = 'E LN2 LN10 LOG2E LOG10E PI SQRT1_2 SQRT2 abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan'.split(' ');
for (var i = 0; i < mathFn.length; i++) {
tree.functions[mathFn[i]] = Math[mathFn[i]];
}
}
@jney
jney / translate-srt.py
Created March 28, 2011 20:37
translate a srt file with google translate
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,json,urllib
from pysrt import SubRipFile, SubRipItem
url_string = 'http://ajax.googleapis.com/ajax/services/language/'
def detect(text):
query = dict(v='1.0', q=text)
@jney
jney / gist:838547
Created February 22, 2011 11:37 — forked from ezmobius/gist:807334
#!/bin/bash
set -e
trap onexit 1 2 3 15 ERR
function onexit {
echo "## cleaning installation folder"
pushd /tmp
rm -rf libev-mirror
rm -rf zeromq-2.1.0
@jney
jney / trace.log
Created February 15, 2011 21:06
sudo dtruss -a -f -l $(which nginx) 2>&1 | tee ./trace.log > /dev/null
PID/THRD RELATIVE ELAPSD CPU SYSCALL(args) = return
3110/0x181437: 229 511 0 getpid(0x7FFF5FBFEC80, 0x7FFFFFE00050, 0x0) = 3110 0
3110/0x181437: 299 76 67 open_nocancel("/dev/urandom\0", 0x0, 0x0) = 3 0
3110/0x181437: 332 40 31 read_nocancel(0x3, "\205\343\261&\327RQd\330v\276\032\016\313\362#\341\244\307\033\327dZ!.\332m>9\2054$G\335aRS\300\345\224fs\354\221\254\317\177f\304\002\273\037\355X\344V\234B\200\re\230Y\357\260\3217^\002\2332\203\377\255\206\342D\v\343\345c\212[bt\373X\264\027\202\373\207\317\311\230\321lX\360\304\357\021\370\214/\344AH\0", 0x6C) = 108 0
3110/0x181437: 340 13 6 close_nocancel(0x3) = 0 0
3110/0x181437: 383 6 0 issetugid(0x100000000, 0x7FFF5FBFEF98, 0x7FFF5FC40530) = 0 0
3110/0x181437: 385 5 0 geteuid(0x100000000, 0x7FFF5FBFEF98, 0x0) = 0 0
3110/0x181437: 469 21 15 __sysctl(0x7FFF5FBFCB70, 0x2, 0x7FFF5FBFCB30) = 0 0
3110/0x181437: 476
@jney
jney / lua.out
Created February 15, 2011 20:58
nm $(which lua) > lua.out
000000010002e15c s stub helpers
000000010001e230 t _Arith
000000010000e070 t _DumpFunction
000000010002e0d8 s _KEY_HOOK
000000010001c4c0 t _LoadFunction
000000010001c3e0 t _LoadString
00000001000361f0 D _NXArgc
00000001000361f8 D _NXArgv
U __DefaultRuneLocale
U ___error