I hereby claim:
- I am jchysk on github.
- I am jchysk (https://keybase.io/jchysk) on keybase.
- I have a public key whose fingerprint is 4697 5E88 C723 4E13 57E0 E88D BC7F C851 B93C C464
To claim this, I am signing this object:
""" | |
from helpers import generate_RSA, encrypt_RSA, generate_password, decrypt_RSA, generate_AES, decrypt_AES, pad | |
priv, pub = generate_RSA() | |
encrypted = encrypt_RSA(pub, generate_password()) | |
key, iv, encryptor = generate_AES() | |
aes_encrypted = encryptor.encrypt(pad("this is a very long string " * 25)) | |
decrypt_AES(key, iv, aes_encrypted) | |
""" | |
BS = 16 |
""" | |
Function that takes two values to generate a QR Code that can be scanned with LaunchKey or TOTP holder | |
@param identity: Name and place. E.g. username/Gmail | |
@param secret: The actual TOTP code | |
Saves the image locally as a png | |
Requires PIL (pillow) and qrcode | |
""" | |
def convert(self, identity, secret): | |
import re |
from formencode import Schema, validators, Invalid | |
from formencode.validators import FormValidator | |
class RequireAtLeastOne(FormValidator): | |
choices = [] | |
__unpackargs__ = ('choices',) | |
def _convert_to_python(self, value_dict, state): | |
for each in self.choices: | |
if value_dict.get(each) is not None: |
""" | |
Pick a random winner | |
""" | |
if __name__ == '__main__': | |
import sys | |
entries = sys.argv[1] | |
import requests | |
# Grab the latest hash | |
latest_hash = requests.get("https://blockchain.info/q/latesthash") |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/python | |
""" | |
Takes a csv of email addresses and gives back a csv of the email addresses that have a resolvable domain. | |
""" | |
domains = list() | |
checked = [] | |
checked_bad = [] | |
import socket |
#!/bin/bash | |
for f in *.jpeg; do convert ./"$f" ./"${f%.jpeg}.pdf"; done | |
for f in *.pdf; do gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile="${f%.pdf}.compressed.pdf" "$f"; done |
# Docker controller | |
# example usage | |
# fab local_os restart_env | |
from fabric.api import * | |
def _vagrant(): | |
env.user = "vagrant" |
#Daut's edited secretary problem | |
#function which randomizes a list | |
def randomize_rankings(sec): | |
import random | |
random.shuffle(sec) | |
return sec | |
#function which returns a secretary based on Daut's algorithm | |
def chooseSecretary(sec): |
#Original secretary problem solution based on 100 secretaries and just on the ranking of secretaries from 1-100 | |
#want to figure out both average ranking chosen and how often the best candidate is chosen | |
#function which randomizes a list | |
def randomize_rankings(sec): | |
import random | |
random.shuffle(sec) | |
return sec |