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
locals { | |
chunks = "${chunklist(local.whitelist, 5)}" | |
rules = [ | |
{ action = "allow", priority = "0", match = { versioned_expr = "SRC_IPS_V1", config = { src_ip_ranges = ["${local.chunks[0]}"] }}}, | |
{ action = "deny(403)", priority = "2147483647", match = { versioned_expr = "SRC_IPS_V1", config = { src_ip_ranges = ["*"] }}, description = "Default rule: deny all"} | |
] | |
} | |
resource "google_compute_security_policy" "policy" { | |
project = "${var.project}" |
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
variable "ips" { | |
default = [ | |
"1.1.1.1/32", | |
"2.2.2.2/32", | |
"3.3.3.3/32", | |
"4.4.4.4/32", | |
"5.5.5.5/32", | |
"6.6.6.6/32", | |
"7.7.7.7/32", | |
"8.8.8.8/29", |
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
[ | |
"104.214.192.0/18", | |
"104.214.231.110/32", | |
"104.214.236.47/32", | |
"104.214.237.135/32", | |
"104.214.243.32/28", | |
"104.40.128.0/17", | |
"104.40.129.89/32", | |
"104.40.147.180/32", | |
"104.40.147.216/32", |
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
init_scratch_dir () { | |
pushd ~/Documents/scratch | |
echo scratch-3.7.2 >> .python-version | |
pyenv virtualenv 3.7.2 scratch-3.7.2 | |
popd | |
} | |
scratch () { | |
pushd ~/Documents/scratch | |
} |
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
from scrapy.pipelines.files import FilesPipeline, S3FilesStore, FSFilesStore | |
class S3FilesStore_V4(S3FilesStore): | |
AWS_ACCESS_KEY_ID = None | |
AWS_SECRET_ACCESS_KEY = None | |
AWS_DEFAULT_REGION = None | |
def __init__(self, uri): | |
super(S3FilesStore_V4, self).__init__(uri) |
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
notification sms { | |
post = https://{AccountSid}:{Authtoken}@api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json | |
body = Body={{.}}&To={ToPhoneNumber}&From={FromPhoneNumber} | |
} |
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
{ | |
"size": 0, | |
"query": { | |
"filtered": { | |
"query": { | |
"query_string": { | |
"analyze_wildcard": true, | |
"query": "_type:logs" | |
} | |
}, |
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
[ec2_metadata] | |
type = "ProcessInput" | |
ticker_interval = 10 | |
decoder = "ec2_metadata_decoder" | |
[ec2_metadata.command.0] | |
bin = "/usr/bin/ec2metadata" | |
args = ["--ami-id", "--instance-id", "--instance-type", "--local-ipv4"] | |
[ec2_metadata_decoder] |
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 | |
tar xvzf virtualenv-1.11.6.tar.gz | |
cd virtualenv-1.11.6 | |
sudo python virtualenv.py ../$1 | |
cd .. | |
# activate the virtualenv, install the requirements | |
source $1/bin/activate | |
sudo pip install -r mac_requirements.txt |
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 | |
tar xvzf virtualenv-1.11.6.tar.gz | |
cd virtualenv-1.11.6 | |
sudo python virtualenv.py ../$1 | |
cd .. | |
source $1/bin/activate | |
sudo pip install -r mac_requirements.txt | |
rm -rf virtualenv-1.11.6 | |
deactivate |
NewerOlder