This file contains 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
#!C:\Python27\python.exe | |
# The MIT License (MIT) | |
# | |
# Copyright © 2014-2016 Santoso Wijaya <santoso.wijaya@gmail.com> | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation files | |
# (the "Software"), to deal in the Software without restriction, | |
# including without limitation the rights to use, copy, modify, merge, | |
# publish, distribute, sub-license, and/or sell copies of the Software, |
This file contains 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
# add with `sudo visudo`: | |
username ALL=(root) NOPASSWD:/usr/bin/truecrypt | |
# obviously change 'username' |
This file contains 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 os | |
import sys | |
import array | |
import struct | |
NUMRANDS = 10 ** 6 # the number of random integers we want to generate (one million) | |
BUFSIZE = 1000 # the number of integers we buffer internally before flushing to output |
This file contains 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 array | |
BUFSIZE = 4096 # read 1000 * 4-byte (32-bit) numbers at a time | |
input = sys.stdin | |
This file contains 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 os | |
import sys | |
import array | |
import heapq | |
import struct | |
import tempfile | |
This file contains 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 os | |
import sys | |
import array | |
import struct | |
NUMRANDS = 10 ** 6 # the number of random integers we want to generate (one million) | |
BUFSIZE = 1000 # the number of integers we buffer internally before flushing to output |
This file contains 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
# http://notmysock.org/blog/hacks/a-twisted-dns-story.html | |
# https://gist.github.com/johnboxall/1147973 | |
# twistd -y dnsfuzz.py | |
import sys | |
import socket | |
from twisted.python import log | |
from twisted.internet.protocol import Factory, Protocol | |
from twisted.internet import reactor |
This file contains 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 random | |
def sort(arr): | |
random.shuffle(arr) | |
_sort(arr, 0, len(arr) - 1) | |
def _sort(arr, lo, hi): | |
if hi <= lo: return | |
lt = lo | |
gt = hi |
This file contains 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
# ~/.profile: executed by the command interpreter for login shells. | |
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login | |
# exists. | |
# see /usr/share/doc/bash/examples/startup-files for examples. | |
# the files are located in the bash-doc package. | |
# the default umask is set in /etc/profile; for setting the umask | |
# for ssh logins, install and configure the libpam-umask package. | |
#umask 022 |
This file contains 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
from scapy.all import * | |
# change this to your test machine's MAC address | |
SELF_MAC = '00:0c:29:67:22:c2' | |
BCAST_MAC = 'ff:ff:ff:ff:ff:ff' | |
# this will send a PROBE ARP request packet to the supplied IP address argument |