Skip to content

Instantly share code, notes, and snippets.

@SamvitJ
SamvitJ / Paxos.txt
Created October 23, 2016 17:36
Paxos Pseudocode
--- Paxos Proposer ---
proposer(v):
choose n > n_p
send prepare(n) to all servers including self
if prepare_ok(n, n_a, v_a) from majority:
v’ = v_a with highest n_a; choose own v otherwise
send accept(n, v’) to all
if accept_ok(n) from majority:
send decided(v’) to all
@SamvitJ
SamvitJ / install-cert.sh
Last active April 29, 2016 04:18
Scripts for importing/installing self-signed certificate on OS X
# Cert signed by a root CA
scp [email protected]:~/scripted/root-CA/{server.crt,rootCA.pem} .
sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "./rootCA.pem"
sudo security add-trusted-cert -r trustRoot -k "/Library/Keychains/System.keychain" "./server.crt"
# Self-signed cert
scp [email protected]:~/scripted/server-only/server.crt .
sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "./server.crt"