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
# Seen at: http://github.com/strcat/dotfiles/ and in grml. | |
# Robust replacement for global aliases, and you can edit them too. | |
# requires extended globbing. | |
typeset -A abbrevs | |
abbrevs=('...' '../..' | |
'....' '../../..' | |
'BG' '& exit' | |
'C' '| wc -l' | |
'G' '|& grep --color=auto' |
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
import paramiko | |
cmd = "sudo /etc/init.d/mediatomb restart" | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
ssh.connect('microwave', username='matt') | |
stdin, stdout, stderr = ssh.exec_command(cmd) | |
print stdout.readlines() | |
ssh.close() |
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
import paramiko | |
cmd = "sudo /etc/init.d/mediatomb restart" | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
ssh.connect('microwave', username='matt') | |
stdin, stdout, stderr = ssh.exec_command(cmd) | |
print stdout.readlines() | |
ssh.close() |
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
import paramiko | |
cmd = "sudo /etc/init.d/mediatomb restart" | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
ssh.connect('microwave', username='matt') | |
stdin, stdout, stderr = ssh.exec_command(cmd) | |
print stdout.readlines() | |
ssh.close() |
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/env python | |
# Grab the width of the macheist bar. | |
# Run using: | |
# while true; do sleep 60; python heist_parse.py >> heist_countdown; done | |
import urllib2 | |
import re | |
import time | |
from BeautifulSoup import BeautifulSoup |
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
import numpy as np | |
import matplotlib as mpl | |
import matplotlib.pylab as plt | |
import time | |
from datetime import datetime | |
f = plt.load('heist_countdown') | |
x = f[:,1] | |
y = f[:,0] |
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/env ruby | |
# Run Perl::Critic on the current file. | |
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor" | |
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" | |
def colorize_critic_output(str) | |
styles = {5 => "Red", 4 => "GoldenRod", 3 => "DodgerBlue" } | |
styles.default = "" | |
str.map do |line| |
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
# set file type to bib | |
# insert as snippet | |
# scope to text.tex.latex | |
# have fun dragging .bib files onto textmate. | |
echo "\bibliographystyle{\${1:plainnat}}" | |
echo "\bibliography{\${2:$(dirname $TM_DROPPED_FILE)/}$(basename $TM_DROPPED_FILE .bib)}" |
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 strict; | |
use warnings; | |
use DirHandle; | |
use JSON::XS; | |
use LWP::UserAgent; | |
use Carp; | |
use CPAN::Inject; | |
use CPAN (); | |
use URI; |
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
awk '{printf $0;printf " "}NR % 2 ==0 {print " "}' |