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
| #!/bin/sh | |
| # | |
| # msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service | |
| # | |
| # Please report issues and/or improvements to Sam Hocevar <[email protected]> | |
| # | |
| # Prerequisites: | |
| # — MSYS2 itself: http://sourceforge.net/projects/msys2/ | |
| # — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights | |
| # |
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 multiprocessing | |
| import time | |
| import os | |
| import signal | |
| def init_worker(): | |
| signal.signal(signal.SIGINT, signal.SIG_IGN) | |
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
| $ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8 | |
| ;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了 | |
| ;; Question section mismatch: got twitter.com/RESERVED0/CLASS256 | |
| ; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8 | |
| ;; global options: +cmd | |
| ;; Got answer: | |
| ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722 | |
| ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 |
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
| #!/bin/bash | |
| ACCOUNT="" | |
| PASSWORD="" | |
| ######################################### | |
| function urlEncode() { | |
| python -c " | |
| import urllib, commands, os; |
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
| #!/usr/bin/env python | |
| import sys | |
| import string | |
| import struct | |
| if len(sys.argv) <= 1: | |
| print 'Usage: %s [filename]' % __file__ | |
| sys.exit() |
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
| #! /bin/sh | |
| if [ "x$TARGET_PRODUCT" == x ]; then | |
| echo "TARGET_PRODUCT not set!" | |
| exit 1 | |
| fi | |
| let TIME_RANGE=5 | |
| if [ $# -eq 1 ]; then | |
| TIME_RANGE=$1 |
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 imaplib | |
| from pprint import pprint | |
| user = 'USER' | |
| password = 'PASSWORD' | |
| imap = imaplib.IMAP4_SSL('imap.gmail.com', 993) | |
| imap.login(user + '@gmail.com', password) | |
| status, data = imap.list() |
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
| # -*- coding: UTF-8 -*- | |
| # vim: expandtab sw=4 ts=4 sts=4: | |
| ''' | |
| Wammu - Phone manager | |
| IMAP UTF-7 codec | |
| ''' | |
| __author__ = 'Michal ?iha?' | |
| __email__ = '[email protected]' | |
| __license__ = ''' | |
| Copyright © 2003 - 2010 Michal ?iha? |
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 hexdump(src, length=16, sep='.'): | |
| FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or sep for x in range(256)]) | |
| lines = [] | |
| for c in xrange(0, len(src), length): | |
| chars = src[c:c+length] | |
| hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
| if len(hex) > 24: | |
| hex = "%s %s" % (hex[:24], hex[24:]) | |
| printable = ''.join(["%s" % ((ord(x) <= 127 and FILTER[ord(x)]) or sep) for x in chars]) | |
| lines.append("%08x: %-*s |%s|\n" % (c, length*3, hex, printable)) |