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/100

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

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/100

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/100

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".

26Jan/108

Dedicated Server Died

This server hosted all my sites and will take a few weeks to get back on-line….. Details below.

-------------------------

Our support staff has responded to your request, details of which are described below:

Discussion Notes
Support Staff Response
Dear Sir/Madam,

Thank you for contacting Server Support.

Unfortunately, we are unable to restore access to your server. When attempting to boot the server, the server experiences a kernel panic. All attempts with other kernels and in single user mode results in the same behavior. A reprovision of your server would be necessary in order to restore connectivity. The reprovision of the server will remove all content and reset the server to the default settings.

To reprovision your server, deleting all data and applications and returning the server to its initial setup state, please follow the instructions below:

1) Log in to your account.
2) Select ‘Servers’ link.
3) Click ‘Launch Manager’ next to the Server that you’d like to reprovision. It will open up in a new window.
4) Click on the ‘Support’ section to expand it and then click on the ‘Reprovision’ button.
5) Confirm the reprovision.

Please note: reprovisioning the server will erase all the data on the server, including any backups stored on the server. You are responsible for the integrity of your data backup and restoration.

Please contact us if you have any further issues.

XXXX.
Server Support

10Sep/095

What attention seeking whore wouldn’t take part in this?

The idea is simple, write a quality piece on anything Lotus and see if it has what it takes to win praise from Captains of our Industry.

Think about it, you might not have the skills to bust through the defensive line of the New England Patriots or score a goal on Manchester United, but surely you can get an article through the Lotus equivalent?

Give it a try and be considered "Published" in our community, with a lot less overhead.

Notes for Authors:
1. All drafts are private, viewable only by the author and the editor-in-chief.
2. Pending articles are only seen by the edit staff.
3. Published articles will be highlighted everywhere and you will be permanently added to the "Published Authors" page. (I will soon be removing myself from this page).

Notes for Editors:
1. A "Voting" link has been added to the Journal front page to make getting to the voting booth easier.
2. The voting RSS feed is live. It will alert you of new content to vote on (available on the voting page).
3. Your services are required, an article is currently watiing your comment or approval, check it out.

Lastly, big props to Daniele Vistalli for being the first to submit an article which I hope everyone will be enjoying soon.... and also to Ulrich Krause for adding some comments to Daniele's contribution.

Sorry in advance if the title offended anyone.

8Sep/091

How to forward a Wordpress Page to an external URL.

Since there is no option to do this in the page itself you have to use a page template.

1. Create a file called redirect_twitter.php with the text below and save it to your theme folder (/public_html/wp-content/themes/yancytheme/redirect_twitter.php).

<?php
/*
Template Name: Redirect Twitter
*/

header('Location: http://twitter.com/yancylent');
die();
?>

If you plan on making more redirects the file name starting in redirect will ensure they all stay together.

2. Create the page, and choose the 'Template Name'  Twitter Redirect.

3. Save, done, test, done.

*Note that if you change your theme you'll have to move the redirect page templates. I tried adding the templates to higher level folders but they aren't picked up, so this manual process is needed.

**Also, no messing with the .htaccess.