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
# Launches the diff between two branches in kdiff3 | |
gitcomparebranches () { | |
git difftool --tool=kdiff3 --dir-diff ${1}..${2} | |
} |
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 centos:7.5.1804 | |
RUN yum install epel-release -y && \ | |
yum -y update && \ | |
yum install -y python-pip && \ | |
pip install awscli --upgrade | |
# docker build -t username/aws-cli -f Dockerfile . | |
# docker push username/aws-cli |
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
# Ref: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html | |
function awsSecretAccessKey2SesPassword () { | |
sesPassword=$((echo -en "\x02"; echo -n 'SendRawEmail' \ | |
| openssl dgst -sha256 -hmac "$1" -binary) \ | |
| openssl enc -base64); | |
encodedSesPassword=$(python -c "import urllib; print urllib.quote('''$sesPassword''','')"); | |
echo $encodedSesPassword; | |
} | |
# usage: awsSecretAccessKey2SesPassword $AWS_SECRET_ACCESS_KEY |
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 *********** | |
# describe ec2 instances | |
aws ec2 describe-instances \ | |
--query 'Reservations[*].Instances[*].[InstanceId,Tags[?Key==`Name`].Value|[0],State.Name, | |
PrivateIpAddress,PublicIpAddress]' \ | |
--output table | |
# stopped instances |
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
apiVersion: v1 | |
version: 0.1.1 | |
name: ${APP_NAME} | |
appVersion: ${APP_VERSION} | |
description: ${APP_DESCRIPTION} | |
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 i in `seq 1 100`; do echo $i; done | paste -sd+ - | bc |
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
{ "id" : { "year" : 2024, "month" : 10 }, "total" : 148 } | |
{ "id" : { "year" : 2037, "month" : 1 }, "total" : 2 } | |
{ "id" : { "year" : 2125, "month" : 7 }, "total" : 46 } | |
{ "id" : { "year" : 2033, "month" : 3 }, "total" : 7 } | |
{ "id" : { "year" : 2027, "month" : 1 }, "total" : 8 } | |
{ "id" : { "year" : 2026, "month" : 10 }, "total" : 5 } | |
{ "id" : { "year" : 2066, "month" : 3 }, "total" : 28 } | |
{ "id" : { "year" : 1980, "month" : 1 }, "total" : 5 } | |
{ "id" : { "year" : 2023, "month" : 1 }, "total" : 1 } | |
{ "id" : { "year" : 2095, "month" : 9 }, "total" : 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
for i in collname1 collname2 collname3; do | |
curl -s "http://server/solr/${i}/select?q=*:*" 2>&1 | grep -o "numF.*" | cut -d' ' -f1 | cut -d\" -f2 | (read count; printf "%-20s %15s\n" $i $count;); | |
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
# view commits that are on a release branch but not on master | |
git log --pretty=oneline --abbrev-commit origin/release/16.12.14 --not origin/master | |
# view commits that are on master but not on a release branch | |
git log --pretty=oneline --abbrev-commit origin/master --not origin/release/16.12.14 | |
# view unique JIRA IDs mentioned in commit messages on a release branch | |
git log --pretty=oneline --abbrev-commit origin/release/17.1.12 --not origin/master | grep -o "PROJNAME.*" | sed -e "s/'/:/g" | cut -d: -f1 | tr ',' '\n' | sed -e 's/ //g' | sort | uniq | |
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
# JSESSIONID is used by the server to identify if the user is logged in. Manually login via the browser in the application, | |
# use Chrome developer tool or Firebug to get JSESSIONID and use that in the curl command to invoke the service endpoints. | |
curl --cookie "JSESSIONID=REPLACE_THIS" http://localhost.xom/api/resourcename/id | |
#Example: | |
for i in `seq 1 100` ; do | |
curl --cookie "JSESSIONID=12345678901234567890" http://localhost.xom/api/resourcename/${i}/; echo ""; | |
done |
NewerOlder