Linux

Wireguard Clients isolation

This will block traffic between clients: ip6tables -I FORWARD -i wg0 -o wg0 -j REJECT –reject-with icmp6-adm-prohibited iptables -I FORWARD -i wg0 -o wg0 -j REJECT –reject-with icmp-admin-prohibited To disable isolation for single client: iptables -I FORWARD -i wg0 -s 10.0.0.3/32 -d 10.0.0.0/24 -j ACCEPT 10.0.0.3/32 – Single client IP...

Continue reading...

Thermal sensors

for i in /sys/class/thermal/thermal_zone[0-9]/temp /sys/class/hwmon/hwmon[0-9]/temp[0-9]_input /sys/devices/platform/coretemp.[0-9]/hwmon/hwmon[0-9]/temp[0-9]_input do [[ -e $i ]] && echo “$i : $(

Continue reading...

sysctl.conf

/etc/sysctl.conf net.ipv4.ip_forward=1 net.ipv4.conf.default.rp_filter=0 net.ipv4.conf.all.rp_filter=0 net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv4.conf.all.proxy_arp=1 sysctl -p

Continue reading...

Custom DocumentRoot for a Domain in DirectAdmin

If you need to permanently change Apache DocumentRoot for just a single domain, you should do this as Admin. Go to http://[domain]:2222/CMD_CUSTOM_HTTPD?domain=[domain] In the first window, under Only add the few lines of the VirtualHost you need to insert. Do not add a whole .. Add the following line: |?DOCROOT=/custom/document/root|...

Continue reading...

Directadmin increasing mysql limits script

#!/bin/sh #Limits (setting these options to 0 removes the limit) MAX_QUERIES_PER_HOUR=30000 MAX_UPDATES_PER_HOUR=20000 MAX_CONNECTIONS_PER_HOUR=5000 MAX_USER_CONNECTIONS=100 #We get DirectAdmin MySQL root user and password here DA_MYSQL=/usr/local/directadmin/conf/mysql.conf MYSQLUSER=`grep “^user=” ${DA_MYSQL} | cut -d= -f2` MYSQLPASSWORD=`grep “^passwd=” ${DA_MYSQL} | cut -d= -f2` mysql -e “use mysql; UPDATE mysql.user SET max_questions=${MAX_QUERIES_PER_HOUR}, max_updates=${MAX_UPDATES_PER_HOUR}, max_connections=${MAX_CONNECTIONS_PER_HOUR}, max_user_connections=${MAX_USER_CONNECTIONS} WHERE...

Continue reading...

IP Tunnel (GRE) in LXC proxmox Container

After container is created, you need to edit the configuration file to add the /dev/net/tun device. # pct config 123 arch: amd64 hostname: CT123 memory: 512 net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=FE:75:64:2A:A3:58,ip=dhcp,type=veth ostype: debian rootfs: local-lvm:vm-123-disk-0,size=4G features: nesting=1 swap: 512 unprivileged: 1 # nano /etc/pve/lxc/123.conf Add the following lines at the end (if you’re...

Continue reading...