Skip to content

Instantly share code, notes, and snippets.

View flowerhack's full-sized avatar

Julia Hansbrough flowerhack

View GitHub Profile
@flowerhack
flowerhack / gist:b01186a3a4db56176a47
Created October 14, 2014 18:36
losing at installing python versions
dhcp-0059526637-5b-99:cryptochallenges juliahansbrough$ which python3
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3
dhcp-0059526637-5b-99:cryptochallenges juliahansbrough$ which pip3.4
/Library/Frameworks/Python.framework/Versions/3.4/bin/pip3.4
dhcp-0059526637-5b-99:cryptochallenges juliahansbrough$ pip3.4 install pycrypto
Requirement already satisfied (use --upgrade to upgrade): pycrypto in /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
Cleaning up...
dhcp-0059526637-5b-99:cryptochallenges juliahansbrough$ python3
Python 3.4.0rc2 (v3.4.0rc2:a300712ed38c, Feb 23 2014, 00:51:37)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
(Pdb) int(999999999999999999999999999999999999999999999999999999999999999)
999999999999999999999999999999999999999999999999999999999999999L
Sure, that L is there to indicate it's a long. I can dig that.
(Pdb) str(int(999999999999999999999999999999999999999999999999999999999999999))
'999999999999999999999999999999999999999999999999999999999999999'
Sweet. We ditch the L when converting to a string since the user doesn't need to see that.
@flowerhack
flowerhack / gist:df6f89b35eaecdb76eab
Last active August 29, 2015 14:07
lolpythonstrings
# this succeeds...
assert equals(
cryptopals.hex_to_b64("""49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"""),
"SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t"
)
# ...but this fails!
assert equals(
cryptopals.hex_to_b64("""49276d206b696c6c696e6720796f757220627261696e206c69
6b65206120706f69736f6e6f7573206d757368726f6f6d"""),
dhcp-0059526637-5b-99:ebd_relAug-2014 flowerhack$ gzip -l ebd_relAug-2014.txt.gz
compressed uncompressed ratio uncompressed_name
7232458369 2856865220 -153.2% ebd_relAug-2014.txt
@flowerhack
flowerhack / pi_golf.py
Last active August 29, 2015 14:03
Pi-Golf (6/25/2014)
# Pi-Golf: http://puzzles.bostonpython.com/pigolf.html
# "Convert the digits of pi into uppercase ASCII letters."
# Solutions:
# first 3-letter English word is "UMP" or "ROD" depending on how you feel about "ump"
# first 4-letter word is "RUTS"
# Aside: somehow SHaP is a word???
# first 5-letter word is "FLOWN"
# first 6-letter word is "CHOCKS"
import sys
@flowerhack
flowerhack / gist:9406413
Created March 7, 2014 06:36
keybase.md
### Keybase proof
I hereby claim:
* I am flowerhack on github.
* I am julia (https://keybase.io/julia) on keybase.
* I have a public key whose fingerprint is FDAF 9F35 303A D53C DA20 1119 65B2 78FE 3B5F 82E9
To claim this, I am signing this object:
@flowerhack
flowerhack / gist:7992665
Created December 16, 2013 19:17
provision fail
Julias-MacBook-Pro:devstack jhans$ vagrant provision
[default] Running provisioner: ansible...
PLAY [Configure instance(s)] **************************************************
GATHERING FACTS ***************************************************************
ok: [192.168.33.10]
TASK: [devpi | update devpi supervisor configuration] *************************
ok: [192.168.33.10] => {"changed": false, "cmd": "/edx/app/devpi/venvs/supervisor/bin/supervisorctl -c /edx/app/devpi/supervisor/supervisord.conf update ", "delta": "0:00:00.061273", "end": "2013-12-16 19:10:50.445470", "item": "", "rc": 0, "start": "2013-12-16 19:10:50.384197", "stderr": "", "stdout": "", "stdout_lines": []}