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
from django.core.management import setup_environ | |
import settings, csv | |
setup_environ(settings) | |
from companies.models import Lead | |
file = csv.reader(open('florida.csv', 'rU'), delimiter = ',', quotechar='|') | |
for row in file: | |
#Name the Django field with corresponding row in your csv. | |
lead = Lead(cname=row[0], crep=row[1], cnumber=row[2], cemail=row[3], caddress=row[4], ccity=row[5],czip=row[6],submissiondate=row[7], businesstype = row[8], comment = row[9]) | |
lead.save() |
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 | |
sudo yum install unzip wget perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA -y | |
wget -O ~ec2-user/CloudWatchMonitoringScripts-1.2.1.zip http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip | |
cd ~ec2-user && unzip CloudWatchMonitoringScripts-1.2.1.zip | |
chown ec2-user:ec2-user ~ec2-user/aws-scripts-mon | |
rm CloudWatchMonitoringScripts-1.2.1.zip | |
crontab -l > ~ec2-user/mycron | |
echo "*/5 * * * * ~ec2-user/aws-scripts-mon/mon-put-instance-data.pl --disk-space-util --disk-path=/ --from-cron" >> ~ec2-user/mycron | |
echo "*/5 * * * * ~ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-used --mem-avail --swap-used" >> ~ec2-user/mycron | |
crontab ~ec2-user/mycron |
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/bash | |
trap exit INT | |
INSTANCES=$( aws --profile=HA ec2 describe-instances --query 'Reservations[].Instances[].InstanceId[]' | sed -e 's/\[//g' -e 's/\]//g') | |
SUM=0 | |
echo $INSTANCES | |
for i in $( echo $INSTANCES | sed -e 's/"//g' -e 's/,//g' -e 's/\[//g' -e 's/\]//g' ) ;do | |
echo "---------------------------$i-------------------------------\n" | |
aws --profile=HA ec2 describe-instances --instance-ids $i --query 'Reservations[].Instances[].Tags[?Key==`Name`].Value' --output text | |
aws --profile=HA ec2 describe-instance-attribute --instance-id $( echo $i | sed -e 's/"//g' -e 's/,//' -e 's/\[//g' -e 's/\]//g' ) --attribute userData \ | |
| jq '.UserData.Value' | sed 's/"//g' | base64 --decode |
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 |
NewerOlder