Skip to content

Instantly share code, notes, and snippets.

@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 / organize_media
Last active August 10, 2023 06:55
Sorts media files into directories by the date when they were created
#!/bin/bash
# Sorts media files into directories by the date when they were
# created. There is no time zone conversion: Many media files don't
# contain a time zone, or they default to UTC.
# Felix E. Klee <felix.klee@inka.de>
shopt -s nullglob
@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 / lnk2desk
Last active November 23, 2023 07:26
Creates link to DIR on Windows desktop. Only works for certain directories inside my Linux virtual machine.
#!/bin/bash
# Depends on:
#
# * Mikaël Le Bohec's [mslink][1], and
#
# * my [winpath][2].
#
# [1]: http://www.mamachine.org/mslink/index.en.html
# [2]: https://gist.github.com/feklee/678c630aa7f84ceda1c766333b37e7d3
@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 / winpath
Last active November 23, 2023 07:26
Prints the path in Windows of a path in my Linux virtual machine
#!/bin/bash
# Felix E. Klee <felix.klee@inka.de>
MSLINK=mslink_v1.3.sh
DROPBOX_DIR="/mnt/c/Users/Felix/Dropbox"
DROPBOX_WIN_DIR='C:\Users\Felix\Dropbox'
HOME_DIR="/home/felix"
HOME_WIN_DIR='\\wsl.localhost\Ubuntu\home\felix'
@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 / 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 / geometry.png
Last active January 7, 2019 17:52
SAN
geometry.png
@feklee
feklee / README.md
Last active February 12, 2024 20:50
GnuPG on Termux for accessing USB smart card reader

Prerequisites

  • smart card reader supported by GnuPG

    I use [0.332][4], a mod of the [SCM332 V2][1] which is comparatively light and small. Previously, I was simply using the SCM332 V2 directly with an OTG adapter.

  • root access from Termux