diff options
| -rw-r--r-- | config/nvim/init.vim | 2 | ||||
| -rwxr-xr-x | local/bin/scan_loop.sh | 32 | ||||
| -rwxr-xr-x | local/bin/updatewebsite.sh | 9 |
3 files changed, 42 insertions, 1 deletions
diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 000166a..c6d2bb3 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -143,7 +143,7 @@ nmap mM mm:!updatewebsite_zaz<CR><CR> " asciidoctor: nnoremap ma :w<CR>:!asciidoctor %<CR><CR> -nmap mA ma:!updatewebsite_zaz<CR><CR> +nmap mA ma:!updatewebsite.sh<CR><CR> " Funcionallity of the following depends on terminal emulator. Needs 8-bit " input enabled diff --git a/local/bin/scan_loop.sh b/local/bin/scan_loop.sh new file mode 100755 index 0000000..c0b6321 --- /dev/null +++ b/local/bin/scan_loop.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# The scan loop is useful when Automatic Document Feeder (ADF) can't be used + +scan_device_uri="hpaio:/net/OfficeJet_Pro_6970?ip=192.168.18.21" +# ^This HP printer is remarkable. It's been working fine since 2017. I refill +# the cardridge with UV ink very easily (I've never purchased ink cardridges +# other than the ones that came with the printer). As of 2023, only the Cyan +# and Black cardridges/inkjets work but Black&White print is all I need. +# And the Linux support and CLI interface is amazing. + + +# Automatic Document Feeder +adf() { + hp-scan --mode=color --resolution=300 --size=a4 --adf #--duplex +} + + +# Scans until terminated with ^C. Saves .png files on CWD. +flatbed_loop() { + echo "Warning: scan loop will run until terminated with Ctrl-C" + i=0 + while true; do + # device show with $ hp-info + hp-scan --mode=color --size=a4 --device=$scan_device_uri + echo "page " $((i + 1)) " done, you have 4 seconds to load next page" + sleep 4 + i=`expr $i + 1` + done + # convert *.png output.pdf +} + diff --git a/local/bin/updatewebsite.sh b/local/bin/updatewebsite.sh new file mode 100755 index 0000000..71c99b2 --- /dev/null +++ b/local/bin/updatewebsite.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# This script syncs local files to my VPS + +# Thank you: https://unix.stackexchange.com/a/2503/347754 +options="-uvrPs --delete-after --copy-links" +targetdir="tokumori.xyz:/var/www" + +rsync $options /home/mitsuo/mahcode/www/tokumori.xyz $targetdir |
