Recursively Deleting all SVN folders
Here's a quick code snippet for how to recursively delete all SVN folders.
Linux: Copying from one folder to another without overwriting any existing files
Here are a few tricks on how to copy files in linux from one location to another whilst not overwriting any files.
Using GNU Copy (which is not included in all distributions) you can simple use the -n (--no-clobber) option like follows:
cp -n /source /target
But, if you happen not to be using GNU copy, a nice little trick I found is to do the following:
yes n | cp -i /source /target
As you can see - I'm simply piping an n into the cp command to tell it not to overwrite any files.
Another option is to use RSYNC, example as follows:
rsync -r -ignore-existing /source/. /target/.
Quick and easy comparison for apps or anything
If you need a quick comparison of almost anything you can just type the name of it into Google and it with "vs".
This will make google fill the rest of the sentence which will be full of alternatives for the thing you're searching for.
I use it with linux commands like sed and awk and another side effect is that it quickly defines the thing you're searching for.
Howto: Stop Postfix from HELOING as localhost.localdomain
Recently, one of our newly setup mail servers was being added to Spamhaus XBL blacklist because it was HELOING as localhost.localdomain. This would prevent emails from reaching alot of addresses if not fixed (We found this issue during site testing!)
The quickest way to address this (since our /etc/hosts file was correct) was to edit the main.cf postfix configuration file.
You can find the file at /etc/postfix/main.cf.
Open up this file, find the line that says myhostname and change to what you want it heloing as. Now all you need to do is request removal from the blacklist (should take no more than 15/20 minutes).
You're done!
How to: Set up and rotate automated MySQL and File/Folder backups
In this blog post I will try to give you a quick tutorial on one way you can automate and rotate mysql and file/folder backups.
Test file uploads in PHPUnit using curl
Use curl to POST a file and other form data to your application through the test environment's apache host. You can do this in the setUp for each test.Slow Apache in a Virtual Machine with Shared Folders
If, like me, you run a unix based LAMP server inside a virtual machine (VirtualBox, VMware...) then you might have noticed apache will not update or send updated static files to the browser if they're served from a vboxsf or hgfs mounted filesystem share.
Using Selenium test tool in our site tests
I've recently incorporated the Selenium Java based test tool into our testing suite for some of our projects. “Selenium Remote Control allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.” Taken from http://seleniumhq.org