27Feb/100

How to convert a website favicon.ico into an image

Few google searches bing back, oops, bring back amazing finds like this. However before reading on know that Google Share Stuff has been Discontinued since last March in favor of Google Reader's sharing bookmarklet. I'm not sure what that means to the favicon service defined below which clearly still works. You've been warned, meaning you can't expect it to work indefinably </captain obvious>

Google Shared Stuff (S2) offers a secret URL that can automatically pull favicon images of any website provided you know the URL. The images are in the PNG format (not ICO) and hence will render correctly in all browsers via the tag. - labnol.org

All you have to do is append a url to the following line and get the current favicon.ico of any website.

http://www.google.com/s2/favicons?domain=www.yancylent.com -> yancylent.com

I can't even tell you the trouble I went through a couple years ago writing a PHP routine that saved the files down to a folder, changed the name, added that name to a database, only to find out that IE Explorer didn't support .ico's like other browers do. This is a fine alternative, thanks google.

27Feb/100

Technorati API… we’re waiting…

I got an email from a blogger on Planet SharePoint telling me his Technorati ranking wasn't being updated. I spent about an hour looking over the code, nothing out of place, did a google search, nothing. Then decided to login to my Technorati account and check my API key status, and that's when I saw this.

Technorati Developers
Our new API is currently under construction. Our new search technology will allow us to provide several new and interesting API features. As it gets near completion, we will announce the new features. If you are a current API user, please note the legacy API will remain in operation until October 25, 2009.

http://technorati.com/developers/

This is pretty amazing. The services has been down for just over 4 months with no new API to take its place. It's almost as if it was abandon. This is a real shame, not even an update.

It looks like all us Duck Soup users are out of luck. Kailash Nadh, if you're reading this please consider updating your fine code with the Technorati updates, when they get around to it.

19Feb/100

How to Force a Unique Index on a MySQL Table

The simple answer is use "Ignore" instead of "Force".

This is being posted for one reason, I always try, and error out with a force instead of using ignore. This scenario applies when you want to weed out the duplicate entries, MySQL will error out if there are duplicate entries, you have to ignore simply to give MySQL permission to remove those dups. Here is an example....

To apply a unique index to an existing table (with dups) use:
ALTER IGNORE TABLE `sites` ADD UNIQUE (`url`)

Do NOT use:
FORCE ALTER TABLE `sites` ADD UNIQUE (`url`)
or
ALTER TABLE FORCE `sites` ADD UNIQUE (`url`)
or
ALTER FORCE TABLE `sites` ADD UNIQUE (`url`)

Yes, this is all basic stuff. I just want to help others making this same elementary mistake. It also helps to know if I get in the same jam a year from now, I have my own blog to search for the answer.

18Feb/104

Evil Free WordPress Themes

I've noticed a common thread in the free WordPress theme collections out there, embedded links for sometimes very strange products. It's done by adding the links to the footer, sometimes in plain html other times in encrypted php code. The latest I've found is the most elaborate. Someone, not sure who does this, the original designer or beyond, but they took the sidebar options, wrapped that php code and encrypted it. If you're thinking ahead, you're correct, the template is void of allowing any changes to what is shown in the side bar.

Here is that a typical footer looks like. This is the actual example of the wrapped sidebar:
eval(base64_decode('Pz4g77u/PGRpdiBjbGFzcz0iZm9vdGVyIj4NCg0KCQk8ZGl2IGNsYXNzPS
JnYm94Ij4NCg0KIDxiciAvPg0KDQo8P3BocCBnZXRfc2lkZWJhcigpOyA/Pg0KDQoNCg0KPGRpdi
BzdHlsZT0iY2xlYXI6Ym90aCI+PC9kaXY+DQoNCg0KDQo8L2Rpdj4NCg0KCTxwPjw/cGhwIHRo
ZV90aW1lKCdZJyk7ID8+IDw/cGhwIGJsb2dpbmZvKCduYW1lJyk7ID8+IC4gIFdvcmRQcmVzc
yAuIDw/cGhwIGlmKGlzX2hvbWUoKSkgOiAPjxhIGhyZWY9Imh0dHA6Ly93d3cuY2lnYXJldHRl
c21peC5jb20vIiB0aXRsZT0iQ2lnYXJldHRlcyBNaXgiPkNpZ2FyZXR0ZXMgTWl4PC9hPjw/cGhw
IGVuZGlmOyAgPz48L3A+DQoNCg0KDQoNCjwvZGl2Pg0KDQo8L2Rpdj4NCg0KPD9waHAgd3Bf
Zm9vdGVyKCk7ID8+DQoNCjwvYm9keT4NCg0KPC9odG1sPiA8Pw=='));

This is only a speed bump. If you really like that theme you have a couple options. You can:

  1. Search for other version of the theme with out the garbage (usually in the footer.php).
  2. View the source code for the page, then copy that into the footer, after you've changed to to info that you like. To do this make sure you know where the footer.php starts and stops. You can add your own flags to insolate the area.
  3. Get a footer from another template, more advanced but an option. Just make sure to line up the .css accordingly.

So, next time you get a free theme, check all of the code for hidden gems, you never know what you're gong to find.

14Feb/100

A crazy time for media consumers

A few upgrades to my home media ecosystem has had my head spinning of late. A faster internet connections coupled with updated hardware doesn't sound like much but along with what's already in place, its mind blowing.

Lets start with movies, currently anyone in the family can pick from a shit-ton of movies stored in various small DVD holders. Any one of them can be played on one of 5 computers in the house, in the family truckster and in any room that has a TV. But there's more, more then the physical DVD's. The family queue at Netflix either physical DVD's or instantly, once again, they can be played in many different places. Then there's the 3 big name movie channels we have free for 3 months for upgrading to HD cable. Each one of them has more sub channels then I had in total when I was 8.

All these ways of consuming movies was sending me into a tailspin just a few hours ago when I sat down to watch a movie, then decided to record it for later on the DVR, then reconsidered. It's sad to think I spent 6 hours one weekend trying to figure out how to convert dvd's to stream them to my computer/HDTV. Yes, there's got to be an easy way, but it take time and with all the options why not just go with the one that is the easiest to manage in the long run... steaming.

The bandwidth is there and the quality is getting better. Just look at Netflix for example. Soon, in addition to watching instant movies via the blu-ray player we'll also be able to on the Wii this Spring, and later this year, they'll start streaming movies at 1080p. So why not just stream it when you want to. No collections to manage, planned physical media obsolescence, the eventually go out of date, just take those dvd's for example, (KID, GET OFF MY LAWN). Yes that last comment made me look old but look how fast DVD's when out of date. They're not dead, but I've watched two so far and up-scaling SUCKS. TV shows on HD look better, even standard def looks better. So why keep investing in 'collections', the holders, the space, the trip to the store, etc.

The convergence is happening. The convergences of having all your entertainment points in the house connected by rj-45 cables. This is where the music portion of  this post comes in. There is overlap from the move rant, where you have Netflix on demand you have streaming Pandora on the blu-ray and the Verizon FiOS has tones of music channels to choose from, they all do. An addition to all this is Media Manager from Verizon. Once installed on your main pc, allows you to stream all your music to your stereo. I've been for this for along time, along with setting my DVR via my phone; check (freaking love it). The Media Manager works like iTunes where it add all your music, and pictures, videos but is then accessible through your cable box using your TV as the display. What makes this worth listening is having optical audio cable from your cable box to your stereo.  No more do you need a DAR, a digital audio receiver, or anything else. It even understands iTunes play lists.

The management, or tending to your media is still there. You have to update your queues, trim the fat on your DVD players and remember to back up your music... somewhere, but its not going to go to be unusable in the figure. Think about it, mp3's, they'll work for ever, not like physical media, and your streaming options, they just might need new firmware or hardware updates, no big, they take up a fixed space, not like all the cd/dvd holders laying around.

There is one catch to all this, what about roaming, or the physical media being the fabric that connects disparate hardware, because you can walk around with it? Your boat, boom-box, someone's car? This is where your smart phone comes into place. With it you can stream or store your other media or subscriptions. The bottle necks at play here are widening, streaming is getting faster and storage capacity bigger.  Beyond this, your phone will turn into a more powerful remote for all your other virtual media collections, DVR, PC, NAS, etc, Love it!

So what's next, Sonos? Not yet, but one thing is sure, more hardware and subscriptions purchases and less physical media stockpiling. And yes, I purposely left out audio books, that's part 2.

14Feb/103

Server Backup so easy Danica Patrick could do it

If I only knew it was this easy in the first place. Not joke, the data backup feature in the Simple Control Panel provided with dedicated servers from godaddy.com is a snap to configure.

However the interface is only data. If they could tap into mysql dump it would be a truley amazing feature. For now you have to configure that on it's own. The back up of your mysql data, add it to the folders you want to back up then have your backup scheduled.

To tie this all together create a shell script that dumps your mysql data into a compressed file:

Add this to a file and name it website.sh
mysqldump -u root -p password databasename | gzip > /home/website/public_html/backups/website.sql.gz

Then enter the following into a new Cron Tab entry...
bash /home/website/public_html/backups/website.sh

The directions above work for godaddy's dedicated or virtual dedicated serves. Make sure if you're working with large data sets that you allow plenty of time to let the mysqldump to complete before performing the backup. To configure the back up itself go to the "Manage Backups" and configure the entire website along with the zipped data. You might want to "Rotate Backups" which means it you'll always more then one on file just in case, just in case.

Make sure to enable FTP. It's not good enough to have the data there safe in a zip file in a different location. If your dedicated / virtual dedicated servers go, they're gone. You are responsible for having a back plan in place, and they won't mount the drive to another, server, etc, they will do nothing, and they shouldn't, its in your contract. And if you're thinking ahead, they won't even as a servers. Your data is gone, as mine was when the kernel on my server when south.

The ftp area is very easy to configure, make sure to time it out a ways to let the data backups finish and if you can at all help it schedule all of your other server wide cron jobs around 'back up time', why not, let it breathe like a fine wine. Once it's complete, test, if you're backing up to another account at godaddy, its going to FLY, trust me. Also, this post isn't complete with out sending a virtual thank you to the CEO at Diligex for providing me with 2 gigs of space to get this all done.

Lastly, file sizes. The backup area has an "exclude folders" option so you can bifurcate your backups, the important areas every night and your huge downloads or images folder every week, the reason? Bandwidth, for the source and target server, each backup will burn some. If you don't have to worry about this then let it ride.

14Feb/101

Twitter.class.php returning Error: 400

This could be one of my bigger lazy moments but after having to rebuild a server from v7 of Fedora to 8 and upgrading everything else in the LAMP stack I gave up and went with a new class, twitter.class.php and it works great, no more Error 400 on posts. The previous class (Twitter.class.php / Brandon Trebitowski Created: 02/26/2009 / Version: 1.0) was throwing too many errors and there were very little answers on the interwebs. Remember, can't stress this enough, I'm sure it's a configuration issue on my end that I don't have the patients to investigate.

This new class is just as easy to implement and comes with an example.php that is very easy to test. Thank you for your time in putting this together Simon Wippich.

Some final notes. This will throw 401 if you have the wrong credentials, Error 400 if you have them correct. The word around the blogs is 400 is related to flood control or the rate limit being reached. This was not the case. Also, Brandon, if you've addressed this in future versions of your class let me know and thank you for the amazing job you did on it!

14Feb/101

How do I create a Subdomain in Simple Control Panel?

If you've read the instructions at godaddy.com then why are you at this page? I'll guess, you forgot that one step that always gets me, the Document Root, more specifically the correct way of typing it...

For Server name: y
For Document Root: public_html/y

As for Simple Control Panel, its amazing. I just learned recently that it's a property godaddy offering. If the developers are reading this post maybe they could use the same folder drop-down already in "Manage Backups".