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
#!/bin/bash | |
# Install: put this in an executable file named `kubectl-decode_secret` , which is in your PATH | |
# Usage: kubectl decode-secret <secret-name> | |
# | |
# Note: the script is using fzf (https://github.com/junegunn/fzf) , for example if you just type `kubectl decode-secret` | |
# it will list the screts and you can select whichever you want | |
kubectl get secret $(kubectl get secret | sed 1d | fzf | awk '{ print $1 }') --template='{{ range $key, $value := .data }}{{ printf "%s: %s\n" $key ($value | base64decode) }}{{ end }}' |
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
#!/usr/bin/env python3 | |
from passlib.totp import TOTP | |
from ansible.module_utils._text import to_text | |
class FilterModule(object): | |
def filters(self): | |
return { | |
'totpcode': self.totpcode | |
} |
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
#!/bin/bash -e | |
### Author: Alex Duzsardi | |
### Twitter: @aduzsardi | |
### GitHub: @aduzsardi | |
### Keybase: @aduzsardi | |
### Requirements: bash, date, docker, jq | |
# Remove docker volumes last used more than a month ago |
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
#!/bin/bash | |
### | |
### my-script — does one thing well | |
### | |
### Usage: | |
### my-script <input> <output> | |
### | |
### Options: | |
### <input> Input file to read. | |
### <output> Output file to write. Use '-' for stdout. |
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
## Do this on each swarm-node | |
# store containers attached to the bridge | |
$ gwbridge_users=$(docker network inspect --format '{{range $key, $val := .Containers}} {{$key}}{{end}}' docker_gwbridge | \ | |
$ xargs -d' ' -I {} -n1 docker ps --format {{.Names}} -f id={}) | |
# stop all containers | |
# if you have stacks that restart automatically, remove them via docker stack <stackName> rm | |
$ echo "$gwbridge_users" | xargs docker stop | |
$ docker network rm docker_gwbridge | |
$ docker network disconnect -f docker_gwbridge gateway_ingress-sbox |
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
docker node inspect self --format '{{json .}}' | jq . | |
{ | |
"ID": "misdcojgeuz8ps4v1w93apoiz", | |
"Version": { | |
"Index": 443 | |
}, | |
"CreatedAt": "2020-08-08T21:58:17.93412711Z", | |
"UpdatedAt": "2020-08-15T12:15:50.442472266Z", | |
"Spec": { | |
"Labels": {}, |
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
# add this to your .bashrc | |
# call it with httproxy http://proxied-url.tld | |
httproxy() { | |
local bold='\e[1m' reset='\e[0m' bright='\e[37m' | |
local info='\e[96m' warn='\e[93m' error='\e[91m' | |
local helpmsg=$(cat <<HELP | |
${info}Usage:${reset} | |
${bright}${FUNCNAME[0]} <proxied-url>${reset} |
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
#!/bin/bash | |
# Based on https://stackoverflow.com/questions/20762575/explanation-of-convertor-of-cidr-to-netmask-in-linux-shell-netmask2cdir-and-cdir | |
mask2cdr () | |
{ | |
local mask=$1 | |
# In RFC 4632 netmasks there's no "255." after a non-255 byte in the mask | |
local left_stripped_mask=${mask##*255.} | |
local len_mask=${#mask} |
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
alias=jdk1.8 | |
section=non-free | |
jre servertool /usr/lib/jvm/jdk1.8/jre/bin/servertool | |
jre keytool /usr/lib/jvm/jdk1.8/jre/bin/keytool | |
jre java /usr/lib/jvm/jdk1.8/jre/bin/java | |
jre jcontrol /usr/lib/jvm/jdk1.8/jre/bin/jcontrol | |
jre rmid /usr/lib/jvm/jdk1.8/jre/bin/rmid | |
jre ControlPanel /usr/lib/jvm/jdk1.8/jre/bin/ControlPanel | |
jre rmiregistry /usr/lib/jvm/jdk1.8/jre/bin/rmiregistry | |
jre orbd /usr/lib/jvm/jdk1.8/jre/bin/orbd |
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
#!/bin/bash | |
nginxver=`apt show nginx-full |grep Version | awk '{print $2}' |awk -F '-' '{print $1}'` | |
nginxname=nginx-$nginxver.tar.gz | |
nginxdir=nginx-$nginxver | |
#apt -y install libmaxminddb0 libmaxminddb-dev mmdb-bin | |
if [ -f "$nginxname" ] |
NewerOlder