From 127f313bd104467d7f8fff0944b9ad8463045a38 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Tue, 19 Apr 2022 19:27:10 -0700 Subject: [PATCH 1/3] cda: add newline before final output --- .config/shell/functions/cda | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/shell/functions/cda b/.config/shell/functions/cda index 3dfe301..231139a 100644 --- a/.config/shell/functions/cda +++ b/.config/shell/functions/cda @@ -17,6 +17,7 @@ cda() { echo "$DIR" (cd "$DIR" && $SHELL) done + echo echo "$0: done" } From 2fd061e62613e9fab718fa2d3f6659636e75f7a7 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Tue, 19 Apr 2022 19:29:30 -0700 Subject: [PATCH 2/3] sitepath: add config variables --- .config/shell/bin/sitepath | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.config/shell/bin/sitepath b/.config/shell/bin/sitepath index 0d22143..fc41f24 100755 --- a/.config/shell/bin/sitepath +++ b/.config/shell/bin/sitepath @@ -1,23 +1,28 @@ #!/bin/bash -# TODO: encode the url to fix things like spaces using something like https://stackoverflow.com/a/10660730/11162605 +# Requires: urlencode # if you need this, I am using dead10ck/urlencode (`cargo install urlencode`) + # usage: sitepath # usage: sitepath # usage: sitepath # usage: sitepath -- you can search with 'fd' if you put in a command +BASE_URL="https://blakenorth.net" +SITE_DIR="/home/blake/docker/blakenorth.net/site" +SEPERATOR='~' # Make this a character you don't use in filenames. It's for sed. + # account for if there is no urlencode command URLENCODE=urlencode if ! command -v urlencode > /dev/null 2>&1;then URLENCODE=cat fi # If there is no input, make the input the current directory -[ -z ${1+x} ] && 1="$(pwd)" -FILEPATH="$(([ -e "$1" ] && readlink -f "$1") || fd $@ /home/blake/docker/blakenorth.net/site)" +[ -z ${1+x} ] && set -- "$(pwd)" +FILEPATH="$( ([ -e "$1" ] && readlink -f "$1") || fd "$@")" # change all file paths into urls echo "$FILEPATH" | grep -o 'site.*' | - sed 's+^site+https://blakenorth.net+g' | - $URLENCODE # if you need this, I am using dead10ck/urlencode (cargo install urlencode) + sed "s${SEPERATOR[0]}^${SITE_DIR##*/}${SEPERATOR[0]}$BASE_URL${SEPERATOR[0]}g" | + $URLENCODE From aff94d0229dc2bc93ad9df30f4e7c6ed8da4b905 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Tue, 19 Apr 2022 19:30:20 -0700 Subject: [PATCH 3/3] aliases: improve occ alias --- .config/shell/aliases | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/shell/aliases b/.config/shell/aliases index 53f95f8..601591e 100644 --- a/.config/shell/aliases +++ b/.config/shell/aliases @@ -95,12 +95,12 @@ alias \ alias glone="git clone" # Docker -alias \ - logs='docker-compose logs --tail=200 -f' \ - dupd='docker-compose up -d' \ - ddwn='docker-compose down' \ - dc='docker-compose' \ - occ='docker exec -u www-data nextcloud php occ' \ +alias \ + logs='docker-compose logs --tail=200 -f' \ + dupd='docker-compose up -d' \ + ddwn='docker-compose down' \ + dc='docker-compose' \ + occ='docker exec -u www-data nextcloud php occ --ansi' \ # file copying with a progress bar alias cpv="rsync -ah --info=progress2"