Skip to content

Instantly share code, notes, and snippets.

dnf install tigervnc-server
sed -e 's/<USER>/username/g' /lib/systemd/system/vncserver@.service >/etc/systemd/system/vncserver@:0.service
systemctl daemon-reload
systemctl enable vncserver@:0.service
systemctl start vncserver@:0.service
firewall-cmd --permanent --zone=public --add-port=5900/tcp
firewall-cmd --reload
cat <<EOF >/etc/gdm/custom.conf
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=username
DefaultSession=gnome-xorg.desktop
WaylandEnable=false
EOF
cat <<EOF >/etc/X11/xorg.conf.d/99-vmware.conf
Section "Monitor"
# Check version
sudo -u postgres psql -X -c "SELECT default_version, installed_version FROM pg_available_extensions WHERE name = 'timescaledb';" zabbix
# Update version
sudo -u postgres psql -X -c "ALTER EXTENSION timescaledb UPDATE;" zabbix
# Check hypertable size
SELECT * FROM hypertable_relation_size_pretty('hypertable');
# Check chunk size
# -*- coding: utf-8 -*-
import os
# These configuration keys can be specified more than once and create lists
KEYS_LIST = (
'lxc.apparmor.raw',
'lxc.cap.drop',
'lxc.cap.keep',
'lxc.environment',
import errno
import os
import subprocess
import sys
# Run command and immediately print output as it is generated
def passthru(cmd):
# Create stdout and stderr pseudoterminal pairs
stdout_master, stdout_slave = os.openpty()
stderr_master, stderr_slave = os.openpty()
IFACE=$(ip route get 1 | head -1 | awk '{print $5}')
echo "net.ipv6.conf.${IFACE}.disable_ipv6 = 1" >/etc/sysctl.d/60-disable-ipv6.conf
systemctl restart procps
echo "Disabled IPv6 on ${IFACE}"
mysql -NB information_schema -e "SELECT table_name FROM tables WHERE table_schema = 'yourdb' AND table_name like 'yourprefix_%'" | xargs -n 1 -I"{}" mysql dbname -e "DROP TABLE {}"
find . -type f -exec ls --full-time {} + | sort -k 6,7
youtube-dl --download-archive "archive.log" -i \
--add-metadata --all-subs --embed-subs --embed-thumbnail \
--match-filter "playlist_title != 'Liked videos' & playlist_title != 'Favorites'" \
-f "(bestvideo[vcodec^=av01][height>=1080][fps>30]/bestvideo[vcodec=vp9.2][height>=1080][fps>30]/bestvideo[vcodec=vp9][height>=1080][fps>30]/bestvideo[vcodec^=av01][height>=1080]/bestvideo[vcodec=vp9.2][height>=1080]/bestvideo[vcodec=vp9][height>=1080]/bestvideo[height>=1080]/bestvideo[vcodec^=av01][height>=720][fps>30]/bestvideo[vcodec=vp9.2][height>=720][fps>30]/bestvideo[vcodec=vp9][height>=720][fps>30]/bestvideo[vcodec^=av01][height>=720]/bestvideo[vcodec=vp9.2][height>=720]/bestvideo[vcodec=vp9][height>=720]/bestvideo[height>=720]/bestvideo)+(bestaudio[acodec=opus]/bestaudio)/best" \
--merge-output-format mkv \
-o "%cd%/%%(playlist_uploader)s/%%(playlist)s/%%(playlist_index)s - %%(title)s - %%(id)s.%%(ext)s" \
"[URL HERE TO CHANNELS PLAYLISTS]"
ipset -F cz.zone
ipset -N cz.zone nethash
for IP in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/cz.zone)
do ipset -A cz.zone $IP
echo $IP
done
iptables -A INPUT -m set --match-set cz.zone src -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP