Monday, October 5, 2020

SSL notes

 Android CA paths

system

/system/etc/security/cacerts

System CA Certificates in Android are stored by the name of their hash, with a ‘0’ as extension.
Rename the CA certificate:
$ MY_CA_CERT=my-ca-cert.pem
$ cp $MY_CA_CERT $(openssl x509 -inform PEM -subject_hash_old -in $MY_CA_CERT | head -1).0

user

/data/misc/keystore/user_0


References:

Tuesday, September 22, 2020

Garmin SubMusic (on Ubuntu 18.04)

  1. Install dependencies
  2. Install Nextcloud
  3. Install Music
  4. Install Ampache
  5. Install Garmin SubMusic

Nextcloud

Reference guide

Nextcloud 19 dependencies:
  • PHP >=7.2
  • MySQL/MariaDB
  • Nginx
Ampache dependencies:
  • PHP >=7.2
  • MySQL/MariaDB
  • Nginx
  • Composer

Thursday, July 2, 2020

Run GUI application from chroot

xhost +local:
sudo chroot /mnt
export DISPLAY=:0
gedit

Wednesday, June 17, 2020

Gedit transparent background

Some gnome applications (usual ones: gedit, gnome-calculator) can suddenly get looking incorrect (transparent background, visual artifacts, etc).

The reason could be a change in:
- Settings => Region & Language => Manage Installed Languages => Keyboard input method system
- Language Support => Keyboard input method system

Solution:

- remove ~/.xinputrc
- reboot

`Error! Could not locate dkms.conf file`

- adapt /usr/sbin/dkms script 

to be more informative when error logging. You can change the line 527 (or similar on your system):

[[ -r $read_conf_file ]] || die 4 $"Could not locate dkms.conf file." \

to something like

[[ -r $read_conf_file ]] || die 4 $"Could not locate $read_conf_file file." \

to see where exactly is the problem located.

- dkms status

There should be valid output, without error messages.
If any dkms.conf file is not found:
- investigate sources and configs existing in the system (see commands below)
- remove "bad" modules (e.g. sudo rm -rf /var/lib/dkms/nvidia/)
- rebuild existing dkms modules

- ls -l /var/lib/dkms

to know what dkms modules are in the system

- ls /usr/src/*/dkms.conf

check existing dkms config files

sudo dpkg-reconfigure virtualbox-dkms

rebuild dkms modules (here is `virtualbox-dkms` as an example)

Monday, May 11, 2020

Add an existing sub-directory as a git submodule

Use case:

- there is a project directory with an initialized git repo inside
- there is a sub-directory with another initialized git repo inside

Goal:

add the subdirectory as a git submodule to the root project repo

Steps:

  1. Add the submodule's url to .gitmodules and to .git/config with
    git submodule add --name <submodule_name> <url> <path_to_subdir>
  2. Move the submodule's $GIT_DIR directory (.git in regular repositories) to .git/modules/<path> with
    git submodule absorbgitdirs <path_to_subdir>

Monday, April 13, 2020

Run a GUI app with sudo

Use pkexec as a GUI alternative for sudo.

A krusader's custom action as an examle:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /bin/bash -c "cryptsetup open --allow-discards /dev/sdb7 data -d /key && mount /dev/mapper/data /media/user/data"; %aGoto("/media/user")%

Thursday, April 2, 2020

Clear systemd journal

examples are taken here

Systemd stores its logs in /var/log/journal.
$ du -hs /var/log/journal/
4.1G    /var/log/journal/
Check the oldest logs date:
$ ls -lath /var/log/journal/*/ | tail -n 2
-rw-r-x---+ 1 root systemd-journal 8.0M Dec 24 05:15 user-xxx.journal

Clear by date: older than X days

Clearing everything older than 10 days:
$ journalctl --vacuum-time=10d
...
Vacuuming done, freed 2.3G of archived journals on disk.

Clear by size: if they exceed X storage

Clearing everything that exceeds 2GB size:
$ journalctl --vacuum-size=2G
...
Vacuuming done, freed 720.0M of archived journals on disk.