Skip to content

Instantly share code, notes, and snippets.

#!/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:

#!/bin/bash
# The More You Know ☄·
fart() {
echo $1
echo $2
echo $3
}
doot() {
# aptitude install libjpeg-dev zlib1g-dev
# pip install Pillow
wget -O ansi.zip https://github.com/rupa/ansiimg/archive/master.zip
pip install ansi.zip
wget -O meme.zip https://github.com/rupa/automeme/archive/master.zip
pip install meme.zip
wget http://images.memegenerator.net/images/298x/84688.jpg
ansi 84688.jpg -t "$(automeme)"
@rupa
rupa / gist:47475
Created January 15, 2009 16:41
lan detection
#!/bin/bash
function wireless {
case "$(uname)" in
Linux)/sbin/iwconfig 2>/dev/null | awk -F\" '/ESSID/&&!/NOT READY/{print $2}';;
Darwin)/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk '/ SSID/{print $2}';;
esac
}
function int_ip {
@rupa
rupa / ewmh
Created January 29, 2009 16:48
EWMH
this module is mostly for making your workspace switcher function properly in GNOMe, KDE, or any other EWMH desktop.
import XMonad.Hooks.EwmhDesktops
This module only has three user facing functions.
There is a function for your layout hook that tells xmonad what EWMH is doing. It lets you click/drag windows in the workspace switcher:
myLayout = ewmhDesktopsLayout
@rupa
rupa / j.sh
Created February 16, 2009 17:28
# maintains a jump-list of directories you actually use
# old directories eventually fall off the list
# inspired by http://wiki.github.com/joelthelion/autojump
# and something similar i had - but i could never get the dir list right.
#
# INSTALL:
# source into .bashrc under your '[-z "$PS1" ] || return' line
# cd around for a while
#
# USE:
@rupa
rupa / README
Created February 23, 2009 07:08
experimental directory navigation
# cd to the shortest, first, non-hidden dir under $root matching all args
#
# USE:
# alias alias=root=root __h [--]
#
# DESCRIPTION
#
# This provides a helper function (__h) meant to be used with aliases to do
# smart directory navigation
#