Skip to content

Instantly share code, notes, and snippets.

View kernelsmith's full-sized avatar
💭
I'm not entirely sure.

Josh kernelsmith

💭
I'm not entirely sure.
View GitHub Profile
@kernelsmith
kernelsmith / easy_shell_proxy.sh
Last active January 14, 2016 21:03
easy_shell_proxy
#
# Functions used to change or display the proxy state
#
# usually it's all the same host, but you could add more host vars if needed
_PROXY_HOST="proxy.company.com"
_HPROXY_PORT="8080"
_HSPROXY_PORT="8080"
_SPROXY_PORT="1080" # this is usually different than http/s
# comma separated (no spaces) list of hosts/ip ranges(cidr) to not proxy
@kernelsmith
kernelsmith / interfaces
Last active October 16, 2023 08:53
example etc/network/interfaces config
# always start with interface up
auth eth0
# Static
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 192.168.1.250
@kernelsmith
kernelsmith / flush_routes.sh
Last active August 29, 2015 14:19
Flush a linux interface to force a DHCP change after a network changes
ip addr flush dev eth0
require 'mailgun'
# First, instantiate the Mailgun Client with your API key
mailgun = Mailgun::Client.new "your-api-key"
# Define your message parameters
message_params = {:from => 'me@sending_domain.com',
:to => 'you@example.com',
:subject => 'The Ruby SDK is awesome!',
:text => 'It is really easy to send a message!'}
### Keybase proof
I hereby claim:
* I am kernelsmith on github.
* I am kernelsmith (https://keybase.io/kernelsmith) on keybase.
* I have a public key whose fingerprint is 580C 336C AC11 E7B7 F7F2 F35B F2C6 11DC 92EC 0809
To claim this, I am signing this object:
@kernelsmith
kernelsmith / README.md
Last active August 29, 2015 14:16 — forked from farrelley/README.md
@kernelsmith
kernelsmith / README.md
Last active August 29, 2015 14:16 — forked from farrelley/README.md
@kernelsmith
kernelsmith / irc_notify.sh
Created November 7, 2014 23:32
irssi irc notifications over ssh & dbus
#07-17.26.09 < nsh> locally:
#07-17.26.09 < nsh> (trusty)xeb@localhost:~/code/irssi-libnotify$ ssh -f -N -q -R 1337:localhost:1337 nsh@ch0wn.org && ./notify-listener.py & nc -kl 1337 | while read L; do
# DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-L4FcbXHr0c,guid=3af4775950b0a0e542bf161c5455fea3 dbus-send --session /org/irssi/Irssi org.irssi.Irssi.IrssiNotify
# string:"Message from t3hmd4rkw4bs" string:"$L"; done
#07-17.26.37 < nsh> when i just changed the command in notify.pl to: echo "$summary: $message" | nc localhost 1337
#07-17.27.35 < nsh> the messy stuff is just what irssi-notifier.sh does from https://code.google.com/p/irssi-libnotify
#07-17.27.50 < nsh> (after the ssh command)
ssh -f -N -q -R 1337:localhost:1337 nsh@ch0wn.org && ./notify-listener.py & nc -kl 1337 | while read L; do
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-L4FcbXHr0c,guid=3af4775950b0a0e542bf161c5455fea3 dbus-send --session /org/irssi/Irssi org.irssi.Irssi.IrssiNotify
@kernelsmith
kernelsmith / osx_window_grab.sh
Created October 21, 2014 23:12
screen capture current terminal window on osx, command-line
screencapture -l$(osascript -e 'tell app "iTerm" to id of window 1') sc_test.png
require 'zip'
source_file = "blah.zip"
string = File.binread(source_file)
Zip::File.open_buffer(string) do |entries|
entries.each {|entry| puts entry.name }
end