Compare commits

...

5 commits

Author SHA1 Message Date
lhark 33b0a93f32 Blender, jupyter, TLS, ls, java 2022-10-01 21:59:28 +02:00
lhark fd523b3443 more manual IMAP 2022-10-01 21:57:32 +02:00
lhark 9247830302 mp3 to video 2022-10-01 21:57:13 +02:00
lhark 432631efe7 NTP chrony fixes 2022-10-01 21:56:47 +02:00
lhark c48337fdc6 PDF decryption 2022-10-01 21:56:15 +02:00

72
how_to
View file

@ -287,6 +287,10 @@ PDF :
Master PDF Editor (free version):
https://code-industry.net/free-pdf-editor/
trizen -S masterpdfeditor
Decrypt pdf files:
# For example when pdftk spews this error:
# `Error: Invalid PDF: unknown.encryption.type.r`
qpdf --decrypt input.pdf output.pdf
D-Bus :
To reload service files /usr/share/dbus-1/services/
@ -321,8 +325,20 @@ Drag & drop files:
Fix hardware clock (with chrony / NTC):
sudo chronyc
# Diagnose
activity
sources
tracking
# Bring NTP online
online
# Force step
makestep
# Synchronize hardware clock with system clock
trimrtc
quit
Alternative to trimrtc:
sudo hwclock --systohc
@ -434,6 +450,28 @@ Video and audio editing:
Your text here # Actual text
# Mandatory empty line
ffmpeg -i in.mp4 -vf "scale=512:-2:flags=lanczos,split[x][z];[z]palettegen[y];[x][y]paletteuse,subtitles=text.srt:force_style='FontName=Oswald,Fontsize=80,FontWeight=Bold'" -r 10 out.gif
mp3 to video:
# https://shkspr.mobi/blog/2020/02/posting-audio-to-twitter/"
# Waveform
ffmpeg \
-i input.mp3 \
-filter_complex "[0:a]showwaves=s=640x480:mode=line,format=yuv420p[v]" \
-map "[v]" \
-map 0:a \
-c:v libx264 \
-c:a copy \
out.mkv
# Still image
ffmpeg \
-loop 1 \
-i image.jpg \
-i audio.mp3 \
-c:v libx264 \
-tune stillimage \
-c:a copy \
-pix_fmt yuv420p \
-shortest \
out.mp4
ImageMagick:
crop to aspect ratio
@ -1105,6 +1143,7 @@ Mounting .bin/.cue image files:
Manual IMAP connection:
# https://www.atmail.com/blog/imap-101-manual-imap-sessions/
# https://stackoverflow.com/questions/14959461/how-to-talk-to-imap-server-in-shell-via-openssl
# https://gist.github.com/fedir/1d8f8fb8a5f80090705ef7793936216a²
$ openssl s_client -connect <imap server>:993 -crlf [-quiet]
$ openssl s_client -connect <imap server>:143 -crlf -starttls imap [-quiet]
@ -1114,6 +1153,9 @@ Manual IMAP connection:
A2 list "" "*"
# list everything under a particular prefix
A3 list "INBOX" "*"
# Or:
# (will print current UIDVALIDITY (useful for fixing mbsync))
A4 select inbox
A99 logout
gdb tricks:
@ -1291,3 +1333,33 @@ Fix chromium microphone autogain (qutebrowser):
# https://github.com/qutebrowser/qutebrowser/discussions/6628
# https://bugs.chromium.org/p/chromium/issues/detail?id=435112
Blender:
Display vertex indices (blender >= 2.8):
# https://blender.stackexchange.com/a/158495
# https://devtalk.blender.org/t/how-to-enable-the-vertex-indices-overlay-over-each-vertex/15491/4
- Edit > Preferences > Interface > Developer Extras (enable)
- Edit Mode
- Overlays (dropdown, top-right) > Indices (enable) (under: "Developer")
Jupyter:
Clear notebook of output data for publishing:
# https://stackoverflow.com/a/47774393/5309963
# In-place version
jupyter nbconvert --clear-output --inplace my_notebook.ipynb
# Or to write to a new file
jupyter nbconvert --clear-output \
--to notebook --output=my_notebook_no_out my_notebook.ipynb
Check SSL/TLS certificate expiration date:
echo | openssl s_client -servername <name.example.tld> -connect <example.tld>:443 2>/dev/null | openssl x509 -noout -dates
List files in chronological order with ls:
# https://shkspr.mobi/blog/2020/12/anatomy-of-an-ls-command/
ls -trhgGN --color=always | cut -d" " -f3-
Change default java environment (archlinux):
# https://wiki.archlinux.org/title/Java#List_compatible_Java_environments_installed
archlinux-java status
# Example
archlinux set java-18-openjdk