Wednesday, February 6, 2008

My Mozyhome Automation Script:

As I mentioned in a previous post, I really like Mozyhome but I don't like having it constantly running in the background; it really only needs to run when it performs a backup, and any other time it shouldn't be wasting my RAM and CPU. So here's a handy Autohotkey script I've written that'll automate starting, running, and killing Mozyhome automatically.

Here's the full script, which I've called mozybackup.ahk:

#SingleInstance force
DetectHiddenText, On
SetTitleMatchMode 2
SetTitleMatchMode, Slow

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 5000

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 10000

WinWait, ahk_class wxWindowClassNR
IfWinNotActive, ahk_class wxWindowClassNR, , WinActivate, ahk_class wxWindowClassNR,
WinWaitActive, ahk_class wxWindowClassNR,
MouseClick, left, 347, 41

WinWait, ahk_class wxWindowClassNR, 1 minute ago
Run, C:\Program Files\PSTools\pskill.exe "mozybackup.exe"
Run, C:\Program Files\PSTools\pskill.exe "mozystat.exe"
Run, C:\Documents and Settings\Arvin\My Documents\scripts\finishedbackup.txt

Alright, now let's go through each part of the script to explain what it does, in case you need to alter parts of it later on (which I'm sure you'll have to).

#SingleInstance force
DetectHiddenText, On
SetTitleMatchMode 2
SetTitleMatchMode, Slow

This part kind of sets the tone for the rest of the script. The first line makes sure only one instance of the script is running. The next three lines sets Autohotkey to actively and thoroughly read the text inside currently open windows. You'll see why this is important later.
run C:\Program Files\MozyHome\mozystat.exe

Sleep, 5000

run C:\Program Files\MozyHome\mozystat.exe

Sleep, 10000
This part runs Mozyhome. If you installed Mozyhome into a different directory, change the file path as appropriate. The reason I call the program twice is because mozystat.exe usually starts minimized in the system tray, where I can't get at it. The second run command brings up the Mozyhome window to the top of the desktop. The long sleep times allow time for Mozyhome to properly load in plenty of time.

WinWait, ahk_class wxWindowClassNR
IfWinNotActive, ahk_class wxWindowClassNR, , WinActivate, ahk_class wxWindowClassNR,
WinWaitActive, ahk_class wxWindowClassNR,
MouseClick, left, 347, 41

This part waits for activates the Mozyhome window if it hadn't already (wxWindowClassNR is the ahk_class or window class of the Mozyhome window). The last line clicks the "Start Backup" button on the Mozyhome window, which starts the backup.
WinWait, ahk_class wxWindowClassNR, 1 minute ago
Run, C:\Program Files\PSTools\pskill.exe "mozybackup.exe"
Run, C:\Program Files\PSTools\pskill.exe "mozystat.exe"
Run, C:\Documents and Settings\Arvin\My Documents\scripts\finishedbackup.txt

The first line of this next section waits for the Mozyhome window to display the term "1 minute ago," which would show up as soon as the backup finishes. The script is paused at this point until that phrase in that window pops up.

Once it finishes, it runs PSKill to kill the mozybackup.exe and mozystat.exe processes. I'd featured PSKill before, but basically it force closes the specified processes. I've put pskill.exe into a folder called PSTools in my Program Files folder, but again, if you've put it elsewhere, make sure you put the right path in there.

Finally, the last line opens a text file called finishedbackup.txt that I'd prewritten and saved in my scripts folder that just simply says "Finished backup!" I just put it in there to let me know the backup finished successfully. You don't need to do this part, or customize it yourself with whatever text file you want. I decided against using a MsgBox because the script won't close unless the OK button on the MsgBox is clicked. With the text file, the script can open the file, and then close itself.

And there you go! To run this script, either just run it by double clicking whenever you want to, or incorporate it into another script and have it run from a specific keystroke. I have it run as part of my computer's shutdown routine, which I invoke with a simple ALT-H at the end of the night, or in the morning before I head out to work.

Monday, February 4, 2008

Worried about unreadable CD's/DVD's? Burn two copies!

I've been on far too many occasions disappointed to find a CD or DVD backup I'd burned a while back unreadable by my optical drive. I seem to recall somebody saying how CD's were indestructable... well, lemme tell ya, you don't just have to put them in the microwave render them useless (though the microwave method is the most fun).

What I've resorted to now is burning two identical copies of my DVD or CD backup. This way, if one file is rendered unreadable by a scratch, I have one more chance to retrieve it, using the other DVD. Optical media is so ridiculously cheap now that I don't mind this so much (it's the difference between a quarter and fifty cents, after all), and DVD burners are getting fast enough that doubling the burning time isn't a huge hassle either.

And now, I get the piece of mind that my backups remain useful in the years to come (unless both discs get scratched...)

Do you implement redundancy into your backups to ensure security? Leave a comment below!

My Portfolio Site Soft-Launches (again!)

For 8 months, my portfolio website, Greasy Pig Studios, was nothing more than a splash page that was essentially a blown-up version of my business card (which I got printed at a heavy discount on Vista Print). It declared "NEW WEBSITE COMING SOON" but nothing came.

Until today. I'd had enough, and decided to add a little substance to the site, even if the content still wasn't the latest from the GPS factory.

With help from Newgrounds for the preloader, and this Wildform Tutorial for a Flash Video Controller (I couldn't get the draggable play-head to work right, but that was a luxury, not a necessity), I was able to customize a player for my reel to present on the front page. It's still a simple site, but now it just might be enough to attract potential clients to my offered services.

So please come and visit the kinda-new Greasy Pig Studios (and check out the reel too, why not).

Sunday, February 3, 2008

Merge Address Bar and Status Bar Safari-Style in Firefox with Fission!

It's funny that the following extension written by Zeniko is called Fission, which is the act of splitting into smaller parts, because its sole purpose is to take the Firefox Status Bar and merge it with the Firefox address bar.

Safari on OSX does the same thing, at least one of the status bar's functions, which is to show the loading status via a color background on the address bar. Fission does the same thing, and it even allows you to customize the colors.

Fission also takes the other function of the status bar, which is to show where a hovered link leads to, and puts that on the address bar by changing the address displayed to the hovered link, if you happen to have your mouse over the link. It's a little disorienting at first, but when've you ever needed to see the current address and the hovered link's address at the same exact time?


In this instance my mouse was hovering over the "restaurants" link, and fission shows the link location in my address bar up above.

By using Fission, you can finally get rid of your status bar, by going to View>Toolbars> and uncheck "Status Bar." Voila, you just shaved another 50 or so vertical pixels off of Firefox, which amounts to more viewing space for the webpages. Because after all, Firefox is for viewing sites, not for ogling itself.

Saturday, February 2, 2008

Stop-Or-Reload Firefox Extension - Merge Two Buttons and Save Room!

The following can be done as a userchrome.css tweak but honestly, I could never get it to work, and it really bugged me. Luckily, it is available as a Firefox extension.

The concept behind the Stop-or-Reload Button extension by Caio Chassot is the idea that you'd only ever need to stop a webpage if it was loading, and you'd only need to refresh a page once it's finished. The two states don't really ever intersect (well, yeah, they do, but not always). So, wouldn't it be efficient to combine the stop and reload button into one button, switching between Stop and Reload depending on the loading status of the page? Why yes!


As you can see I only have two icons on my top menu bar, and that's the Compact Menu (featured in my previous article here), and Stop-or-Reload. The rest is taken up by my address bar, which is pretty much long enough to handle all but the most interminably long URLs.

If you liked this article and want to know more about the Firefox extensions I personally use to make my browsing experience super efficient, check out the other posts on this blog labeled Firefox.

Compact Menu Firefox Extension: Firefox Menus Under One Icon

I haven't really given much time to focusing on how I've optimized my Firefox browser on this blog, even though Firefox is arguably the most customized piece of software I use (aside from Windows itself). So I'll try to do several articles a week to the various extensions and tweaks I've used to make Firefox run as smoothly and productively as possible.

Compact Menu is a Firefox extension written by Milly C. that opens up a crapload of space on your Firefox window by collapsing the main menu options (File, Edit, Bookmarks, Tools, etc) into one dropdown menu. If you're like me, you hardly access those menu options anyway (especially if you've mastered keyboard shortcuts and use your scrollwheel button), so the occasional extra mouseclick to view those menu options is worth the third of a toolbar's space I save with it.Even better, CompactMenu also allows you to not show certain menu items at all. I've chosen to uncheck the "Edit" menu, since I don't ever use it (Find can be accessed with CTRL-F or the even better "/" for quickfind).

Stay tuned for more showcases on my Firefox tweaks!

Friday, February 1, 2008

Minimize Icons in System Tray

This is something I'd already done months ago, but to save time I'd rather point to a well-written and comprehensive article from Help2Go about how to remove icons from your system tray.

While to me the most important thing about the system tray is to make sure you don't have too many applications running at once anyway (which is why I personally frown on too many small productivity applications running at once), there is still something you can do for the system tray apps that you just can't get rid of.

For the record, 90% of the time the only icons that populate my system tray (along with the clock) is Miranda, AVG anti-virus, volume, Ultramon, and my ubiquitous autohotkey Hotkeys script. But using the hide feature like shown in the Help2Go article, Miranda's the only one that's always showing.