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 sys | |
sys.path.append("./python-keepass/python") | |
from keepass import kpdb | |
byte_strings = [hex(x)[2:].rjust(2, '0').lower() for x in range(255)] | |
pass_template = "%s3b140a6ec5%sec" | |
num_tried = 0 | |
for s1 in byte_strings: | |
for s2 in byte_strings: | |
tmp_pw = pass_template % (s1, s2) | |
num_tried += 1 |
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
# Copyright 2012 Matt Redmond | |
__author__ = "[email protected]" | |
import mechanize | |
from Queue import Queue, Empty | |
from threading import Thread | |
import re | |
queue = Queue() | |
break_regex = re.compile("<br>", re.IGNORECASE) |
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 string | |
# Algorithm for SMBC #2874 - the "fouriest" transform. | |
# Support bases 2-36. | |
BASE_LIST = string.digits + string.letters | |
def encode(integer, base): | |
# Stolen off the internet from somewhere, | |
# almost certainly guaranteed to be buggy. | |
base_list = BASE_LIST[:base] |
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
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
Bundle 'tpope/vim-fugitive' | |
Bundle 'Lokaltog/vim-easymotion' | |
Bundle 'Valloric/YouCompleteMe' |
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 json | |
import requests | |
# Rough bounding box for San Clemente, CA | |
southwest = [33.351665, -117.779208] | |
northeast = [33.566387, -117.537489] | |
bbox_string = "%s,%s,%s,%s" % tuple(southwest[::-1]+northeast[::-1]) | |
stops = [] | |
routes = [] |
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
; nasm -f elf64 -g -F dwarf repeat_hello.asm && gcc -g -no-pie repeat_hello.o -o repeat_hello && ./repeat_hello 5 | |
; Intended for use on linux x86-864 machines; to run on OS X you'd have to change the syscalls. | |
extern atoi | |
global main | |
section .data | |
message: db "Hello, world!", 0x0A | |
length: equ 14 | |
err_msg: db "Wrong!", 0x0A |
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
#include "stdio.h" | |
#include "string.h" | |
// 6. (Implementation) | |
void memory_copy(void* to, const void* from, int n) { | |
// Need to cast from void to char so that pointer arithmetic works here. | |
const char* src = (const char *) from; | |
char* dest = (char *) to; | |
for (int i = 0; i < n; i++) { |
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
#include "stdio.h" | |
#include "stdlib.h" | |
#include "string.h" | |
#define MAX_DICTIONARY_SIZE 300000 | |
#define MAX_WORD_LENGTH 15 | |
// We should guarantee room for a newline and null byte in our buffer. | |
#define BUFFER_SIZE (MAX_WORD_LENGTH + 2) | |
int populate_dictionary(char *filepath, char dictionary[][BUFFER_SIZE]) { |
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 | |
class HashFamily: | |
def __init__(self): | |
self.memomask = {} | |
def hash_fn(self, n): | |
mask = self.memomask.get(n) | |
if mask is None: | |
random.seed(n) | |
mask = self.memomask[n] = random.getrandbits(64) |
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 sys | |
# Should return a set() of all words in the scrabble dictionary passed in at the given file path. | |
# You should implement this file loader. | |
def LoadWords(scrabble_dictionary_path): | |
pass | |
# Return a set() of ALL valid words from the input set `all_words` that differ by exactly one letter from `word` | |
# Hint: you may want to try using regular expressions here. | |
def FindAllNeighbors(word, all_words): |
OlderNewer