Monthly Archives: July 2011

1:1 NAT with iptables and KVM

Use libvirt to add a network with NAT forwarding to an interface. It will add most of the iptables rules for you. It should looks something like below. “iptables -L”: Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT … Continue reading

Posted in Uncategorized | Tagged | 2 Comments

Squid 3.1 Ad Block

It seems like the Squid 3.x (at least for 3.1) parses acl rules a bit differently. I needed to add “all” to the http_access deny for it to work. acl ads dstdom_regex “/etc/squid/ad_block.txt” http_access deny all ads Instructions for initial … Continue reading

Posted in Uncategorized | Leave a comment

Installing Squid 3.1 on CentOS 5.6 with SELinux

Since there are no official packages of Squid 3.1 for CentOS or RHEL, the only ways to install are compiling from source or via 3rd party rpm. My method may not be proper so if there are any glaring mistakes, … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Using TC to Limit Uplink Bandwidth in Linux

Short guide on using TC to force users to obey a certain upload speed in linux. #First add a ‘root’ for eth1 tc qdisc add dev eth1 root handle 1: htb default 30 #Second add a class (bucket) with bandwidth … Continue reading

Posted in Uncategorized | Tagged | 8 Comments

Batch to Turn Off Display in Windows 7

Here is a simple way to turn off the display in Windows 7. It is not instantaneous, but I can live with it waiting one minute. The script temporarily changes the idle time to 1 minute, waits 65 seconds for … Continue reading

Posted in Uncategorized | Tagged | 3 Comments