From bb89fe5416be4e51f9eb17aed8e935b11087baef Mon Sep 17 00:00:00 2001 From: Nikurasu Date: Tue, 24 Jan 2023 08:56:26 +0100 Subject: [PATCH] Added shell functions --- .gitignore | 3 ++- README.md | 4 ++++ shell/env.sh.example | 1 + shell/functions.sh | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100644 shell/env.sh.example create mode 100644 shell/functions.sh diff --git a/.gitignore b/.gitignore index 496ee2c..15dde54 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.DS_Store +.env.sh \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c65166b --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Nikus Dotfiles + +## Note for env.shell.example +Copy it and rename it to .env.sh. Don't commit one with your environment variables, that variables are secret keys \ No newline at end of file diff --git a/shell/env.sh.example b/shell/env.sh.example new file mode 100644 index 0000000..ee0e2f5 --- /dev/null +++ b/shell/env.sh.example @@ -0,0 +1 @@ +export GOTIFY_KEY="" \ No newline at end of file diff --git a/shell/functions.sh b/shell/functions.sh new file mode 100644 index 0000000..0c948d8 --- /dev/null +++ b/shell/functions.sh @@ -0,0 +1,14 @@ +function secure_erase { + dd if=/dev/urandom of=/dev/$1 bs=1M status=progress + dd if=/dev/urandom of=/dev/$1 bs=1M status=progress + dd if=/dev/urandom of=/dev/$1 bs=1M status=progress + dd if=/dev/urandom of=/dev/$1 bs=1M status=progress + curl --location --request POST 'https://gotify.cat-enby.club/message' --header 'X-Gotify-Key: $GOTIFY_KEY' --header 'Content-Type: application/json' --data-raw '{ + "appid": 1, + "message": "Disk /dev/$1 successfully erased", + "title": "secure_erase complete", + "date": "$(date +"%Y-%m-%d %T")", + "priority": 5 + }' + echo "Disc /dev/$1 erased successfully" +} \ No newline at end of file