Iptables Flush

Full flush iptables script: #!/bin/sh iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT

2 December 2009 @ 07:15 · Updated: 30 June 2026 @ 03:28 · leo

Auto Check - OpenVPN

Su connessioni fastweb usando openvpn è in caso di restart dei router di destinazione spesso le sessioni restano appese e non viene ristabilito il tunnel, in teoria questo bug è stato risolto nelle ultime release, per non rischiare 4 righe di script: #!/bin/bash if ! ping -c 1 -w 5 "xxx.xxx.xxx.xxx" &>/dev/null ; then /etc/init.d/openvpn restart fi Eseguite ogni 5 minuti come da cron: */5 * * * * /root/yeahup

14 September 2009 @ 01:45 · Updated: 30 June 2026 @ 03:28 · leo

Cisco - Get & Save config using telnet

Vi è mai capitato di dover salvare delle configurazione da apparati cisco senza avere un tftp a disposizione? In aiuto un piccolo script: #!/bin/bash host=xx.xx.xx.xx port=23 login=user passwd=pass nobreak='terminal length 0' cmd='show running-config all' (echo open ${host} ${port} sleep 1 echo ${login} sleep 1 echo ${passwd} sleep 1 echo ${nobreak} sleep 1 echo ${cmd} sleep 30 echo exit) | telnet sw01.txt

13 April 2009 @ 19:08 · Updated: 30 June 2026 @ 03:28 · leo

Windows - Disable automatic update from VBS

Sono stufo di cliccare.. Const AU_DISABLED = 1 Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate") Set objSettings = objAutoUpdate.Settings objSettings.NotificationLevel = AU_DISABLED objSettings.Save

12 February 2009 @ 01:20 · Updated: 30 June 2026 @ 03:28 · leo

Discovery Subnet with Ping

Sometime we need to discover an entire subnet. This is a small script not so fast but easy: #!/bin/sh subnet=10.10.10. addr=1 while [ $addr -lt 256 ]; do ping -c 1 -t 1 $subnet$addr /dev/null && echo $subnet$addr Is Alive let addr=addr+1 done

8 February 2009 @ 03:58 · Updated: 30 June 2026 @ 03:28 · leo