aboutsummaryrefslogtreecommitdiff
path: root/config/shell/funcs
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2024-10-31 17:08:48 +0000
committerryo <ryo@nopwd.lol>2024-10-31 17:08:48 +0000
commit709542f2011784e2da48405a0972ee46705033b8 (patch)
tree43d9a54e8055b4d91d1f659b757d33a2cb1d060c /config/shell/funcs
parentcc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (diff)
Fixed: major bugs and bad file names
Diffstat (limited to 'config/shell/funcs')
-rw-r--r--config/shell/funcs24
1 files changed, 24 insertions, 0 deletions
diff --git a/config/shell/funcs b/config/shell/funcs
new file mode 100644
index 0000000..7788689
--- /dev/null
+++ b/config/shell/funcs
@@ -0,0 +1,24 @@
+#!/usr/bin/env zsh
+
+proxy_connect=0
+toggle_proxy() {
+ if [[ "$proxy_connect" -eq 0 ]]; then
+ export http_proxy="http://127.0.0.1:2081"
+ export https_proxy=$http_proxy
+ proxy_connect=1
+ echo "vpn activated"
+ else
+ unset http_proxy
+ unset https_proxy
+ proxy_connect=0
+ echo "vpn deactivated"
+ fi
+}
+
+generate_pass() {
+ local len=8
+ if [ $# -eq 1 ]; then
+ len=$1
+ fi
+ tr -cd '[:graph:]' < /dev/urandom | head -c $len | xargs -0
+}