Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sonicintrusion on github.
  • I am khanh (https://keybase.io/khanh) on keybase.
  • I have a public key whose fingerprint is 7896 1DA1 A353 616F 5AA9 006F 4A49 D2F5 B860 84C4

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am sonicintrusion on github.
* I am khanh (https://keybase.io/khanh) on keybase.
* I have a public key ASD2l8U2imnW-mQ68vi28jsd0gGJbbaMvx7LWeb88od5_go
To claim this, I am signing this object:
@sonicintrusion
sonicintrusion / prompt
Last active April 29, 2017 21:15
Alter and shorten the prompt
# alters prompt
export PS1='\j:\[\033[01;32m\]\u@\h\[\033[01;34m\] $(_dir_chomp "$(pwd)" 20)\[\033[01;37m\]$(parse_git_branch)\[\033[01;34m\] \$\[\033[00m\] '
_dir_chomp () {
local IFS=/ c=1 n d
local p=(${1/#$HOME/\~}) r=${p[*]}
local s=${#r}
while ((s>$2&&c<${#p[*]}-1))
do
d=${p[c]}
@sonicintrusion
sonicintrusion / gitconfig
Last active September 23, 2019 15:37
.gitconfig
[user]
name = sonicintrusion
useConfigOnly = true
[pull]
rebase = true
[push]
default = simple
[commit]
template = ~/.gitmessage
[branch]
@sonicintrusion
sonicintrusion / gitmessage
Last active September 15, 2020 13:46
.gitmessage
#<type>[optional scope]: <description>
#fix|feat: do/did something
#[optional body]
#i made an awesome thing
#[optional footers]
#REF: INFRA-xxx
# Provide links to any relevant tickets, articles or other resources
@sonicintrusion
sonicintrusion / bash_aliases
Last active September 15, 2020 13:45
.bash_aliases
alias ll="ls -al"
alias k="kubectl"
alias kns="k config set-context --current --namespace"
alias ks="k config use-context"
alias ao="aws-okta"
alias av="aws-vault"
alias gs="git status"
alias sm='aws ssm start-session --target $@'
alias asm="aws-okta exec $1 -- aws ssm start-session --target $2"
alias aso="aws --profile sso"
@sonicintrusion
sonicintrusion / Vagrantfile
Created May 16, 2017 12:57
.vagrant.d/Vagrantfile
Vagrant.configure(2) do |config|
if Vagrant.has_plugin?("vagrant-proxyconf")
if ENV['HTTP_PROXY']
config.proxy.http = ENV['HTTP_PROXY']
config.proxy.https = ENV['HTTPS_PROXY']
config.proxy.no_proxy = ENV['NO_PROXY']
else
config.proxy.http = ""
config.proxy.https = ""
config.proxy.no_proxy = ""
@sonicintrusion
sonicintrusion / getpass.sh
Created May 16, 2017 13:00
get password from lastpass
#!/bin/bash
echo "What application: "
read application
app="$(lpass ls | grep -i $application)"
echo $app
appID=$(echo $app | cut -d"[" -f2 | cut -d" " -f2 | cut -d"]" -f1)
lpass show --password $appID | pbcopy
echo "Copied first to the clipboard"
@sonicintrusion
sonicintrusion / list-instances.sh
Created May 16, 2017 13:01
list ec2 instances
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,Tags[?Key==`Name`].Value|[0],State.Name,PrivateIpAddress,PublicIpAddress]' --output text | column -t
@sonicintrusion
sonicintrusion / unload-keybase.sh
Created May 16, 2017 13:14
unload keybase from a mac after it auto loads
#!/bin/bash
supersecretpassword=$1
cd ~/Library/LaunchAgents
launchctl unload keybase.*
cd /Library/LaunchDaemons
launchctl unload keybase.*