From 64796a5169bda8b554f49746c136e6b05871faf5 Mon Sep 17 00:00:00 2001 From: Salt Date: Mon, 1 Jun 2020 01:11:47 -0500 Subject: [PATCH] Lots: Add README, purge old shit scripts --- README.md | 41 +++++++++++++++++++++++++ mklatex | 39 ------------------------ ssht | 90 ------------------------------------------------------- 3 files changed, 41 insertions(+), 129 deletions(-) create mode 100644 README.md delete mode 100755 mklatex delete mode 100755 ssht diff --git a/README.md b/README.md new file mode 100644 index 0000000..428e96b --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +#.bin + +A submodule for my scripts + +## Useful Scripts + +binary | description +--- | --- +`colortest` | Ricey color tester +`fetch` | Neofetch and scrot wrapper +`i3-settree` | Save and restore i3 trees on the fly +`rmbspam` | Spam the right mouse button +`te` | Versatile templating script +`tmp` | Spawn a temporary directory and clean it up at the end of the shell +`xrdbupdate` | Load in a bunch of xrdb files from ~/.config/xrdb instead of just ~/.Xresources + +## One-Off Scripts + +binary | description +--- | --- +`cconvert` | Converts a hex color into RGB integers +`domainfind` | Given a list of TLDs as arguments, find dictionary words that contain those TLDs +`test-notifications` | Print three test notifications + +## Specialized Scripts + +Scripts that are really only useful to me. + +binary | description +--- | --- +`g910-lights` | Ricey G910 LED startup script + +## Bullshit Scripts + +binary | description +--- | --- +`cowsayeternal` | Build up a ton of nested `cowsay` output +`mclevel` | Use xdotool to rig an Ars Magica 2 journal to give you a certain number of levels except it doesn't work +`tubetop` | Embed a video into the desktop using xwinwrap +`tubetop2` | The cooler tubetop +`xephwrap` | Use xephyr to wrap a new X session diff --git a/mklatex b/mklatex deleted file mode 100755 index d0e36fc..0000000 --- a/mklatex +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2017 rehashedsalt/vintagesalt -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -if [ -z "$@" ]; then - printf "mklatex: no files specified\n" - exit 1 -fi -for sourcefile in "$@"; do - if [ ! -f "$sourcefile" ]; then - printf "mklatex: file not found: $sourcefile\n" - else - pdflatex $sourcefile - fi -done -if [ "$(which llpp)" ]; then - killall -SIGHUP llpp -fi -if [ "$(which mupdf)" ]; then - killall -SIGHUP mupdf -fi diff --git a/ssht b/ssht deleted file mode 100755 index 95fbbd2..0000000 --- a/ssht +++ /dev/null @@ -1,90 +0,0 @@ -#! /usr/bin/env bash -# -# ssht -# Copyright (C) 2018 salt -# -# Distributed under terms of the MIT license. -# - -name="$(basename $0 .sh)" - -# $1: Message -function log() { - [ -z ${1+x} ] && return 1 - printf "\e[94m$name\e[0m: $*\n" -} - -# $1: Binary in $PATH -function check_program_exists() { - if ! which $1 > /dev/null 2>&1; then - return 1 - fi - return 0 -} - -function get_tor_port() { - for port in 9050 9051 9150 9151; do - if netstat -ntl | grep 127.0.0.1:"$port" > /dev/null 2>&1; then - export return="$port" - return 0 - fi - done - return 1 -} - -# $1: Tor Port -# $2: Host -# $*: Command -function ssh_through_tor() { - [ -z ${3+x} ] && return 1 - ssh -o ProxyCommand="nc -x 127.0.0.1:$1 \%h \%p" $2 ${*:3} -} - -# $1: Tor Port -# $2: Host -function get_ssh_ip() { - # Yes, this is bad and you could totally run it through an SSH tunnel - # to avoid the curl requirement on the remote host - # Yes, that would avoid an extraneous connection - # TODO: That, also add curl to the list of critical requirements - log "Checking if host $2 has curl" - if ssh_through_tor "$1" "$2" which curl > /dev/null 2>&1; then - log "Finding out host's IP through curl" - export return="$(ssh_through_tor $1 $2 curl -s http://whatismyip.akamai.com)" - return 0 - fi - # TODO: Add more identification methods - return 1 -} - -# $1: Host -# $*: Arguments to ssh -function main() { - if ! [[ "$1" == *.onion ]]; then - log "First argument must be a .onion address" - exit 1 - fi - for dep in ssh tor netstat nc; do - if ! check_program_exists "$dep"; then - log "Could not find critical dependency \"$dep\"" - exit 50 - fi - done - if ! get_tor_port; then - log "Tor is not running" - exit 51 - fi - torport="$return" - log "Found Tor listening on local port $torport" - if ! get_ssh_ip $torport $1; then - log "Failed to determine target's public IP" - exit 52 - fi - ssh_ip="$return" - log "Found public IP: $ssh_ip" - unset return torport - exec ssh $ssh_ip ${*:2} -} - -main "$@" -