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/python | |
import sys, time, os, datetime, json | |
import logging, logging.handlers | |
import subprocess | |
log = logging.getLogger(__name__) | |
UID = "moo" | |
PWD = "moo" |
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 | |
import os, argparse, time, datetime, pytz, json | |
import logging, logging.handlers | |
from pprint import pprint | |
""" | |
usage examples: | |
>utc.py # current epoch to timestamp for each timezone | |
>utc.py 1234567890 # epoch to timestamp for each timezone | |
>utc.py -t "2009-02-13 23:31:30" # timestamp string to epoch for each timezone | |
>utc.py -r # run forever |
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/python | |
import fileinput, argparse | |
from glob import glob | |
""" | |
# read from <file(s)> or <STDIN> | |
# Examples: | |
args.py *.txt | |
args.py 1.txt 2.txt 3.txt |
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
use strict; | |
use warnings; | |
use 5.020; | |
use Getopt::Long qw(GetOptions); | |
Getopt::Long::Configure ("bundling"); # -d | |
my $debug; | |
GetOptions('debug|d' => \$debug) or die "$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
import fileinput, sys | |
from pprint import pprint | |
header = ['date', 'time', 's-ip', 'cs-method', 'cs-uri-stem', 'cs-uri-query', 's-port', 'cs-username', 'c-ip', 'cs(User-Agent)', 'sc-status', 'sc-substatus', 'sc-win32-status', 'sc-bytes', 'cs-bytes', 'time-taken'] | |
l = [] # a list to hold a <dict> for each line in the IIS log file | |
for line in fileinput.input(sys.argv[1]): | |
if not line.startswith('#'): | |
fields = line.split() |
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 | |
# usage: ping 8.8.8.8 | tea.pl [-v] [-t] [FILE] | |
# -v = verbose | -t = prefix timestamp to output | FILE = output filename | |
use IO::Handle; | |
use Getopt::Long; | |
use Time::HiRes; | |
use POSIX; |
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/python | |
import sys, datetime, os, time | |
from PIL import Image # for <PIL> on Python 2.6 => "pip install Pillow" - for Python 2.7 <PIL> part of core modules | |
from PIL.ExifTags import TAGS | |
# usage examples: | |
# ./exif.py ~/Pictures/* | |
# ./exif.py DSCF0155.JPG | |
# ./exif.py ~/Pictures/DSCF0155.JPG ~/Pictures/DSCF0156.JPG |
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
# tiny "flip-flop" | |
use strict; | |
use warnings; | |
use 5.020; | |
use Getopt::Long qw(GetOptions); | |
Getopt::Long::Configure ("bundling"); # -lcd => line / chomp / debug | |
my $debug; |
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
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
# a decent bash prompt # \d or \D = date - \t = time - \u = user - \h = host - \w = cwd |
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/python | |
""" | |
Usage: | |
% [-dv] FILE ... | |
% -h | --help | |
% --version | |
Options: |