Archive for September, 2006
PHP Lesson 1: Pretty URLs!
Sep 28th
I am going to start a new practice here. Every now and again I’m going to post some PHP code with some explanation. Today, I’m going to write about what I’ve been calling “pretty URLs” and how to create and manage them in PHP.
PHP includes a variable in the superglobal scope $_SERVER called “PATH_INFO.” PATH_INFO includes information entered after the name of the requested script.
Let’s use firsttube.com as an example. The URL of a story is constructed as such:
http://firsttube.com/read.php/[id]/[url_friendly_title].html
The story is also accessible as /read.php?id=[id]
So how do we construct this so-called “pretty URL?” Using PATH_INFO. Read on for details.
More >
Nothing Says "I Love You" Like an Ass in the Box
Sep 28th
I can’t wait to buy an Ass in the Box for someone. What a novel idea. You get a gift in the mail, you open it, and it’s a giant ass. Lovely.
This article from CRACKED magazine had me laughing this morning. I really enjoy the new site. It’s – how you say? Ah, yes… – funny.
I registered for Netvibes today, and I must say, it’s what Google Personalized ought to be. It’s heavily AJAX and drag-n-drop based, and there are no page reloads when you switch tabs. It’s fast and simple, but not as simple and pretty as Google. C’mon Google, you’ve got a ways to go with Writely, Spreadsheets, Google Personalized, and Picasaweb. Don’t disappoint us, we’re counting on your to get these puppies as spit-shined as Gmail.
New, Delicious 20" iMac and Bringing it Back to Life
Sep 28th
So, it arrived. My new Core 2 Duo 20″ iMac. I upgraded to 2GB of RAM and the 256MB video card, making this machine a real whopper. I may post a short review here later.
What I really want to talk about is rebuilding a Mac from zero. When I moved from the iBook to the MacBook Pro, I used the Migration Assistant, which is an amazing tool. Unmatched by anything in Windows, you literally plug it in and let it transfer everything – apps, settings, files, etc – to the new Mac. You log in, and – boom! – OS X feels like the same thing you just left behind, from your desktop wallpaper to your keychain to your browser bookmarks.
But this time, I sold the MBP weeks before the new iMac arrived, so I had no migration assistant to work with. What I did have was
1) an external Firewire drive, but the data was two weeks old.
2) an external USB2 drive with a current exact copy of the drive (via CarbonCopyCloner).
3) A copy of my home directory on a USB2 drive.
So, I booted up and set myself up as a user. Nice to know that a Mac wil detect Bluetooth mouse and keyboard as part of the setup process. Windows never did that before!
First things first: I copied all of the apps I wanted over from the external USB2 imaged drive. Step 2, I copied over the contents of the “Application Support” folder in ~/Library. Then a few more library folders, such as ~/Library/Mail and ~/Library/Application Enhancers.
The next step was restoring my keychain. This was done via a simple replace. I simply overwrote ~/Library/Keychains/login.keychain with the copy from my external and it was restored.
iTunes was a bit more complex – but only a bit. First I copied over my music library, which I do NOT keep in the default location of ~/Music/iTunes Library. I changed the preference in iTunes to point to my prefered location and then quit iTunes. Then I copied over two critical files: ~/Music/iTunes Library/iTunes Library.xml and ~/Music/iTunes Library/iTunes Library. Relaunching iTunes had everything there in one shot: playlists and all of my music. Now, since I had backed up on iTunes 6 and this Mac came with iTunes 7, it had to update my library data AND determine gapless playback for over 5000 songs, which took some time. The nI fetch cover art, which took some time too. After that, I got a very odd error: “Cannot launch iTunes. There is not enough free memory.” Hmm… that’s odd. I have 2GB of memory, of which I’m using less than 300MB, but iTunes can’t open.
Long story short – after some internet searches, I had to download and reinstall iTunes, which is more complex than you’d think, because if you don’t remove iTunes.app AND the iTunes components from /System/Library/Reciepts/, it won’t install at all. That fixed the problem, which was odd. One site suggested it was because of a haxie I use called UNO.
Anyway, after that, I launched iPhoto and guess what – it worked perfectly on the first shot. How satisfying.
All in all, it took about 2 hours of actual work time to get myself back up and running and that was with fooling around in the middle. I’m extremely happy with how quickly one can rebuild a Mac without using the included tools.
In truth, at its core, if you just back up your home directly and your /Applications folder, you will have everything you need for the most part. Having done a rebuild of Windows machines more times than I’d care to remember, this is just cake. Absolute cake.
Search Optimization: A 60 Day Test
Sep 26th
I sent Eugenia and Thom a list of suggestions for improving your standing in search engines. It’s really just a list of lessons I learned as I researched the topic for my company. I culled the info from websites, a search engine optimization partner, and various writings on the subject. The thing is, as I wrote in an earlier post, it’s really worked for me. I’ve obviously done something right, because firsttube.com is returning much higher in all search engines in the last few months. Actually updating once in a while is probably a large part of it…
So I decided to implement many of the same things on OSNews. I have not only created “pretty URLs,” which are really just URLs that obey PATH_INFO rather than standard GET variables, but I’ve added lots of links, included additional internal links, cleaned up the page titles, and added links to submission forms of popular social networking/social bookmarking sites in attempt to earn some additional trust in pagerank.
I’m hoping to see some changes within the next 60 days. So, let’s check back at Thanksgiving time and see what happens.
Two Quickies
Sep 22nd
1. CRACKED magazine online reports about 5 Movies Hollywood Needs to Stop Making Now. It’s hilarious.
2. Youtube is simply amazing. So, without further adue, something you could only find on the internet: Japanese pen tricks. It’s like extreme “penning,” or something.
Links 09/21/2006
Sep 21st
The Maragret Thatcher Illusion
Oooooh! Scary face! But actually, really kinda cool. Interesting how the mind works…. which leads me to…
Mind Performance Hacks
I want this book. Seriously. I want this book to sharpen a mind that I spend the majority of the time dulling.
Crazy urban ninja dude
Because the first minute is totally sweet.
Armless Man Plays The Guitar With His Feet
I would watch this dude, not walk by aimlessly, as most people seem to be doing.
It’s Peanut Butter Jelly Time!
No need to say any more.
Girl Archer
This is just too amazing to be real. Some people have amazing toes, like the dude above.
My SEO is working!
Sep 18th
Some time ago, I decided to learn a little bit about Google Pagerank. I wanted to improve my site’s rankings in Google’s search results. I learned about Google-dancing and many of the sports that involve optimizing your page in search results. So I took the advice and redid a lot of my page to work with what I knew. Those of you that actually follow my blog have seen changes: tags, topics, changes to my XML feeds, new prettier URLs, etc. I keep track of all referers when someone hits my blog. I see Yahoo! Slurp and the Googlebot crawl me everyday. But then I started noticing something. I started seeing really simple Google searches refering to me. As of this writing, by typing:
into Google, firsttube.com returns as the FIRST result. In fact, if you just search for “picasaweb,” I’m the fifth result, ranked only behind Google itself, ZDNet, and Miguel de Icaza. I have a ton of traffic coming to my Picasaweb vs. Flickr article, and lots of traffic goes to my “I want Picasa on Mac” article, even though it’s mostly worthless other than me pining away.
Anyway, I definitely want to make the same types of changes on OSNews, because clearly we could always use a boost in search engine results. As a direct result of the boost firsttube.com has seen, I think I’ll be adding friendly URLs to OSNews in the next few days.
Office:Mac is a’Comin
Sep 18th
Mac:Office 2007 is coming! This is great news. Microsoft has made Office a MUCH better product with Office 2003, and the associated updates, and I look forward to an Intel-native version of Office that accomodates the UI changes that have been introduced since Jaguar.
Since I ordered a new iMac, I will consider buying Office:Mac 2007, provided NeoOffice hasn’t gotten so good by then that it makes owning MSO worthless.
Also, I have found that almost all of my home Office-app needs can be accomplished via SubEthaEdit for text and Google Spreadsheets for… uh… spreadsheets.
Bye-Bye Slashdot, Hello IG
Sep 15th
Today is a fairly big day, well, at least for my internet habits. When I launch a browser and open up my tabs, they look like this:
Gmail|Slashdot|OSNews|My Yahoo!|Work|Bloglines|Digg
I’ve added to the tabs in the last year or two: I added the work tab (email when at home, our helpdesk at work), then added Bloglines when I got into RSS aggreggation. Then Digg is new as of the middle of last year or so.
But I realized recently that I don’t really read Slashdot much anymore. For one, their news is way too slow, especially compared to Digg. The same COULD be said for OSNews, although we’re typically MUCH faster (faster even than Digg can promote to the front page for huge news), we feature many more originals, and the comments are readable, whereas the Slashdot arrogance and the volume of comments has gotten to be too much for me. What has been my #2 tab since about 2002 (I started reading Slashdot sometime in 2000) is now used the least of all. So, with the introduction of tab’s on Google’s customizable homepage, I pimped out my Google and made it tab #2. I’ve got my main tab, my Tech tab, my Sports tab, and my Entertainment tab rockin’. It’s pretty cool. So, from now on, I’ll get my Slashdot fill from google.com/ig.
I wonder if Slashdot is losing people, or if I’m just a single person moving on.
