Skip to content

Instantly share code, notes, and snippets.

View ramingar's full-sized avatar
:octocat:
Not a PRO user

Rafael Minguet ramingar

:octocat:
Not a PRO user
View GitHub Profile
@ramingar
ramingar / percona-server-backup-restore-podman.md
Last active September 3, 2025 16:12
Start a Percona Server on a Podman container and make/restore backups with xtrabackup
# create the percona-server container
podman volume create percona-apiprejobs-data
podman volume create percona-apiprejobs-logs
podman run --replace --name percona-apiprejobs   -p 3306:3306 -v percona-apiprejobs-data:/var/lib/mysql  -v percona-apiprejobs-logs:/var/log/mysql     -e MYSQL_ROOT_PASSWORD=zzzzzzzz  -e MYSQL_USER=user -e MYSQL_PASSWORD=xxxxxxx  -d percona/percona-server:8.0 --bind-address=0.0.0.0

You will need a user with some special permissions:

@ramingar
ramingar / force-stop-container.md
Created August 29, 2025 10:17
Force to stop a container
podman inspect <container id|name> | grep Pid
ps -fp <PID>
kill -9 <PID>

# to verify:
ps -o pid,stat,cmd -p <PID>
@ramingar
ramingar / create-ssl-san.md
Created August 28, 2025 21:32
Crear certificado SSL con SAN (Subject Alternative Name)
  1. Creamos el archivo de configuración del SAN

Por ejemplo san.cnfs

[ req ]
default_bits       = 2048
prompt             = no
default_md         = sha256
req_extensions = req_ext
@ramingar
ramingar / create-servicio-systemd-rootless.md
Created August 28, 2025 21:25
Crear servicio systemd en modo usuario - para podman y para clickhouse
  1. Crear el directorio de servicios de usuario (si no existe)
mkdir -p ~/.config/systemd/user/
  1. Crear el archivo del servicio
cat > ~/.config/systemd/user/portainer.service << 'EOF'
[Unit]
@ramingar
ramingar / expand-space.md
Last active August 21, 2025 15:59
Expand unallocated space on root server
df -h
image
sudo lsblk
image
@ramingar
ramingar / clickhouse-ssl-access.md
Last active August 13, 2025 10:22
How to set up clickhouse to use SSL connections with self-signed certs
  • Generate the CA and self-signed certs
openssl req -new -x509 -days 3650 -keyout ca.key -out ca.crt
openssl req -newkey rsa:2048 -nodes -keyout node.key -out node.csr
openssl x509 -req -in node.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out node.crt -days 365
  • Put the certs in /etc/clickhouse-server/certs/ and adjust the permissions

  • Set up your Clickhouse server

@ramingar
ramingar / useradd.md
Created August 11, 2025 16:27
Useradd with home dir, bash login and sudo

Command to create a new user with a home dir, bash login shell and the ability to sudo

sudo useradd -m -s $(which bash) -G sudo <USERNAME>
@ramingar
ramingar / pwa-flatpak-not-write-access.md
Last active August 4, 2025 21:33
PWAs: This Flatpak does not have write access to...

Error:

This Flatpak does not have write access to ~/.local/share/applications and ~/.local/share/icons, so it cannot install or uninstall PWAs.
Once you grant access to those two directories (Flatseal is the easiest method), you can attempt to re-create the shortcuts from chrome://apps.
Close.

Solution:

flatpak override --user --filesystem=~/.local/share/applications --filesystem=~/.local/share/icons com.google.Chrome # or your preferred browser 
@ramingar
ramingar / change-name-udev-rule.md
Last active December 29, 2024 14:54
Change a device name using udev rules and check its information #udev #device #ubuntu
  • create the rule:
$ sudo nano /etc/udev/rules.d/99-persistent-usb-serial.rules

# write/append following line:
ATTRS{idVendor}=="0457", ATTRS{idProduct}=="0819", ATTRS{busnum}=="1", ATTRS{devnum}=="2", SYMLINK+="touchscreen1", MODE="0666", OWNER=":YOUR_USER"
  • get the variabled as follow:
@ramingar
ramingar / assign-device-touchscreen.md
Created December 29, 2024 13:03
Assign some device as a touchscreen using gsettings on Ubuntu 24.04 Gnome Wayland #ubuntu #24.04 #gsettings #gnome #wayland
  • gsetting assigning a device as a touchscreen
gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/:ID/ output "[':VENDOR', ':PRODUCT', ':SERIAL']"

# example:
gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/0457:0819/ output "['CMN', '0x1626', '0x00000000']"
  • how to get :ID