Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env python | |
import logging | |
import pymongo | |
import datetime | |
class MongoHandler(logging.Handler): | |
""" | |
A logging handler that will record messages to a (optionally capped) | |
MongoDB collection. |
# Sort a list of dictionary objects by a key - case sensitive | |
from operator import itemgetter | |
mylist = sorted(mylist, key=itemgetter('name')) | |
# Sort a list of dictionary objects by a key - case insensitive | |
mylist = sorted(mylist, key=lambda k: k['name'].lower()) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
gh_url = 'https://api.github.com' | |
req = urllib2.Request(gh_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
############################################################################# | |
# Documentation # | |
############################################################################# | |
# Author: Todd Whiteman | |
# Date: 16th March, 2009 | |
# Verion: 2.0.0 | |
# License: Public Domain - free to do as you wish | |
# Homepage: http://twhiteman.netfirms.com/des.html | |
# |
<ifModule mod_rewrite.c> | |
Options +FollowSymLinks | |
IndexIgnore */* | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule (.*) index.html | |
</ifModule> |
//equivalent of "select count (distinct fieldName) from someTable" | |
db.someCollection.aggregate([{ $group: { _id: "$fieldName"} },{ $group: { _id: 1, count: { $sum: 1 } } } ]) |
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger (doppelheathen@gmail.com) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo | |
echo usage: $0 network-interface | |
echo | |
echo e.g. $0 eth0 | |
echo | |
echo shows packets-per-second |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# dtob.py | |
# Digest to Basic downgrade attack PoC plugin for proxpy (https://code.google.com/p/proxpy/) | |
# | |
# 2013 Leon Jacobs | |
# Licensed under IDC (I don't Care) license. | |
import base64 | |
import hashlib | |
def headerCleanup(v): |