Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
_fileloc=$HOME/lqxcheck #Where to keep the pkgs
_CHROOT=$HOME/chroot #Where do you want the chroot
_nproc=$(nproc) #How many threads to compile on
if [[ $EUID -ne 0 ]]; then
echo "Give me the root password:"
sudo echo "Thanks"
fi
@xnumad
xnumad / whatsapp-backup.md
Created October 22, 2019 22:45
WhatsApp message backup and restore process

If you activate WhatsApp (verifying your phone number) while having a /sdcard/WhatsApp/Databases/msgstore.db.crypt12 file present AND have a WhatsApp backup on Google Drive, WhatsApp will claim to restore your Google Drive backup (with your consent), but it only restores the media files from Google Drive but at no occassion the msgstore.db.crypt12. It won't merge your local backup and the cloud backup databases!

With local WhatsApp media files it will only offer to restore the local backup at activation but not the one from Google Drive, hence the need for an empty /sdcard/WhatsApp/Media/ folder. But with a local chat backup, the Google Drive backup restore process just imports media only anyways.

Ways to get to the key file to decrypt the *.crypt12 DBs:

  • either access /data/data/com.whatsapp/files/key with root permissions
  • OR adb backup com.whatsapp and extract the key from the .ab file

I have extracted the key and found out that it's the same for all my devices (*I always tested wi

@xnumad
xnumad / plasmashell-autostart.md
Created August 4, 2019 01:40
KDE Plasma login doesn't automatically start plasmashell

Problem

  • Plasmashell doesn't start automatically after log-in
  • [optional] Windows of applications of previous sessions are restored which indicates that kwin loads/starts and is working automatically.
  • Condition: Manually executing kstart5 plasmashell works as intended. If this is not the case, the solution will very likely not help you!

Solution

Open "System Settings -> Startup and Shutdown -> Autostart -> Add Program" and add plasmashell (manually write it into the text field in the dialog window). (File saved in ~/.config/autostart)

Cause

The old autostart file only had the content

@xnumad
xnumad / dig-clean.md
Last active August 3, 2019 14:14
Clean dig for CSV (coherent/consistent) parsing

Problem

dig sometimes uses double tabs which is only good for visually viewing lookups of short to medium-length hostnames, but it is bad for reusing the values as in parsing them like a CSV file into a table.

Solution

To prevent the double use of tabs, you can pipe as follows:

dig <host> | sed --quiet 's/[\t ]\+/\t/gp'

Explanation

pipe/forward it to sed and let it replace one or more (greedy) tab or space with a single tab

@xnumad
xnumad / list-file-compare.sh
Last active May 1, 2020 22:00
Check if files in list (TXT) do exist (and which files don't exist)
#!/bin/bash
input="$1" #The file to read from given as first argument
#File content looks like this:
#/a.txt
#/subdir/b.txt
#File needs to have a newline at the end to have the last line processed!
while IFS= read -r line #Repetitively read lines
do
@xnumad
xnumad / pre-installed-chrome-extensions
Last active April 16, 2024 10:22
Simplest way to get rid of pre-installed Chrome extensions
Sadly, the usual uninstallers of those programs DO NOT remove their "enforcement of pre-installing" extensions into Google Chrome web browser. ("Another program on your computer added an extension that may change the way Chrome works.")
This guidance only contains instructions for Google Chrome.
Enter about://extensions into the adress bar of Google Chrome.
Click on "Details" for the respective extension you want to stop from being pre-installed.
Copy the extension ID from the URL (the text after "id=").
Now remove all these in the registry existing keys at the following paths:
- HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\<id>
- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\<id>
- HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\Extensions\<id>
@xnumad
xnumad / linux-permanently-set-cpufreq-scaling_governor.md
Last active July 10, 2019 00:28
Linux permanently set cpufreq scaling_governor

Problem

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor contains "powersave" but the file scaling_available_governors in the same folder implies that a performance governor is available. Changing the contents of the first file will not persist reboots. Same applies for all (virtual) cpu cores named cpuX in /sys/devices/system/cpu/.

Solution

  1. Install the package cpufreqd (on Arch Linux via the AUR)

  2. Enable the service to start on boot

@xnumad
xnumad / kde-plasma-reset-favorites.md
Last active April 16, 2019 10:27
KDE Plasma reset favorites

Problem

Favorite applications in the start/application menu are missing in KDE Plasma and you can't add any as they won't appear as favorites.

Solution

Troubleshoot by running kbuildsycoca5 --noincremental in a terminal to read the output and repeat until there is no error. The approaches to different error types are listed below.

1. File is missing

Copy it from /etc/xdg/menus/:

@xnumad
xnumad / blogger-google+.md
Last active April 3, 2019 22:39
Blogger Google+ comments integration analysis

Blogger account linked with Google+ = Your Blogger account is linked to the respective (your) Google+ profile (both are in the same Google account and if you link them, Blogger automatically uses the Google+ profile in your Google account)

Blogger profile data = display name (changeable), profile photo (changeable, removable), publicly displayed email adress (changeable, hideable), username (unchangeable, the email adress of your Google account, not displayed publicly)

Blogger comment mode = Use Google+ Comments on this blog set to No

Google+ comment mode = Use Google+ Comments on this blog set to Yes

| Comment type | General note

@xnumad
xnumad / windows-visual-effects-smooth-scrolling-chromium.md
Last active August 13, 2019 13:34
Affect of Windows visual effects setting on smooth scrolling in Chromium

Command: sysdm.cpl ,3 -> Edit Visual Effects -> "Animate controls and elements inside windows"

off on
Chrome scrolling hard smooth

Firefox's behaviour is not affected by this setting but controlled by the "Use smooth scrolling" option in its browser options about:preferences#general