by alexander white ©
2.0.0-p481 :001 > OpenSSL::SSL::SSLContext::DEFAULT_PARAMS
=> {:ssl_version=>"SSLv23", :verify_mode=>1, :ciphers=>"ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW", :options=>-2147482625}
2.0.0-p481 :002 > rating = JSON.parse(RestClient::Resource.new("https://www.howsmyssl.com/a/check" ).get)['rating']
=> "Bad"
This file contains hidden or 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
""" | |
A deep neural network with or w/o dropout in one file. | |
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/ | |
""" | |
import numpy, theano, sys, math | |
from theano import tensor as T | |
from theano import shared | |
from theano.tensor.shared_randomstreams import RandomStreams |
This file contains hidden or 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
cd /var/lib | |
mkdir tor2 | |
chown debian-tor tor2 | |
chmod 2700 tor2 | |
cd /usr/share | |
cp -r tor tor2 | |
cd tor2 | |
(edit tor-service-defaults-torrc) |
This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.
Highly recommended things!
This is my five-star list. These are my favorite things in all the world.
A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★
A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E
- WAL-E: https://github.com/wal-e/wal-e
- Assuming Ubuntu 12.04 LTS ("Precise")
- We'll be using S3. Make sure you have an IAM in a group with
GetObject
,ListBucket
andPutObject
on the bucket you want to use (and that it's not public).
- These packages:
This file contains hidden or 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
wget http://stedolan.github.io/jq/download/linux64/jq | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
"Name=instance-state-name,Values=running" \ | |
| jq -r \ | |
".Reservations[] | .Instances[] | .InstanceId" \ | |
aws ec2 describe-volumes --filters \ | |
"Name=status,Values=available" \ | |
| jq -r ".Volumes[] | .VolumeId" \ |
This file contains hidden or 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
""" | |
This file contains code that, when run on Python 2.7.5 or earlier, creates | |
a string that should not exist: u'\Udeadbeef'. That's a single "character" | |
that's illegal in Python because it's outside the valid Unicode range. | |
It then uses it to crash various things in the Python standard library and | |
corrupt a database. | |
On Python 3... well, this file is full of syntax errors on Python 3. But | |
if you were to change the print statements and byte literals and stuff: |
This file contains hidden or 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
from dateutil import rrule | |
from datetime import datetime | |
def get_schedule_holidays_rrules(): | |
return [ | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=1, bymonthday=1), # New Years | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=5, byweekday=rrule.MO(-1)), # Memorial | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=7, bymonthday=4), # Independence | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=11, byweekday=rrule.TH(4)), # Thanksgiving | |
rrule.rrule(rrule.YEARLY, dtstart=datetime.now(), bymonth=12, bymonthday=25), # Christmas |