Archive for 'How To'
How To Add a System Tray Icon For TortoiseSVN
Posted on February 27, 2008, under Development, How To, Software, Tools and Services.
TortoiseSVN is arguably the best SVN client for Windows, my favorite for sure. The only negative aspect he program comes with is that TSVNCache.exe becomes very large in memory over time. This process keeps a cached state of your folders under source code control.
There is a way of putting an icon in the system tray which allows you to gracefully exit this app from time to time, not allowing it to get that large. This trick is documented in the hidden registry features of TortoiseSVN.
Fairly simple if you know your way around the registry. All you have to do is create a DWORD value under "HKCU\Software\TortoiseSVN\CacheTrayIcon" and set it to 1.
Presto! A System tray icon.
Popularity: 7% [?]
No Comments
Easy MySQL Backups on a Windows Server
Posted on February 27, 2008, under Code Snippets, How To, IIS, Software, Windows.
During the re-launch of BlueCrestStudios we moved to a Windows server. It was part of our initiative to take things back to our roots, and make things simpler. Because we run a fair amount of PHP applications we went with MySQL as our database. MySQL comes with a great little application called "mysqldump" which simply enough dumps your data to a SQL file. This little tool, combined with the free and great 7Zip makes for simple and great database backups. It’s best to dump your database onto a separate drive then where the data is stored, offers a little redundancy.
Now before we get started, I know some of you are thinking there is no need for this if you hosting company does backups. True, yes any good hosting company should do regular backups of all your data. However, I find it good to have a dump of our databases for that oops situation, and not involve the hosting company if we need to recover a database or table or row. In addition, you can schedule dump every other hour, or more regularly then your hosting company does backups.
So here is our script, let’s see what we are doing here:
1: set ARCHIVE=E:\Backups\MySQL\%DATE%.zip
2: set FILE=E:\Backups\MySQL\Backup.sql
3: DEL %ARCHIVE% /f /q
4: "C:\Program Files\MySQL\bin\mysqldump.exe" --all-databases --user=YOURMYSQLUSER --password=YOURMYSQLPASS > %FILE%
5: "C:\Program Files\7-Zip\7z.exe" a -tzip %ARCHIVE% %FILE%
6: DEL %FILE% /f /q
Basically we are dumping the database daily here, to an archive that holds the day of the week. The variable "ARCHIVE" holds to archive for today that will be created. The "FILE" variable holds the temporary dump file before we compress it, it is deleted after the compression just to clean up after ourselves.
- Line 3, we are deleting the current backup archive just incase.
- Line 4, we are doing the actual dump. You need to set your mysql user and password , a note do not use root!
- Line 5, we are doing the actual creating of the archive. SQL dump files compress very well, so this is a space saver step.
- Line 6, we are deleting the temporary backup file as mentioned above.
The tactics above can be enhanced greatly, as you can do dumps based on database, time, and get very elaborate on this. As an extra step I am using my Windows Home Server to download the dump nightly via FTP. Simple, elegant, fairly robust, and useful.
Popularity: 8% [?]
No Comments
How I Dropped Outlook Like a Bad Habit
Posted on September 26, 2007, under Email, How To, Software, Tools and Services.
I have had a couple questions lately on how I handle all of my emails, so here goes:
Like many out there I have used Outlook for the longest time, longer than I can remember actually. I had a huge PST file with emails dating back to college. When I got a PDA for work purposes, all of a sudden having my email in one place on my desktop did not work unless I wanted to setup an Exchange server. It has always upset me that Outlook does not support IMAP completely, and they have made it difficult to use; so this wasn’t an alternative. I had fears about giving up control of my mail server, which I have always chosen to run myself. Lastly, how was I going to sync up my calendar? After testing many setups, this is how I dropped Outlook like a bad habit.
Let Go of Mail Server Control:
I always ran my own mail server because I didn’t have to worry about spam signatures being attached to my emails, running out of storage space, or any of that other crap. GMail came along and changed the game with Google Apps, and Yahoo has been ramping up it’s offerings as well. I needed my email in a central place where any of my devices could hit it. An Exchange server was too pricey and with it came support problems, and any other software was just going to be something else I would have to set time aside to get up and running and keep running. I finally let go control of running my own mail server, and haven’t looked back since. Gmail is fast, works with my domain, has plenty of storage, improves it’s services without me having to upgrade anything, requires no time investment from me, has a mobile portal, and just keeps getting better.
Got Used To Using WebMail:
It was hard to get used to using a webmail client as my only email client. Especially with GMail which uses tags instead of folders. Breaking out of the mentality that my email is here, I can physically handle it, and it’s mine proved difficult and I almost reverted at several points.
Mail Notification:
With a webmail client, unless you want to keep it open all the time, you need to know when you have new mail so you can stay on top of it. I found a little gem by a company called MassGrid called GAlert. I paid a hefty $20 for this little shareware application, which sits in the system tray and lets you know when you have new mail for more than one GMail account. This was actually a hard application to find, yes there are a lot of GMail notification tools out there but not that many work with Google Apps and even less that work well.
On The Road:
As mentioned before, GMail has a slick mobile interface which is easy to use; just point toward your regular login and Google knows you are coming from a mobile device. Calendar was the next problem. Right now there are limited API’s available for GMail and Google Calendar, so it was also a task trying to find a way to synchronize my mobile calendar with Google Calendar. GooSync does just that. A little application downloads to your Mobile device, and lets you sync with the mobile calendar. They have both a free and paid service. Perfect!
Conclusion:
I haven’t been happier. In the process I dropped having to invest time in running a mail server and manage my mail and calendar, made myself more mobile and able to grab my data anywhere, and dropped ActiveSync which is a blessing of it’s own.
Popularity: 11% [?]
10 Comments
Tips For Updating WordPress
Posted on September 12, 2007, under Blogging, How To, WordPress.
WordPress has made it fairly simple to update to a new version, but there are some little quirks that come along with it. Here are a couple of tips I have implemented over the years for a smooth upgrade path.
Your Do Not Need To Be The First:
Unless you are doing a review or enjoy being the guinea pig, never be the first to upgrade. I usually give a new release about a week to see what, if any, troubles come up in the headlines. Sometimes a security flaw is found right out of the gate, and WordPress will release a fix. If you wait a week you do not have to deploy this fix, because it will be included in the most recent download.
Use a Sandbox Environment:
This is a lot more feasible these days, with hosting providers allowing more than one domain or even subdomains. You can easily replicate a WordPress deployment and database to make a sandbox environment of your blog or website. Deploying an upgrade to a sandbox install will give you a chance to solve any problems before taking your blog down for an upgrade.
Check Your Plug ins:
Much like Firefox, some of your plug ins might not be compatible with a new version of WordPress. You should check with every plug in to see if there is a new version available that has been tested with the version of WordPress you are upgrading to. Any problems with your plug ins can be found in your sandbox installation noted above. If you have problems with a particular plug in, most authors are quick to release a new version; or you might have to wait a little longer to deploy the WordPress upgrade.
Backup, Backup, Backup:
I will never hold back on how important backups are with any data. Your Blog is not different. Right before you are about to do an upgrade to WordPress, make a backup copy of all WordPress files and your database. Even if you are doing automatic backups to your web server, which you should, if you need to rollback for any reason you want to roll back to the point right before the upgrade.
Popularity: 6% [?]
No Comments
How To: Simple Error Pages With .htaccess
Posted on September 6, 2007, under Code Snippets, How To, Web Hosting.
HTTP error pages are more important than some may think. If you have a visitor or a customer to your site and they reach an error, you want to display a message and give them alternatives to find the content they are looking for. Most graphical control panels from hosting companies give you the option to easily setup error pages, but if you are in a situation where you need to create error pages on your own .htaccess is the way to go. In two easy steps you can have error pages up and running.
Step 1: Create your .htaccess File
Create a file called .htaccess and put the following contents in this file. Then place this file in the root “/” directory of your web server, where your web content goes.
[ftf]
ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
[/ftf]
Step 2: Create Error Pages
Now you want to create the above HTML files with their respective names. In these files you can put any sort of message to your visitors. It is a standard HTML file, no special rules apply.
Done!
Told you it was easy. Not you should be able to test it out by going to a page that does not exist on your website, and getting to the appropriate page above.
Popularity: 5% [?]
No Comments
How To Hack Experts Exchanges In Two Steps
Posted on August 23, 2007, under How To, Tools and Services.
Experts Exchange use to be a valuable resource for finding answers to common and uncommon problems, and is a good resource for developers. The problem is now they employ some “shady” techniques to get it Google’s top pages results to promote their paid content. This is against Google’s Terms of Use, and some are pushing to get it removed from Google search results.
Personally for me, when I am searching for an answer to something online while developing, I can’t tell you how frustrating it is to click on one of their links that pushes signing up for a membership. Most users have no intention of signing up, and they led you to this page under false pretenses. I am all for companies making money, but they are polluting Google page results and leading you to paid content. Not something that sits well for Google or Experts Exchange. I usually do not promote “hacking” techniques, but I would hardly consider this hacking; it’s really just using your browser. So lets get started:
Here are what Experts Exchange answers usually look like. Blocked out with overlays promoting their pay service.

The basis of this technique is we are going to block Experts Exchange from setting any cookies on your browser, and this tutorial is a walk through for Firefox you can do the same in IE.
Step One: Clear Existing Cookies From Expert Exchange
Go to your options under the “Tools” menu in Firefox, and click on the “Privacy” tab. Next click on the “Show Cookies…” button. Search for any cookies for “experts-exchange.com” and delete them.

You can now close out of this dialog.
Step Two: Setup a Block Filter for Experts Exchange:
Now you want to click on the “Exceptions…” button, and type “experts-exchange.com” in the text box. Now click the “Block” button, and then close out of this dialog and all the way back to your browser. Restart Firefox after this just for good measure.
Results:
Now when you go to an Experts Exchange link with blocked out answers, you will still see the blocked out answers and it may appear that this hack did nothing. Scroll down all the way to the end of the page and you will see the answers.
Popularity: 10% [?]
6 Comments
Thoughts about PHP after the Facebook Source Code Leak
Posted on August 15, 2007, under Development, How To, Networking, Security, Tools and Services, Web Hosting.
So by now, you already know that Facebook source code was leaked due to a mis configured server. And if you didn’t already know Facebook is written in PHP, a language that is compiled when it’s executed. So there are some questions that come to at least my mind about this situation.
First, what does this mean for Facebooks’ reputation? It is in a legal dispute over whether or not Mark Zuckerberg, the sites founder, stole source code from fellow university students. Even though the source code of any popular and profitable company is valuable. It is arguably not nearly as valuable as the data that goes along with that source code. This is the case with Facebook, who has millions of users and personal information in databases. But how can someone get access to the databases just by having the source code, you ask? Well with PHP it’s not so difficult. In most cases there is a configuration file that has all of the database information you need.
So how could have Facebook, and others prevent this sort of this sort of thing from happening? Here are a couple ideas:
- Put your configuration file where it can not be executed directly. For example, not in your “httpdocs” folder anywhere. In this situation Facebooks’ servers were mis configured so the PHP code was not rendering but instead showing itself. This means if the configuration file was under the “httpdocs” folder somewhere, presto! Access to the database. (Obviously firewalls and things like that might stand in the way).
- Obfuscate your PHP code. Yes this might slow down the processing of your PHP code by milliseconds, but it really would have helped in any situation like this where the possibly of PHP being show is present. Some obfuscation tools will also optimize the code, so it might make up for any processing time gained by obfuscating.
- Sandbox environments, and pulling production boxes out of rotation. Not sure what Facebook’s server setup is, but sandbox environments might have caught this server misconfiguration before it made it to production. Additionally if you have any sort of mirrored servers (a company like Facebook is bound to have something along these lines), you probably have your servers behind a load balancer. When you push code to production you need to pull these servers out of rotation (meaning not available for outside access). You can then test these servers individually before putting them back into production with the new code. Tedious? Yes, but worth it for not having a PR nightmare like your source code leaked. Additionally there are lots of tactics you can employ to make this process semi-automated and not as tedious.
These are obviously just some of many tips you can deploy to keep this from happening to you. Most large companies like Facebook will have similar processing in place, but the key is to always follow protocol… no shortcuts not matter what time crunch you are under. One slip and your source code is all over the Internet… might even be worse.
Popularity: 7% [?]
No Comments
How to Remove Word Smileys from Outlook 2007
Posted on August 7, 2007, under Email, How To, Software, Tools and Services.
With Outlook 2007, and even with Outlook 2003 Microsofts little smiley faces
will be replaced for the standard
smiley you type. THis is both annoying and unnecessary; so how do you disable it? Not too difficult, here are the steps:
- In Outlook 2007 go to the “Tools Menu” and click on “Options”.
- Click on the “Spelling” tab and then on the “Spelling and AutoCorrection…” tab.
- Select the “Proofing” tab on the left, and then the “AutoCorrect Options…”
- You will now see the a list of character. ON the ride side is the symbol that will be replaced with the text on the left side. You all 4-5 smiley faces and click the “Delete” button.
- Click “OK” and back out of your dialogs.
With all of the steps you have to go to jut to get to this option dialog, no wonder it’s not commonly known.
Popularity: 8% [?]
1 Comment
Clearer Screen Type on Windows with ClearType
Posted on August 2, 2007, under How To, Operating Systems, Tools and Services.
I had to install Vista for a job coming up, so I decided to install it on an actual machine as apposed to a VM machine. I spent a week settin it up, and playing with all of the neat new settings, and after a week explorer kept crashing and after two hours I could not find a solution so out came the XP CD again and Vista went back to a VM machine.
When going back to XP the biggest thing I missed about Vista was actually the clearer fonts used, there were a pleasure to read. Note: you can get the Vista fonts on XP though a simple search, or even easier if you install Office 2007 you will get the Vista fonts.
So what makes the fonts smoother and easier to read on Vista? Well it’s called ClearType and there is a PowerToy for XP that you can install for free. Download, install, and configure in the control panel, and you will have smoother fonts similar to Vista.
I knew about this before Vista, but actually couldn’t stand using it. A week of using Vista everyday changed my view on that; no pun intended.

Popularity: 4% [?]
No Comments
How to Setup a Subversion Server on Windows
Posted on July 24, 2007, under Development, How To, Operating Systems, Software, Subversion, Tools and Services.
A while back I wrote an How To on how to setup a Subversion server on Linux. So anything you can do on Linux you should be able to do on Windows, right? Well I am not getting into that debate, but yes you can setup a Subversion server on Windows. Much like Linux there are many ways to accomplish this, today I will be talking about how to set it up using Apache. So let’s take a look…
Downloads:
These are the recent versions of this date, please check for the latest stable versions at time of install.
Install:
First lets install Apache. You should be able to select all of the defaults during the installation process, unless you know what you are specifically trying to accomplish. Be sure to select “Apache Modules” where it talks about the SVN module.
Second lets install SVN, again the defaults work fine.
Third, and last install TortoiseSVN, yup defaults work good for this as well.
Configure Apache Password File:
First lets create a Apache password file, from a command line run:
[ftf]
C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe -c C:\Program Files\Apache Group\Apache2\passwd myuser
[/ftf]
Be sure to replace “myuser” with the username you wish to use for your login.
Create a Repository:
Next we need to create a subversion repository:
[ftf]
C:\Program Files\Subversion\bin\svnadmin.exe create C:\MyRepos
[/ftf]
Configure Apache:
In Notepad open up the file “C:\Program Files\Apache Group\Apache2\conf\httpd.conf” and put the following at the end of the file:
[ftf]
DAV svn
SVNPath “C:\MyRepos”
AuthType Basic
AuthName “My Subversion Repository”
AuthUserFile passwd
Require valid-user
[/ftf]
Presto! All you need to do is restart Apache via the neat little system tray icon, and import your repository and you are up and rolling.
Popularity: 21% [?]


