Skip to content

Instantly share code, notes, and snippets.

@feklee
feklee / multilang.el
Last active September 22, 2019 08:55
Emacs multi language configuration
;; EMACS configuration for editing files in different languages.
;;
;; When loading a text file, depending on the specified ispell
;; dictionary:
;;
;; * Sets keyboard layout (layout when starting Emacs needs to be
;; American)
;;
;; * If available, enables "typo-mode" with the correct language
;; option. "typo-mode" facilitates entering typographically correct
@feklee
feklee / images_to_pdf
Last active October 10, 2020 07:25
Convert image files to PDF
#!/bin/bash
# Some of the `getopts` code has been taken from:
# http://mywiki.wooledge.org/BashFAQ/035#getopts
# Felix E. Klee <felix.klee@inka.de>
W=210
H=297
D=300
@feklee
feklee / winpath2clip
Last active November 14, 2020 02:02
Copies the path in Windows of a path in my Linux virtual machine to the clipboard
#!/bin/bash
# Felix E. Klee <felix.klee@inka.de>
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} PATH
Copies the path in Windows of PATH (in my Linux virtual machine) to
the clipboard.
@feklee
feklee / mvdev
Last active January 3, 2021 06:04
Finds developed photos, i.e. ones where there is a raw file and at least one JPEG file
#!/bin/bash
# Felix E. Klee <felix.klee@inka.de>
shopt -s nullglob
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} TARGET_DIR
@feklee
feklee / viewenc
Last active April 15, 2021 04:47
Easily view encrypted files
#!/bin/bash
# Felix E. Klee <felix.klee@inka.de>
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} ENCRYPTED.gpg
Decrypts ENCRYPTED.gpg and displays its contents.
EOF
@feklee
feklee / x11vnc
Last active May 4, 2021 20:20
Sxmo script for remote access
#!/bin/sh
# Allows maintaining of an Sxmo session on a PinePhone via VNC.
# Felix E. Klee <felix.klee@inka.de>
st -e sh -c "x11vnc -auth guess -once -loop -noxdamage -repeat -rfbport 5900 -shared"
@feklee
feklee / fake_gpg
Created January 2, 2022 16:37
Wrapper script to use GPG with an expired key
#!/bin/bash
/usr/bin/gpg2 --faked-system-time 20200101T000000 "$@"
@feklee
feklee / find_docurl_images
Last active January 10, 2022 20:48
Finds images that contain DocURLs in their EXIF data
#!/bin/bash
# Finds images that contain DocURLs in their EXIF data, because I
# remember that I once had the idea to put them there. Hopefully
# there are none.
# Felix E. Klee <felix.klee@inka.de>
find -regex ".*\.jpe?g" | while read a; do
r=$(exiftool "$a" | grep -i docurl) && echo "$a: '$r'"
@feklee
feklee / docurl.el
Last active January 17, 2022 15:41
To browse files associated with DocURLs
;; About DocURLs, see: http://f76.eu/a0
;;
;; Felix E. Klee <felix.klee@inka.de>
(defgroup docurl nil
"Support for browsing DocURLs"
:group 'communication)
(defcustom docurl-cache-filename
"~/.local/share/docurl_cache"
@feklee
feklee / append_to_encrypted_pdf
Last active June 15, 2022 17:45
Appends a PDF file to a PGP encrypted PDF file
#!/bin/bash
# Felix E. Klee <felix.klee@inka.de>
set -e
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} PGP_ENCRYPTED_PDF NEW_PDF PGP_ENCRYPTED_RESULT