Commit 87c22654 authored by Nicolas Lenz's avatar Nicolas Lenz

Renew repo

parents
# scripts
Miscellaneous scripts for my everyday usage.
#!/usr/bin/env zsh
# Converts into pdf with pandoc and the protocol template
# Arg 1: Input file
pandoc ${1} -t beamer --slide-level 2 -V theme:metropolis -H ~/.pandoc/metropolis-foss.latex --pdf-engine=xelatex -o ${1%.*}.pdf
#!/usr/bin/env zsh
# Converts into H265/Opus with VA-API in a Matroska container.
# Arg 1: Input file
ffmpeg -i ${1} -vaapi_device /dev/dri/renderD128 -vf 'format=nv12,hwupload' -c:v hevc_vaapi -maxrate:v 5M -c:a libopus -vbr:a on -b:a 128k ${2}.mkv
#!/usr/bin/env zsh
# Converts into Opus in a Matroska container.
# Arg 1: Input file
ffmpeg -i ${1} -c:a libopus -vbr:a on -b:a 128k ${1%.*}.mka
#!/usr/bin/env zsh
# Converts into pdf with pandoc and the protocol template
# Arg 1: Template
# Arg 2: Input file
pandoc -i ${2} --template=${1} --from=markdown+raw_tex --pdf-engine=xelatex -o ${2%.*}.pdf
#!/usr/bin/env zsh
# Converts into tex with pandoc and the protocol template
# Arg 1: Template
# Arg 2: Input file
DIR=$(pwd)
cd ~/dev/pandoc
stack exec pandoc -- -i ${DIR}/${2} --template=${1} -o ${DIR}/${2%.*}.tex
cd ${DIR}
#!/usr/bin/env zsh
exiftool -overwrite_original -all= -tagsfromfile @ -Title -Description -Artist -Rights -Subject -Make -Model -LensModel -FNumber -ExposureTime -ISO -FlashAction -FocalLength $1
#!/usr/bin/env zsh
# Removes the DNS directives from all .conf files. Meant for wireguard configurations.
sed -i "/^DNS = /d" *.conf
#!/usr/bin/env zsh
# Gets the IPv4 and v6 addresses from icanhazip.com.
curl -4 icanhazip.com
curl -6 icanhazip.com
#!/usr/bin/env zsh
# Gets up-to-date mirrorlist with reflector.
sudo reflector -c DE -a 3 -p https -f 3 --sort rate
#!/usr/bin/env zsh
# Start the Nextcloud occ command line controls.
# Arg 1: OCC command
sudo -u http php /srv/http/cloud.online-lenz.de/occ ${1}
#!/usr/bin/env zsh
# Start the Nextcloud updater.
sudo -u http php /srv/http/cloud.online-lenz.de/updater/updater.phar
#!/usr/bin/env zsh
# Print a file with the FSR office printer.
# Arg 1: File to print
# Arg 2: -s for simplex, default is duplex
if [[ ${2} = "-s" ]] then
DUPLEX="one-sided"
else
DUPLEX="two-sided-long-edge"
fi
ssh eins lpr -P HP_Color_LaserJet_MFP_M477fdw -o sides=$DUPLEX < ${1}
#!/usr/bin/env zsh
# Print a file with ohs14pr1.
# Arg 1: File to print
# Arg 2: -s for simplex, default is duplex
if [[ ${2} = "-s" ]] then
DUPLEX="simplex"
else
DUPLEX="duplex"
fi
ssh czi lpr -P ohs14pr1 -N0 -K$DUPLEX < ${1}
#!/usr/bin/env zsh
# Get print quota.
ssh polonium lpquota
#!/usr/bin/env zsh
# Show the neo layout on screen.
# Arg 1: Level to show
feh ~/.neo/neo2-${1}.png -x --image-bg=#555555 --zoom 100 --title neo2-layout-viewer &
sleep 3s
kill $!
#!/usr/bin/env zsh
# Toggle touch devices on ThinkPad Yoga *60.
xinput-toggle -r "Elantech Touchpad"
xinput-toggle -r "Elantech TrackPoint"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment