Categories
Uncategorized

PHP error_reporting

PHP (Once again a note for myself, but if you find it useful, well, you’re welcome!)

After a PHP upgrade, I noticed at least one bit of PHP code one the server wasn’t working (the TextLinkAds plugin for WordPress) so after a bit of digging around in php.ini, I found that this line was uncommented:

error_reporting  =  E_ALL

Which was causing warnings to spit out when some PHP scripts were run. I commented that line, and uncommented this line instead…

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

…for a little bit less error reporting/warnings about things, and that fixed it.

I’m sure this is not a cure-all, as another site with the same plugin always worked fine, and was never affected, but still, I didn’t really like seeing those warnings (which I believe are harmless, but they may need investigating anyway.)

Categories
Uncategorized

PowerSmash: Death of a PowerMac

So there I was quietly trying to enjoy my lunch when I heard voices… I then found these two nutcases out back near the dumpsters with an old PowerMac so I grabbed the video camera and caught it all on tape.

They told me they may have more things that need to be smashed, and that I should be on the lookout and always have a camera ready… I told them that if they bring the smashin’ I’ll bring the camera, and we’ll see what happens.

Enjoy!

Categories
Uncategorized

Headphones or VW Beetles

beetlephones

download the large one

(consider it cc:by)

I wanted to draw some headphones, but I think they may look like Volkswagen Beetles leaving skid marks… or maybe balloons of Volkswagen Beetles on strings… or something. Do these even look anything like headphones!?

Enjoy!

Categories
Uncategorized

apt-get fixes

Ubuntu As I get more and more used to Ubuntu and using apt-get I figured I should start keeping some notes. (btw, did you know that in the old days we had to compile everything!? Sheesh!)

apt-get kept crapping out on me with errors, some failed install I believe. This seemed to fix it:

cd /var/cache/apt/archives
sudo rm -rf ./*
sudo mkdir partial

sudo apt-get update
sudo apt-get update
sudo apt-get upgrade

Yes, sudo apt-get update is in there twice. You may only need once, but twice shouldn’t hurt.

You may also have to look for trouble in:

cd /var/cache/debconf
sudo rm -rf ./*

Warning: Unless you understand what rm -rf does, don’t type it!. It is a destroyer of files. Make a backup if needed. While these are cache files, and it should be harmless to delete them, remember that rm has no undo command.

Also, I’m running Ubuntu on an old G4 PowerBook as a low-power server (thanks to Dave from Kernel Design.) I’ve only had a few problems with the old “powerpc-linux-gnu” so far, mostly involving finding a BOINC client that will work. The typical LAMP stack is good, and the DAViCal install was painless.

Categories
Uncategorized

mysql backup shell script

This is what I tend to use for a simple MySQL database backup script… I wanted to post this so I can look it up when I need it. There are probably better ways to do this (tell me about them!) but this works for me.

#!/bin/bash

DT=`date +"%Y%m%d%H%M%S"`

mysqldump -u [USERNAME] -p[PASSWORD] [DATABASENAME] > /home/backups/[DATABASENAME]-$DT.dump

gzip /home/backups/[DATABASENAME]-$DT.dump

mysqlsm

Substitute your MySQL user for [USERNAME]. (There should be a space between the ‘-u’ and the [USERNAME])

Substitute your MySQL user’s password for [PASSWORD]. (There should not be a space between the -p and the [PASSWORD])

Substitute your MySQL user’s database for p[DATABASENAME].

Each time you run it, it will get the date with the year, month, day, hours, minutes, seconds, and use it in the name. So %Y%m%d%H%M%S would produce something like 20100711090854. If you are running one backup per day, you could shorten it to %Y%m%d.

This would put the files in the /home/backups directory. Set this to wherever you want the files to go.

The gzip command compresses the dumped database file. If you don’t want to compress it (and save disk space) then don’t use it.

(BTW, you don’t type the [ brackets ]. They are just there to highlight the words you need to fill in.)