THEAARBS sysadmin - nets - 2018-12-29 13:18:36

Raw #!/bin/bash # Bound to Mod+n # Set menu properties mymenu=$(setmenu -l) # Where network documents are stored Docs="/home/$USER/Documents/networks/" # Where should log files be stored Logs="/home/$USER/Logs/" MenuChoices=\ "Info Servers Networking Workstations Printers Ping PullRC Reboot ShoVer Time Entry VPN" runprefix= tty=$(tty) case $tty in *tty1|"not a tty") runprefix="$TERMINAL -e" ;; esac ClearExit() { clear ; exit 0 ;} SecurePW() { PassFile=$(mktemp) ; echo "$Password" >$PassFile ;} Say() { (echo "$1" "$2" | lolcat) ; notify-send "$1" "$2" ;} MainMenu() { Chosen=$(cat /tmp/nets-names | $mymenu "Choose a network:") || ClearExit clear [[ $Chosen = "Time Entry" ]] && timeentry && ClearExit for i in $Docs* ; do [[ $Chosen = $( (sed "3q;d" $i) | awk '{print $2;}' | cut -d '"' -f2) ]] && Document=$i done [[ -z $Document ]] && ClearExit ScanDoc $Document CommandMenu ;} CommandMenu() { CommandChoice=$(echo -e "$MenuChoices" | $mymenu "$Network Command:") clear [[ -z $CommandChoice ]] && ClearExit case $CommandChoice in "Info") openfile $Document ; exit 0 ;; "Time Entry") timeentry $Network ; exit 0 ;; "VPN") connectvpn "$VPNType" "$VPNName" "$Network" ; exit 0 ;; *) SubMenu ;; esac ;} SubMenu() { case $CommandChoice in Ping) ChosenHost=$(echo -e "$ServerChoices\n$SwitchChoices\n$WorkstationChoices\n$PrinterChoices" | \ $mymenu "$Network Choose a device to ping:") ;; Reboot) ChosenHost=$(echo -e "$ServerChoices" | $mymenu "$Network Choose a device to reboot:") ;; PullRC) ChosenHost=$(echo -e "$CiscoChoices\nALL!

THEAARBS tools - linkhandler - 2018-12-28 09:17:26

Raw #!/bin/bash # Imgur client id # Required for indirect imgur links imgurClientId="" # Temp file directory tmpDir="/tmp/linkhandler" # Handlers imgHandler="feh" gifHandler="mpv --quiet --loop" vidHandler="mpv --quiet" dwnHandler="tsp wget" bcpHandler="bandcamp-dl" redHandler="rtv" browser=$BROWSER ## Templates imgFiles="png apng jpg jpeg jpe bmp tiff" # Images imgSites="i.imgur.com/ \|i.redd.it/ \|deviantart.com/ \|tinypic.com/ \|unsplash.com/photos/ \|gyazo.com/ \|prnt.sc/ " gifFiles="gif webm" # Gifs gifSites="gfycat.com/ \|giphy.com/ \|gph.is/ \|gifbin.com/ \|clips.twitch.tv/ \|streamable.com/ " vidFiles="mkv mp4 mov mpv flv avi" # Video vidSites="youtube.

THEAARBS menus - netmenu - 2018-10-05 22:47:05

Raw #!/bin/bash # Network tools menu # Bound to Mod+F6 mymenu=$(setmenu -l) IOFile=$(mktemp) amitty=$(tty) case $amitty in *tty1|"not a tty") runprefix="$TERMINAL -o $IOFile -e" ;; esac MenuChoices=\ "asdm sho run sho inv connect to dig ftp killvpn nmtui nmgui clonesite ping pingsubnet smtp telnet ssh keys ssl query speedof lan speedof wifi speedof wan newnet cifs mount whois winbox" MenuCommands() { case $choice in "asdm") UtilASDM ;; "ftp") UtilFTP ;; "killvpn") killvpn ;; "nmtui") $runprefix nmtui ;; "nmgui") nm-connection-editor ;; "clonesite") UtilCloneSite ;; "connect to") connectcomputer ;; "ping") $runprefix cping $(inprompt "Hostname or IP:") ;; "pingsubnet") $(ifinstalled nmap) && $runprefix pingsubnet $(inprompt "Subnet to ping:") ;; "smtp telnet") UtilSMTPTelnet ;; "ssh keys") SSHMenu ;; "sho run") ciscorun ;; "sho inv") ciscover ;; "ssl query") UtilSSLQuery ;; "speedof lan") $runprefix speedof -l ;; "speedof wifi") $runprefix speedof -w ;; "speedof wan") speedof -i ;; "newnet") sudo systemctl restart NetworkManager ;; "cifs mount") UtilCIFSMount ;; "dig") DigMenu ;; "whois") UtilWhois ;; "winbox") $(ifinstalled winbox) && winbox ;; esac ;} Say() { (echo "$1" "$2" | lolcat) ; notify-send "$1" "$2" ;} GetKeyFile() { KeyFile="$(find /home/$USER/.

THEAARBS tools - speedof - 2018-08-04 13:03:49

Raw #!/bin/bash Say() { echo -e "$1\n$2" ; notify-send "$1" "$2" ;} get_interfaces() { for i in $all_interfaces ; do interface_name="${BLOCK_INSTANCE:-$i}" case $interface_name in eno*|eth*) LanInterface=$interface_name ;; wlp*|wlan*) WLanInterface=$interface_name ;; esac done ;} speed_meter() { $(ifinstalled speedometer) && all_interfaces=$(ls /sys/class/net) get_interfaces $all_interfaces case $1 in lan) the_interface=$LanInterface ;; wlan) the_interface=$WLanInterface ;; esac [[ -z $(ip addr show $the_interface | perl -n -e '/inet ([^\/]+)/ && print $1') ]] && Say "⛔ Error: interface $the_interface is not connected" || speedometer -t $the_interface ;} get_speedlimits() { $(ifinstalled speedtest) && Say "⌛ Testing internet speeds.

THEAARBS tools - syncworkflow - 2018-07-07 03:11:46

Raw #!/bin/bash # Bound to Mod+UpArrow and Mod+DownArrow MenuChoices=\ "all browsers calendar documents dotfiles hosts hugo pictures projects scripts ssh vpn" choices=${MenuChoices//'\n'/ } choices=($choices) # Set dmenu properties mymenu=$(setmenu -l) # # --- User-defined variables # ServerHost should also be defined in ~/.ssh/config # for key-authenticated sshfs connections to the # backup repository ServerHost="nas" # SyncPath should be the path to a writeable directory # inside your backup repository SyncPath="/media/home-nas/6eece2a2-d4d4-47d6-bb12-ae9db150e8e6/rsync_computers" # NASMountRoot is the 'root' directory of your # backup repository; this will be mounted to a local # directory NASMountRoot=".

THEAARBS menus - search - 2018-05-06 03:11:46

Raw #!/bin/bash # A menu script for easy web searching. # Bound to Mod+s SearchSites=\ "DuckDuckGo ArchWiki BandCamp IMDB Reddit Rev Wikipedia YouTube" SearchCommands() { case "$Choice" in r|Reddit) $runprefix rtv -s "$Query" ;; yt|YouTube) $runprefix youtube-viewer $Query ;; rev|Rev) $BROWSER "https://revolutiontt.me/browse.php?search=$Query" ;; ddg|DuckDuckGo) $BROWSER "https://duckduckgo.com/?q=$Query&t=ffab&atb=v1-1" ;; aw|ArchWiki) $BROWSER "https://wiki.archlinux.org/index.php?search=$Query" ;; w|Wikipedia) $BROWSER "https://en.wikipedia.org/?search=$Query" ;; bc|BandCamp) $BROWSER "https://bandcamp.com/search?q=$Query" ;; im|IMDB) $BROWSER "http://www.imdb.com/find?ref_=nv_sr_fn&q=$Query&s=all" ;; esac ;} runprefix= mymenu=$(setmenu -l) Query=${@:2} Choice=$1 amitty=$(tty) case $amitty in *tty1|"not a tty") runprefix="$TERMINAL -e" ;; esac if [ -z "$Choice" ]; then Choice=$(echo -e "$SearchSites" | $mymenu "🔎 Search where") ; fi if [ -z "$Query" ]; then Query=$(inprompt "🔎 Search terms") ; fi if [ -z "$Query" ]; then clear ; exit 1 ; fi if [ -z "$Choice" ]; then Choice="ddg" ; fi SearchCommands clear

THEAARBS tools - backup - 2018-05-06 03:11:46

Raw #!/bin/bash # Bound to Mod+Backspace # Set menu properties mymenu=$(setmenu) # # --- User-defined variables # ServerHost should also be defined in ~/.ssh/config # for key-authenticated sshfs connections to the # backup repository ServerHost="nas" # NASPath should be the path to a writeable directory # inside your backup repository NASPath="/media/home-nas/9c360a84-078b-4cc5-9515-a38f3f84daa5/backup" # NASMountRoot is the 'root' directory of your # backup repository; this will be mounted to a local # directory NASMountRoot=".

THEAARBS menus - config - 2018-05-05 22:59:24

Raw #!/bin/bash # A menu script for conveniently accessing config files # Bound to Mod+F2 # Each menu choice has a file to edit # or command to run in the MenuCommands() function MenuChoices=\ "alias appearance audio backup bash bookmarks disks hosts i3 i3blocks input mpd mpv mutt newsboat printers profile ranger rss screens scripts ssh startup surf tmux vim x zathura" MenuCommands(){ case $chosen in alias) openfile ~/.config/aliasrc ;; appearance) lxappearance &disown ;; audio) pavucontrol &disown ;; backup) openfile ~/.

THEAARBS menus - recordmenu - 2018-05-05 22:47:05

Raw #!/bin/bash # Recording options menu # Bound to Mod+Insert mymenu=$(setmenu -l) asktype() { case $(echo -e "Screencast\nVideo only\nAudio only" | $mymenu "Select recording style:") in Screencast) screencast ;; "Audio only") audio ;; "Video only") video ;; esac ;} asktoend() { [[ $(echo -e "No\nYes" | $mymenu "Recording still active. End recording?") = "Yes" ]] && sudo killall ffmpeg || exit 0 ;} audio() { while [[ -f $HOME/audio$n.mkv ]] ; do n=$((n+1)) ; done filename="$HOME/audio$n.

THEAARBS tools - publish - 2018-05-05 03:11:46

Raw #!/bin/bash # Bound to Mod+Shift+Backspace # Publish a Hugo site to a remote server # User-defined variables are set in # ~/.config/hugosites.conf file Say() { echo "$1" "$2" ; notify-send "$1" "$2" ; echo "$1" "$2" >> $LogFile ;} ConfigFile="/home/$USER/.config/hugosites.conf" ConfigFiletmp='/tmp/hugosites.conf' if egrep -q -v '^#|^[^ ]*=[^;]*' "$ConfigFile" then Say "🗞️ Config file is unclean, cleaning it..." egrep '^#|^[^ ]*=[^;&]*' "$ConfigFile" > "$ConfigFiletmp" cp "$ConfigFiletmp" "$ConfigFile" fi source "$ConfigFile" runprefix= # Set menu properties mymenu=$(setmenu -l) amitty=$(tty) case $amitty in *tty1|"not a tty") runprefix="$TERMINAL -e" ;; esac mkdir -p $PathToLogs/push LogFile="$PathToLogs/push/$(date +%b%d)/$(date +%H%M).

THEAARBS menus - dmenuhandler - 2018-04-29 09:17:26

Raw #!/bin/bash # Feed this script a URL and choose what opens it # Bound to Mod+y if [ -z $1 ] ; then url=$(inprompt "URL:") || exit else url=$1 ; fi runprefix= mymenu=$(setmenu -l) amitty=$(tty) case $amitty in *tty1|"not a tty") runprefix="$TERMINAL -e" ;; esac handle_url() { if [[ "${#1}" -gt 30 ]] then visual="${1:0:20}"..."${1: -7}" else visual="$1" fi echo $visual choice=$(echo -e "$READER\n$IMGVIEWER\n$BROWSER\nw3m\nmpv\nmpv (loop)\nmpv (float)\nwget\nstream-dl\nbandcamp-dl" | $mymenu "How should I open '$visual'?

THEAARBS tools - extract - 2016-05-04 13:03:49

Raw #!/bin/bash Dir=$(pwd) Say() { echo "$1" "$2" | lolcat ; notify-send "$1" "$2" ;} MultipleFiles() { for f in $Dir/* do ExtractFile $(basename $f) done ;} ExtractFile() { Name=${1%.*} mkdir $Name && cd $Name case $1 in *.tar.bz2|*.tbz2) Com="tar xvjf ../$1" ;; *.tar.gz|*.tgz) Com="tar xvzf ../$1" ;; *.tar.xz) Com="tar xvJf ../$1" ;; *.tar) Com="tar xvf ../$1" ;; *.lzma) Com="unlzma ../$1" ;; *.bz2) Com="bunzip2 ../$1" ;; *.rar) Com="unrar x -ad .