summaryrefslogtreecommitdiff
path: root/.kshrc
diff options
context:
space:
mode:
authorchers <chers@hgdump.net>2026-10-27 22:15:20 +1300
committerchers <chers@hgdump.net>2026-10-27 22:15:20 +1300
commitb871e63d3a41f14eb0c599e296b4370674167709 (patch)
treeb9e091bc4928ce2abd6b3ce40953bae3ea13ccd8 /.kshrc
intmain
Diffstat (limited to '.kshrc')
-rw-r--r--.kshrc32
1 files changed, 32 insertions, 0 deletions
diff --git a/.kshrc b/.kshrc
new file mode 100644
index 0000000..8edcc4c
--- /dev/null
+++ b/.kshrc
@@ -0,0 +1,32 @@
+PS1='${PWD##*/} ⋘ '
+up() {
+ scp -O -r "$1" "chers@larp.nz:~/websites/cdn/$1"
+}
+
+
+
+cr() {
+ if [ -z "$1" ]; then
+ echo "usage: cr repository"
+ return 1
+ fi
+
+ case "$1" in
+ *[!a-zA-Z0-9._-]*|.*|*..*)
+ echo "invalid repository name"
+ return 1
+ ;;
+ esac
+
+ ssh -t chers.casa "doas mkdir -p /var/lib/git/$1 &&
+ doas git init --bare /var/lib/git/$1 &&
+ doas chown -R chers:www-data /var/lib/git/$1 &&
+ doas chmod -R g+rwX /var/lib/git/$1 &&
+ doas find /var/lib/git/$1 -type d -exec chmod g+s {} + &&
+ doas touch /var/lib/git/$1/git-daemon-export-ok &&
+ doas git config --system --add safe.directory /var/lib/git/$1"
+}
+
+
+
+alias lua=lua54