Compare commits
No commits in common. "02b22627efabdef25a4b05b7e24cce2d66762e2e" and "c416ee3695aee80d2120aff10afc2ca2c17238a7" have entirely different histories.
02b22627ef
...
c416ee3695
9 changed files with 49 additions and 72 deletions
1
.config/autostart/signal-tray.desktop
Symbolic link
1
.config/autostart/signal-tray.desktop
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../.local/share/applications/signal-tray.desktop
|
|
@ -611,12 +611,6 @@ Version 2019-11-04 2021-02-16"
|
||||||
"E" 'org-export-repeat
|
"E" 'org-export-repeat
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun org-export-disable-id ()
|
|
||||||
(interactive)
|
|
||||||
(defun my-link-remover (link contents info) contents)
|
|
||||||
(org-link-set-parameters "id" :export 'my-link-remover)
|
|
||||||
)
|
|
||||||
|
|
||||||
(setq org-html-style "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://gongzhitaao.org/orgcss/org.css\"/>"
|
(setq org-html-style "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://gongzhitaao.org/orgcss/org.css\"/>"
|
||||||
org-html-head-include-default-style nil
|
org-html-head-include-default-style nil
|
||||||
org-html-htmlize-output-type 'css)
|
org-html-htmlize-output-type 'css)
|
||||||
|
|
|
@ -22,14 +22,6 @@ matches:
|
||||||
Technischer Leiter https://software-challenge.de, deutscher Programmierwettbewerb für Schüler
|
Technischer Leiter https://software-challenge.de, deutscher Programmierwettbewerb für Schüler
|
||||||
CTO der FTT Forensic Discovery GmbH - gesunde IT aus Bayreuth: https://forensicdiscovery.de
|
CTO der FTT Forensic Discovery GmbH - gesunde IT aus Bayreuth: https://forensicdiscovery.de
|
||||||
Software Engineering Student @ https://code.berlin
|
Software Engineering Student @ https://code.berlin
|
||||||
- trigger: ";grer"
|
|
||||||
replace: |-
|
|
||||||
Greetings from Bavaria,
|
|
||||||
Janek
|
|
||||||
|
|
||||||
---
|
|
||||||
CTO https://forensicdiscovery.de and https://software-challenge.de
|
|
||||||
Software Engineering Student @ https://code.berlin
|
|
||||||
- trigger: ";date"
|
- trigger: ";date"
|
||||||
replace: "{{mydate}}"
|
replace: "{{mydate}}"
|
||||||
vars:
|
vars:
|
||||||
|
|
|
@ -504,12 +504,16 @@ else
|
||||||
alias f1='find -mindepth 1 -maxdepth 1'
|
alias f1='find -mindepth 1 -maxdepth 1'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
lowercase() {
|
||||||
|
#$(which perl-rename || echo rename) -iv 'y/A-Z /a-z-/' "$@"
|
||||||
|
find "$@" -exec sh -c 'mv -iv "{}" "$(echo "{}" | tr "A-Z " "a-z-" | sed "s|---|_|;s|\.-|.|")" 2>/dev/null' \;
|
||||||
|
}
|
||||||
|
|
||||||
# TODO replace cp by rsync, automatically use compression for remote transfers
|
# TODO replace cp by rsync, automatically use compression for remote transfers
|
||||||
# rsync directory properly - suffix both dirs with / to act on contents
|
# rsync directory properly - suffix both dirs with / to act on contents
|
||||||
alias rcn='rsync -v --recursive --human-readable --links --dry-run'
|
alias rcn='rsync -v --recursive --human-readable --links --dry-run'
|
||||||
rcd() { rcn --size-only "$@" | tail +2 | tree --fromfile . | less -F; }
|
rcd() { rcn --size-only "$@" | tail +2 | tree --fromfile . | less -F; }
|
||||||
compdef rcd=rsync
|
compdef rcd=rsync
|
||||||
# TODO do not sync times to FAT
|
|
||||||
alias rc='rcs --links --hard-links --times'
|
alias rc='rcs --links --hard-links --times'
|
||||||
alias rcu='rc --existing --size-only'
|
alias rcu='rc --existing --size-only'
|
||||||
alias rcs='rsync --recursive --info=progress2,remove,symsafe,flist,del --human-readable'
|
alias rcs='rsync --recursive --info=progress2,remove,symsafe,flist,del --human-readable'
|
||||||
|
@ -567,8 +571,8 @@ compdef mkcd=mkdir
|
||||||
# Other stuff {{{1
|
# Other stuff {{{1
|
||||||
|
|
||||||
alias unmount=umoul
|
alias unmount=umoul
|
||||||
# This is a function rather than a script as it needs to cd up
|
# This is a function rather than a script as it potentially needs to cd out
|
||||||
# if the current directory is to be unmounted
|
# if the current directory is the one to unmount
|
||||||
umoul() {
|
umoul() {
|
||||||
local arg
|
local arg
|
||||||
local mnt="${MNT:-${XDG_RUNTIME_DIR}/mnt}"
|
local mnt="${MNT:-${XDG_RUNTIME_DIR}/mnt}"
|
||||||
|
@ -576,7 +580,7 @@ umoul() {
|
||||||
for arg; do true; done
|
for arg; do true; done
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
(-a|--all)
|
(-a|--all)
|
||||||
mountpoints="$(mount | grep "$mnt" | cut -d' ' -f3)";;
|
mountpoints=$(mount | grep "$mnt" | cut -d' ' -f3)
|
||||||
("")
|
("")
|
||||||
mountpoints="$(pwd | grep -v /home || echo /)"
|
mountpoints="$(pwd | grep -v /home || echo /)"
|
||||||
while test "$mountpoints" != "/"; do
|
while test "$mountpoints" != "/"; do
|
||||||
|
@ -588,23 +592,21 @@ umoul() {
|
||||||
grep --invert-match -e " /[^m][^/]*\(/[^/]*\)\? " -e "/sys" -e "/run/user" -e "/run/docker" -e "/home" |
|
grep --invert-match -e " /[^m][^/]*\(/[^/]*\)\? " -e "/sys" -e "/run/user" -e "/run/docker" -e "/home" |
|
||||||
fzf --exit-0 | awk '{print $3}')" ||
|
fzf --exit-0 | awk '{print $3}')" ||
|
||||||
return $?
|
return $?
|
||||||
;;
|
|
||||||
(*)
|
(*)
|
||||||
mountpoints="$(test -d "$arg" && realpath "$arg" || echo "$mnt/$arg")"
|
mountpoints="$(test -d "$arg" && realpath "$arg" || echo "$mnt/$arg")"
|
||||||
mountpoint "$mountpoints" 2>/dev/null || test -b "$mountpoints" ||
|
mountpoint "$mountpoints" 2>/dev/null || test -b "$mountpoints" ||
|
||||||
mountpoints="$(mount --show-labels | grep "$arg" | cut -d' ' -f3)"
|
mountpoints="$(mount --show-labels | grep "$arg" | cut -d' ' -f3)"
|
||||||
test "$mountpoints" || return 1
|
test "$mountpoints" || return 1
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
while true; do
|
||||||
|
case "$PWD" in
|
||||||
|
("$mountpoints"*) popd || builtin cd "$(dirname $mountpoints)";;
|
||||||
|
(*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
# pass on all args except last
|
# pass on all args except last
|
||||||
for mountpoint in $mountpoints; do
|
for mountpoint in $mountpoints
|
||||||
while true; do
|
do moul -u "${@:1:$(((# > 1) ? #-1 : 0))}" "$mountpoint"
|
||||||
case "$PWD" in
|
|
||||||
("$mountpoint"*) popd || builtin cd "$(dirname "$mountpoint")";;
|
|
||||||
(*) break;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
moul -u "${@:1:$(((# > 1) ? #-1 : 0))}" "$mountpoint"
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -ex
|
||||||
# Set exec flag on all files that should be executable
|
# Set exec flag on all files that should be executable
|
||||||
find -maxdepth 4 -name "*.sh" "$@" -exec chmod -v +x {} +
|
find -maxdepth 4 -name "*.sh" "$@" -exec chmod +x {} +
|
||||||
|
|
|
@ -5,11 +5,6 @@
|
||||||
# and shows progress indications for some operations
|
# and shows progress indications for some operations
|
||||||
# optdepends: rewrite(part of my dotfiles, for unzip line rewriting) 7z p7zip unzip
|
# optdepends: rewrite(part of my dotfiles, for unzip line rewriting) 7z p7zip unzip
|
||||||
# TODO auto-delete archive, auto-extract in current dir, trim .tar.gz fully
|
# TODO auto-delete archive, auto-extract in current dir, trim .tar.gz fully
|
||||||
if test $# -eq 0
|
|
||||||
then ex *.zip
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
for arg do
|
for arg do
|
||||||
case $arg in
|
case $arg in
|
||||||
(-d) del=$(expr ${del:-0} + 1);;
|
(-d) del=$(expr ${del:-0} + 1);;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Lowercase given files
|
# Lowercase given files
|
||||||
#perl-rename 'y/A-Z /a-z-/' "$@"
|
perl-rename 'y/A-Z /a-z-/' "$@"
|
||||||
#$(which perl-rename || echo rename) -iv 'y/A-Z /a-z-/' "$@"
|
|
||||||
find "$@" -exec sh -c 'mv -iv "{}" "$(echo "{}" | tr "A-Z " "a-z-" | sed "s|---|_|;s|\.-|.|")" 2>/dev/null' \;
|
|
||||||
|
|
|
@ -1,37 +1,34 @@
|
||||||
#!/bin/sh
|
#!/bin/sh -x
|
||||||
# Mount a partition by label or device identifier automatically
|
# Mount a partition by label or device identifier automatically
|
||||||
# Includes interactive selection if no argument is given
|
# Includes interactive selection if no argument is given
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
_help="$0 <device> [mountpoint] [options...]"
|
_help="$0 <device> [mountpoint] [options...]"
|
||||||
case $1 in
|
case $1 in
|
||||||
(-v) shift
|
(-v) shift
|
||||||
bash -x "$0" "$@";;
|
bash -x "$0" "$@";;
|
||||||
("") # TODO include size
|
("") # TODO include size
|
||||||
arg=$(
|
arg=$(
|
||||||
{
|
{ #for ip in $(sudo nmblookup -S \* | grep '^[0-9]' | cut -d' ' -f1)
|
||||||
#for ip in $(sudo nmblookup -S \* | grep '^[0-9]' | cut -d' ' -f1)
|
#do timeout --kill-after=.1s .1s showmount --no-headers --exports "$ip" 2>/dev/null | sed "s|\([^ ]*\) .*|$ip:\1|"
|
||||||
#do timeout --kill-after=.1s .1s showmount --no-headers --exports "$ip" 2>/dev/null | sed "s|\([^ ]*\) .*|$ip:\1|"
|
#done &
|
||||||
#done &
|
lsblk --list --noheadings --output name,label,fstype,mountpoint | grep -v LUKS | grep -v '/' | grep ".\+ [^ ]\+"; } | fzf --exit-0 |
|
||||||
# TODO handle labels with spaces
|
sed "s/^\([^ ]\+ \+\)\?\([^ ]\+\) \+[^ ]\+ *$/\2/");;
|
||||||
lsblk --list --noheadings --output name,label,fstype,mountpoint | grep -v LUKS | grep -v '/' | grep ".\+ [^ ]\+";
|
(--help) echo "$_help" && exit 0;;
|
||||||
} | fzf --exit-0 | sed "s/^\([^ ]\+ \+\)\?\([^ ]\+\) \+[^ ]\+ *$/\2/"
|
(-u) shift
|
||||||
);;
|
for last; do true; done
|
||||||
(--help) echo "$_help" && exit 0;;
|
sudo umount --verbose "$@"
|
||||||
(-u) shift
|
code=$?
|
||||||
for last; do true; done
|
sudo rm -df "$last"
|
||||||
sudo umount --verbose "$@"
|
exit $code;;
|
||||||
code=$?
|
(*) arg=$1
|
||||||
sudo rm -df "$last"
|
shift;;
|
||||||
exit $code;;
|
|
||||||
(*) arg=$1
|
|
||||||
shift;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# FSTAB: BY LABEL
|
# FSTAB: BY LABEL
|
||||||
if grep --word-regexp "LABEL=$arg" /etc/fstab
|
if grep --word-regexp "LABEL=$arg" /etc/fstab
|
||||||
then # have to mount twice as the first one might be creating the directory
|
then # have to mount twice as the first one might be creating the directory
|
||||||
mount -L "$arg" "$@" 2>/dev/null || mount -L "$arg" "$@"
|
mount -L "$arg" "$@" 2>/dev/null || mount -L "$arg" "$@"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
# FSTAB: BY MOUNTPOINT/NAME
|
# FSTAB: BY MOUNTPOINT/NAME
|
||||||
if grep --word-regexp "$arg" /etc/fstab
|
if grep --word-regexp "$arg" /etc/fstab
|
||||||
|
@ -42,23 +39,22 @@ fi
|
||||||
mountpoint="${2:-${MNT:-${XDG_RUNTIME_DIR}/mnt}/$(basename "$arg")}"
|
mountpoint="${2:-${MNT:-${XDG_RUNTIME_DIR}/mnt}/$(basename "$arg")}"
|
||||||
if grep -e "[^\w=/]$mountpoint[^\w/]" /etc/fstab
|
if grep -e "[^\w=/]$mountpoint[^\w/]" /etc/fstab
|
||||||
then test $# -gt 0 && shift
|
then test $# -gt 0 && shift
|
||||||
mount "$mountpoint" "$@"
|
mount "$mountpoint" "$@"
|
||||||
code=$?
|
code=$?
|
||||||
cd $mountpoint
|
cd $mountpoint
|
||||||
exit $code
|
exit $code
|
||||||
fi
|
fi
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
(sd*|loop*|nvme*|mm*|md*|dm*|vg*) partition="/dev/$arg";;
|
(sd*|loop*|nvme*|mm*|md*|dm*|vg*) partition="/dev/$arg";;
|
||||||
(/dev/*) partition="$arg";;
|
(/dev/*) partition="$arg";;
|
||||||
(*) params="-L"
|
(*) partition="-L $arg";;
|
||||||
partition="$arg";;
|
|
||||||
esac
|
esac
|
||||||
shift $(expr 2 \& $# \> 2 \| $#)
|
shift $(expr 2 \& $# \> 2 \| $#)
|
||||||
#uid=$(id --user),gid=$(id --group), \
|
#uid=$(id --user),gid=$(id --group), \
|
||||||
if ! mountpoint "$mountpoint" 2>/dev/null
|
if ! mountpoint "$mountpoint" 2>/dev/null
|
||||||
then mp="/run/media/$USER/$arg" && test -e "$mp" && mountpoint="$mp"
|
then mp="/run/media/$USER/$arg" && test -e "$mp" && mountpoint="$mp"
|
||||||
sudo mount -vo users,X-mount.mkdir,noatime,umask=003,gid=users,uid=$USER $params "$partition" "$mountpoint" "$@" ||
|
sudo mount -vo users,X-mount.mkdir,noatime,umask=003,gid=users,uid=$USER $partition $mountpoint "$@" ||
|
||||||
sudo mount -vo users,X-mount.mkdir,noatime $params "$partition" "$mountpoint" "$@"
|
sudo mount -vo users,X-mount.mkdir,noatime $partition $mountpoint "$@"
|
||||||
fi
|
fi
|
||||||
cd $mountpoint
|
cd $mountpoint
|
||||||
exec $SHELL
|
exec $SHELL
|
||||||
|
|
|
@ -23,7 +23,6 @@ export TEXMF=""
|
||||||
pdfjam $quiet "$signature" --outfile "$sig" --papersize "{595pt, 842pt}" --noautoscale true \
|
pdfjam $quiet "$signature" --outfile "$sig" --papersize "{595pt, 842pt}" --noautoscale true \
|
||||||
--offset "${h}pt ${v}pt" --scale "${4:-1}"
|
--offset "${h}pt ${v}pt" --scale "${4:-1}"
|
||||||
pdfjam $quiet "$1" last "$sig" --outfile "$tmp_signed" --delta "0 -842pt" --nup "1x2" --fitpaper true
|
pdfjam $quiet "$1" last "$sig" --outfile "$tmp_signed" --delta "0 -842pt" --nup "1x2" --fitpaper true
|
||||||
# TODO consider pdftk stamp
|
|
||||||
|
|
||||||
timg "$tmp_signed"
|
timg "$tmp_signed"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue