Skip to content

Instantly share code, notes, and snippets.

View gotbadger's full-sized avatar
🦡
Set your status

Philip Hayton gotbadger

🦡
Set your status
View GitHub Profile
@gotbadger
gotbadger / gist:2a67466df091512e96a2
Created January 19, 2015 17:11
Change mac address OSX to something random
NEW_MAC_ADDRESS=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
echo Mac changed to $NEW_MAC_ADDRESS
sudo ifconfig en0 ether $NEW_MAC_ADDRESS
ifconfig en0 |grep ether
@gotbadger
gotbadger / gist:6702336
Created September 25, 2013 16:35
Twitter Bootstrap 3 Find and Replace For Sublime. Usefull for adding all col sizes after only adding large
Find: col-lg-(\w)+
Replace col-lg-$1 col-md-$1 col-sm-$1 col-xs-$1
@gotbadger
gotbadger / gist:5109289
Created March 7, 2013 16:25
compare the changes in two branches. in this case the changes between master and development
git --no-pager diff --stat --color master..development
@gotbadger
gotbadger / gist:4979243
Created February 18, 2013 17:54
Setup SSH tunnel on OSX
#!/bin/bash
# setup local
BIND_ADAPTER="en0"
LOCAL_PORT=4000
# setup remote
REMOTE_USER="user"
REMOTE_HOST="server.example.com"
REMOTE_PORT=9999
@gotbadger
gotbadger / dav.nginx
Created June 19, 2012 08:45
Nginx PUT
server {
listen 8880;
root /var/www;
index index.html index.htm;
server_name localhost;
location / {
@gotbadger
gotbadger / publish.coffee
Created May 18, 2012 08:38
AMQP Publisher
amqp = require 'amqp'
connection = amqp.createConnection { host: 'localhost' }
# Wait for connection to become established.
connection.on 'ready', ()->
exchange = connection.exchange 'phil-exchange'
exchange.publish '#',"hello"
@gotbadger
gotbadger / listen.coffee
Created May 18, 2012 08:37
AMQP Listener
amqp = require('amqp');
connection = amqp.createConnection { host: 'localhost' }
# Wait for connection to become established.
connection.on 'ready', ()->
exchange = connection.exchange 'phil-exchange'
# Create a queue and bind to all messages.
connection.queue 'phil-queue',{autoDelete:false,durable:true}, (q)->
# Catch all messages