summaryrefslogtreecommitdiff
path: root/posix-shell
diff options
context:
space:
mode:
Diffstat (limited to 'posix-shell')
-rw-r--r--posix-shell/aliases.sh4
-rw-r--r--posix-shell/constants.sh3
-rw-r--r--posix-shell/utils.sh42
3 files changed, 48 insertions, 1 deletions
diff --git a/posix-shell/aliases.sh b/posix-shell/aliases.sh
index 7d37e85..df2620e 100644
--- a/posix-shell/aliases.sh
+++ b/posix-shell/aliases.sh
@@ -19,3 +19,7 @@ alias nolink='cd $(pwd -P)'
alias zephyr='export ZEPHYR_BASE="${HOME}/zephyrproject/zephyr" && source "${HOME}/zephyrproject/.venv/bin/activate"'
alias myrename="perl-rename 's/[^a-zA-Z0-9äöüÄÖÜß\.\/]+/-/g; s/^-+|-+$//g; \$_ = lc(\$_)'"
alias aerc="mbsync -a && aerc"
+alias st='STM32_Programmer_CLI -c port=SWD freq=1800 mode=UR'
+alias mygdb="gdb-multiarch -ex 'target extended-remote :3333' -ex 'set confirm off'"
+alias mydiff="wdiff --start-delete=$'\e[31m' --end-delete=$'\e[0m' --start-insert=$'\e[32m' --end-insert=$'\e[0m'"
+alias pdf2png="convert -background white -alpha remove -alpha off -density 600"
diff --git a/posix-shell/constants.sh b/posix-shell/constants.sh
index 9258e1b..8b9387a 100644
--- a/posix-shell/constants.sh
+++ b/posix-shell/constants.sh
@@ -2,5 +2,6 @@
export GOPATH="${HOME}/go"
-export PATH="${HOME}/.local/bin:${GOPATH}/bin:${PATH}"
+export PATH="${HOME}/.local/bin:${GOPATH}/bin:${HOME}/development/flutter/bin:${PATH}"
export EDITOR='nvim'
+export TERM='xterm' # actually `foot` but this is less known
diff --git a/posix-shell/utils.sh b/posix-shell/utils.sh
index 596263e..4354a37 100644
--- a/posix-shell/utils.sh
+++ b/posix-shell/utils.sh
@@ -216,3 +216,45 @@ url() {
# open selected URL in browser
firefox "${url}"
}
+
+lar() {
+ temp="$(mktemp -d)"
+ tar -xf "$1" -C "$temp"
+ pushd "$temp"
+ lf
+ popd
+ rm -rf "$temp"
+}
+
+hexdiff() {
+ if test "$#" -ne 2
+ then
+ echo "Usage: hexdiff <file1> <file2>"
+ return 1
+ fi
+
+ dump1="$(mktemp)"
+ dump2="$(mktemp)"
+
+ hexdump -C "$1" > "$dump1"
+ hexdump -C "$2" > "$dump2"
+
+ diff --unified=4 --color=always "$dump1" "$dump2"
+
+ rm -f "$dump1" "$dump2"
+}
+
+lar() {
+ if test "$#" -ne 1
+ then
+ echo "Usage: lar <archive-file>"
+ return 1
+ fi
+
+ temporary_directory="$(mktemp -d)"
+ tar -xf "$1" -C "$temporary_directory"
+ pushd "$temporary_directory"
+ lf
+ popd
+ rm -rf "$temporary_directory"
+}