Skip to content

Instantly share code, notes, and snippets.

View zol's full-sized avatar

Zoltan Olah zol

View GitHub Profile
@zol
zol / 1.8.7-p173
Created December 7, 2011 01:07
ruby-build file to match ruby+gem on production icyte server
require_gcc
install_package "ruby-1.8.7-p173" "http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p173.tar.gz"
install_package "rubygems-1.3.6" "http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz" ruby
@zol
zol / gist:4229164
Created December 6, 2012 22:44
TCPDump log packets to port 9090 on en1
sudo tcpdump -w logged.pcap -i en1 -vv dst port 9090
@zol
zol / gist:5469228
Created April 26, 2013 18:12
WIP cordova In App Browser wrapper.
IAB = {
closed: true, //for meteor to detect closed state
open: function(url, cb, goalURL) {
var that = this;
cordova.exec(function(params) {
switch (params.type) {
case 'loadstart':
console.log('IAB: loadstart url, ' + params.url);
@zol
zol / gist:5810016
Created June 18, 2013 22:23
Running chrome with security disabled to test cross origin ajax.
open -a Google\ Chrome --args --disable-web-security
@zol
zol / gist:6440391
Created September 4, 2013 17:53
Debugging a meteor app with node inspector.
Client-side you have the console. For server-side debugging, use node-inspector and make sure you have meteor v0.5.3, which makes things easier thanks to support for NODE_OPTIONS:
Install node-inspector: `npm install -g node-inspector`
Start meteor: `NODE_OPTIONS='--debug' mrt run`
Start `node-inspector`
Go to the URL given by node-inspector in Chrome
Debug at will
@zol
zol / gist:6643666
Created September 20, 2013 20:45
Restore a dumped mongodb into local meteor development db
mongorestore --port 3002 --drop --db meteor ./dump/verso/
@zol
zol / gist:8428649
Created January 15, 2014 00:26
Connecting to a running meteor development app's mongodb oplog from a second app launched on port 3100
MONGO_OPLOG_URL=mongodb://127.0.0.1:3002/local MONGO_URL=mongodb://127.0.0.1:3002/meteor meteor --port 3100
@zol
zol / gist:8905602
Created February 9, 2014 20:38
Copy directory tree excluding .git directories
rsync -av --exclude='.git*' src dest
@zol
zol / watch-mongodb-oplog.js
Last active August 29, 2015 13:56
Tailing the mongodb oplog
#!/usr/bin/env node
MongoWatch = require('mongo-watch');
new MongoWatch({
format: 'pretty',
db: 'XXX',
host: 'XXX'
}).watch();
@zol
zol / gist:62c772d94d33581b9ab6
Created May 2, 2014 19:29
Remove branches from origin that have been merged into master except devel
git fetch
git checkout master
git branch --merged | grep -v "\*" | grep -v devel | xargs -n 1 git push --delete origin
# this last step is for colleagues to clean up their local tracking branches
git remote prune origin