View error-handler.sh
This file contains 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
# Bash error handler. | |
# On any error print full stack trace of the failure and exit with the original error code | |
# set -o errtrace | |
# inspired by https://gist.github.com/ahendrix/7030300 | |
set -Eeuo pipefail | |
function errexit() { | |
local err=$? | |
set +o xtrace | |
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}." >&2 |
View gist:a8e05350c1fb052db3da75241e5bc564
This file contains 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
foreach ($group in $groups) { Write-Host " === $group == "; (Get-Culture).TextInfo.ToTitleCase((Get-ADGroupMember $group | Sort-Object -property Name | Select Name -ExpandProperty Name | Out-String -Width 100).ToLower()) } |
View cleanup docker registry
This file contains 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
# inspired by the https://gist.github.com/jaytaylor/86d5efaddda926a25fa68c263830dac1 | |
registry="http://${registry_user}:${registry_passwd}@${registry_url}/v2" | |
for repo in `cat repos-todel`; do | |
for tag in $(curl -sSL "${registry}/${repo}/tags/list" | jq -r '.tags[]?'); do | |
tagURL="${registry}/${repo}/manifests/${tag}" | |
sha256=$(curl -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -sSL -I ${tagURL} | awk '$1 == "Docker-Content-Digest:" { print $2 }' | tr -d $'\r') | |
deleteURL="${registry}/${repo}/manifests/${sha256}" | |
echo $deleteURL | |
# curl -v -sSL -X DELETE $deleteUR | |
done |
View Kubernetes delete terminating pod
This file contains 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
https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod | |
kubectl patch pod <pod> -p '{"metadata":{"finalizers":null}}' | |
kubectl delete pods <pod> --grace-period=0 --force |
View choco-install-all.bat
This file contains 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
@REM choco install all the applications from the choco-win-10-fresh file one by one | |
@echo off | |
for /f "tokens=* delims=" %%a in ('type choco-win-10-fresh') do ( | |
call choco install -y %%app | |
) | |
start chocolateygui |
View .env
This file contains 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
COMPOSE_PROJECT_NAME=template | |
VAR_FROM_FILE=anyvalue | |
VAR_FROM_FILE_WITH_THE_SAME_NAME=any_other_value |
View Sandbox.wsb
This file contains 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
<Configuration> | |
<MappedFolders> | |
<MappedFolder> | |
<HostFolder>C:\SandBoxShare</HostFolder> | |
<ReadOnly>true</ReadOnly> | |
</MappedFolder> | |
</MappedFolders> | |
<LogonCommand> | |
<Command>C:\Users\WDAGUtilityAccount\Desktop\SandBoxShare\init-sandbox.bat</Command> | |
</LogonCommand> |
View sqlite to mysql
This file contains 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
https://github.com/techouse/sqlite3-to-mysql |
View how to use separate private keys for github bitbucket and other users
This file contains 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
https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use | |
~/.ssh/config | |
host bitbucket.org | |
HostName bitbucket.org | |
IdentityFile ~/.ssh/github_rsa | |
User git | |
https://medium.com/@xiaolishen/use-multiple-ssh-keys-for-different-github-accounts-on-the-same-computer-7d7103ca8693 |
NewerOlder