apt install ansible
mkdir /etc/ansible ; cd $_
ansible-config init --disabled > ansible.cfg
ansible-config --version
Category Archives: linux
postgres show process list
\c postgres
SELECT *
FROM pg_stat_activity
WHERE datname = 'mydb';
Kill connections to database if you want:
SELECT
pg_terminate_backend (pid)
FROM
pg_stat_activity
WHERE
datname = 'mydb';
postgres rename database
su - postgres
psql
ALTER DATABASE oldb RENAME TO newdb;
postgresql import gz
su - postgres
gunzip < /tmp/db.sql.gz | psql mydb
ubuntu 24 install postgresql 17
apt install postgresql-common
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
apt update && apt upgrade
apt install postgresql-17
pg_ctlcluster 17 main start
pg_ctlcluster 17 main status
pg_ctl: server is running (PID: 1028)
/usr/lib/postgresql/17/bin/postgres "-D" "/var/lib/postgresql/17/main" "-c" "config_file=/etc/postgresql/17/main/postgresql.conf"
vim /etc/postgresql/17/main/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::/0 md5
vim /etc/postgresql/17/main/postgresql.conf
listen_addresses = '*'
pg_ctlcluster 17 main restart
posthog plugin server ยท node error
Error: Encryption keys are not set\n at new EncryptedFields (/code/plugin-server/dist/cdp/encryption-utils.js:10:19)\n at createHub (/code/plugin-server/dist/utils/db/hub.js:183:26)\n at async setupHub (/code/plugin-server/dist/main/pluginsServer.js:156:34)
bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"
Try older release instead of latest: d009c8a5b3e1310947711f543ebd2ee63984a1bc
update minikube
minikube update-check
CurrentVersion: v1.27.0
LatestVersion: v1.34.0
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube update-check
CurrentVersion: v1.34.0
LatestVersion: v1.34.0
docker show startup policies
docker container ls -q | \
xargs docker container inspect --format \
'{{ .Name }}: {{.HostConfig.RestartPolicy.Name}}'
grep text wrapped by quotes
echo '"Test"' | cut -d '"' -f 2
VMware Tools is not installed on this virtual machine.
ubuntu install vmware tools
apt-get install open-vm-tools
systemctl enable --now open-vm-tools
docker list ip addresses
docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
borg backup home
mkdir /backups/home
borg init –encryption=none /backups/home
Easy script for /home:
#!/usr/bin/env bash
borg create -v --stats \
/backups/home::'{now:%Y-%m-%d_%H:%M}' \
/home
borg prune -v --list --keep-daily=7 /backups/home
borg compact /backups/home
do-release-upgrade auto answear all questions
do-release-upgrade -f DistUpgradeViewNonInteractive
system restart required reason
xargs apt-get changelog < /var/run/reboot-required.pkgs
zabbix proxy sqlite
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
apt update
apt install zabbix-proxy-sqlite3 zabbix-sql-scripts
mkdir /var/lib/sqlite
sqlite3 /var/lib/sqlite/zabbix.db < /usr/share/zabbix-sql-scripts/sqlite3/proxy.sql
chown -R zabbix:zabbix /var/lib/sqlite
cat /etc/zabbix/zabbix_proxy.conf | grep ^DBName
DBName=/var/lib/sqlite/zabbix.db
/etc/init.d/zabbix-proxy start