Skip to content

Instantly share code, notes, and snippets.

View rustyrazorblade's full-sized avatar

Jon Haddad rustyrazorblade

View GitHub Profile
@rustyrazorblade
rustyrazorblade / gist:6567023
Created September 15, 2013 00:35
DHCP network bridge from wired to wireless
jhaddad@media ~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
iface eth2 inet manual
iface wlan1 inet manual
auto br0
iface br0 inet dhcp
/**
* Created with IntelliJ IDEA.
* User: jonhaddad
* Date: 6/16/13
* Time: 4:21 PM
* To change this template use File | Settings | File Templates.
*/
package main
import (
@rustyrazorblade
rustyrazorblade / gist:5793810
Created June 16, 2013 23:18
jon's I/O random binary writer in go
package main
import (
"fmt"
"math/rand"
"time"
"os"
"encoding/binary"
"bytes"
)
[nosetests]
with-id==1
with-progressive=1
detailed-errors=1
logging-clear-handlers=1
logging-filter=shift
logging-level=WARNING
Traceroute has started…
traceroute to platform.grapheffect.com (54.245.121.221), 64 hops max, 72 byte packets
1 dd-wrt (192.168.11.1) 1.060 ms 8.029 ms 1.065 ms
2 10.227.0.1 (10.227.0.1) 411.340 ms 406.520 ms 409.500 ms
3 tge1-2.snmncaby-cer02.socal.rr.com (76.166.16.93) 408.882 ms 404.886 ms 400.337 ms
4 tge0-8-0-7.lamdca1-cr02.socal.rr.com (72.129.9.106) 351.242 ms 243.411 ms 250.923 ms
5 agg28.tustca1-cr01.socal.rr.com (72.129.9.2) 283.114 ms 405.243 ms 529.269 ms
6 107.14.19.30 (107.14.19.30) 589.349 ms 507.863 ms 504.307 ms
7 107.14.19.67 (107.14.19.67) 523.545 ms * 413.884 ms
@rustyrazorblade
rustyrazorblade / gist:3310153
Created August 10, 2012 01:35
what the fuck is this
class Monad m where
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
return :: a -> m a
fail :: String -> m a
root@smtdev:~/whatever.net/puppet# puppet apply --modulepath modules manifests/site.pp
err: /Stage[main]/Python/File[/etc/profile.d/virtualenv.sh]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/python/virtualenv.sh at /media/sf_splitmytab.net/puppet/manifests/site.pp:23
notice: Finished catalog run in 0.43 seconds
root@smtdev:~/whatever.net/puppet# ls modules/
python
root@smtdev:~/whatever.net/puppet# ls modules/python/virtualenv.sh
modules/python/virtualenv.sh
root@rabbit:~# ls
build celeryconfig.py celery.sublime-project tasks.py test.py
celery celeryconfig.pyc celery.sublime-workspace tasks.pyc tornado_test.py
root@rabbit:~# cat celeryconfig.py
BROKER_URL = "librabbitmq://test:test@localhost/testvhost"
CELERY_RESULT_BACKEND = "amqp"
CELERY_DISABLE_RATE_LIMITS = True
CELERYD_PREFETCH_MULTIPLIER = 20
show_status = ->
$.get "/api/debtors", (result) ->
html = Mustache.to_html(who_owes_me, result)
$("#owesme").html html
$(".debtor_paid").click handle_mark_paid
who_owes_me = '''
<table class='table table-condensed table-striped ' >
<tr class="titles">
<th class="name">Who Owes Me</th>
<th class="amount">Amount</th>
<th class="status">&nbsp;</th>
</tr>
{{#users}}
<tr>
<td class="name"><a href="#">{{name}}</a></td>