Skip to content

Instantly share code, notes, and snippets.

View paxswill's full-sized avatar

Will Ross paxswill

View GitHub Profile
@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()))
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 / 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 evesrp.killmail import CRESTMail
class SubmittedCRESTZKillmail(CRESTMail):
"""Accepts and validates CREST killmail links, but submits them to
ZKillboard and substitutes the zKB link in as the canonical link
"""
def __init__(self, url, **kwargs):
# Let CRESTMail validate the CREST link
from evesrp.killmail import ZKillmail
import gdata.spreadsheets.client
from decimal import Decimal
# patch the spreadsheet's client to use the public feeds
gdata.spreadsheets.client.PRIVATE_WORKSHEETS_URL = \
gdata.spreadsheets.client.WORKSHEETS_URL
gdata.spreadsheets.client.WORKSHEETS_URL = ('https://spreadsheets.google.com/'
'feeds/worksheets/%s/public/full')
@paxswill
paxswill / calendar.sh
Created October 28, 2010 11:50
This formats a single days worth of events. Note that I have two UUIDs from my calendars in here, replace with ones from your calendar.
#!/bin/bash
#Get the date command
#DATE_CMD_LOC=`which date`
DATE_CMD_LOC=/bin/date
#Build the date command strings
START_DATE_CMD="$DATE_CMD_LOC -v+$1d +%Y-%m-%d\ 00:00:01\ -0500"
END_DATE_CMD="$DATE_CMD_LOC -v+$1d +%Y-%m-%d\ 23:59:59\ -0500"
#echo $START_DATE_CMD
#echo $END_DATE_CMD
@paxswill
paxswill / libimobiledevice config.log
Created February 17, 2011 18:14
This is the config.log of imobiledevice
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libimobiledevice configure 1.0.3, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/libimobiledevice/1.0.3 --without-swig
## --------- ##
## Platform. ##
@paxswill
paxswill / complexity.c
Created April 1, 2011 05:40
Dropping from quadratic to linear complexity
/*
In computer science, algorithmic complexity is represented by something called
Big-Oh notation. Writing O(1) means a function will take the same amount of
time no matter how large the input is, ie: it is constant. O(n) means it will
take linear time, for example if you double the amount of input, the time taken
to perform that function will also double. Other common complexities are O(n^2),
O(log(n)), and O(n log(n)). Note, in most cases the logarithm is log base 2.
The following functions basically split a list of numbers in the following way:
{0, 1, 2, 3, 4, 5, 6, 7}
#include <string>
using namespace std;
// So here I'll define a struct that will go in the linked list
typedef struct person{
string name;
int age;
};
@paxswill
paxswill / fizzbuzz-recursive-bit.c
Last active September 25, 2015 16:48
FizzBuzz with recursion and no multiplication or division
#include <stdio.h>
#include <stdbool.h>
int addDigitsHex(int num);
void recursiveFizzBuzz(int start, int end);
int main (int argc, char const *argv[]) {
recursiveFizzBuzz(1, 100);
return 0;
}