Skip to content

Instantly share code, notes, and snippets.

View zol's full-sized avatar

Zoltan Olah zol

View GitHub Profile
@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
@zol
zol / gist:16710210c9f7569a7050
Last active August 29, 2015 14:01
Tunnel remote port to localhost
ssh -L 9000:localhost:8983 ubuntu@host
# forwards remote port 8993 to local port of localhost:9000 as seen by host
@zol
zol / gist:2dadb04add98bc8c3219
Created June 25, 2014 18:30
Redirect all output and background command
some_cmd > some_file 2>&1 &
@zol
zol / gcontrol.sh
Last active August 29, 2015 14:06
Ground Control CLI
#!/usr/bin/env bash
#
# Ground Control CLI
# Copyright Percolate Studio 2014
if [ $# -gt 0 ]; then
ssh -t -x $1@build.gcontrol.io gcontrol ${*:2}
else
echo "Ground Control CLI"
echo "Usage: gcontrol.sh <app> [command] [arguments]"
@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