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
| # show routes used for bestpath, multipath from bgp peers | |
| show ip bgp neighbors | include BGP neighbor is|Used as | |
| # show interfaces with Proxy ARP enabled | |
| sh ip int | incl is up|Proxy ARP is enabled | |
| # show interfaces with IP unreachables enabled | |
| sh ip interface | incl is up|ICMP unreachables are always sent | |
| # clean interface config/set default |
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
| #!/bin/bash | |
| # change ip address for accounts (included DNS records) | |
| grep $OLD_IP /var/cpanel/users/* | cut -d: -f1 | xargs -n1 basename | xargs -tI{} /usr/local/cpanel/bin/setsiteip -u {} $NEW_IP |
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
| # ISSUE: | |
| # Example of bad rewrite rule | |
| # first, check if url is not file or directory, if not then do rewrite! | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule "^(\S*)\s+(\S*\s.*)$" $1-$2 [N] | |
| # if is set N flag, do this rewrite indefinitely (limited to 32000 iterations in apache >= 2.4.8) |
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
| pci_stub | |
| vfio | |
| vfio_iommu_type1 | |
| vfio_pci | |
| kvm | |
| kvm_intel |
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
| 1) go to whm -> exim configuration manager | |
| * choose advanced editor | |
| 2) search spamd & replace with this: | |
| set smtputf8_advertise_hosts = * | |
| spamd_address = 127.0.0.1 11333 variant=rspamd retry=30s tmo=3m | |
| * find and disable acl_smtp_data:default_check_message_pre | |
| * find and disable acl_smtp_data:no_forward_outbound_spam_over_int |
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
| #!/bin/bash | |
| TTL=600 | |
| USERS="`/usr/local/vesta/bin/v-list-users plain | awk '{ print $1 }'`" | |
| for user in $USERS; do | |
| /usr/local/vesta/bin/v-list-dns-domains $user plain | awk '{ print $1 }' | xargs -I{} v-change-dns-domain-ttl $user {} $TTL | |
| done |
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
| #!/bin/env python | |
| import os | |
| import subprocess | |
| import time | |
| # subprocess.check_output is not exist in python 2.6 which is on centos6 | |
| # hostname = os.getenv("COLLECTD_HOSTNAME", subprocess.check_output(["hostname", "-f"]).strip()) | |
| p = subprocess.Popen(["hostname", "-f"], stdout=subprocess.PIPE) |
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 /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| DEVICE="eth0" | |
| BOOTPROTO="static" | |
| HWADDR="00:26:6C:F3:11:A8" # match network interface by mac address | |
| ONBOOT="yes" | |
| TYPE="Ethernet" | |
| IPADDR=XXX.XXX.XXX.XXX | |
| PREFIX=24 | |
| GATEWAY=XXX.XXX.XXX.XXX | |
| DNS1=8.8.8.8 |
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
| #!/bin/bash | |
| IFS='|' | |
| # Id | User | Host | db | Command | Time | State | Info | Progress | |
| mysqladmin pr | sed -E 's/\s+//g' | grep -v '\-\-\-' | grep -vi Time | while read -r id1 id user host db command time state info progress; do | |
| [ -z "$time" ] && continue; | |
| [ "$command" = "Sleep" ] && continue; | |
| if [ "$time" -gt 300 ]; then | |
| mysql -e "kill $id" | |
| echo "killing $id ($db) $info" |
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
| require("lsqlite3") | |
| -- Igmar: Wanneer closen we dat DB object eigenlijk ? | |
| db = sqlite3.open('/etc/asterisk/users.sqlite') | |
| --CONSOLE = "Console/dsp" -- Console interface for demo | |
| --CONSOLE = "DAHDI/1" | |
| --CONSOLE = "Phone/phone0" | |
| TRUNK = "DAHDI/G1" |