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 | |
# adjust to taste | |
for i in `ls *JPG`; do | |
BASENAME=$(basename "$i" .JPG) | |
convert $i -resize 400x Resized/$BASENAME.png | |
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 | |
#this file just checks to see if there are any packages to install | |
# we will run this script from the root crontab each night | |
if [[ `apt-get update 2>&1 | grep Get` ]]; then | |
if [[ `apt-get --simulate dist-upgrade 2>&1 | grep Inst` ]]; then | |
apt-get --simulate dist-upgrade | |
fi | |
fi |
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
file = sys.stdin.readlines() | |
for line in file: | |
line = line.rstrip() | |
# don't laugh, the following line works fine for what I need. | |
# it uses a little regex to put what I need into a list called 'parts' | |
parts = re.findall("(.*)(moses.*)(IN=.*)(OUT=.*)(MAC=.*)(SRC=.*)(DST=.*)(LEN=.*)(TOS=.*)(PREC=.*)(TTL=.*)(PROTO=.*)(SPT=.*)(DPT=.*)(WINDOW=.*)", line) | |
for p in parts: | |
src = re.match("(SRC=)(.*)", p[5]) | |
dst = re.match("(DST=)(.*)", p[6]) |
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
#!/usr/bin/perl | |
# replace spaces in all filenames with underscores | |
$dir = "."; | |
opendir(DIR, $dir) || die "Can't open $dir\n"; | |
for (readdir(DIR)) { | |
next if $_ eq '.'; | |
next if $_ eq '..'; | |
next if $_ eq 'lost+found'; |
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
#! /usr/bin/python | |
import stripe | |
import decimal | |
import datetime | |
stripe.api_key ='yourStripeKey' | |
def runBalance(): | |
# change limit to suit taste | |
bal = stripe.BalanceTransaction.all(limit=30) |