$ docker run --rm -it -v $PWD:/src -w /src 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
set-option -g prefix C-b |
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
# https://stackoverflow.com/questions/2998832/git-pull-fails-unable-to-resolve-reference-unable-to-update-local-ref | |
git gc --prune=now | |
git remote prune origin |
from Enabling AAC and AptX over Bluetooth on MacOS
sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true
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 bash | |
# | |
# Delete indexes from N days ago | |
# | |
for arg in ${@} ; do case $arg in (-h|-\?) echo "USAGE: [INDEX_PREFIX=[filebeat]] $BASH_SOURCE [DAYS_AGO]" 1>&2 ; exit 255 ;; esac ; done | |
DAYS_AGO=${1:-90} | |
INDEX_PREFIX_DEFAULT="filebeat" |
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
""" | |
Copy objects from one bucket/prefix to another bucket with the same prefix. | |
Used to allow CloudFront logs to get parsed for uploading to ES *AND* analyzed | |
by WAF. | |
CloudFront Distribution logs -> s3://es-bucket/incoming -> Lambda (this) -> s3://waf-bucket/ | |
Set environment variable `destination_bucket` |
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
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --name SSH_RATE_LIMIT --set | |
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --name SSH_RATE_LIMIT --update --seconds 60 --hitcount 4 -j DROP |
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
################################################## | |
### Elasticsearch host name | |
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com" | |
### Elasticsearch prefix for index name | |
INDEX_PREFIX = "awslogs" | |
################################################# | |
### ELB access log format keys | |
ELB_KEYS = ["timestamp", "elb", "client_ip", "client_port", "backend_ip", "backend_port", "request_processing_time", "backend_processing_time", "response_processing_time", "elb_status_code", "backend_status_code", "received_bytes", "sent_bytes", "request_method", "request_url", "request_version", "user_agent"] |
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 bash | |
# | |
# curl wrapper returning timing information. | |
# | |
# ORIGIN: https://github.com/mat/dotfiles/blob/master/bin/curlt | |
# | |
# curl format adapted from | |
# http://josephscott.org/archives/2011/10/timing-details-with-curl/ | |
# | |
# Example usage: |
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 bash | |
# | |
# https://github.com/creationix/nvm | |
# | |
DIR="$(cd $(dirname $0) ; pwd)" | |
# Error codes | |
ERROR_NVM_INSTALL_SHA=2 | |
# Installer script from NVM repo |
NewerOlder