more scripts

This commit is contained in:
Sam Hadow 2025-02-20 14:39:53 +01:00
parent 2ad7ef62df
commit 763bb52070
4 changed files with 50 additions and 0 deletions

10
convert_md_to_pdf.sh Normal file
View File

@ -0,0 +1,10 @@
pandoc infile.md \
--include-in-header listings-setup.tex \
-V linkcolor:blue \
-V geometry:a4paper \
-V geometry:margin=2cm \
-V mainfont="Overpass" \
-V monofont="Hack" \
--listings \
--pdf-engine=xelatex \
-o outfile.pdf

14
get_matrix_access_token.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
if [ $# -ne 3 ]; then
echo "Usage: $0 <username> <password> <matrix server domain>"
exit 1
fi
access_token=$(curl -s -XPOST -d '{"type":"m.login.password", "user":"'"$1"'", "password":"'"$2"'"}' "https://$3/_matrix/client/r0/login" | jq -r '.access_token')
if [ -z "$access_token" ]; then
echo "Failed to retrieve access token. Please check your username and password."
exit 1
fi
echo "$access_token"

24
listings-setup.tex Normal file
View File

@ -0,0 +1,24 @@
\usepackage{xpatch,realboxes}
\usepackage{xcolor}
\definecolor{Light}{HTML}{F4F4F4}
\lstset{
basicstyle=\ttfamily,
extendedchars=true
numbers=left,
numberstyle=\tiny\ttfamily,
backgroundcolor=\color[RGB]{248,197,196},
showstringspaces=false,
tabsize=2,
columns=fixed,
frame=trbl,
frameround=tttt,
framesep=7pt,
breaklines=true, postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}
}
\makeatletter
\xpretocmd\lstinline{\Colorbox{Light}\bgroup\appto\lst@DeInit{\egroup}}{}{}
\makeatother

2
webptogif.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
convert -delay 10 -dispose none $1 -coalesce -loop 0 -layers optimize ${1%".webp"}.gif