Compare commits

...

13 commits

Author SHA1 Message Date
lhark 412ee1d52b Firmware flashing 2021-08-27 20:25:40 +02:00
lhark ff52318032 Disable git auto guessing email addresses 2021-08-27 20:25:40 +02:00
lhark 4b963e97d7 Minor updates 2021-08-27 20:25:40 +02:00
lhark 037cf084be big bluetooth blob 2021-08-27 20:25:40 +02:00
lhark fa398015d5 ssh NAT tunnel 2021-08-27 20:25:40 +02:00
lhark 10a8b4c991 lossless img to pdf 2021-08-27 20:25:40 +02:00
lhark ace145a64d More pacman options 2021-08-27 20:25:40 +02:00
lhark f2e0d8dd93 Cleanup & consistency 2021-08-27 20:25:40 +02:00
lhark 49130de071 [vim] word counting 2021-08-27 20:25:40 +02:00
lhark 25879199d7 Add docx to text methods 2021-08-27 20:25:40 +02:00
lhark 66114985a0 Misc tips (sway keyboard, old bluetooth tools, deb packages) 2021-08-27 20:25:31 +02:00
lhark 341e713f8a Some tips on doing secure backups via ssh 2021-08-27 20:24:00 +02:00
lhark 1e4745e76f Regroup android tips, and add docs on runit logging 2021-08-27 20:24:00 +02:00
2 changed files with 330 additions and 158 deletions

465
how_to
View file

@ -31,6 +31,8 @@ Usefull packages :
lnav
Backlight management:
light # http://haikarainen.github.io/light/
IRC:
catgirl # https://git.causal.agency/catgirl
System setup:
display/drivers:
@ -106,9 +108,8 @@ keyboard :
Nice environment :
cd ~
git clone http://gitlab.rezometz.org/lhark/rc.git
[git -C rc checkout v2]
rc/install.sh
chsh -s </bin/zsh|/usr/bin/fish>
chsh -s /bin/zsh
pacman :
-Syu Upgrade system
@ -117,7 +118,9 @@ pacman :
-Sc Clean packages cache
-Rns <> Remove program, its unused dependencies, and config files
-Qi <> Package information
-Fo <file> Which package the file belongs to
-Ql <> List files owned by package
-Qo <file> Which package the file belongs to
-Qs <> Search install packages
Recover installed packages from /var/log/pacman.log
(awk '$3 ~ /installed/{print $4}' /var/log/pacman.log | sort | uniq; sed -En 's@.*/home/lhark/aur/(.*)/.*@\1@p' /var/log/pacman.log) | sort | uniq -u > package-list
@ -231,6 +234,9 @@ PDF :
convert [jpg|png|txt|pdf|...] output.pdf
# Might need to tweak /etc/ImageMagick-7/policy.xml
# https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
Create pdf from images losslessly:
pacman -S img2pdf
img2pdf -o <out.pdf> <in1.jpg..inN.jpg>
Fill form & annotate:
For well formatted interactive forms:
evince
@ -242,6 +248,7 @@ PDF :
inkscape
Batch mode with pdftk:
# http://www.myown1.com/linux/pdf_formfill.shtml
# https://blog.nemirwen.me/posts/batch-pdf-form-filling
Finding the fields:
# pdftk needs java-commons-lang
pdftk form.pdf dump_data_fields_utf8 > fields.flds
@ -254,11 +261,11 @@ PDF :
Filling the form:
pdftk form.pdf fill_form fields.fdf output filled_form.pdf
Generate a PDF quickly from Markdown:
Generate a PDF quickly from Markdown:
# tectonic is pretty nice as a "it just works" latex compiler
pandoc --pdf-engine=tectonic in.md -o out.pdf
Fill dynamic XFA forms on linux:
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
@ -306,6 +313,8 @@ Wallpapers :
center selection
etc.
Or use https://github.com/aearil/dustr in a loop
Drag & drop files:
dragon : https://github.com/mwh/dragon
@ -341,6 +350,9 @@ Network Manager:
Under IPv4:
select Shared
Chrony integration:
trizen -S https://aur.archlinux.org/networkmanager-dispatcher-chrony.git/
Power saving :
echo "vm.dirty_writeback_centisecs = 6000" >> /etc/sysctl.d/dirty.conf
echo "vm.laptop_mode = 5" >> /etc/sysctl.d/laptop.conf
@ -459,19 +471,18 @@ Borg backup:
Serial terminal
st -l /dev/ttyUSB0 <baud>
# Or
minicom -D /dev/ttyUSB0 -b <baud>
Wifi AP:
https://wiki.archlinux.org/index.php/Software_access_point
# https://wiki.archlinux.org/index.php/Software_access_point
sudo pacman -S create_ap
https://github.com/oblique/create_ap/issues/107
# https://github.com/oblique/create_ap/issues/107
sed -i '/CHANNEL=$WIFI_IFACE_CHANNEL/d' /usr/bin/create_ap
Replace is_wifi_connected with:
is_wifi_connected() { return 1 }
# Replace is_wifi_connected with:
# is_wifi_connected() { return 1 }
sudo create_ap [-c <channel>] wlp2s0 wlp2s0 <ssid> <pwd>
Sync from phone:
adb-sync -R /sdcard/<folder>/ <dest>
fail2ban unban:
Check if/where IP is banned
iptables -L -n | less
@ -485,33 +496,6 @@ fail2ban unban:
# Remove leading "-A "
iptables -D <rule>
Backup non rooted phone with adb:
adb backup -all -shared -obb -f <file>
need adb < 1.0.31
sometimes you might need to quote all arguments together
Root Samsung GT-S7275R "Ace 3" :
Use heimdall (cross platform equivalent to Samsung's Odin)
Install TWRP recovery:
Boot phone to download mode (Hold vol-down & home at boot)
Connect USB
$ heimdall flash --RECOVERY <recovery.img>
Keep vol-up & home pressed during reboot to go straight into recovery or img is overwritten by stock ROM
Flash CM13:
Use TWRP to Wipe system, data, dalvik & cache
$ adb push <cm13.zip> /sdcard
Use TWRP to flash CM13
Setup tips:
Activate dev mode by spamming Settings > About > Build
Enable USB debugging
Settings > Developer Options > Root Access
Sources:
https://forum.xda-developers.com/ace-3/development/recovery-t-r-p-samsung-galaxy-ace-3-lte-t2989278
https://web.archive.org/web/20160321062212/https://davideddu.org/blog/posts/how-to-flash-a-recovery-image-using-heimdall/
https://twrp.me/devices/samsunggalaxyace3.html
https://forum.xda-developers.com/ace-3/development/gt-s7275r-b-t-cyanogenmod-13-ace-3-lte-t3242054
https://forum.xda-developers.com/ace-3/development/gt-s7275r-b-t-cyanogenmod-14-samsung-t3468084
Nginx + uwsgi:
$ pacman -S nginx (nginx-runit) uwsgi uwsgi-plugin-python
/etc/
@ -568,25 +552,39 @@ Nginx + uwsgi:
runit:
echo "exec uwsgi --ini /etc/uwsgi/emperor.ini --logto /var/log/uwsgi.log" > /etc/sv/uwsgi/run
Easy LaTeX compilation:
LaTeX:
Easy LaTeX compilation:
$ trizen -S tectonic
$ tectonic <file>.tex
Should automatically resolve all dependencies
Also takes care of biblatex
Uses Xetex to compile
Subtle enby non-binary flag in latex:
# Thx @Scarlet
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}
\definecolor{nb1}{RGB}{255,244,48}
\definecolor{nb2}{RGB}{220,220,220}
\definecolor{nb3}{RGB}{156,89,209}
\definecolor{nb4}{RGB}{0,0,0}
\begin{center}
\crule[nb1]{0.5cm}{0.1cm}
\crule[nb2]{0.5cm}{0.1cm}
\crule[nb3]{0.5cm}{0.1cm}
\crule[nb4]{0.5cm}{0.1cm}
\end{center}
Rename files from date of creation:
for f in *;do
mv "$f" "$(date "+IMG_%Y%m%d_%H%M%S.${f##*.}" -r "$f")"
done
Dans le cas d'android, utiliser tar -cf pour garder les timestamps
In Android's case, use tar -cf to keep the timestamps
Deduplication de fichiers:
file deduplication:
find ./ -type f -exec md5sum '{}' + | tee imgmd5
cat imgmd5| sort | uniq --check-chars=32 -d | cut --characters=35- | xargs rm
# Pour le debug : | xargs feh -.
# Voir aussi la commande cmp, plus efficace qu'un calcul de hash dans certains cas
# For debugging : | xargs feh -.
# See also the `cmp` command, might be more efficient than a hash computation
Install and update YouCompleteMe on Arch:
sudo pacman -S clang cmake
@ -627,7 +625,8 @@ Install 64 bits kernel on 32 bits system (and 64 bits hardware) (bad idea)
Compile C for ATmega328p/Arduino:
sudo xbps-install -S avr-gcc avr-libc avrdude
sudo usermod -aG dialout <user> # Or /dev/ttyACM0 group
sudo pacman -S avr-libc avrdude
sudo usermod -aG dialout <user> # Or /dev/ttyACM0 group (might be uucp)
avr-gcc -g -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o <name>.o <name>.c
avr-gcc -mmcu=atmega328p <name>.o -o <name>
@ -676,15 +675,15 @@ Get hardware informations:
dmidecode -t memory
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
awk '/\.mp3/{f = $0;next} f{printf "mv %s \"../%s.mp3\"\n", f, $0; f=0}' ident > rename.sh
Echo to stderr
Echo to stderr:
>&2 echo "message"
Reset gpg-agent passphrase cache
Reset gpg-agent passphrase cache:
Useful mainly for testing purposes
echo RELOADAGENT | gpg-connect-agent
@ -703,84 +702,29 @@ Better Bibtex, Zotero:
Bumblebee runit fix:
sed -i 's/Driver=$/Driver=nvidia/' /etc/bumblebee/bumblebee.conf
Uncompress android .ab backup files:
Runit logging:
socklog
* syslogd replacement
* gets messages sent via syslog() (into /dev/log)
svlogd
* builtin log rotation
* needs to be setup for each service (/etc/runit/sv/<service>/log/run)
`exec chpst -u log svlogd -tt /var/log/<service>`
$ sudo mkdir /var/log/<service>
$ sudo chown -R :log /var/log/<service>
$ sudo chmod g+w /var/log/<service>
runsvdir
* sends its stdout to /dev/console
* sends its stderr to its own command line (ps aux | grep runsvdir)
runsv
* if <service>/log exists, redirects service's stdout to logger's stdin
* by default, runsv's stderr, stdout (and stdin?) are redirected to /dev/console
Android:
Uncompress android .ab backup files:
# https://stackoverflow.com/questions/18533567/how-to-extract-or-unpack-an-ab-file-android-backup-file
( printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 backup.ab ) | tar xfvz -
Fix: Failed to activate service 'org.freedesktop.login1': timed out:
If dbus has been restarted, don't forget to restart elogind/systemd-logind
Artix:
Artixlinux pacman gpg unknown trust fix:
sudo pacman-key --init
sudo pacman-key --populate archlinux artix
Or if it's an old system:
sudo pacman -S archlinux-keyring
Artixlinux steam lib32-systemd fix:
https://forum.artixlinux.org/index.php/topic,633.msg7437.html
[Attached file]: resources/lib32-systemd-dummy.pkgbuild
Open-rc keymap:
/etc/conf.d/keymaps
LibreOffice unlock write-protected doc:
Format -> Sections... -> [Uncheck Protect in "Write protection"]
Euro truck simulator 2:
Enable additional beams (roof, bumper, etc.)
<F4> then tick "Roof" and "Aux"
Run ETS2Studio under wine
winetricks dotnet45
Confirmed to work on a 32 bits prefix, untested on 64
ssh:
get machine fingerprints:
Local
find /etc/ssh/ -name "ssh_host_*.pub" -exec ssh-keygen -lf '{}' \;
Remote
ssh-keyscan <hostname> 2>/dev/null | ssh-keygen -lf /dev/stdin
Generate secure keypairs
# https://security.stackexchange.com/a/144044
Elliptic curve: best but maybe not supported everywhere
ssh-keygen -t ed25519 -a 100
Good ol' RSA, with 4096 bits for good measure
ssh-keygen -t rsa -b 4096 -o -a 100
Run MSVC on linux with Wine:
As seen on the internet, not tested:
https://hackernoon.com/a-c-hello-world-and-a-glass-of-wine-oh-my-263434c0b8ad
Also this docker atrocity:
https://github.com/mstorsjo/msvc-wine
/!\ You need to get the original files from a windows machine/VM
Simple python HTTP server:
Supports --help option
python3:
python -m http.server [port]
python2:
python -m SimpleHTTPServer [port]
Elegant deduplication lines in file:
https://iridakos.com/how-to/2019/05/16/remove-duplicate-lines-preserving-order-linux.html
awk '!visited[$0]++' your_file > deduplicated_file
Run studiotax on wine:
http://pnijjar.freeshell.org/2018/studiotax/
WINEARCH=win32
winetricks settings win7 # Might not be necessary
winetricks dlls dotnet45 ie6
winetricks settings win7
wine ./StudioTax2017Install.exe /extract
msiexec /i StudioTax.msi
Easily switch to russian phonetic keyboard:
setxkbmap fr,ru -variant ,phonetic -option grp:shift_caps_toggle
man xkeyboard-config # get list of possible toggles
Image/photo sorting with feh:
feh --action1 'mv -v %F "/path/to/target/"%N' \
--action[2-9] [...] /dir/to/sort
Setup udev for android device with adb:
Setup udev for android device with adb:
# Solves "adb: error: failed to get feature set: insufficient permissions for device"
# https://wiki.archlinux.org/index.php/Android_Debug_Bridge#Adding_udev_Rules
Get Vendor and and product IDs with
@ -798,33 +742,37 @@ Setup udev for android device with adb:
SUBSYSTEM=="usb",ATTR{idVendor}=="<your vendor id>",ATTR{idProduct}=="<your product id>",SYMLINK+="android_fastboot"
$ sudo udevadm control --reload-rules
Get original windows key from linux:
# From: https://twitter.com/BrandonPrry/status/1038269038881898498
# Not guaranted to work
sudo cat /sys/firmware/acpi/tables/MSDM | tail -c 32 | xargs -0 echo
Setup android emulator:
trizen -S android-emulator \
android-google-apis-x86-system-image-23 \
android-sdk-cmdline-tools-latest # Some tools are borked in the original package
source /etc/profile # Update PATH
# avdmanager will complain about permissions at first start but will
# happily put AVDs in /root/.android/avd if you let it have it for too long
/opt/android-sdk/cmdline-tools/latest/bin/avdmanager create avd \
--force \
--name <your AVD name> \
--package 'system-images;android-23;google_apis;x86' # Match path in /opt/android-sdk/system-images/
# AVD is stored in ~/.android/avd/
# Enable using the hardware keyboard, and switch layout to azerty
sed -i -e 's/\(hw.keyboard=\).*/\1yes/' \
-e 's/\(hw.keyboard.charmap=\).*/\1azerty/' \
~/.android/avd/<your AVD name>.avd/config.ini
# If you have issues running image from different arch, try checking the PATH or
# https://www.bram.us/2017/05/12/launching-the-android-emulator-from-the-command-line/
emulator -avd <your AVD name> [-camera-back <none|emulated|webcam0|virtualscene>]
Wayland install:
Qt issues:
sudo pacman -S qt5-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
# Other method, never tried: https://acavalin.com/p/android_emu
MSI ge62 webcam not found:
Activate using fn+F6
Air Canada PNR access:
https://services.aircanada.com/ServicingPNR/Ancillary/ACO/
Android diagnostic debug phone codes:
Android diagnostic debug phone codes:
# https://www.itworld.com/article/2708985/debug-your-phone-with-these-hidden-android-secret-codes.html
# https://www.redmondpie.com/hidden-android-secret-codes-for-samsung-htc-motorola-sony-lg-and-other-devices/
Confirmed working on Samsung Galaxy Ace 3:
*#06# IMEI number
*#0*# Enter the service menu on newer phones like Galaxy S III
*#*#4636#*#* Phone information, usage statistics and battery
*#0*# Enter the service menu on newer phones like Galaxy S III
*#*#34971539#*#* Detailed camera information
*#*#273282*255*663282*#*#* Immediate backup of all media files
*#*#197328640#*#* Enable test mode for service
@ -872,9 +820,156 @@ Android diagnostic debug phone codes:
##3282# Show EPST menu
##786# Reverse Logistics Support
Android wpa_supplicant conf file path:
Android wpa_supplicant conf file path:
/data/misc/wifi/wpa_supplicant.conf
Sync from phone:
adb-sync -R /sdcard/<folder>/ <dest>
Backup non rooted phone with adb:
adb backup -all -shared -obb -f <file>
need adb < 1.0.31
sometimes you might need to quote all arguments together
Root Samsung GT-S7275R "Ace 3" :
Use heimdall (cross platform equivalent to Samsung's Odin)
Install TWRP recovery:
Boot phone to download mode (Hold vol-down & home at boot)
Connect USB
$ heimdall flash --RECOVERY <recovery.img>
Keep vol-up & home pressed during reboot to go straight into recovery or img is overwritten by stock ROM
Flash CM13:
Use TWRP to Wipe system, data, dalvik & cache
$ adb push <cm13.zip> /sdcard
Use TWRP to flash CM13
Setup tips:
Activate dev mode by spamming Settings > About > Build
Enable USB debugging
Settings > Developer Options > Root Access
Sources:
https://forum.xda-developers.com/ace-3/development/recovery-t-r-p-samsung-galaxy-ace-3-lte-t2989278
https://web.archive.org/web/20160321062212/https://davideddu.org/blog/posts/how-to-flash-a-recovery-image-using-heimdall/
https://twrp.me/devices/samsunggalaxyace3.html
https://forum.xda-developers.com/ace-3/development/gt-s7275r-b-t-cyanogenmod-13-ace-3-lte-t3242054
https://forum.xda-developers.com/ace-3/development/gt-s7275r-b-t-cyanogenmod-14-samsung-t3468084
Update Emojis on old androids:
# https://toot.party/@SigmaOne/106159205703917847
Custom NotoColorEmoji.ttf in /system/fonts/
Fix: Failed to activate service 'org.freedesktop.login1': timed out:
If dbus has been restarted, don't forget to restart elogind/systemd-logind
Artix:
Artixlinux pacman gpg unknown trust fix:
sudo pacman-key --init
sudo pacman-key --populate archlinux artix
Or if it's an old system:
sudo pacman -S archlinux-keyring
Artixlinux steam lib32-systemd fix:
https://forum.artixlinux.org/index.php/topic,633.msg7437.html
[Attached file]: resources/lib32-systemd-dummy.pkgbuild
Open-rc keymap:
/etc/conf.d/keymaps
LibreOffice unlock write-protected doc:
Format -> Sections... -> [Uncheck Protect in "Write protection"]
Euro truck simulator 2:
Enable additional beams (roof, bumper, etc.)
<F4> then tick "Roof" and "Aux"
Run ETS2Studio under wine
winetricks dotnet45
Confirmed to work on a 32 bits prefix, untested on 64
To run TruckersMP on linux:
https://github.com/truckersmp-cli/truckersmp-cli
ssh:
get machine fingerprints:
Local
find /etc/ssh/ -name "ssh_host_*.pub" -exec ssh-keygen -lf '{}' \;
Remote
ssh-keyscan <hostname> 2>/dev/null | ssh-keygen -lf /dev/stdin
Generate secure keypairs
# https://security.stackexchange.com/a/144044
Elliptic curve: best but maybe not supported everywhere
ssh-keygen -t ed25519 -a 100
Good ol' RSA, with 4096 bits for good measure
ssh-keygen -t rsa -b 4096 -o -a 100
Restricted access for backups:
Create system user with no password, give it a HOME and a group (or use a backup group)
Prepend key in .ssh/authorized_keys with
command="scp -f /path/to/<file|wildcard>",no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding ssh-rsa AAAAB[...]
Setup rssh
pacman -S rssh
# Access bits order: rsync, rdist, cvs, sftp, scp, svnserve
echo "user=<backup user>:<umask>:000010:" >> /etc/rssh.conf
sudo chsh -s /usr/bin/rssh <backup user>
Fix key auth:
chmod 700 ~/.ssh/
chmod 600 ~/.ssh/authorized_keys
Allow connections from behind a NAT:
from NAT-ed machine:
ssh -R 2222:localhost:22 <user>@<server>
from server:
ssh -p 2222 <user>@127.0.0.1
Run MSVC on linux with Wine:
As seen on the internet, not tested:
https://hackernoon.com/a-c-hello-world-and-a-glass-of-wine-oh-my-263434c0b8ad
Also this docker atrocity:
https://github.com/mstorsjo/msvc-wine
/!\ You need to get the original files from a windows machine/VM
Simple python HTTP server:
Supports --help option
python3:
python -m http.server [port]
python2:
python -m SimpleHTTPServer [port]
Elegant deduplication lines in file:
https://iridakos.com/how-to/2019/05/16/remove-duplicate-lines-preserving-order-linux.html
awk '!visited[$0]++' your_file > deduplicated_file
Run studiotax on wine:
http://pnijjar.freeshell.org/2018/studiotax/
WINEARCH=win32
winetricks settings win7 # Might not be necessary
winetricks dlls dotnet45 ie6
winetricks settings win7
wine ./StudioTax2017Install.exe /extract
msiexec /i StudioTax.msi
Easily switch to russian phonetic keyboard:
setxkbmap fr,ru -variant ,phonetic -option grp:shift_caps_toggle
man xkeyboard-config # get list of possible toggles
Image/photo sorting with feh:
feh --action1 'mv -v %F "/path/to/target/"%N' \
--action[2-9] [...] /dir/to/sort
Get original windows key from linux:
# From: https://twitter.com/BrandonPrry/status/1038269038881898498
# Not guaranted to work
sudo cat /sys/firmware/acpi/tables/MSDM | tail -c 32 | xargs -0 echo
Wayland install:
Qt issues:
sudo pacman -S qt5-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:
Activate using fn+F6
Air Canada PNR access:
https://services.aircanada.com/ServicingPNR/Ancillary/ACO/
Grub2 theme customization:
theme.txt reference:
http://wiki.rosalab.ru/en/index.php/Grub2_theme_/_reference#Main_file_syntax
@ -889,7 +984,7 @@ Limit bandwidth, download/upload speed of process:
XferCommand = /usr/bin/wget --limit-rate 100K --passive-ftp -c -O %o %u
Qutebrowser
Adblocking:
Adblocking (obsolete, now builtin):
https://gitlab.com/jgkamat/jblock
Config:
:set auto-save.session true
@ -997,9 +1092,12 @@ Check for available package updates with Arch/Artix:
sudo pacman -S pacman-contrib
checkupdates
Git push and pull using different URL/protocols:
Git:
Git push and pull using different URL/protocols:
# https://www.scivision.dev/git-pull-https-push-ssh/
git config url."git@example.org:user/".pushInsteadOf "https://example.org/user/"
Prevent git from trying to auto-detect user name and email:
user.useConfigOnly = true
Setup a midi synth:
# http://www.tedfelix.com/linux/linux-midi.html
@ -1061,3 +1159,76 @@ GPG:
Windows use realtime clock as UTC:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal = QWORD 0x01
sway / wayland:
Get current active (first) keyboard layout name:
# https://queer.hacktivis.me/objects/73823f56-1954-44fe-b046-39e726cca67b
swaymsg -t get_inputs | jq 'map(select(.type == "keyboard"))[0].xkb_active_layout_name'
Bluetooth:
Get access to deprecated gatttool, hcitool or sdptool:
trizen -S bluez-utils-compat
Add `--disable-systemd` to ./configure command on Artix
Setup new device with bluetoothctl:
# https://wiki.archlinux.org/title/Bluetooth#Pairing
bluetoothctl
[bluetooth]# power on
[bluetooth]# scan on
[bluetooth]# pair <MAC>
Fix `Failed to connect: org.bluez.Error.Failed`:
# In my case it was apparently pulseaudio's fault oO
sudo pacman -S pulseaudio-bluetooth
pactl load-module module-bluetooth-discover
Send files (WIP, still not working here):
# https://www.garron.me/en/go2linux/how-transfer-files-bluetooth-linux.html
# https://wiki.archlinux.org/title/ObexFTP
OBEX Object Push method:
trizen -S obexftp
sdptool search --bdaddr 00:18:31:12:3A:3F OPUSH | grep -i channel
# `--nopath --noconn --uuid none` result in making an Obex Push request
obexftp --nopath --noconn --uuid none --bluetooth <MAC> --channel <CHANNEL> --put <FILE>
OBEX File Transfer method:
trizen -S obexftp
sdptool search --bdaddr 00:18:31:12:3A:3F FTP | grep -i channel
# `--channel` (and so sdptool search) might be superfluous (autodetect?)
obexftp --bluetooth <MAC> --channel <CHANNEL> --put <FILE>
Blueman method:
sudo pacman -S blueman
blueman-sendto --device=<MAC> <FILE>
# Also, for the GUI:
blueman-manager
ussp-push method:
trizen -S ussp-push
ussp-push <MAC> <LOCAL FILE> <REMOTE FILE NAME>
Receive files:
# https://gitlab.com/obexpushd/mainline
# Not even packaged on the AUR for now
Bluetooth tools recap' (2007):
# https://hanishkvc.wordpress.com/2007/05/16/short-and-simple-commandline-bluetooth-in-any-new-linux-distros/
Extract debian .deb package:
ar x <package>.deb
tar xf data.tar.xz
Convert docx to text format in CLI:
# Better fidelity wrt. the document layout
docx2txt <name>.docx
# Can output markdown
pandoc <name>.docx -o <name>.md
Flash BIOS using CH341A and SOP8 clip:
Hardware setup:
/!\ Don't connect USB before everything else is plugged-in correctly
/!\ Remove all source of alimentation from the target board (power jack AND battery)
Connect clip to EEPROM: red wire is pin 1
Connect clip to CH341A: use the SPI/BIOS side of the programmer
Reading firmware:
sudo pacman -S flashrom
# Flashrom list of supported chips: https://www.flashrom.org/Supported_hardware
# https://wiki.archlinux.org/title/Flashing_BIOS_from_Linux#Flashrom
sudo flashrom --programmer ch341a_spi -r backup1.bin
sudo flashrom --programmer ch341a_spi -r backup2.bin
# Check we got a correct read
cmp backup1.bin backup2.bin
Flashing firmware:
sudo flashrom --programmer ch341a_spi -w <new_firmware.bin>

View file

@ -6,6 +6,7 @@ NORMAL MODE
<C-W>[HJKL] Move split to extreme left, bottom, top, right
c% Replace argument with arbitrary nested paren/brackets/etc...
https://thepugautomatic.com/2014/03/vims-life-changing-c-percent/
g<C-G> count words
VISUAL MODE
<C-V>g<C-A/X> Convert column of identical number to inc/decrementing list