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
Public Key Cryptography | |
The Problem: How do we communicate securely on the internet? | |
- We have to encrypt our communications. | |
- How do two parties who have never met, agree on a key when all of their communications are public? | |
- The answer: Diffie Hellman Key Exchange. -Whitfield Diffie, Martin Hellman | |
- The first implementation of public key cryptography as envisioned by Ralph Merkle. | |
The Setup: | |
- Alice wants to Talk to Bob. |
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
Get all requests that match :identifier | |
get matching user_agent_ids | |
get matching user_agent | |
os = user_agent.split(' ')[1] | |
count requests that match os | |
create hash {os => count } | |
display os[1..-2] + count |
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
1. Check to see if application is registered | |
2. Check to see if payload is present | |
3. Check to see if request is a duplicate one. | |
4. Sanitize payload | |
5. Insert payload into database. |
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
class Centaur | |
attr_reader :name, | |
:breed | |
def initialize(name, breed) | |
@name = name | |
@breed = breed | |
@actions = 0 | |
@standing = true | |
end |
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
Create VPC | |
Create Security Group | |
Create incoming and outgoing rules for SSH, HTTP, Sinatra and Rackup, 443 | |
Create Key Pair | |
cd ~/.ssh | |
mv ~/Downloads/Turing.pem . | |
chmod 400 Turing.pem | |
ssh-add -k Turing.pem | |
Launch Instance | |
ubuntu 14.04 |
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
def validator(card) | |
card.chars | |
.map { |n| n.to_i } | |
.map.with_index { |n, index| index.even? ? n * 2 : n } | |
.map { |n| n.to_s.length == 2 ? n.to_s[0].to_i + n.to_s[1].to_i : n } | |
.reduce(:+) % 10 == 0 ? "Valid" : "Invalid" | |
end |
NewerOlder