Skip to content

Instantly share code, notes, and snippets.

@rupa
rupa / hhgttg.summarized.txt
Created June 16, 2010 23:02
Douglas Adams v. Open Text Summarizer
Hitchhiker's Guide To The Galaxy 1-5
summarized with Open Text Summarizer at ratio of 1%
http://libots.sourceforge.net/
-------------------------------------------------------------------------------
I
Mr Prosser's mouth opened and closed a couple of times while his mind was for a
@rupa
rupa / sshh_functions.sh
Created October 12, 2010 05:57
ssh/scp through NAT
# ssh/scp through NAT, as long as $outer has nc
# ssh v5.4+ should allow ssh -oProxyCommand="ssh -W $inner:%p" $outer $*
# hosts could also be defined in .ssh/config:
# Host foo
# hostname inner
# ProxyCommand ssh outer nc -w 1 %h %p
sshh() {
[ "$1" = "-h" ] && {
echo "sshh [opts] outer inner [cmd]"
return
@rupa
rupa / capslockenforcementbot
Created October 22, 2010 21:27
capslock enforcement bot
#!/usr/bin/perl
use POSIX;
use IO::Socket;
use utf8;
use Encode;
#fork && exit;
setsid;
#!/bin/bash
# rly dum markov
# db file
db=~/.smirnoff.db
# min length of chain to learn
min=3
function help {
echo "$(basename $0) [ -init | -cram | -help ]"
function! SuperTab()
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$')
return "\<Tab>"
else
return "\<C-n>"
endif
endfunction
function! SuperShiftTab()
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$')
return "\<S-Tab>"
@rupa
rupa / hack.sh
Created April 7, 2012 01:46 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
#!/usr/bin/env python
import random
CHARS = {
'top': [
u'\u0300',
u'\u0301',
u'\u0302',
u'\u0303',
@rupa
rupa / every
Created August 18, 2014 15:33 — forked from sorbits/every
#!/usr/bin/env bash
progname=$(basename $0)
version="1.0 (2014-08-17)"
step=2
function create_hash {
openssl dgst -sha1 -binary <<< "$1" | xxd -p
}
@rupa
rupa / proxy_s5.py
Last active August 29, 2015 14:07 — forked from yaonie/proxy_s5.py
forking version
#!/usr/bin/python
# Filename s5.py
# Python Dynamic Socks5 Proxy
# Usage: python s5.py 1080
# Background Run: nohup python s5.py 1080 &
# Email: ringzero@557.im
import socket, sys, select, SocketServer, struct, time
SocketServer.TCPServer.allow_reuse_address = True

Keybase proof

I hereby claim:

  • I am rupa on github.
  • I am rupa (https://keybase.io/rupa) on keybase.
  • I have a public key whose fingerprint is 9B45 0005 6F42 477C 66C8 2575 C5A3 1CA6 6B64 3957

To claim this, I am signing this object: