Skip to content

Instantly share code, notes, and snippets.

@jayhding
jayhding / find-gcp-public-ip.sh
Created August 30, 2019 00:12
This script is used to find specific public IP by looping all GCP projects
#!/usr/bin/env bash
# This script finds specific public ip from all of your GCP projects
PUBLIC_IP=$1
for projct in $(gcloud projects list | awk '{print $1}' | sed -n '1!p'); do
echo "-- Searching in $projct"
gcloud config set project "$projct" >> /dev/null 2>&1
for ip in $(gcloud --format="value(networkInterfaces[0].accessConfigs[0].natIP)" compute instances list); do
@jayhding
jayhding / rename-vault-path.sh
Created August 30, 2018 03:33
This script is used to rename a path in vault by listing all credentials then add to new path
#!/usr/bin/env bash
old_path=$1
new_path=$2
raw_list=$(vault list ${old_path})
list=$(echo "${raw_list}" | sed -e "s/Keys//" -e "s/----//" -e "/^\s*$/d")
IFS=$'\n'; list_array=($list);

Keybase proof

I hereby claim:

  • I am jayhding on github.
  • I am jding (https://keybase.io/jding) on keybase.
  • I have a public key whose fingerprint is 7873 FAF5 01CF 5E3A D14F F47D AB64 6CEC B10F 708E

To claim this, I am signing this object:

@jayhding
jayhding / cvimrc
Last active April 15, 2016 00:29
Jay's CVIM Configuration File
map [ :call previousTab<CR>
map ] :call nextTab<CR>
map <C-[> :call previousMatchPattern<CR>
map <C-]> :call nextMatchPattern<CR>
let barposition = "bottom"
let blacklists = ["https://mail.google.com/*","*://mail.google.com/*","@https://mail.google.com/mail/*","*://rancher.auiag.corp/*","*://vmprod.*/*","://20.178.32.55/*"]
" this will enable the config block below on the specific domain
site '*://confluence.*/*' {