$ git rev-parse HEAD
# Short version
$ git rev-parse --short HEAD
# Previous commit
$ git rev-parse HEAD~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
#!/bin/bash -e | |
# Usage: eval `aws-session <profile> <token>` | |
# Sets up environment variables for AWS temporary session credentials where | |
# MFA is required for API access. | |
# See: https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/ | |
# https://mharrison.org/post/aws_mfa/ | |
if [ $# -ne 2 ] | |
then |
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/bin/ruby | |
require 'json' | |
require 'net/http' | |
require 'uri' | |
region = "us-east-1" | |
service = "CLOUD9" | |
r = Net::HTTP.get(URI::parse('https://ip-ranges.amazonaws.com/ip-ranges.json')) |
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
# Check on running go routines: | |
[parse@parse lnxjedi]$ go tool pprof http://localhost:8888/debug/pprof/goroutine | |
Fetching profile over HTTP from http://localhost:8888/debug/pprof/goroutine | |
Saved profile in /home/parse/pprof/pprof.bot.test.goroutine.008.pb.gz | |
File: bot.test | |
Type: goroutine | |
Time: Mar 25, 2018 at 12:13am (UTC) | |
Entering interactive mode (type "help" for commands, "o" for options) | |
(pprof) list lnxjedi | |
Total: 11 |
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
# User specific aliases and functions | |
source <(kubectl completion bash) | |
source <(helm completion bash) | |
source <(argocd completion bash) | |
complete -C '/usr/local/bin/aws_completer' aws | |
alias k=kubectl | |
complete -F __start_kubectl k | |
alias h=helm | |
complete -F __start_helm h | |
export PATH=$HOME/go/bin:/usr/local/go/bin:$PATH |
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 [ ! "$1" ] | |
then | |
echo "Missing namespace" | |
exit 1 | |
fi | |
NAMESPACE=$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
#!/bin/bash -e | |
trap_handler() | |
{ | |
ERRLINE="$1" | |
ERRVAL="$2" | |
echo "line ${ERRLINE} exit status: ${ERRVAL}" | |
# The script should usually exit on error | |
exit $ERRVAL | |
} |
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
# Bash Terraform completion | |
# Originally adapted from: https://gist.github.com/cornfeedhobo/8bc08747ec3add1fc5adb2edb7cd68d3 | |
# Adapted from: https://gist.github.com/zish/85dccece461e050077997ff5d7d9c9d4 by Jeremy Melanson | |
# | |
#--- Get options listing from Terraform command. | |
_terraform_completion_get_opts () { | |
local CMD_EXEC="${1}" | |
local TF_OPT="${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
#!/bin/bash -e | |
# Usage: aws-session <token> (account) | |
# Sets up aws configuration for API access using temporary credentials | |
# See: https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/ | |
# https://mharrison.org/post/aws_mfa/ | |
usage(){ | |
cat <<EOF | |
Usage: aws-session [-r <region>] ([-i] | <token> (account)) |
OlderNewer