Archive for the ‘Scripts’ category

Backup/Migrate MySQL Databases to New Server (Windows)

March 27th, 2010

Bird migration image from: http://audubonoffloridanews.org/?p=3314

I searched far and wide and could not find a way to easily migrate MySQL data from one server to another. I remember a few years back that MySQL released a migration assistant that did the job pretty well, but that software seems have reached EOL. I had to move files on my local (windows) dev server to a new desktop that I purchased and decided to write a couple bat files that automate the process of exporting and importing the databases. Download the scripts now.

It seems that MySQL has replaced the former helpful software with MySQL Workbench — which is pretty cool, but unfortunately it doesn’t include any help for migration.

A future release of MySQL Workbench (post 5.2) will add a migration plugin, providing features comparable to the MySQL Migration Toolkit component of the MySQL GUI Tools Bundle. We will also be adding many other enhancements and new features.

Where does that leave us? Mysqldump.

I modified a MySQL backup shell script from Sonia Hamilton, and these scripts could both be modified to work with nix, but they are mainly for Windows. Read on for how to migrate your windows MySQL server.
» Read more: Backup/Migrate MySQL Databases to New Server (Windows)

More examples of image manipulation with PHP

January 14th, 2010

All of these examples use the PHP simple image manipulation class that I created.

Every now and then I write a batch image converter snippet that others might find useful. I figure I’ll post them here for my benefit and yours. These snippets will also serve as a way to better understand the class. As I come up with these in life, I’ll update this post.

All of these examples assume that you’ve already included the class in your file.

» Read more: More examples of image manipulation with PHP

Simple Image Manipulation in PHP (Rotate, Resize, Crop, Flip and Mirror, Thumbnails square and regular)

December 31st, 2009

UPDATE: I’ve added support for PNG alpha transparency which makes this class significantly more useful. Changelog in the class code below.

I keep misplacing this class so I figured I’d post it here so that I know where it is.

I wrote/assembled this class because I wasn’t happy with any of the image manipulation libraries out there. They are either way too complex with a steep learning curve or didn’t work all that great. (I didn’t see any reason to load up a class with 3,000 lines of code just to resize or rotate an image.)

So here it is, a simple class that allows you to open an image, perform common operations, and save. There are no bells and whistles or anything exciting here. Just a collection of commonly used image manipulation functions: Rotate, Flip, Resize, Thumbnail (square and regular), and Crop.

A lot of the class code is original but some of it has been gathered over my life as a programmer from long lost sources. If you recognize your work, leave a comment and I’d be happy to cite you!

» Read more: Simple Image Manipulation in PHP (Rotate, Resize, Crop, Flip and Mirror, Thumbnails square and regular)

AdCenter SEMs lives just got easier (Greasemonkey script inside)

December 18th, 2009

If you are a search engine marketer that has used Microsoft’s AdCenter, you probably have found it a bit annoying that when creating text ads, it doesn’t tell you how many characters you have left.

This means that the genius PPC ad-copy that you just wrote will only be rejected when you go to save because it is too long.

This Greasemonkey script detects when the new text ad dialog is visible, and will update the remaining characters that you have left to use as you type.  Something that Microsoft should have done…. pay me MS, you lazy bastards.

This isn’t the only thing I find annoying about Microsoft AdCenter, but all the Greasemonkey scripts in the world won’t fix it. Click through for the script.
» Read more: AdCenter SEMs lives just got easier (Greasemonkey script inside)

Greasemonkey/Firefox script to enable autocomplete

August 12th, 2009

Browsers can save logins and passwords.  Unless the autocomplete attribute is set to off, that is.

If you ever go to a website and wonder why it’s not asking you to save your password, it is probably because autocomplete has been turned off by the web designer.

Thanks Mr. Web designer, but I think I’ll be the judge of that.

First, let me say autocomplete=off is a good feature that keeps people who don’t know any better from doing something dumb.  Looking at you, grandma.

But, if you are pretty confident in your internet self, and you use Firefox, you can use the following Greasemonkey script for Firefox to abolish autocomplete entirely from all websites you are viewing.

» Read more: Greasemonkey/Firefox script to enable autocomplete