add new utilities

This commit is contained in:
opfez 2021-05-29 17:57:16 +02:00
parent 931b57de7f
commit 09883bfe72
5 changed files with 44 additions and 0 deletions

5
addpkg Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
for arg; do
echo $arg >> /etc/pkglst/pkgs.txt
done

3
capsfix Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
setxkbmap -option caps:escape

8
slystart Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ `ls | grep *.asd` ]; then
sbcl --eval '(push (truename ".") asdf:*central-registry*)' \
--eval "(ql:quickload :$(basename `pwd`))" \
--eval '(ql:quickload :slynk)' \
--eval '(slynk:create-server)'
fi

25
sync Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
local_files=$(mktemp)
remote_files=$(mktemp)
ls ~/sync > $local_files
ssh skoskapet "ls sync" > $remote_files
local_files_missing=$(mktemp)
diff $local_files $remote_files | grep "^> " | awk '{print $2}' > $local_files_missing
remote_files_missing=$(mktemp)
diff $local_files $remote_files | grep "^< " | awk '{print $2}' > $remote_files_missing
while IFS='' read -r LINE || [ -n "${LINE}" ]; do
echo "${LINE} not found on skoskapet, uploading..."
scp ~/sync/"$LINE" skoskapet:~/sync
done < $remote_files_missing
while IFS='' read -r LINE || [ -n "${LINE}" ]; do
echo "missing file ${LINE}, downloading..."
scp skoskapet:~/sync/"$LINE" ~/sync
done < $local_files_missing
echo "all good!"

3
ttm Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
curl -Ffile=@"$1" https://ttm.sh