Skip to content

Instantly share code, notes, and snippets.

View e0da's full-sized avatar

Justin Force e0da

View GitHub Profile
# vim: set ft=sh:
# setup
ip tuntap add mode tap $TAP user $USER
ip link set $TAP up
brctl addif $BR $TAP
# teardown
ip link set $TAP down
brctl delif $BR $TAP
@e0da
e0da / git-submodule-rm.sh
Created August 28, 2012 00:40 — forked from barraponto/git-submodule-rm.sh
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@e0da
e0da / git-submodule-rm.sh
Created August 28, 2012 00:40 — forked from zaius/git-submodule-rm.sh
Add rm command to git submodule
#!/bin/zsh
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
class Actor
def ping
puts "#{self.class.name}:ping"
end
end
class SinatraApp < Actor
def run
loop do
puts :whoa?
@e0da
e0da / rep.sh
Created October 11, 2012 21:43
watch like script
#!/bin/bash
#
# st_repeat HELP:
# st_repeat [-d <delay>] [-i] [-c <count>] [-k] <command>
# Repeat the given command.
#
# By default, this command will exit upon success, unless -i or -c are given.
#
# -d (default 2) specifies how long to wait between iterations
# -i will repeat the command indefinitely
@e0da
e0da / my_init.sh
Created November 16, 2012 23:11
Basic SysV-compatible init script
#!/bin/sh
run_string="command to run program"
kill_match="string to match in ps -ef to find this process"
start() {
$run_string
}
stop() {
#!/bin/sh
# credit: http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/ "Configuring Multiple Default Routes in Linux"
start() {
start_iface
start_vlans
start_addresses
start_routes
configure_resolv
@e0da
e0da / kill_fb_chat.js
Created January 28, 2013 01:26
Turn off Facebook chat programatically
/*
* So far, the strategy is to try to use the menu to do this.
* It would be better to call whatever function turns this crap
* off directly, but so far I haven't found anything.
*/
// Open the menu
document.querySelector('.fbChatSidebarDropdown a').click()
// Turn off chat (can only be clicked if the menu is open)
enzo:~/code/love_code% cat love_code.rb 
require 'base64'

puts Base64.decode64 <<END
CiAgICAgIyMjIyMgICAgICMjIyMjCiAgICAjIyMjIyMjICAgIyMjIyMjIwog
ICAjIyMjIyMjIyMgIyMjIyMjIyMjCiAgICMjIyMjIyMjIyMjIyMjIyMjIyMK
@e0da
e0da / _README.md
Last active December 15, 2015 02:49

Chef 11.4.0 doesn't work with Ruby 2.0.0-p0.

It's been fixed but not released yet.