Skip to content

Instantly share code, notes, and snippets.

@syedhassaanahmed
syedhassaanahmed / migrate_kv.sh
Last active December 3, 2021 09:05
Copy secrets from one Azure Key Vault to another assuming they're both in the same Azure subscription
#!/bin/bash
set -euo pipefail
SOURCE_KV="<source_key_vault_name>"
DEST_KV="<destination_key_vault_name>"
SOURCE_SECRETS=$(az keyvault secret list --vault-name $SOURCE_KV --query "[].id" -o tsv | cut -d "/" -f5)
DEST_SECRETS=$(az keyvault secret list --vault-name $DEST_KV --query "[].id" -o tsv | cut -d "/" -f5)
MISSING_SECRETS=$(echo "${SOURCE_SECRETS} ${DEST_SECRETS}" | tr ' ' '\n' | sort | uniq -u)
#Deploy Linkerd2 with helm3 and certificates
kubectl create ns linkerd
kubectl label ns linkerd config.linkerd.io/admission-webhooks=disabled
#brew install step
step certificate create identity.linkerd.cluster.local ca.crt ca.key --profile root-ca --no-password --insecure
step certificate create identity.linkerd.cluster.local issuer.crt issuer.key --ca ca.crt --ca-key ca.key --profile intermediate-ca --not-after 8760h --no-password --insecure
#install helm3-rc from https://github.com/helm/helm/releases
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active August 12, 2024 13:00
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@midwire
midwire / reset_routing_table.sh
Last active July 25, 2024 17:31
[Reset routing table on OSX] #osx #devops #networking
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times