user:thomas 由用户创建的 Gists
user:thomas
title:mygist 包含指定标题的 Gists
title:mygist
description:sync gists with given description
description:sync
filename:myfile.txt 包含指定文件名的 Gists
filename:myfile.txt
extension:yml 包含指定扩展名的 Gists
extension:yml
language:go 包含指定编程语言的 Gists
language:go
topic:homelab 具有给定主题的 Gists
topic:homelab
all:systemctl search all fields
all:systemctl
登录
A small script to swap between main monitor+audio source to secondary monitor+audio. Either just swap which is set as primary, or also disable the secondary. Add "Command or Script" shortcut to trigger it from the keyboard.
#!/usr/bin/env bash # Enable/Activate both monitors and get info from `kscreen-doctor -o | grep -A3 Output` # Get audio sinks from `pactl list sinks short`
lsblk
cryptsetup luksOpen /dev/sda2 myEncryptedVolume
mount /dev/mapper/myEncryptedVolume /mnt
mount -o subvol=@ /dev/sda2 /mnt
Prerequisite: Have a collection of openssl.conf files named as their hostname, eg
openssl.conf
Create new passwords for every conf:
for i in *.conf; do openssl rand -base64 32 > ${i%.conf}.pass; done
for d in sd{a..e}; do smartctl -a /dev/$d | \ awk -v d="$d" '/Power_On/ {print "PowerOnHours "d, int($10), "("int($10 / 24)" days)"}' ; done
Example output:
PowerOnHours sda 23050 (960 days)
Resize images with ImageMagick, all images in current directory to "resized" subdirectory.
for i in *.jpg; do magick $i -resize 60% ./sized/$i; done
PREVIOUS="$(sort -t: -k2 -n /etc/subuid | tail -n1)" && PREVIOUS="${PREVIOUS#*:}" && echo "$PREVIOUS" # ex.out: 165536:65536 FIRST="$((${PREVIOUS%:*}+${PREVIOUS#*:}))" && echo "$FIRST" # ex.out: 231072 NEW=${FIRST}-$((${FIRST}+65535)) && echo "$NEW" # ex.out: 231072-296607
Select all lines then: (remember the dot within [0-9.] if decimal-epoch) :'<,'>s/\([0-9.]\+\)/\=strftime('%c', submatch(1))
[0-9.]
:'<,'>s/\([0-9.]\+\)/\=strftime('%c', submatch(1))
Result:
# From: 1779764414.0, test, ABC123, X # To:
# with specific formats and to mkv ffmpeg -i input.mkv -map 0 -c:v libx264 -crf 18 -vf format=yuv420p -c:a copy output.mkv # quick and default and convert to mp4 ffmpeg -i input.mkv -c:v libx264 -c:a aac output.mp4
由 Opengist 强力驱动 ⋅ Load: 139ms⋅