Skip to content

Instantly share code, notes, and snippets.

@opie4624
opie4624 / fix_nmap_xml_output.sh
Created October 6, 2010 15:45
Fixes XML files resulting from a resumed NMAP scan
#!/bin/bash
# If you resume an NMAP scan while outputting to XML the file
# becomes malformed. This script will take that file and split
# it into multiple .xml files, one for each run.
#
# Files without the .xml extension didn't lint and couldn't be fixed.
#
# It will try to lint the file twice, and add </nmaprun> if needed.
# If that doesn't work, pay attention to the xmllint errors and
@opie4624
opie4624 / build-tunnel.sh
Created June 19, 2010 19:57
Reliable outbound SSH tunnel through a restrictive proxy. Read more: http://post.ly/k4O9
#!/bin/bash
echo
date
echo "----------------------------"
if ssh -O check tunnel@vpn.example.com; then
echo "Tunnel's up."
else
echo "Starting up tunnel..."
if ssh -R 2222:localhost:22 tunnel@vpn.example.com -f 'sleep 3300'; then
echo "Seems good."
# This controller handles the login/logout function of the site.
class SessionsController < ApplicationController
# Be sure to include AuthenticationSystem in Application Controller instead
include AuthenticatedSystem
layout nil
# render new.rhtml
def new
end
def create
[Wed Mar 10 07:40:01 2010] [notice] Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l Phusion_Passenger/2.2.9 PHP/5.2.11-pl0-gentoo configured -- resuming normal operations
[ pid=11617 file=ext/apache2/Hooks.cpp:727 time=2010-03-10 07:40:06.344 ]:
Unexpected error in mod_passenger: The ApplicationPool server unexpectedly closed the connection while we're reading a response for the 'get' command.
Backtrace:
(backtrace support disabled during compile time)
[Wed Mar 10 07:40:07 2010] [notice] child pid 11609 exit signal Segmentation fault (11)
[ pid=11618 file=ext/apache2/Hooks.cpp:727 time=2010-03-10 07:40:09.93 ]:
Unexpected error in mod_passenger: Could not connect to the ApplicationPool server: Broken pipe (32)
Backtrace:
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/setuptools/setuptools-0.6.8.ebuild,v 1.4 2009/11/08 16:54:19 arfrever Exp $
EAPI="2"
SUPPORT_PYTHON_ABIS="1"
inherit distutils eutils
MY_PN="distribute"
@opie4624
opie4624 / calllater.py
Created January 26, 2010 22:45
Working through the Twisted book
#!/usr/bin/env python
# encoding: utf-8
"""
calllater.py
Created by Andrew Kraut on 2010-01-25.
"""
import sys
import os
SICP
====
Book
----
http://mitpress.mit.edu/sicp/
Tutorial
--------
http://icampustutor.csail.mit.edu/6.001-public/tutor.cgi
@opie4624
opie4624 / README
Created September 7, 2009 08:20
Make emacsclient an easy habit!
Set an environment variable called ALTERNATE_EDITOR to point to this script. Then get in the habit of using emacsclient always. This will fire up emacs and wait for the server to start then fire up the file passed in via emacs client.
Right now it only works if your emacs will come up on your window manager, because that's primarily how I use it.
-Opie
@opie4624
opie4624 / gist:59645
Created February 6, 2009 22:04
A nice non-compete agreement
\documentclass[11pt]{article}
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
%\nopagenumbers
@opie4624
opie4624 / Solution.txt
Created January 10, 2009 05:15
Puzzles for Hackers
>>> from xorencdec import xorencdec
>>> xorencdec('creature_creature_creature',']VTYJQC]aGC]_PDJ[{RJ[EEMLA')
'>$18>$18>$18>$18>$18>$18>$'
>>> xorencdec('Smith','>$18')
'mIXLV'