This file contains 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 | |
save_dir="$HOME/Library/Application Support/minecraft/saves" | |
dropbox_dir="$HOME/Dropbox/minecraft/world1_backups/" | |
dest_file=$( date '+%Y%m%d_%H%M%S.tar.gz' ) | |
world=$1 | |
test -z "$world" && world=World1 | |
cd "$save_dir" |
This file contains 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
sub do_dir { | |
my ($dir) = @_; | |
chdir $dir; | |
my @entries = map { chomp; $_ } grep { m{/$}xms } qx/svn ls/; | |
system qw/svn update -N --set-depth=empty/, @entries; | |
do_dir("$dir/$_") for @entries; | |
} |
This file contains 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 | |
export SEP_CHAR="" | |
export QUOTE_CHAR="" | |
test "$1" == "--grep" && export SEP_CHAR="|" | |
( test "$1" == "--sql" || test -z "$1" ) && export SEP_CHAR="," && export QUOTE_CHAR="'" | |
new_list=$( pbpaste | perl -e 'chomp(@lines = <STDIN>); print q{(} . join( $ENV{SEP_CHAR} => map { $ENV{QUOTE_CHAR} . $_ . $ENV{QUOTE_CHAR} } @lines ) . q{)}' ) | |
echo $new_list | pbcopy |
This file contains 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
prev=$(du -bs . | awk '{print $1}'); sleep 1; | |
while true; do | |
now=$(du -bs . | awk '{print $1}'); | |
diff=$(echo -e "scale=3\n($now - $prev) / 1024 / 1024" | bc); | |
echo "diff: $diff"; | |
prev=$now; | |
sleep 1; | |
done |
This file contains 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 | |
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --enable-logging --v=1 2>> "$HOME/Library/Application Support/Google/Chrome/chrome_stderr.log" & |
This file contains 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
export TEMPDEST=/tmp/trouw URL=https://www.ticketswap.nl/36538/trouw-op-zondag-ade-special-ade; while sleep 5; do curl --silent $URL | grep -w -A2 counter-available >! $TEMPDEST; new_sha=$(sha1sum $TEMPDEST | awk '{print $1}'); if [[ "$new_sha" != "$last_sha" ]]; then; rgrowl 'tickets changed' "$( grep counter-value $TEMPDEST )"; echo $new_sha; fi; last_sha=$new_sha; echo -n . ; done |
This file contains 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
# https://twitter.com/OvidPerl/status/137172488206553090 | |
perl -e '@t=qw(▁ ▂ ▃ ▄ ▅ ▆ ▇ █);@s=sort{$a<=>$b}@ARGV;$d=($s[-1]-$s[0])/@t;$d*=1.01;for(@ARGV){print $t[($_-$s[0])/$d]}' |
This file contains 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 | |
apt-get install sudo vim-nox wget tmux tcpdump strace htop iotop pv moreutils build-essential pkg-config autoconf zip unzip bzip2 libssl-dev zlib1g-dev libreadline-dev libexpat-dev libevent-dev libncurses-dev libnss-mdns |
This file contains 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
$ uname -a | |
Linux proton 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 GNU/Linux |
This file contains 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
# Set the prefix to ^A. | |
unbind C-b | |
set -g prefix ^A | |
bind a send-prefix | |
# Bind appropriate commands similar to screen. | |
# lockscreen ^X x | |
unbind ^X | |
# bind ^X lock-server | |
unbind x |
OlderNewer