This file contains hidden or 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
names=( $(az keyvault secret list --vault-name [oldvault] | jq '.[] | .name') ) | |
for name in "${names[@]}" | |
do | |
name=`echo $name | tr -d '"'` | |
value=`az keyvault secret show --name $name --vault-name [oldvault] | jq '.value' | tr -d '"'` | |
echo "setting $name..." | |
az keyvault secret set --name "$name" --vault-name [newvault] --value "$value" | |
done |
This file contains hidden or 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
table_exists() { | |
db_url="$1" | |
user="$3" | |
password="$4" | |
schema="$2" | |
if [[ ! -z $(mysql -Ns -h"$db_url" -u"$user" -p"$password" -e "select schema_name from information_schema.schemata where | |
schema_name='${schema}';") ]]; then | |
echo "schema exists" | |
return 0 | |
fi |
This file contains hidden or 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 | |
read -rp "What is the new access_key: " access_key | |
read -rp "What is the new secret_key: " secret_key | |
enc_access=$(echo "$access_key" | base64) | |
enc_secret=$(echo "$secret_key" | base64) | |
echo "encrypted access key: $enc_access" | |
echo "encrypted secret key: $enc_secret" |
This file contains hidden or 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
docker ps -aqf "name=rmq" | xargs -I{} docker exec {} bash -c "rabbitmqctl stop_app ; rabbitmqctl reset ; rabbitmqctl start_app" |
This file contains hidden or 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
import requests | |
import json | |
uri = 'http://localhost:15677/api/queues' | |
res = json.loads(requests.get(uri, auth=('username', 'password')).content) | |
for i in res: | |
print('{:<40}: {} {}'.format(i.get('name'), i.get('state'), i.get('consumers'))) |
This file contains hidden or 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 | |
curl -O https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.23.0.tar.gz | |
tar -xvf git-2.23.0.tar.gz | |
cd git-2.23.0/ | |
./configure | |
make && make install | |
cp git /usr/local/bin/git |
This file contains hidden or 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
{ | |
"contexts": { | |
"application-1": { | |
"beans": { | |
"spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties": { | |
"prefix": "spring.transaction", | |
"properties": {} | |
}, | |
"management.trace.http-org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceProperties": { | |
"prefix": "management.trace.http", |
This file contains hidden or 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
import java.time.Duration; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.cache.CacheManager; | |
import org.springframework.cache.annotation.CachingConfigurerSupport; | |
import org.springframework.cache.annotation.EnableCaching; | |
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; |
This file contains hidden or 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
mkdir -p ~/.git_hooks | |
# make it executable | |
chmod a+x ~/.git_hooks/commit-msg | |
# --------------------------- | |
# vi ~/.git_hooks/commit-msg: | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
echo "$NAME"': '$(cat "$1") > "$1" |
This file contains hidden or 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
read -p "What version you want to install? " version | |
brew install mongo@$version | |
brew install mongod | |
sudo mkdir -p /data/db | |
sudo chmod -R go+w /data/db | |
echo "Done! Run \"mongod\" to start the database" |
NewerOlder