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
#/usr/local/bin/bash | |
#set -x | |
git config --global credential.helper '!aws codecommit credential-helper $@' | |
git config --global credential.UseHttpPath true | |
declare -a folders |
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 | |
yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA unzip | |
cd /home/ec2-user | |
curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O | |
unzip CloudWatchMonitoringScripts-1.2.1.zip | |
rm -rf CloudWatchMonitoringScripts-1.2.1.zip | |
chown ec2-user:ec2-user aws-scripts-mon | |
echo "* * * * * /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-util --swap-util --aggregated --auto-scaling --from-cron" >> /var/spool/cron/ec2-user | |
echo "0 * * * * /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --disk-space-used --disk-space-avail --disk-space-util --disk-path=/ --aggregated --auto-scaling --from-cron" >> /var/spool/cron/ec2-user |
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 | |
if [ $# -lt 3 ]; then | |
echo "To update fastly dynamic vcls" | |
echo "----------------------------" | |
echo "https://docs.fastly.com/vcl/vcl-snippets/using-dynamic-vcl-snippets/" | |
echo "$0 <fastly-key> <service-number> <revision-number>" | |
exit 1 |
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 https://api.github.com/users/serkanh/repos\?per_page\=1000 | jq '.[] | select(.fork==false) | .html_url' | |
curl https://api.github.com/users/serkanh/repos\?per_page\=1000 | jq '.[] | select(.fork==false and .language=="JavaScript") | .html_url' |
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 -ox | |
#either pass slack token as a param or env var SLACK_TOKEN=${1:SLACK_TOKEN} | |
SLACK_TOKEN=${SLACK_TOKEN} | |
# Get the list of channels | |
# https://api.slack.com/methods/channels.list/test |
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
aws --profile=HA sns list-subscriptions \ | |
--query 'Subscriptions[*]|[?contains(Protocol,`lambda`)==`false`]|[?contains(Endpoint,`bark`)==`true`]|[?contains(Endpoint,`stg`)==`true`]|[?contains(TopicArn,`d6cbe`)==`false`].{TopicArn:TopicArn}' --output text |
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 | |
# https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html | |
amazon_ips=( $(curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="AMAZON") | .ip_prefix') ) | |
ec2_ips=( $(curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="EC2") | .ip_prefix') ) | |
containsElement () { | |
local element match="$1" | |
shift | |
for element | |
do [[ "$element" == "$match" ]] && return 0; done |
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 axios = require('axios'); | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function fetch_retry(url,n){ |
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
aws --profile=jumpstart ecr describe-images --repository-name lead-front-door \ | |
--query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]' --output text |
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 | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
yum install -y aws-cli | |
yum install epel-release | |
sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/epel.repo | |
yum update -y | |
yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap automake openssl-devel git | |
git clone https://github.com/s3fs-fuse/s3fs-fuse | |
cd s3fs-fuse/ | |
./autogen.sh |
NewerOlder