This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dnf install tigervnc-server | |
| sed -e 's/<USER>/username/g' /lib/systemd/system/[email protected] >/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 {}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -type f -exec ls --full-time {} + | sort -k 6,7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder