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
==> Downloading http://nmap.org/dist/nmap-5.51.tar.bz2 | |
File already downloaded in /Users/paul/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/paul/Library/Caches/Homebrew/nmap-5.51.tar.bz2 | |
==> ./configure --prefix=/usr/local/Cellar/nmap/5.51 --without-zenmap | |
./configure --prefix=/usr/local/Cellar/nmap/5.51 --without-zenmap | |
checking whether NLS is requested... yes | |
checking build system type... x86_64-apple-darwin11.2.0 | |
checking host system type... x86_64-apple-darwin11.2.0 | |
checking for gcc... /usr/bin/gcc-4.2 | |
checking whether the C compiler works... yes |
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
==> Downloading http://nmap.org/dist/nmap-5.51.tar.bz2 | |
File already downloaded in /Users/paul/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/paul/Library/Caches/Homebrew/nmap-5.51.tar.bz2 | |
==> ./configure --prefix=/usr/local/Cellar/nmap/5.51 --without-zenmap | |
./configure --prefix=/usr/local/Cellar/nmap/5.51 --without-zenmap | |
checking whether NLS is requested... yes | |
checking build system type... x86_64-apple-darwin11.2.0 | |
checking host system type... x86_64-apple-darwin11.2.0 | |
checking for gcc... /usr/bin/llvm-gcc | |
checking whether the C compiler works... yes |
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
# SaferScanner is just like re.Scanner, but it neuters any grouping in the lexicon | |
# regular expressions and throws an error on group references, named groups, or | |
# regex in-pattern flags. Any of those can break correct operation of Scanner. | |
import re | |
from sre_constants import BRANCH, SUBPATTERN, GROUPREF, GROUPREF_IGNORE, GROUPREF_EXISTS | |
class SaferScanner(re.Scanner): | |
def __init__(self, lexicon, flags=0): | |
self.lexicon = lexicon |
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
# works on Mac OS X and Linux. haven't tried BSD. obviously windows is out. | |
import os | |
import subprocess | |
import signal | |
def get_tty_fg(): | |
# make a new process group within the same session as the parent. we | |
# do this so that if the user hits ctrl-c, etc in the curses program | |
# that's about to be exec'd, the SIGINT and friends won't be sent to |
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
[alias] | |
; "git find" should work exactly like your system find (BSD or GNU), except for | |
; two things: one, it will always ignore the current git directory; and two, if | |
; you don't supply any root paths to search, it defaults to searching from your | |
; git project toplevel. | |
; | |
; paul cannon <[email protected]> 2011 | |
find = "!_() { \ | |
declare -a preargs; \ |
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
def center(text, width): | |
if len(text) < width: | |
diff = width - len(text) | |
pad = ' ' * (diff / 2) | |
text = pad + text + pad | |
if diff % 2: | |
text += ' ' | |
return text | |
def print_table(fieldnames, table, outstream=None): |
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
changelog_from_deb () { | |
# won't work when packages symlink their docs from another package from the same source; | |
# you'll get "No changelog found." | |
t="$(mktemp -d)" | |
p="$(dpkg-deb -f "$1" Package)" | |
fail=1 | |
dpkg-deb --fsys-tarfile "$1" | \ | |
tar -x --wildcards -C $t ./usr/share/doc/"$p"/changelog\* 2>/dev/null | |
for f in changelog.Debian.gz changelog.gz; do |
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 re | |
backslash_shell_quote_re = re.compile(r'([^A-Za-z0-9_.,:/])') | |
def shell_escape(s, flavor='sh'): | |
""" | |
Escape a random string (s) so that it reads as a single word when | |
undergoing shell command-line parsing. | |
The default flavor should be safe for all mainstream shells I know | |
about, but there are some other escaping modes which may result in |
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
[alias] | |
xlog = log --graph --pretty=format:\"%C(yellow)%h%Creset %ad %s%C(cyan)%d%Creset %C(green)[%an]%Creset\" --date=short |
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
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. | |
# See LICENSE for details. | |
import traceback | |
import warnings | |
from sys import exc_info | |
# Twisted imports | |
from twisted.python import failure, lockfile | |
from twisted.python.util import mergeFunctionMetadata |