Let's assume we have a pod called nginx
running in the namespace nginx-test
.
kubectl create namespace nginx-test
kubectl run nginx --image=nginx -n nginx-test
#!/bin/sh -e | |
echo "[$(date +%T)] Deregister boundary worker" | |
# Read the worker id from the file written on startup | |
worker_id=$(cat ./worker_id) | |
# Base url for the HCP cluster | |
base_url="https://${cluster_id}.boundary.hashicorp.cloud/v1" | |
auth_url="${base_url}/auth-methods/${auth_method_id}:authenticate" | |
dereg_url="${base_url}/workers/${worker_id}" |
#!/bin/bash | |
# export LICENSE_ID="" | |
# export PASSWORD="" | |
[[ -z "$LICENSE_ID" ]] && echo "Please Set LICENSE_ID Environment Variable" && exit 1 | |
[[ -z "$PASSWORD" ]] && echo "Please Set PASSWORD Environment Variable" && exit 1 | |
b64_password=$(echo -n ${PASSWORD} | base64) |
#!/usr/bin/env bash | |
function walk() { | |
for secret in $(vault list $1 | tail -n +3) | |
do | |
if [[ ${secret} == *"/" ]] ; then | |
walk "${1}${secret}" | |
else | |
echo "${1}${secret}" | |
fi |
Thank you everybody, Your comments makes it better
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904 | |
function jwt-decode() { | |
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq | |
} | |
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ | |
jwt-decode $JWT |
# /usr/local/bin/set_proxy.sh | |
# Sets proxy env vars. | |
# To use, source this into your shell: | |
# | |
# . /usr/local/bin/set_proxy.sh | |
PROXY_HOST=my-company-proxy.example.com | |
PROXY_PORT=3128 | |
read -p "Enter your username: " PROXY_USER |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
#!/bin/bash | |
echo -n "Starting vault... " | |
vault server -dev &> vault-server.log & | |
vault_pid=$! | |
echo OK | |
shutdown() { trap "" EXIT; echo -n 'Shutting down... '; kill -9 $vault_pid; echo OK; exit $1; } | |
trap "shutdown 0" EXIT | |
trap "echo; echo 'Got interrupt signal!'; shutdown 255" INT |