Skip to content

Instantly share code, notes, and snippets.

Avatar
🐱
meow sucking

meoww-bot meoww-bot

🐱
meow sucking
View GitHub Profile
View a python logging Handler that writes events to MongoDB
#!/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.
View python-sort-list-object-dictionary-multiple-key.1.py
# 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())
@eigenein
eigenein / pyDes.py
Created Oct 10, 2011
A pure python implementation of the DES and TRIPLE DES encryption algorithms
View pyDes.py
#############################################################################
# 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
#
@rayfranco
rayfranco / APACHE: .htaccess pushstate
Created Jul 30, 2012
.htaccess for HTML5 Pushstate support
View APACHE: .htaccess pushstate
<ifModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</ifModule>
@1wErt3r
1wErt3r / SMBDIS.ASM
Created Nov 9, 2012
A Comprehensive Super Mario Bros. Disassembly
View SMBDIS.ASM
;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
@joemiller
joemiller / netpps.sh
Last active Sep 14, 2020
shell: quick linux scripts for showing network bandwidth or packets-per-second
View netpps.sh
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@willurd
willurd / web-servers.md
Last active Sep 28, 2020
Big list of http static server one-liners
View web-servers.md

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@leonjza
leonjza / dtob.py
Created Jun 26, 2013
Digest to Basic downgrade attack PoC plugin for proxpy (https://code.google.com/p/proxpy/)
View dtob.py
# 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):
@clowwindy
clowwindy / ssl.md
Last active Aug 28, 2020
为什么不应该用 SSL 翻墙
View ssl.md

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
@thom-nic
thom-nic / cx_oracle_instructions.md
Created Jul 16, 2013
Installing CX Oracle for Python & Mac OS X. Instructions exist around the web, but they seem to be piecemeal and incomplete.
View cx_oracle_instructions.md
You can’t perform that action at this time.