allowing only 1 IP through

iptables -I INPUT \! –src 1.2.3.4 -m tcp -p tcp –dport 777 -j DROP # if it’s not 1.2.3.4, drop it insert into chain INPUT drop any tcp packet to port 777 thats not from the ip 1.2.3.4 Source: ServerFault

resize2fs – resize a live partition in linux (for use in AWS)

Hi there, You launched an instance on AWS with an EBS-backed storage. The AMI you used deployed a smaller volume than what you needed by default [insert many other reasons this might be the case], and so you need to resize it. Go to your AWS console. Find your instance under ‘Instances’. Stop your instance […]

auto-run phpunit on modified files, linux

watch -n 60 -d find <directory to look into> -mmin -1 -iname ‘”*.php”‘ -exec ‘phpunit –bootstrap=<directory to look into>/bootstrap.php {} \;’

LC_CTYPE, LC_ALL problems on a fresh install of Debian Squeeze

Last few times I’ve installed a fresh copy of Debian Squeeze, I’ve had the following errors show up during/after a routine apt-get update;apt-get upgrade: locale: cannot set LC_CTYPE to default locale: No such file or directory After that point I could reproduce the error by typing: locale -a You will find tons of people on […]