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
[InnoDB] Tablespace 1, name ‘sys/sys_config’, file ‘./sys/sys_config.ibd’ is missing!
su - mysql -s /bin/bash
mysqld_safe --upgrade=MINIMAL --skip-grant-tables --skip-networking
mysql> DROP DATABASE sys;
ERROR 3679 (HY000): Schema directory './sys/' does not exist
mkdir /var/lib/mysql/sys
chown mysql:mysql /var/lib/mysql/sys
mysql> drop database sys;
Query OK, 101 rows affected (0.03 sec)
upgrade postgres 15 -> 16
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
apt update
apt install postgresql-16
pg_dropcluster --stop 16 main
pg_upgradecluster --method=upgrade --link 15 main
pg_lsclusters
15 main 5433 down postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log
16 main 5432 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postgresql-16-main.log
nodejs serve directory
npx http-server -o /path/to/static/content
locust
An open source load testing tool.
Define user behaviour with Python code, and swarm your system with millions of simultaneous users
rabbitmq list total queue sorted
# Print total number of messages in all queues
rabbitmqctl list_queues | awk ‘{s+=$2} END {print s}’
# List all queues, sorted by number of queued messages in descending order
rabbitmqctl list_queues | sort -nr -k2 | less
make RAM load linux
head -c 1G /dev/zero | tail
generate cpu load linux
openssl speed -multi $(nproc --all)
openssl speed -multi $(grep -ci processor /proc/cpuinfo)
linux make website read only
find /some/path/ \( -type f -exec chmod a=r {} \; \) -o \( -type d -exec chmod a=rx {} \; \)
many php extensions at once
apt install php7.2-{mysql,curl,json,xsl,gd,xml,zip,xsl,soap,bcmath,mbstring,gettext,imagick}
wireguard-ui without docker
wget wireguard-ui:
https://github.com/ngoduykhanh/wireguard-ui/releases
tar -xvzf wireguard-ui-*.tar.gz
mkdir /opt/wireguard-ui
mv wireguard-ui /opt/wireguard-ui/
vim /opt/wireguard-ui/.env
SESSION_SECRET=
WGUI_USERNAME=
WGUI_PASSWORD=
vim /opt/wireguard-ui/postup.sh
#!/usr/bin/bash
# /opt/wireguard-ui/postup.sh
ufw route allow in on wg0 out on eth0
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
vim /opt/wireguard-ui/postdown.sh
#!/usr/bin/bash
# /opt/wireguard-ui/postdown.sh
ufw route delete allow in on wg0 out on eth0
iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
chmod +x /opt/wireguard-ui/post*.sh
vim /etc/systemd/system/wireguard-ui-daemon.service
[Unit]
Description=WireGuard UI Daemon
Wants=network-online.target
After=network-online.target
[Service]
User=root
Group=root
Type=simple
systemctl daemon-reload
systemctl start wireguard-ui-daemon.service
vim /etc/systemd/system/wgui.service
[Unit]
Description=Restart WireGuard
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart [email protected]
[Install]
RequiredBy=wgui.path
vim /etc/systemd/system/wgui.path
[Unit]
Description=Watch /etc/wireguard/wg0.conf for changes
[Path]
PathModified=/etc/wireguard/wg0.conf
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable wgui.{path,service}
systemctl start wgui.{path,service}
Nginx proxy:
add_header Cache-Control no-cache;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:5000/;
kibana add enrollment token cli
bin/kibana-setup --enrollment-token
PMM
Percona Monitoring and Management (PMM) is an open-source database monitoring, management, and observability solution for MySQL, PostgreSQL, and MongoDB.
mysql dump triggers only
mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt my_db > ~/my_db_triggers.sql