Work on sites before the DNS has rolled over (by editing the hosts file)

Important: This does not work if you are behind a proxy, which includes antivirus firewalls and such.

  • Right click on the hosts file in C:WindowsSystem32driversetc
  • Go to properties, turn off “read-only
  • Open the file using Notepad or any text editor
  • Add a line to the bottom of the file with the IP and domain
  • When you are done, don’t forget to turn read-only back on again


Use the IP of the new server and then the domain you want that IP to resolve to.

Now you can browse to that domain and it will resolve to the new IP even though the DNS hasn’t been updated yet.

Speed up Magento by ~235%

How to REALLY speed up your Magento site:

The information below on enabling gzip compression will improve your speed a bit, but if you are using a bargain basement web host then that could be a major factor as well. XPC Web Hosting provides advanced technology for speeding up your sites with performance tuned servers in both the USA and Canada. Some of our latest improvements include nginx which speeds up image loading and our database backup system that creates two backups a day and stores off-site archives for 30 days in case of emergency. Learn more.

GZip Compression:
There’s a feature called “gzip” that’s installed by default on most web servers. Modifying your site to make use of it can really speed up the performance.

How much faster?
Try the quick and easy mod_gzip tester by Just enter the URL and it will tell you how much faster it would be.

How to enable it for Magento
“One of the drawbacks of Magento is currently its speed if default configuration is used. There are certain ways of making it run faster. The best one is to enable GZip compression by changing .htaccess file a little. You just need to uncomment part of the code. In my case, the speed increase was exactly 235%. Continue reading…

Replacing your main hard drive is actually really easy

I recently had to swap out a hard drive on a perfectly good computer here at work. I needed to do this quickly, so I found out about Acronis True Image. This program lets you make a bootable disc that lets you clone one hard drive to another (so you can then remove the old and leave the new in), or you can backup in windows and then restore via boot cd.

The boot cd restore process is quite nice. You can even browse your network to find the backup files on another computer! So if you were thinking of upgrading your Windows (or whatever) drive with a Raptor or something, this would make it extremely painless.

Easy Windows Explorer Tweak

You can make Windows Explorer start in whatever folder or drive you want! I always found it really annoying how it would start in “My Documents”, which after a while has so many subfolders in it that you have to scroll and find My Computer, and the drive you want to get to, etc.

This is EASY.

  1. Right click on the shortcut you use for Windows Explorer and go to properties.
  2. In the “Target path:” field on the “Shortcut” tab, add the following to the end of whatever is there: /e,c:

Your end result should look something like this:
[code]%SystemRoot%explorer.exe /e,c:[/code] Note: Change the c: to whatever path you want Windows Explorer to start at.

Backup solution with WinRAR and a batch file

I wanted to make the perfect manual backup solution in a batch file, so here’s the code. Just make a file called backup.bat and paste this text into it. You might have to change a few of the file paths and stuff though.

What it does:
– Offers to make an exact copy of what files exist now, or lets you continue and add new files that aren’t in the backup archive yet (assuming it’s you’ve ran it before)
– Lets you pick a file name once at the top rather than having to type it in multiple places.
– Uses a password protected archive.
– Will make another copy the backup file to another location by default for added safety.

Note: I think I had to make a %path% variable (or whatever those are called) to the WinRAR folder, and I don’t exactly remember what I did. It was really easy though.


@ECHO off
SET varFileName=EnterFilenameHere

ECHO *********************************************************
ECHO *         Start a fresh backup? Press Y or N.           *
ECHO *                                                       *
ECHO *      You should do this every once and a while,       *
ECHO *                but not all the time.                  *
ECHO *********************************************************
set choice=
set /p choice=Choice:
if not ‘%choice%’==” set choice=%choice:~0,1%
if ‘%choice%’==’y’ goto yes
if ‘%choice%’==’n’ goto no
ECHO “%choice%” is not valid please try again
goto start

ECHO ******************** Fresh Backup ***********************
DEL D:Backup”%varFileName%”.rar
goto end

ECHO *********************** Update **************************
goto end

ECHO                Cougar Design Backup Wizard
ECHO *********************************************************
ECHO *                                                       *
ECHO *        Choose your password for the archive.          *
ECHO *                                                       *
ECHO *********************************************************
rar a -u -r -rr10 -rv20 -s -hp -m1 D:Backup”%varFileName%”.rar @C:Backup”%varFileName%”.lst
ECHO *********************************************************
ECHO *              Time to make a 2nd backup!               *
ECHO *********************************************************
xcopy D:Backup”%varFileName%”.rar E:Backup”%varFileName%”.rar /y /i
ECHO *********************************************************
ECHO *                       Complete!                       *
ECHO *        This will close when you press any key.        *
ECHO *********************************************************


Shorter nested IF statements in Excel

This code checks to see if A1 equals the letters K, H or L.

Instead of using:
[code lang=”html”]=IF(A1=”K”,TRUE,IF(A1=”H”,TRUE,IF(A1=”L”,TRUE,FALSE)))[/code]

You can use:
[code lang=”html”]=IF(OR(A1=”K”,A1=”H”,A1=”L”),TRUE,FALSE)[/code]

As you can see, it’s a lot shorter and makes a lot more sense. Especially if you need to add more to it in the future.

Easy stylesheets with basic PHP

Create a file called stylesheet.php and link to it in you’re page. Then play with this code:

[code lang=”php”] < ?php header('Content-type: text/css'); // Colour scheme $primary = "#44749d"; $secondary = "#c6d4e1"; $tertiary = "#ffffff"; $quaternary = "#ebe7e0"; $quinary = "#bdb8ad"; ?>

background: < ?php echo $tertiary ?>;
color: #000000;
margin: 0px;