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 | |
# | |
# Public-Key Encryption and Decryption | |
# * http://www.openssl.org/ | |
# * http://barelyenough.org/blog/2008/04/fun-with-public-keys/ | |
# | |
# Mac OS X 10.6.4 | |
# OpenSSL 0.9.8l 5 Nov 2009 | |
# Generate keys |
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
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/XXXX/XXXXX/XXXXXX'; | |
const slack_req_opts = url.parse(slack_url); | |
const slack_channel = '@user_name'; //or channel name | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; | |
exports.handler = function(event, context, callback) { |
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 | |
set -e | |
set -x | |
#{ | |
#date | |
export zabbixemailto=$1 | |
export zabbixsubject=$2 | |
export zabbixbody=$3 | |
slack_web_hook_url=https://hooks.slack.com/services/#####/#####/########## |
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 | |
set -e | |
set -x | |
#{ | |
#date | |
export [email protected] | |
export zabbixemailto=$1 | |
export zabbixsubject=$2 | |
export zabbixbody=$3 |
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 | |
region=`facter ec2_placement_availability_zone | sed 's/[a-z]$//g'` | |
instanceId=`facter ec2_instance_id` | |
/usr/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=${instanceId}" --region ${region} | jq '.Tags[] | "ec2_tag_" + .Key + "=" + .Value' | tr [:upper:] [:lower:] | tr -d '"' | |
exit 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
docker rm $(docker ps -q -f status=exited) |
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
filter { | |
# Format Nginx Error logs | |
if [type] =~ /nginx_.*_error/ { | |
grok { | |
match => { | |
"message" => [ | |
"%{DATESTAMP:timestamp} \[%{DATA:severity}\] (%{NUMBER:pid:int}#%{NUMBER}: \*%{NUMBER}|\*%{NUMBER}) %{GREEDYDATA:message}", | |
"%{DATESTAMP:timestamp} \[%{DATA:severity}\] %{GREEDYDATA:message}", | |
"%{DATESTAMP:timestamp} %{GREEDYDATA:message}" | |
] |
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 -x | |
set -e | |
REPO_NAME=production | |
YUM_SERVER_URL=http://localhost:8888/yum-repo-server | |
FILES=*.rpm | |
curl -s -d "name=$REPO_NAME" $YUM_SERVER_URL/repo | |
for f in $FILES | |
do | |
echo "Processing $f file..." |
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
for /F %%x in ('hg log -r "heads(all()) and closed()" --template "{rev}"\n') do (call :merge "%%x") | |
GOTO :eof | |
:merge | |
hg --config ui.merge=internal:local -y merge --rev %1 | |
hg commit -m merge | |
GOTO :eof |
NewerOlder