This file contains 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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Backquote (`) to Tab, preserving ~, opt + backtick -> backtick</name> | |
<appendix>Also, allows backquote</appendix> | |
<identifier>backquote_to_tab</identifier> | |
<autogen> | |
__KeyToKey__ | |
KeyCode::BACKQUOTE, ModifierFlag::OPTION_L, | |
KeyCode::BACKQUOTE |
This file contains 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 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 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 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 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 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
curl -XGET 'localhost:9200/index/doc/_search' -d '{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"range": { | |
"field1": { | |
"from": 900, |
This file contains 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 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 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/ | |
--> |
OlderNewer