This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# OSX requires Quicktime Pro, linux requires scrot and mencoder | |
# jpg faster/png higher quality | |
FORMAT=jpg | |
usage() { | |
cat <<! | |
use: $(basename $0) -c <path/to/empty/folder> [seconds] | |
$(basename $0) -o <path/to/empty/folder> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rat { | |
# change part of pwd path, and cd to it | |
# example: | |
# /usr/lib/foo$ rat li src | |
# /usr/src/foo$ | |
local cd=$(echo $PWD | awk -v q="$*" -F\/ ' | |
BEGIN { l = split(q,a," ") } | |
{ | |
for( i=1;i<=NF;i++ ) { | |
for( j=1;j<=l;j=j+2 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rat { | |
# change part of pwd path, and cd to it | |
# example: | |
# /usr/lib/foo$ rat li src | |
# /usr/src/foo$ | |
local cd=$(echo $PWD | awk -v q="$*" -F\/ ' | |
BEGIN { l = split(q,a," ") } | |
{ | |
for( i=1;i<=NF;i++ ) { | |
for( j=1;j<=l;j=j+2 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change part of pwd path, and cd to it | |
# example: | |
# /usr/lib/foo$ cx lib src | |
# /usr/src/foo$ | |
# slashes need double escaping: \\/ | |
# surprisingly, most everything else doesn't | |
cx() { | |
local cd="$PWD" | |
while [ $1 ]; do | |
cd="$(echo $cd | sed "s/$1/$2/")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
z is the new j | |
First, there was [j](http://github.com/rupa/j/). | |
Then, there was [j2](http://github.com/rupa/j2/), with some python added. Made | |
it easier to experiment with some stuff I'd been thinking about. | |
Now there's this, where I rewrote j2 back in bash. I like it. Sorry about all | |
the repos , but it kind of grew this way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use POSIX; | |
use IO::Socket; | |
#fork && exit; | |
setsid; | |
$nick = "CAPSLOCKENFORCEMENTBOT"; |
OlderNewer