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
#!/bin/bash | |
set -eu -o pipefail | |
gen_priv() { | |
openssl genrsa 2048 2> /dev/null | |
} | |
gen_pub() { | |
echo "${1}" | openssl rsa -pubout 2> /dev/null | |
} |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
from base64 import b64encode | |
from uuid import uuid4 | |
try: | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend |
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
#!/bin/sh | |
# Modified version of: | |
# http://tech.namshi.com/blog/2015/08/02/vmware-fusion-headless/ | |
# See above for adding `vmrun` to your path. | |
if [ -z "$vmFile" -a -f *.vmx ] | |
then | |
vmFile=`ls *.vmx | head -n 1` | |
echo "vmFile set to $vmFile." |
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
{ | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetObject", | |
"s3:GetObjectAcl", | |
"s3:PutObject", | |
"s3:PutObjectAcl", | |
"s3:ListBucket" |
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
#!/usr/bin/env python | |
""" | |
This is a simple webhooks receiver for testing purposes. It should NOT be used on | |
production as it does not verify the sender. For an example that does, check out | |
http://blog.kloudless.com/2014/10/19/getting-started-with-kloudless-webhooks/ | |
To install dependencies and run: | |
$ pip install flask |
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
# /etc/ipsec.secrets | |
# Add the location of our secrets files. | |
include /etc/ipsec.secrets.d/* |
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
# /etc/ipsec.d/us-west-2.conf | |
conn us-west-2 | |
auto=start | |
type=tunnel | |
# right is remote | |
right=REMOTE_ELASTIC_IP | |
rightid=@REMOTE_PRIVATE_SUBNET | |
rightsubnet=REMOTE_PRIVATE_SUBNET | |
# left is local |
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
# /etc/sysctl.d/99-openswan.conf | |
net.ipv4.ip_forward = 1 | |
net.ipv4.conf.all.accept_redirects = 0 | |
net.ipv4.conf.all.send_redirects = 0 | |
net.ipv4.conf.default.accept_redirects = 0 | |
net.ipv4.conf.default.send_redirects = 0 |
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
# Wrote this before realizing django.utils.functional.lazy existed. | |
class LazyDict(dict): | |
""" | |
Loads data lazily. | |
""" | |
def __init__(self, loader, *args, **kwargs): | |
self._data_loaded = False | |
self.loader = loader | |
super(LazyDict, self).__init__(*args, **kwargs) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>File Explorer</title> | |
</head> | |
<body> | |
<!-- | |
Throw in the HTML from the JSFiddle's HTML tab here. | |
The JSFiddle is at http://jsfiddle.net/pseudonumos/PB565/embedded/ | |
--> |
NewerOlder