Author Archives: davychiu

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 | 9 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

Limit Handbrake Useable CPU Cores in Windows

The CPU limit argument of Handbrakes seems to have no effect in Windows. One way to get around this is to start Handbrake with the built-in “start” command with the affinity argument. start /wait /affinity 33 “” “C:\Program Files (x86)\MC-TVConverter\tools\handbrake\HandBrakeCLI.exe” … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Installing Tinyproxy

Short guide on installing Tinyproxy in CentOS on an OpenVZ VPS. [root@shizuka ~]# yum install tinyproxy At this point, you need to edit the conf file and add an “Allow x.x.x.x/xx” line to let users access the proxy. [root@shizuka ~]# … Continue reading

Posted in Uncategorized | Tagged | 3 Comments

Expanding HFS Partition in MacOSX

When you grow disk in VMWare, MacOSX does not allow you to do much with it. The easiest way to extend the partition is to create a new one in the free space with GParted and then merge them. diskutil … Continue reading

Posted in Uncategorized | Leave a comment

Resizing Logical Volume & Swap on Redhat/CentOS VM

My CentOS vm was near the capacity of its allocated VHD. I used VHD Resizer from VMToolKit to expand the file container. Once it is expanded, the inner layers must expanded as well. This is a collection of info I … Continue reading

Posted in Uncategorized | Tagged | 1 Comment

Hirens Bootcd with VMware

It seems VMware can only boot cds with an IDE CDROM device. If the VM only has a SCSI CDROM, add an IDE one to the vmx file. GParted or Hirens should boot after.

Posted in Uncategorized | Tagged | Leave a comment