Browse Source

Renew repo

Nicolas Lenz 6 months ago
commit
87c22654e9
17 changed files with 115 additions and 0 deletions
  1. 3
    0
      README.md
  2. 6
    0
      conv-beamer
  3. 6
    0
      conv-h265
  4. 6
    0
      conv-opus
  5. 7
    0
      conv-pdf
  6. 10
    0
      conv-tex
  7. 3
    0
      edit-jpg-public
  8. 5
    0
      edit-wg-del-dns
  9. 6
    0
      get-ip
  10. 5
    0
      get-mirrors
  11. 6
    0
      nc-ctl
  12. 5
    0
      nc-update
  13. 15
    0
      print-fsr
  14. 13
    0
      print-oh14
  15. 5
    0
      print-quota
  16. 8
    0
      show-neo2
  17. 6
    0
      toggle-touch

+ 3
- 0
README.md View File

@@ -0,0 +1,3 @@
1
+# scripts
2
+
3
+Miscellaneous scripts for my everyday usage.

+ 6
- 0
conv-beamer View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Converts into pdf with pandoc and the protocol template
4
+# Arg 1: Input file
5
+
6
+pandoc ${1} -t beamer --slide-level 2 -V theme:metropolis -H ~/.pandoc/metropolis-foss.latex --pdf-engine=xelatex -o ${1%.*}.pdf

+ 6
- 0
conv-h265 View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Converts into H265/Opus with VA-API in a Matroska container.
4
+# Arg 1: Input file
5
+
6
+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

+ 6
- 0
conv-opus View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Converts into Opus in a Matroska container.
4
+# Arg 1: Input file
5
+
6
+ffmpeg -i ${1} -c:a libopus -vbr:a on -b:a 128k ${1%.*}.mka

+ 7
- 0
conv-pdf View File

@@ -0,0 +1,7 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Converts into pdf with pandoc and the protocol template
4
+# Arg 1: Template
5
+# Arg 2: Input file
6
+
7
+pandoc -i ${2} --template=${1} --from=markdown+raw_tex --pdf-engine=xelatex -o ${2%.*}.pdf

+ 10
- 0
conv-tex View File

@@ -0,0 +1,10 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Converts into tex with pandoc and the protocol template
4
+# Arg 1: Template
5
+# Arg 2: Input file
6
+
7
+DIR=$(pwd)
8
+cd ~/dev/pandoc
9
+stack exec pandoc  -- -i ${DIR}/${2} --template=${1} -o ${DIR}/${2%.*}.tex
10
+cd ${DIR}

+ 3
- 0
edit-jpg-public View File

@@ -0,0 +1,3 @@
1
+#!/usr/bin/env zsh
2
+
3
+exiftool -overwrite_original -all= -tagsfromfile @ -Title -Description -Artist -Rights -Subject -Make -Model -LensModel -FNumber -ExposureTime -ISO -FlashAction -FocalLength $1

+ 5
- 0
edit-wg-del-dns View File

@@ -0,0 +1,5 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Removes the DNS directives from all .conf files. Meant for wireguard configurations.
4
+
5
+sed -i "/^DNS = /d" *.conf

+ 6
- 0
get-ip View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Gets the IPv4 and v6 addresses from icanhazip.com.
4
+
5
+curl -4 icanhazip.com
6
+curl -6 icanhazip.com

+ 5
- 0
get-mirrors View File

@@ -0,0 +1,5 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Gets up-to-date mirrorlist with reflector.
4
+
5
+sudo reflector -c DE -a 3 -p https -f 3 --sort rate

+ 6
- 0
nc-ctl View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Start the Nextcloud occ command line controls.
4
+# Arg 1: OCC command
5
+
6
+sudo -u http php /srv/http/cloud.online-lenz.de/occ ${1}

+ 5
- 0
nc-update View File

@@ -0,0 +1,5 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Start the Nextcloud updater.
4
+
5
+sudo -u http php /srv/http/cloud.online-lenz.de/updater/updater.phar

+ 15
- 0
print-fsr View File

@@ -0,0 +1,15 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Print a file with the FSR office printer.
4
+# Arg 1: File to print
5
+# Arg 2: -s for simplex, default is duplex
6
+
7
+if [[ ${2} = "-s" ]] then
8
+    DUPLEX="one-sided"
9
+else
10
+    DUPLEX="two-sided-long-edge"
11
+fi
12
+
13
+
14
+
15
+ssh eins lpr -P HP_Color_LaserJet_MFP_M477fdw -o  sides=$DUPLEX < ${1}

+ 13
- 0
print-oh14 View File

@@ -0,0 +1,13 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Print a file with ohs14pr1.
4
+# Arg 1: File to print
5
+# Arg 2: -s for simplex, default is duplex
6
+
7
+if [[ ${2} = "-s" ]] then
8
+    DUPLEX="simplex"
9
+else
10
+    DUPLEX="duplex"
11
+fi
12
+
13
+ssh czi lpr -P ohs14pr1 -N0 -K$DUPLEX < ${1}

+ 5
- 0
print-quota View File

@@ -0,0 +1,5 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Get print quota.
4
+
5
+ssh polonium lpquota

+ 8
- 0
show-neo2 View File

@@ -0,0 +1,8 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Show the neo layout on screen.
4
+# Arg 1: Level to show
5
+
6
+feh ~/.neo/neo2-${1}.png -x --image-bg=#555555 --zoom 100 --title neo2-layout-viewer &
7
+sleep 3s
8
+kill $!

+ 6
- 0
toggle-touch View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env zsh
2
+
3
+# Toggle touch devices on ThinkPad Yoga *60.
4
+
5
+xinput-toggle -r "Elantech Touchpad"
6
+xinput-toggle -r "Elantech TrackPoint"

Loading…
Cancel
Save