I was looking for a simple solution to backup my newly constructed server to an off-site location in case something were to happen. I don’t mean I lost a file… more like catastrophic hardware failure, fire, water damage, physical damage, and even theft!. Local backups really are best, and I don’t plan on abandoning them …
Tag Archives: tip
Adding the Fedora Install DVD to Your Yum Repo List
I recently performed a major upgrade on my file server this week. It was a lot harder than it should have been, but that’s only because my Linux Foo can only go this far. Two to three re-installs later on the new hardware it was getting old, so I told the Fedora installer to just …
Continue reading “Adding the Fedora Install DVD to Your Yum Repo List”
Nasty WordPress Worms
I just ran across a nasty worm in one of my WordPress blogs (not the most current install). Not only did it overwrite a ton of files, inserting spam links and malware into the pages, but it was sneaky enough to go into my wp-admin/.svn/prop-base/ directory and re-write those files as well. It’s fairly ingenious …
Fixing a Broken TimeMachine Backup
I had the unfortunate event of having to send my MacBook Pro into Apple for some repairs. The machine came back working fine, however there was something odd going on with TimeMachine – it wanted to do a full backup of my disk. Odd, considering I keep it plugged-in all the time when I’m at …
HABTM Unit Testing in CakePHP
I use this blog quite a bit for documenting little quirks, bugs, work-arounds, neat things, and tutorials so that I know where I can find the solution in the future. At the same time, you benefit by hopefully not having to go through some of the same messes I did just to get to this …
Unchecked checkbox values
Working with form check boxes can be a bit of a pain on sites with dynamic content. Saving the checked data is easy, but how do you easily save the unchecked value without manually adding it to an array from inside your code? Keep reading. revealCMS is working great – I’m really starting to see …
SMARTY: Assigning variables to the header from the body
The problem recently presented itself to me when writing some new functionality for revealCMS: I needed to set some variables to load in the page head, but could only be set after a portion of the body had completed rendering. I wrote a plugin that essentially loads a different stylesheet depending on the input of …
Continue reading “SMARTY: Assigning variables to the header from the body”
Replacing Substrings using SQL, not PHP
Let’s say you have a problem: A recent DB migration has escaped a lot of quote marks within your fields and now your app is acting funny. Your task is to fix the problem, and do it FAST. Enter the replace() function in MySQL (assumed other RDBMs as well, such as Postgres and MSSQL) UPDATE …
What’s your Fortune?
Here’s a fun little thing you can do for your next site goodie: display your users’ “fortunes” from the command-line interface, CLI, application Fortune. On Fedora, install: % sudo yum install fortune-mod from PHP (fortune.php) <pre> <? passthru(‘fortune’); ?> </pre> I pre-formatted the text because it comes out looking as it does in the CLI. …
Fixing Zen Cart’s Tax Miscalculation When Using a Coupon
I was recently alerted to an error in Zen Cart by a client where the tax was being miscalculated when using a coupon. Here’s the fix. Around line 240 in /store/includes/modules/order_total/ot_coupon.php Remove these lines: //$od_amount[$tax_desc] += (($products[$j][‘final_price’] * $products[$j][‘quantity’]) * $tax_rate)/100 * $ratio; //$od_amount[$tax_desc] += round(((($products[$j][‘final_price’] * $products[$j][‘quantity’]) * $tax_rate) + .5)/100 * $ratio, 2); …
Continue reading “Fixing Zen Cart’s Tax Miscalculation When Using a Coupon”