Linux
Contents
- 1 firefox
- 2 usbguard
- 2.1 list currently connected devices
- 2.2 add all currently connected devices (and allow them)
- 2.3 activate rules
- 2.4 list all blocked devices
- 2.5 allow specific device once (until unplugged)
- 2.6 allow specific device permanent
- 2.7 block specific device
- 2.8 allow device classes
- 2.9 IPC ERROR: request id=1: FileRuleSet saving: /etc/usbguard/rules.conf: Read-only file system
- 3 games
- 4 cli
- 5 pi-hole
- 6 ssh
- 7 xinput
- 8 pdf
- 9 upgrade issues
firefox
enable gpu for video playback (h264)
about:config
media.ffmpeg.vaapi.enabled
=true
media.ffvpx.enabled
=false
media.rdd-vpx.enabled
=false
media.navigator.mediadatadecoder_vpx_enabled
=true
~/.profile
# set VA-API driver to iHD export LIBVA_DRIVER_NAME=iHD export MOZ_DISABLE_RDD_SANDBOX=1 export MOZ_X11_EGL=1 #export MOZ_ENABLE_WAYLAND=1
review if settings work
run sudo intel_gpu_top
(installed via sudo apt install intel-gpu-tools
) to see if the ENGINE "Video/0" is used when videos are played.
usbguard
man page: http://manpages.ubuntu.com/manpages/bionic/man1/usbguard.1.html
list currently connected devices
sudo usbguard list-devices
add all currently connected devices (and allow them)
usbguard generate-policy | sudo tee > /etc/usbguard/rules.conf
activate rules
sudo systemctl enable usbguard
list all blocked devices
usbguard list-devices --blocked
allow specific device once (until unplugged)
the id can be retrieved with the parameter list-devices above
sudo usbguard allow-device 23
allow specific device permanent
the id can be retrieved with the parameter list-devices above
sudo usbguard allow-device 23 --permanent
block specific device
sudo usbguard block-device 40
allow device classes
source: https://warlord0blog.wordpress.com/2021/06/10/usbguard/
omitting anything with a class 08 (mass storage) and E0 (wireless)
/etc/usbguard/rules.conf
allow with-interface one-of { 09:*:* } allow with-interface one-of { 07:*:* } allow with-interface one-of { 06:*:* } allow with-interface one-of { 03:*:* } allow with-interface one-of { 02:*:* } allow with-interface one-of { 01:*:* } allow with-interface one-of { 0b:*:* } allow with-interface one-of { 0d:*:* } allow with-interface one-of { 0e:*:* } allow with-interface one-of { 10:*:* }
IPC ERROR: request id=1: FileRuleSet saving: /etc/usbguard/rules.conf: Read-only file system
source: https://github.com/USBGuard/usbguard/issues/347
sudo mkdir /etc/systemd/system/usbguard.service.d cat <<"EOF" | sudo tee /etc/systemd/system/usbguard.service.d/override.conf [Service] ReadWritePaths=-/dev/shm -/var/log/usbguard -/tmp -/etc/usbguard EOF
games
- https://www.thedarkmod.com
- https://ufoai.org
- https://ihhub.github.io/fheroes2/
- https://wz2100.net/
- https://springrts.com/wiki/Games
- http://www.openra.net
- https://openage.sft.mx/
- http://dunelegacy.sourceforge.net/website/index.html
- https://bitbucket.org/dalerank/caesaria/wiki/Home
- https://www.widelands.org/
- http://www.freeciv.org/
- https://megaglest.org/
- https://www.indiedb.com/games/the-fertile-crescent
- https://github.com/Keriew/augustus
- https://www.flightgear.org/
cli
rename files (prepend text)
for i in *.txt; do mv -- "$i" "PREPEND_TEXT-${i}"; done
pi-hole
clear logs
service pihole-FTL stop cd /etc/pihole/ rm pihole-FTL.db.old mv pihole-FTL.db pihole-FTL.db.old service pihole-FTL start
ssh
autostart tmux on ssh connection
source: http://blog.thelinuxkid.com/2013/06/automatically-start-tmux-on-ssh.html
- This should always be run last either in .bashrc or as a script in .bashrc.d
if -z "$TMUX" ; then
tmux has-session &> /dev/null if [ $? -eq 1 ]; then exec tmux new exit else exec tmux attach exit fi
fi
xinput
list devices
xinput list | grep "Optical Mouse"
list devices - output
⎜ ↳ PixArt Lenovo USB Optical Mouse id=16 [slave pointer (2)]
set mouse speed
xinput --set-prop 16 "libinput Accel Speed" 0
remove encryption
qpdf --decrypt "in.pdf" "out.pdf"
or
qpdf --decrypt "in.pdf" --replace-input
merge pdfs
pdfunite '1 - first file.pdf' '2 another file.pdf' merged.pdf
upgrade issues
compose key not working
after upgrading from LM19 to LM20 the compose key (CAPSLOCK) would not work. to fix this I had to disable and re-enable the option in the keyboard settings.