Group some relevant tips together

This commit is contained in:
lhark 2019-10-03 13:00:22 -04:00
parent 3c4cfc5b56
commit d151b71d1d

125
how_to
View file

@ -26,6 +26,9 @@ Usefull packages :
Obscure/Useful vim plugins: Obscure/Useful vim plugins:
better-indent-support-for-php-with-html better-indent-support-for-php-with-html
jedi-vim jedi-vim
Pretty log pager:
lnav
keyboard : keyboard :
console: console:
@ -96,6 +99,14 @@ synaptics :
Option "MaxSpeed" "1.0" Option "MaxSpeed" "1.0"
Option "MinSpeed" "1.0" Option "MinSpeed" "1.0"
Mouse/Touchpad acceleration disable:
Set MaxSpeed=MinSpeed
For testing:
synclient MaxSpeed=<speed> MinSpeed=<speed>
For persistence, add to the right section in /etc/X11/xorg.conf.d/XX-synaptics.conf:
Option "MaxSpeed" "1.2"
Option "MinSpeed" "1.2"
st : st :
with ABS (arch) with ABS (arch)
https://wiki.archlinux.org/index.php/Patching_in_ABS https://wiki.archlinux.org/index.php/Patching_in_ABS
@ -134,6 +145,36 @@ PDF :
convert [jpg|png|txt|pdf|...] output.pdf convert [jpg|png|txt|pdf|...] output.pdf
# Might need to tweak /etc/ImageMagick-7/policy.xml # Might need to tweak /etc/ImageMagick-7/policy.xml
# https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion # https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
Fill form & annotate:
For well formatted interactive forms:
evince
For non-interactive PDF:
xournal
libreoffice Draw
inkscape
Fill dynamic XFA forms on linux:
Run Acrobat Reader DC 2019 on wine:
https://linuxconfig.org/how-to-install-latest-adobe-acrobat-reader-dc-on-ubuntu-18-04-bionic-beaver-linux-with-wine
https://www.quora.com/How-do-I-install-Adobe-Reader-on-Ubuntu-using-the-Wine-software
ftp://ftp.adobe.com/pub/adobe/reader/win/AcrobatDC/
WINEARCH=win32
WINEPREFIX=~/.wine-32
winetricks mspatcha
winetricks riched20
winetricks allfonts # Maybe not ?
trizen -S ttf-windows # Indispensable, without it no text in UI
# maybe? winetricks atmlib wsh57
winetricks settings win7
wget ftp://ftp.adobe.com/pub/adobe/reader/win/AcrobatDC/1901220034/AcroRdrDC1901220034_en_US.exe # Replace by latest version
wine ./AcroRdrDC1901220034_en_US.exe
wine ~/.wine-32/drive_c/Program\ Files/Adobe/Acrobat\ Reader\ DC/Reader/AcroRd32.exe
Select "Always open with Protected Mode Disabled"
Don't forget to kill the wineserver, adobe leaves a lot of garbage running:
wineserver --kill
Master PDF Editor (free version):
https://code-industry.net/free-pdf-editor/
trizen -S masterpdfeditor
D-Bus : D-Bus :
To reload service files /usr/share/dbus-1/services/ To reload service files /usr/share/dbus-1/services/
@ -175,6 +216,14 @@ Fix hardware clock (with chrony):
Network Manager: Network Manager:
nmtui : add/edit connections nmtui : add/edit connections
nmcli : informations nmcli : informations
Fix nm-applet/nmtui only working with root/sudo:
# /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {
return polkit.Result.YES;
}
});
sudo usermod -aG network <user>
Power saving : Power saving :
echo "vm.dirty_writeback_centisecs = 6000" >> /etc/sysctl.d/dirty.conf echo "vm.dirty_writeback_centisecs = 6000" >> /etc/sysctl.d/dirty.conf
@ -216,10 +265,14 @@ Video and audio editing:
# https://unix.stackexchange.com/a/294892 # https://unix.stackexchange.com/a/294892
ffmpeg -i in.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4 ffmpeg -i in.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4
ImageMagick:
crop to aspect ratio
convert in.png -gravity center -crop 4:3 out.png
RE .net apps: RE .net apps:
ilspymono <list-of-deps.txt>(can be empty) <exe or dll to disassemble> <output dir> ilspymono <list-of-deps.txt>(can be empty) <exe or dll to disassemble> <output dir>
Wireshark proprement: Wireshark properly:
sudo gpasswd -a <user> wireshark sudo gpasswd -a <user> wireshark
sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip CAP_DAC_OVERRIDE+eip' /usr/bin/dumpcap sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip CAP_DAC_OVERRIDE+eip' /usr/bin/dumpcap
@ -253,14 +306,6 @@ Wifi AP:
is_wifi_connected() { return 1 } is_wifi_connected() { return 1 }
sudo create_ap [-c <channel>] wlp2s0 wlp2s0 <ssid> <pwd> sudo create_ap [-c <channel>] wlp2s0 wlp2s0 <ssid> <pwd>
PDF fill form & annotate:
For well formatted interactive forms:
evince
For non-interactive PDF:
xournal
libreoffice Draw
inkscape
Sync from phone: Sync from phone:
adb-sync -R /sdcard/<folder>/ <dest> adb-sync -R /sdcard/<folder>/ <dest>
@ -277,9 +322,6 @@ fail2ban unban:
# Remove leading "-A " # Remove leading "-A "
iptables -D <rule> iptables -D <rule>
Pretty log pager:
lnav
Backup non rooted phone with adb: Backup non rooted phone with adb:
adb backup -all -shared -obb -f <file> adb backup -all -shared -obb -f <file>
need adb < 1.0.31 need adb < 1.0.31
@ -451,14 +493,6 @@ Transition from Thunderbird to mutt+mbsync+msmtp:
color status <color> default color status <color> default
Mouse/Touchpad acceleration disable:
Set MaxSpeed=MinSpeed
For testing:
synclient MaxSpeed=<speed> MinSpeed=<speed>
For persistence, add to the right section in /etc/X11/xorg.conf.d/XX-synaptics.conf:
Option "MaxSpeed" "1.2"
Option "MinSpeed" "1.2"
Get hardware informations: Get hardware informations:
dmidecode dmidecode
Get laptop model: Get laptop model:
@ -472,6 +506,7 @@ Get hardware informations:
Others values are <bios|baseboard|chassis> Others values are <bios|baseboard|chassis>
Music fingerprinting Music fingerprinting
# https://github.com/beetbox/pyacoustid
for f in *.mp3;do echo $f; python ~/src/pyacoustid/aidmatch.py $f;done > ident for f in *.mp3;do echo $f; python ~/src/pyacoustid/aidmatch.py $f;done > ident
awk '/\.mp3/{f = $0;next} f{printf "mv %s \"../%s.mp3\"\n", f, $0; f=0}' ident > rename.sh awk '/\.mp3/{f = $0;next} f{printf "mv %s \"../%s.mp3\"\n", f, $0; f=0}' ident > rename.sh
@ -483,7 +518,7 @@ Reset gpg-agent passphrase cache
echo RELOADAGENT | gpg-connect-agent echo RELOADAGENT | gpg-connect-agent
Better Bibtex, Zotero: Better Bibtex, Zotero:
Add URL to webpages Add URL to references to webpages
https://retorque.re/zotero-better-bibtex/scripting/ https://retorque.re/zotero-better-bibtex/scripting/
if (Translator.BetterBibTeX && item.itemType === 'webpage') { if (Translator.BetterBibTeX && item.itemType === 'webpage') {
if (item.accessDate) { if (item.accessDate) {
@ -494,10 +529,6 @@ Better Bibtex, Zotero:
} }
} }
ImageMagick:
crop to aspect ratio
convert in.png -gravity center -crop 4:3 out.png
Bumblebee runit fix: Bumblebee runit fix:
sed -i 's/Driver=$/Driver=nvidia/' /etc/bumblebee/bumblebee.conf sed -i 's/Driver=$/Driver=nvidia/' /etc/bumblebee/bumblebee.conf
@ -512,7 +543,6 @@ Artix:
Artixlinux pacman gpg unknown trust fix: Artixlinux pacman gpg unknown trust fix:
sudo pacman-key --init sudo pacman-key --init
sudo pacman-key --populate archlinux artix sudo pacman-key --populate archlinux artix
Artixlinux steam lib32-systemd fix: Artixlinux steam lib32-systemd fix:
https://forum.artixlinux.org/index.php/topic,633.msg7437.html https://forum.artixlinux.org/index.php/topic,633.msg7437.html
[Attached file]: resources/lib32-systemd-dummy.pkgbuild [Attached file]: resources/lib32-systemd-dummy.pkgbuild
@ -567,29 +597,6 @@ Run studiotax on wine:
wine ./StudioTax2017Install.exe /extract wine ./StudioTax2017Install.exe /extract
msiexec /i StudioTax.msi msiexec /i StudioTax.msi
Fill dynamic XFA forms on linux:
Run Acrobat Reader DC 2019 on wine:
https://linuxconfig.org/how-to-install-latest-adobe-acrobat-reader-dc-on-ubuntu-18-04-bionic-beaver-linux-with-wine
https://www.quora.com/How-do-I-install-Adobe-Reader-on-Ubuntu-using-the-Wine-software
ftp://ftp.adobe.com/pub/adobe/reader/win/AcrobatDC/
WINEARCH=win32
WINEPREFIX=~/.wine-32
winetricks mspatcha
winetricks riched20
winetricks allfonts # Maybe not ?
trizen -S ttf-windows # Indispensable, without it no text in UI
# maybe? winetricks atmlib wsh57
winetricks settings win7
wget ftp://ftp.adobe.com/pub/adobe/reader/win/AcrobatDC/1901220034/AcroRdrDC1901220034_en_US.exe # Replace by latest version
wine ./AcroRdrDC1901220034_en_US.exe
wine ~/.wine-32/drive_c/Program\ Files/Adobe/Acrobat\ Reader\ DC/Reader/AcroRd32.exe
Select "Always open with Protected Mode Disabled"
Don't forget to kill the wineserver, adobe leaves a lot of garbage running:
wineserver --kill
Master PDF Editor (free version):
https://code-industry.net/free-pdf-editor/
trizen -S masterpdfeditor
Easily switch to russian phonetic keyboard: Easily switch to russian phonetic keyboard:
setxkbmap fr,ru -variant ,phonetic -option grp:shift_caps_toggle setxkbmap fr,ru -variant ,phonetic -option grp:shift_caps_toggle
man xkeyboard-config # get list of possible toggles man xkeyboard-config # get list of possible toggles
@ -618,6 +625,11 @@ Wayland install:
Qt issues: Qt issues:
sudo pacman -S qt5-wayland sudo pacman -S qt5-wayland
export QT_QPA_PLATFORM="wayland" export QT_QPA_PLATFORM="wayland"
sudo/root issues with GUI apps:
# https://bugzilla.redhat.com/show_bug.cgi?id=1274451
xhost +SI:localuser:root
sudo <gui>
xhost -SI:localuser:root # Clean up the security hole
MSI ge62 webcam not found: MSI ge62 webcam not found:
Activate using fn+F6 Activate using fn+F6
@ -680,18 +692,3 @@ Android diagnostic debug phone codes:
Android wpa_supplicant conf file path: Android wpa_supplicant conf file path:
/data/misc/wifi/wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
Run GUI apps as root with sudo on Wayland:
# https://bugzilla.redhat.com/show_bug.cgi?id=1274451
xhost +SI:localuser:root
sudo <gui>
xhost -SI:localuser:root # Clean up the security hole
Fix Network Manager nm-applet/nmtui only working with root/sudo:
# /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("network")) {
return polkit.Result.YES;
}
});
sudo usermod -aG network <user>