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/sh | |
dir=$1 | |
find $dir -type f -name "*.zip" -printf "%TY-%Tm-%Td\t%h/%f\n" | sort | while read line; do | |
echo "unzip -jod $line"; 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/sh | |
# stuart powers | |
# list the files installed from a specific package or all | |
# packages which match /pattern/ # one line of output per file: | |
# [exe|dir|pipe|etc] $PACKAGE $FILE | |
#to see all the executable files from libwww-perl: | |
#stu@sente ~ $ pkginfo.sh libwww-perl | grep ^x | cut -f3 | |
# /usr/bin/lwp-download |
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
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBJNXmgPkbvgLx+ntGD55ON6fPwXKWIy+ah475VHip6Pdr3QWQSo0VdB8cheRwrDys0wVotWxd4ZufeNCJEGNUR2NWFYXfWYpC8hbtga/RlH/GhfcvJW4wlg4vBXBbwBl5kLRRQo6FfgqJlXeVq6gQINEogm4EnXQ+Wo8RxXOIzRQ== rsa-key-20060627 |
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
import codecs | |
def unicode_safe_127(ss, debug=False): | |
"""safely handle strings with have ordinal values greater than 127 | |
by escaping each value as appropriate. | |
if debug=True, log each conversion to stderr | |
""" | |
mys = ss | |
tos=[] | |
for i,s in enumerate(mys): |
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/env python | |
import getpass, mechanize, optparse, os.path, sys | |
parser = optparse.OptionParser() | |
parser.add_option('--login') | |
parser.add_option('--password') | |
parser.add_option('--filename') | |
parser.add_option('--description') | |
parser.add_option('--private', action='store_true', default=False) |
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 | |
# from reddit -------------------------------------------- | |
def traceit(fn): | |
import sys | |
def new_fn(*a,**kw): | |
ret = fn(*a,**kw) | |
sys.stderr.write("Fn: %s; a=%s; kw=%s\nRet: %s\n" | |
% (fn,a,kw,ret)) | |
return ret |
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
#taken from Doug Hellman's PyMOTW | |
import imaplib | |
import ConfigParser | |
import os | |
def open_connection(verbose=False): | |
# Read the config file | |
config = ConfigParser.ConfigParser() | |
config.read([os.path.expanduser('~/.pymotw')]) |
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
from twisted.internet import reactor, defer | |
from connectiontester import testConnect | |
def handleAllResults(allResults, ports): | |
for port, results in zip(ports, allResults): | |
success, result = results | |
if success: | |
print "Connected to port %i" % port | |
reactor.stop() |
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 sys | |
import socket | |
try: | |
server = sys.argv[1] | |
except: | |
server = "localhost" | |
for x in range(10000): |
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
PATH=$PATH:bin/ | |
set -x | |
cd $HOME || exit 1 | |
DIR=.hide/proc/snapshots | |
if [ ! -d ${DIR}/daily.0 ]; then exit 1; fi | |
cp -al ${DIR}/daily.0 ${DIR}/daily.`date +%F` |
OlderNewer