Publicado en English

How to keep P2P users out of your network with openwrt

Say that you have a open wireless network connection and you have some users that use P2P programs to download stuff. The main problem with P2P programs is the number o connections that try to open on the ADSL router so the NAT table gets full pretty quickly.

#!/bin/sh
# Ban. Add mac to the forward table if the number of connecions get 100

for ip in $(grep "br-lan" /proc/net/arp | awk '{print $1}'); do

cont=$(grep -c "$ip" /proc/net/ip_conntrack);
mac=$(grep "$ip" /proc/net/arp| awk '{print $4}');

if [ "$cont" -gt "100" ] ;then
echo iptables -A forwarding_rule -m mac --mac-source $mac -j DROP;
fi
logger "$ip $mac $cont";
done

so create a entry on /etc/crontabs/root

# run this script every hour
0,10,20,30,40,50 * * * * /etc/ban > /dev/null
0 * * * * /etc/unban > /dev/null
ban

Publicado en English

How to clean up a guest user under windows xp

Using the shtasks utility create a task to run a clean script.

schtasks /create /tn limpieza /tr c:\limpieza.bat /sc onstart /ru System

Here is the limpieza.bat script:

RD /S /Q  «C:\Documents And Settings\Invitado»

If  you want an user to autologon check this info: http://support.microsoft.com/kb/315231

 

 

http://superuser.com/questions/340396/how-do-i-change-automatic-logon-via-script-or-command-line

 

 

REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Invitado /f