Add resources directory with baseline common file/templates
This commit is contained in:
18
resources/bash/helpers.sh
Normal file
18
resources/bash/helpers.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
random() {
|
||||
if [[ $# -eq 0 ]]; then
|
||||
num=32
|
||||
else
|
||||
num=$1
|
||||
fi
|
||||
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $num | head -n 1
|
||||
}
|
||||
|
||||
function up() { cd $(eval printf '../'%.0s {1..$1}); }
|
||||
|
||||
function pipin() { pip freeze | grep $1; }
|
||||
|
||||
function passhash() {
|
||||
read -sp 'Password: ' tmppass;
|
||||
echo $tmppass | python3 -c 'import crypt; print(crypt.crypt(input(), crypt.mksalt(crypt.METHOD_SHA512)));';
|
||||
unset tmppass;
|
||||
}
|
Reference in New Issue
Block a user