Skip to content

Instantly share code, notes, and snippets.

View paxswill's full-sized avatar

Will Ross paxswill

View GitHub Profile
@paxswill
paxswill / core.py
Created June 27, 2014 20:17
Core API Walkthrough
#!/usr/bin/env python
from binascii import unhexlify
from brave.api.client import API
from ecdsa import SigningKey, VerifyingKey, NIST256p
from flask import Flask, redirect, request, url_for
from hashlib import sha256
app = Flask(__name__)
from brave.core.key.model import EVECredential
def delete(delete=False):
""" Deletes every key from before the leak from the database."""
query = EveCredential.objects(key__lt=3283828)
count = query.count()
keys = query.scalar('key')
keys = '\n'.join(keys)
@paxswill
paxswill / ecdsa_keys.py
Last active August 29, 2015 14:00
Generating Core keypairs
from binascii import hexlify
from ecdsa import SigningKey, NIST256p
# Generate the private key and the corresponding public key
sk = SigningKey.generate(curve=NIST256p)
vk = sk.get_verifying_key()
# Write the keys to disk in hex format
with open('signing_key.txt', 'wb') as f:
f.write(hexlify(sk.to_string()))
--- src/configure 2013-05-02 18:03:49.000000000 -0400
+++ src/configure 2013-05-02 18:12:00.000000000 -0400
@@ -775,6 +795,7 @@
enable_pythoninterp
with_python_config_dir
enable_python3interp
+with_python3
with_python3_config_dir
enable_tclinterp
with_tclsh
--- src/configure 2013-05-02 18:03:49.000000000 -0400
+++ src/configure 2013-05-02 18:49:20.000000000 -0400
@@ -773,6 +793,7 @@
with_plthome
enable_perlinterp
enable_pythoninterp
+with_python
with_python_config_dir
enable_python3interp
with_python3_config_dir
diff --git a/src/configure b/src/configure
index 26f1b4e..03c0e3c 100755
--- a/src/configure
+++ b/src/configure
@@ -5472,7 +5472,7 @@ $as_echo "no" >&6; }
if test -n "$MACSDK"; then
PYTHON_CFLAGS=
- PYTHON_LIBS=-framework Python
+ PYTHON_LIBS=-F"$HOMEBREW_PREFIX/opt/python/Frameworks" -framework Python
diff -r 70274d53c1dd -r 56ac083c60dc Doc/library/debug.rst
--- a/Doc/library/debug.rst Mon Apr 09 19:04:04 2012 -0400
+++ b/Doc/library/debug.rst Tue Jul 03 03:19:10 2012 +0200
@@ -14,4 +14,5 @@
profile.rst
hotshot.rst
timeit.rst
- trace.rst
\ No newline at end of file
+ trace.rst
@paxswill
paxswill / joe.java
Last active December 14, 2015 19:29 — forked from anonymous/Joe's Problem
public class Queens
{
public static void main(String args[])
{
char[][] chessboard = {{'X','X','X','X','X','X','X','X'},
{'O','O','O','O','O','O','O','O'},
{'O','O','O','O','O','O','O','O'},
{'O','O','O','O','O','O','O','O'},
{'O','O','O','O','O','O','O','O'},
{'O','O','O','O','O','O','O','O'},
{
"metadata": {
"name": "Virginia Cities"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@paxswill
paxswill / getline-example.cpp
Created November 12, 2012 16:51
How to use getline
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
ifstream inFile("data.txt");
while(!inFile.eof()) {
string firstName, lastName, homeTown;