Skip to content

Instantly share code, notes, and snippets.

View franciscocpg's full-sized avatar

Francisco Guimarães (chico) franciscocpg

View GitHub Profile
@franciscocpg
franciscocpg / README.md
Created April 24, 2023 16:47
No audio in garuda linux for electron-based apps

If you don't have audio for electron-based apps, go to the audio configuration, play a sound in the electron-based app and make sure the device isn't muted as below.

image

If it's muted, just unmute it.

image

If you are not seeing it, you may click in the Show inactive devices button.

@franciscocpg
franciscocpg / README.md
Last active January 25, 2023 01:52
Limit systemctl log

Edit the file below:

nano /etc/rsyslog.d/50-default.conf

Comment the line below:

#*.*;auth,authpriv.none         -/var/log/syslog
@franciscocpg
franciscocpg / README.md
Created December 17, 2022 01:22
Fix python root asdf

Edit sudoers file (eg: sudo nano /etc/sudoers) and uncomment the line below:

Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Reference to this solution

@franciscocpg
franciscocpg / README.md
Created December 13, 2022 12:24
Configure fingerprint in garuda linux

Full instructions here

Steps

  • Install fprint: yay -S fprint
  • Follow the Restrict enrolling instructions to make sure that only root users can add fingerprints
  • Add the line auth sufficient pam_fprintd.so to the beginning of the following files:
    • /etc/pam.d/sudo
    • /etc/pam.d/system-local-login
  • /etc/pam.d/kde
@franciscocpg
franciscocpg / README.md
Created December 12, 2022 12:34
auto mount LUKS device

Copied from https://www.golinuxcloud.com/mount-luks-encrypted-disk-partition-linux/

How to auto mount LUKS device (encrypted partition) using fstab in Linux

How LUKS Disk Encryption Works?

The entire block device can be encrypted using LUKS; it's well suited for protecting the data on removable storage media or the laptop disk drives LUKS Disk Encryption uses the existing device mapper kernel subsystem It also provides passphrase strengthening, which helps protect against dictionary attacks ALSO READ:

@franciscocpg
franciscocpg / README.md
Last active July 18, 2023 12:56
How to move the default /var/lib/docker to another directory for Docker on Linux

Take note that you can use this approach to move the /var/lib/docker directory to another disk or partition. Just make sure you create the destination directory in this new disk or partition.

  • Stop the server:
sudo systemctl stop docker
  • Create/edit the configuration at /etc/docker/daemon.json, for example:
{
@franciscocpg
franciscocpg / README.md
Last active August 26, 2021 14:11
Hack to manually trigger saving password in chrome

Go to a page that has a password input element and type the code below in the browser's console:

const cred = new PasswordCredential({
  id: 'id',
  password: 'password',
  name: 'name',
});

navigator.credentials.store(cred)
@franciscocpg
franciscocpg / README.md
Last active December 13, 2022 17:13
Install MacOS docker on arch

Installation

Install deps, configure kvm and reboot:

yay -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison edk2-ovmf xorg-xhost

sudo systemctl enable libvirtd.service
sudo systemctl enable virtlogd.service

echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
@franciscocpg
franciscocpg / Index size.sql
Created January 18, 2021 01:10
Postgres utils
SELECT
relname as "Table",
pg_size_pretty(pg_total_relation_size(relid)) As "Size",
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size",
indexrelname AS "Index",
pg_size_pretty(pg_total_relation_size(indexrelid)) As "Size",
pg_size_pretty(pg_total_relation_size(indexrelid) - pg_relation_size(indexrelid)) as "External Size"
FROM pg_catalog.pg_statio_user_indexes ORDER BY pg_total_relation_size(relid) DESC;
@franciscocpg
franciscocpg / fix-megasync-deepin.sh
Created August 28, 2020 12:05
Mega sync fix on Deepin
sudo sed -i -r '/^TryExec/d;s|^(Exec=).*$|\1env QT_SCALE_FACTOR=1 megasync|g' /usr/share/applications/megasync.desktop
sudo cp /usr/share/applications/megasync.desktop ~/.config/autostart/