• Posted on September 11, 2010

So you rooted your Android…Now what?

Let me begin by saying that I’m pretty new to Android rooting as well. I typically work in LAMP stacks and mobile development and tweaking is something I’ve only been doing for a few months now. Having said that, if you’re comfortable in *Nix environments, you won’t have any trouble.

Image courtesy of xkcd

Disclaimer

“Rooting your phone will void your warranty, damage your reputation as an upstanding member of society and maybe even insult your family. In no way, shape or form do we condone any action that goes against the principles of any agreement that you might have signed to not modify your phone’s software. Read further at your own risk.” -TNW

Anywho, this isn’t an article about why you should or shouldn’t root. If you’re here, you’ve probably already rooted or, at least, already decided it’s for you. This article assumes you’ve just rooted and you’re not sure what to do next.

Am I rooted?

The first question I had after I rooted my Droid Incredible (which was stock 2.2 OTA) was, “Uhm, did it work?” After rooting, the phone goes through a process of reboots which takes 5-7 minutes in all. (I was surprised, I assumed the rooting process would take longer.)

The quickest way to test for ‘root’ is to simply open up your Apps folder and see if a new app called ‘Superuser Permissions’ shows up. It has a picture of a ninja. If you see this, you’re rooted! Congratulations!

So, what’s next?

So you know that root has its benefits, but what should you do first? My opinion will vary from others, but then again you’re reading my blog, so you asked for it. :)

I would most certainly download Clockwork’s ROM Manager and perform your first nandroid backup. (Huh?) A nandroid backup is an exact file system copy of your phone (think .iso or CCC). It allows you to restore your phone (apps, settings, preferences, etc.) to that state in the future should you need to. It’s a good idea to have this ‘stock’ backup in case you FUBAR your phone with your newly granted Root rights and need to revert. There are plenty of instructions out there on how to Backup/Restore your phone using ROM manager.

Another Backup?

I also suggest people immediately download Titanium Backup (donate version) and backup their system & preferences with it as well. This may be redundant, but it also allows you to restore individual apps & settings in the future, should you need to.

Finally, if you haven’t already, download Appbrain’s app to your phone, create a free account, and sync your apps. If for some reason you lost your backups and has to reflash a stock ROM, you would lose all your settings but at least you could re-install all of your apps easily.

Next steps

So, now you’re all backed up. You probably want to start removing Bloatware and other preinstalled apps. In my opinion, Titanium Backup is the best option here. Once you donate, you get a Key to unlock features such as ‘freezing’ apps. While some apps can easily be deleted (Nascar on Sprint, Skype & VZNavigator on Verizon), others don’t like to be removed. Some applications like Friendstream.apk are used by other apps like Twitter and Facebook. For this reason, using TB to ‘Freeze’ these apps (basically renaming them to prevent them from loading) is a better option. This way they’re still on the phone if you decide you want to reenable them later.
(I actually mistakenly deleted FriendStream after my first root thinking that it was Footprints.apk. I had to reflash from my nandroid and then go through it all again; it cost me 3 hours or work but I was sure glad I had the nandroid!)

What about Wifi tethering?

Yes, after backups and removing bloatware, free wifi tethering is one of the greatest things about having a rooted device. Carriers charge between $20 and $30/month for 3G hotspot capabilities which seems erroneous since most smartphone plans make concessions for unlimited data.

There are a few ways to use free 3G hotspot (wifi tethering) and a Google search will bring you more info than what I can share. I will insert a few links to make things easier though:
Wireless Tether for Root (pre8) – This seems to be the crowd favorite right now for app-based tethering.
Verizon EPST hack – If you’re on Big Red, you may also want to read about this EPST hack. It’s fast, simple, and doesn’t require root or a 3rd party app. (Of course, I don’t condone breaching your contract, so only read about this. Never do it. Right Big Red?)

Next steps

So, you’re rooted, backed up, surfin’ the web for free…anything else? Of course! You’re just getting started. Lots of cool apps out there require root to run. A few of my faves include:

  • Screen Shot It: This app allows you to take those cool screen shots of your screen that you see when checking out forums. This particular one is paid, but allows for cropping and ‘shaking’ to capture. Great app.
  • Root Explorer: Also a paid app, this file explorer is granted SU access and can remount the drive from Read-Only to Read-Write quickly and easily. Very useful.

Closing Remarks

I hope this “What to do now that you’re rooted” guide helps. It certainly isn’t intended to be a How To guide of any sort…more like a roadmap for where to go next. Keep in mind that if you have a stable nandroid backup, you can experiment a good bit. Be careful what you uninstall and create new nandroid backups when you reach a point where you like your current build (i.e. after you remove bloatware and install your rooted apps.) It’s also a good idea to copy your nandroids off your SD card to your computer from time-to-time for safer storage.

Further reading

I didn’t get into the benefit of custom ROMs etc. in this short article; there are PLENTY of other write-ups out there on that topic. Here are a few other reads for you if you wanna dive in further.

Need more help?

If you still need help, many great supporters can always be found in the #unrevokedtest channel on Freenode IRC. Join from your favorite IRC client or via the web. I can typically be found under the handle “idowens”.

  • Posted on August 16, 2010

WHM & WordPress Tips & Tricks

In my day job, I work a lot with WordPress and lately we’ve been utilizing a VPS or Dedicated server for more labor-intensive needs when shared hosting won’t cut it. Further, this site you’re reading now, along with about 8 others I own, are currently hosted on a VPS I’ve had for about 6 months now.

During this time, I’ve learned a lot about server management from the Linux command line, WHM (Web Host Manager, for the uninitiated), and cPanel. Below are just a few of the more helpful things I’ve learned along the way.

WHM vs. cPanel

If cPanel is the user interface for managing you hosting account, think of WHM as the user interface for managing all of your cPanels. Most people won’t ever see/use WHM because with most shared hosting accounts, you don’t get WHM access. However, as soon as you purchase a VPS or Dedicated server, you’ll be provided WHM as a way to manager all of your sites on the server. Resellers are very used to WHM as they use it to manage their clients.

WHM doesn’t allow you to do anything you can’t do from the command line & an FTP client but it sure does make it easier and faster. The WHM interface is very cPanel-esque and once you learn where the main things are, it’s pretty simple.

~tilde access for temporary site access

One of the great things about setting up a shared hosting account and registering a new domain name is the fact that most hosts give you immediate access via the IP address followed by “/~account_name”. When I first began using my VPS, I noticed that this helpful option is turned off by default.

Turning it on is a really simple procedure. Basically the Apache module mod_userdir needs to be enabled. To do so, log into WHM, open the ‘Security Center’ tab in the sidebar, and click the first option, ‘Apache mod_userdir Tweak.’ Once there, uncheck the ‘Enable mod_userdir Protection’ box and viola! your /~username conventions will now work.

A note from the cPanel user manual: “Disabling this is desirable, as the bandwidth used when the site is accessed using this method is attributed to the web host’s main domain, skipping bandwidth monitoring systems.”

Whitelist IP addresses

When setting up a new site, or constructing one for a client, it’s not unusual to hit (that is, access) a site several hundred times an hour (esp. if you’re awful at CSS like me and need to refresh a lot.) Default firewalls are typically set to quickly lock users out for what looks like ‘spam’ OR if you happen to forget a password and attempt to login with the wrong credentials more than a few times.

To prevent this, it’s a good idea to quickly whitelist your IP address (at home and work) as well as any potentials clients who will be accessing the site a lot. To do do, go to the very bottom of the WHM sidebar and open the Plugins option, then ‘ConfigServer Security & Firewall’. Once there, look for the Green box that reads ‘Quick Allow’. Simple enter your IP addresses here, one by one, and click Quick Allow. You can also use wildcards here.

Set recursive php.ini location

Over and over, WordPress plugins require more that 8, 16, and even 32MB of PHP memory to run. Many hosts limit the ceiling of PHP memory allowed to 32 or 64MB (Midphase upped one of my accounts to 96MB upon request, but it took getting in touch with a System Admin. for the concession and I got a strong warning that if more than 7 processes used 96MB simultaneously, my account would be subject to suspension.)

Anywho, without getting into the details of the PHP.ini file and why it needs to be modified (that’s another post), in order to be truly useful, the newly created .ini file needs to be placed in EVERY directory on the server. That can be really tedious for many reasons. (1) It’s a pain to place it in every directory and (2) to make a change, one has to replaced it every directory. Fortunately there’s a solution that makes use of your .htaccess file.

Most WordPress users will only be familiar with their .htaccess file as it relates to their permalink structure as this is the file WordPress writes to for mod_rewrite rules. The .htaccess, among other things, is useful to creating permanant 301 redirects, custom rewrite rules, and setting the location of a ‘global’ .ini file.

I use the term ‘Global’ loosely as the VPS or Dedicated server’s PHP.ini file has the ‘ultimate’ ceiling defined but a local .ini file can up your limits to the max of what is allowed. So ‘global’ is the local sense. Confusing, I know.

Back to the helpful part: Rather than placing this file in every directory, simply place your PHP.ini file in a central locale and then add the following line to your .htaccess file:

SetEnv PHPRC /location/todir/containing/phpinifile

Notice that the command does NOT link to the actual .ini file but rather the directory in which the .ini file resides. Setting this value makes it easy to change, keeps you from having to place the .ini file in every directory, and finally, some areas in WordPress work much better with this line defined (For example, the Media Upload tool often doesn’t recognize an upload limit that has been raised from the 8MB initial limit to a newly defined 32MB.)

Closing remarks

These are just a few tips I’ve picked up in the last few months. When I have time, I’ll try to write a follow up article dedicated solely to the best practices for .htaccess files & PHP.ini files.

  • Posted on July 25, 2010

Clingo Phone Mounts

When I swapped from my Blackberry to an Android phone (Droid Incredible) I knew that I would be using the the Inc as my new GPS Navigation unit. See, about 3 weeks earlier I had flown to Raleigh, NC and I took my Telenav GPS unit so that I wouldn’t have to rent one from Hertz once I got there. Don’t get ahead of me. On the return trip, there was a mix up on my ticket and I almost didn’t make my return flight. Luckily I made it on board unscathed, but my baggage wasn’t so lucky…it was apparently dropped a few times making it from the ramp to the plane and when I got back home to Birmingham, I noticed that the touch screen was completely cracked, and, being out of warranty, I was completely out of luck.

So, back to the story. Knowing that I was planning on using my new phone as a GPS unit, I began looking for the right vehicle mount. Verizon provides one made for the Inc but it’s giant and definitely an eye sore. There are also other aftermarket car mounts with a various array of mounting options. Some mount to the windshield, some to the dash, and others on the AC vent. Of course, in the hot Alabama summers we have here, anything that would partially block the AC is a laughable proposition.

Most of the mounts were not ‘sexy’ to use a good geek term. They all looked big and clunky…not at all a good match for such a sleek phone. (This is one area what Apple outshines…mounts, cases, etc. for the iPhones are much hotter & more accessible..having said that, manufacturers have an easier time since with Apple products, there is typically just one form factor where with Androids, Blackberrys, etc. have many different sizes, shapes, etc.

After a bit more searching online, I ran across a product called Clingo, made but the well-know Allsop company. Clingo use standard bases for the desk, car, and neck (yes, neck) and then uses snap-on, lime-green sticky pads which the phone then adheres to. Sounds crazy, right?

I ordered a desk mount for the office as well as a car mount which easily swivels 360° so that I can easily rotate it for Navigation or for a larger keyboard when texting (at red lights, of course!) When the products arrives, the desk mount sticky pad was already coming apart…the pad was poorly glued to the base and since one has to literally ‘peel’ the phone off the pad, I knew this wouldn’t last very long. A quick call to Customer Service and they drop-shipped me a new pad for the desk mount and I’m pleased to say it was much much better quality.

All in all, I’m really pleased with the product. I should note that some phones don’t work well with the sticky pad method. For example, if you phone doesn’t have a ‘flat’ back…that is, if it is curved or has ridges like the Droid Incredible, it’s not going to stick very well. (I have a hard plastic case on my Inc which apparently is the absolute MOST adhesive thing for these sticky pads to stick to because it can tedious to remove at times.) Also, the latest iPhone 4 doesn’t stick really well to it. It may work fine for your desk but in the car, there’s too much vibration for it to stay on.

These mounts run between $30-40, depending on your setup. They’re available directly from the company and should soon be available in Best Buy, Radio Shack, and are now available online at Amazon. Also, if you’re using a clingo car mount with the Inc, be sure to pickup a right-angle micro-USB cable to keep the cord out of your way as you rotate it!

All of these items can be found in my Gear Guide Amazon Store where you’ll find products for your Droid Incredible. Check it out

Do you have any experience with the Clingo mount or other solutions? Be sure to share them with me!

  • Posted on July 01, 2010

Android / Droid Removable Drive Icons

I bought an HTC Droid Incredible last week and have had a lot of fun getting acclimated to it from the Blackberry Pearl that I was using before. The addition of Wifi, the large screen, and especially the apps, make this a HUGE upgrade and makes my former “smart” phone look pretty dumb.

One of the first tasks I was interested in was moving my media (images, ringtones [see previous post], etc.) from my Blackberry’s older 2GB SD card to my new 16GB SD card. So, I read up on how to mount the phone & SD card to my Mac and was off to the races. Something that bothered me from the get go was the fact that my Mac simply assigned both drives, which were both named ‘no name’, the default ‘Removable Drive’ icon. Not only was this ugly, but it also didn’t help me differentiate the two.

So, having the Type-A personality I do, I set out to set the world straight. I searched online for a few different drive icons that I liked, grabbed the Android Robot icon, and fired up Photoshop to make some edits. The finished product was 3 ‘droid branded drive icons which I could then assign to the internal phone memory and the removable SD card, with one to spare.

Here’s a preview of the set:

Android Drive Icons

If you’re interested, you can download the set below. The .ZIP includes:

  • The original droid robot icon @ 256×256
  • All 3 unbranded drives @ 256×256 in .PNG & .ICO formats
  • All 3 branded drives @ 256×256 in .PNG & .ICO formats
  • A ReadMe / License RTF

Download the free Android Drive Icons ZIP file.

  • Posted on June 27, 2010

Free Business Ringtones | Professional SMS Tones

On the previous iteration of this blog, I had a very popular post by this same title…aparrently I wasn’t the only one looking for non-poppy ringtones.

Somehow during my move, I didn’t back up my SQL DB, so I lost the actual post. But, in anticipation for my HTC Droid Incredible arrival tomorrow, I was pulling all the MP3s off of my Blackberry so I can transfer them to my Droid. Here are the few tones I had listed in the previous post…some are ringtones, some are for text messages or MMS:

8SMS – SMS
Business – SMS
Doraemon – SMS
Msg_Notice – SMS
Naruto – SMS
Piano – SMS
TXT – SMS
Silver – Ringtone

SInce I’ve had my Blackberry for about 2 years now, I’ve gotta kinda fond of a few ringtones & alarms. Well, I’m not so sure ‘fond’ is the correct word…maybe ‘accustomed’ is a better term. In other words, like Pavlov’s Dog, I’ve learned what types of emails or messages are coming in by which noise the phone makes. Therefore, I searched out copies of the default Blackberry ringtones, SMS and MMS tones, and alarms. Rather that link all 56 of them individually like the ones above, I’m including them in a 193kb .ZIP file.

Download the Blackberry Preloaded Tones Zip

Hopefully RIM won’t come sniffing around and make me remove the zip. Enjoy it while it lasts.

  • Posted on May 22, 2010

Add Max Width to WordPress Image Uploads

The core WordPress media manager does a pretty good job of helping folks to automatically manage their images. Depending on your setup, WordPress will look for the GD Image Library on the server (you can also set it to ImageMagick if you prefer…like I do) and resize your images, auto-create thumbnails, and perform other neat on-the-fly chores that would take awhile to do if you blog a lot.

The later versions of WordPress will take a large image and create 4 different images once you upload it: a thumbnail, small, medium, and large, along with the original. You can then select which image you would like to insert into your post.

Over the past two weeks, I’ve been helping my Mother move from a Blogger blog to a new WordPress blog. She had been wanting the ability to have a wider “content” area and wanted a fresh new look. So, we found her a template that would work well for her and I modified it to fit her needs.

One of the issues we had, once we launched her new blog was image sizing. Sometimes she’ll upload images from her digital camera (which are really large) and other times she’ll grab smaller images from a Google search to include in her posts. It was confusing to her to not have all the size options each time she uploaded an image. See, if a photo is relatively small when you upload it, you won’t get the options for a small or medium image, only the original. Conversely, if a very large image is uploaded and she chooses ‘large’ or ‘orginal’ it may be too wide for the content area and essentially ‘break’ the layout.

Fortunately, there is a simple solution. Locate your theme’s main functions.php file (typically found in the theme’s root directory), and add the following after the opening < ?php

$GLOBALS['content_width'] = 800;

This will set the maximum width for uploaded images to 800 pixels. You may, of course, adjust as necessary. Now, when my Mom uploads an image, she always knows to choose the 'original' option, because it will never be 'too large' for the content wrapper...of course, she doesn't know that this piece of code is in place...she just knows that it works. And, as they say, ignorance is bliss.

  • Posted on May 18, 2010

Redirecting Visitors on Unix Servers

There are many times when one may wish to redirect a visitor on his or her site. Say for example you used to have your blog a yourdomain.com/blog but now you want it in the root; you could redirect all traffic from the /blog directory back to the root / directory. Or, perhaps you’re moving to an entirely new domain; you could redirect all traffic from one domain to another. Like the first example, if you used to have webpages in a subfolder (like, /articles/article1.html) and you change your structure directory, you could redirect traffic from /articles to /entries.

One could come up with hundreds of reasons to redirect traffic and since there are so many reasons to redirect, there are a handful of ways to accomplish the redirection. The easiest and cleanest method is by editing your .htaccess file. The .ht (or, hypertext) access file is a directory-level configuration file that allows for “decentralized management of a web server1.” Incidentally, the file begins with a dot (.) because this is the default ‘hidden’ mode for *Nix servers. Anywho, the .htaccess file can do a lot of stuff and is very powerful, so always make a backup when editing the file and don’t erase things you find when you get there…always append, or prepend, and add a comment about what the code is meant for. (See #4 on Donnie’s list…in fact, read them all while you’re there.)

A few mote notes about .htaccess:

  • Always transfer your .htaccess file to the server is ASCII mode; binary will mess it up and could cause your server to operate incorrectly.
  • If you can’t see your .htaccess file, make sure your FTP server is set show hidden files. Also, as mentioned before, you won’t find this file on a Windows server…*Nix only. You can always try uploading abc.htacccess.txt and then renaming it once it’s on the server to simply “.htaccess” if you’re having trouble.

301 Redirect

To move a single page:

Redirect 301 /oldpage.html http://www.example.com/newpage.html

To move your whole site:

Redirect 301 / http://www.example.com/

What if you’ve changed your site from .html extensions to .php or vice versa? The following will help you redirect one extension to another on the server-side; it looks for any .html extension and changes it to .php:

RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php

Other Methods

Remember at the beginning of the article when I said that editing the .htaccess file was the “clean & easy” way of redirecting? Well, not everyone has access to their .htaccess file so there is an alternate method. You can *gasp* use a meta redirect.

Search engines don’t like meta redirects and most people don’t either. They’re clumsy and they’re not bullet-proof like the .htaccess method. Either way, it can be used in a pinch. For this method, we’ll open the index.html or index.php file (or header file, if you’re using SSI) and add a few lines of code:

<meta http-equiv="refresh" content="10; url=http://example.com/">

The content=”10;  tells the browser how many seconds to wait before redirecting…you could easily change this to meet your needs.

Final Notes

All of my notes above have the intent of creating 301 redirects, as opposed to 302s. A 301 redirect is meant to be a permanant change. If Google and other spiders see a 301 redirect in place, they will begin updating their records accordingly.

Conversely, if you create a 302 redirect, you don’t lose your search engine friendliness. Here’s a helpful image to help you see the difference:

So, there ya go; a quick run down on redirecting visitors on a *nix box. Any questions?

  • Posted on May 13, 2010

Overlooked Gmail Security Features

One of the features I’ve long enjoyed with Gmail (and other Google accounts) is the ability to see which IP address logged in last and at what time; if you’ve never noticed this at the bottom of your Gmail window before, take a peek next time you log in. It looks something like this:

Then, of course, if you click on the ‘details’ link, you can see a more detailed view of which IP addresses have accessed your Gmail account and what type of device it was. Further, you can set up alerts to email you if ‘suspicious’ behavior is observed. Pretty nifty.

I know my home & work IP addresses so I take a gander from time to time and which addresses have accessed my account to see if I notice anything out of the ordinary. To see this for yourself (assuming you’re logged in to Gmail), click on ‘Details’ at the bottom of the main window; Gmail will also tell you which IP address is currently logged in; this is helpful if you’re using a public network at an airport or coffee shop, for example.

In my next post, I’ll explain how Facebook is incorporating some similar security features that are rolling out this week.

  • Posted on May 11, 2010

Hosting: Shared vs VPS vs Dedicated

web hosting
In my line of work, I have the frequent task of helping clients choose a hosting provider. Usually, my clients are not IT people but, rather, they work in Marketing, PR, or are the CEO of a company, wearing all kind of hats. Thus, my task of explaining the differences to them can be somewhat painstaking at times.

There are three basic types of hosting (but you know that already because you’ve read the post title.) Allow me to break down the three in less-than-technical terms.

Shared:

This hosting plan is the most common and the cheapest. Big name companies like Dreamhost, Bluehost, and Startlogic are some of the big players in this game. They take fairly good hardware (a fast processor, a lot of ram, and a Linux distribution like Ubuntu or CentOS) and then ‘partition’ the server into thousands of tiny little slices. They then resell those slices to individuals for a nominal fee…anywhere from $5 to $10 per month, usually.

Shared hosting is OK for your brother’s blog, a super-simple website without complicated eCommerce transactions, and the occasional calling-card website. The price is right and smaller, simple sites like these don’t require a lot of system resources to run. Where shared hosting falls short is when you have an application (or string of applications such as PHP) that need a lot of RAM to run the site. This can happen if you make a lot of custom MySQL database calls or if you’re uploading & serving lots of photos. Since shared hosts typically ‘oversell’ these servers (meaning, they sell more slices than ‘the math’ says they should, expecting some clients to use MORE than their slice but most to use less, the server can quickly get bogged down. It’s not uncommon for these mega hosts to have 1,500 or more ‘slices’ on a single server…which is too many, no matter how you cut it. More often than not, I like to stay away from shared hosting.

VPS:

VPS, or Virtual Private Server, is the mid-way point between shared and dedicated, as you may have guessed. In this case, the larger server is still ‘sliced’ into pieces, but rather than sharing and pooling resources, each virtual slice acts like it’s own server. It has it’s own OS, it’s allocated it’s own amount of RAM that it doesn’t share with others on the server, and–unlike shared servers–virtual servers can be independently rebooted (this really comes in handy when recompiling PHP or other server-side languages.)

In my opinion, the biggest advantage to VPS is that one has root access (meaning that they can do absolutely anything they want to on the server…install programs, allocate resources, and as I said, it typically has a guaranteed amount of RAM. Because VPS servers have come down so much in price (ranging from $50 to $150/month), many resellers use a VPS to resell accounts to clients and host their sites. The major players in the VPS game are VPS.net, MediaTemple, though my personal favorite as of late is WiredTree…their level of customer support is second to none.

Dedicated:

Finally, Dedicated servers are upper-echelon of the hosting world. Priced anywhere from $135 to $750, depending of the configuration, these servers power the most highly trafficked and CPU / RAM intensive sites. These servers are highly configurable and vary based on which host you go with. You can configure them with multiple hard drives, several CPU units, redundant power supplies, a custom amount of RAM and even the speed of the connectivity port. Dedicated servers are often housed with hosting providers who have extremely fast connections to the internet (close to a backbone), providing great transfer rates between the server and client. Dedicated servers have become more of a commodity over the past few years as prices for components have dropped significantly but would still be considered ‘overkill’ for the vast majority of websites out there.

Other Considerations

Another thing to ask yourself if whether or not you want a managed setup or whether you plan to act as your own administrator. Managed sites offer greater flexibility. Your team is available to help you recompile PHP, install software, keep the OS updated with the latest version and security patches and you have a support team to help you when you can’t figure things out on your own. This is almost priceless for someone who has little or no knowledge of server administration, has little time to learn, or for someone who wants to learn, but needs help along the way. The best hosts will not only help you with you questions but will also help teach you along the way…in their eyes, if they can teach you how to perform a task on the server, you won’t need their help next time. And if you’re a geek, you’ll really enjoy having root access after awhile.

Conversely, unmanaged servers require the admin to install and update everything: the OS, PHP version, MySQL support, anti-virus program, FTP programs, Mail programs…everything. Who has time for that? While you’ll be charged a premium for Managed support, after your first support ticket, you’ll appreciate the nominal fee.

On a side note, here’s a great Linux command-line cheat sheet that has helped me out multiple times.

There are a lot of choices out there when it comes to hosting. Beyond the types of hosting, there are thousands or even tens of thousands of hosts who claim to specialize in different areas in an attempt to boost their organic search results. Some hosts claim to be great for hosting WordPress blogs while others target geographic markets. At the end of the day, the best choice is to decide which type of host you need, do some research to narrow your possible choices down to a handful, and then check their knowledge base out as well as their Twitter feed. Knowledge bases are online help centers that attempt to cover questions that are asked repetitively; sort of like a FAQ but in much greater detail; if a host has an amazing online knowledge base (like MediaTemple, for example) that’s a good sign that they’ll offer great real-time support as well. I mention the Twitter feed because every host will have one and customers, pleased and otherwise, will be sure to make their voices heard. Read the replies to their twitter account…are people thrilled with their support and service or is it a myriad of complaints? WiredTree’s twitter account, for example, is laden with great comments which was a deal sealer for me. One can have the slickest website in the world, but if they don’t have quality support, they’re not worth paying for…even if it’s free!

  • Posted on May 06, 2010

Mobile Phone Sniffer

A few weeks ago my brother approached me and asked me if I could help him setup a mobile site for his company. He’s a professional photographer and beyond his landing page, the site is entirely flash and therefore not mobile friendly.

Working for an internet technology firm has it’s advantages. I was able to quickly ask around and find out exactly what is needed, and it’s actually rather simple.

Though it seems backwards, we’ll start from the end and work back. If we’re going to send users to a mobile site, we have to have a mobile site in place. With a simple text editor and some relative paths to logos (optimized for mobile phone screens), one can build a simple mobile site in a matter of minutes. By “simple”, I just mean that the site isn’t going to have a whole lot of functionality. It will have a landing page, contact info, hours, location/map, and for his business, perhaps a few thumbnails to showcase work. Putting all this together takes about 20 minutes.

Now that we have the “mobile site” built, we need a way to intercepting traffic. The easiest way is a simple “View Mobile Edition” link on his landing page, so that if a user arrives by way of a mobile device, he or she simple clicks the link to see the phone friendly version. To add another level of sophistication–and professionalism–one really needs to employ a “sniffer.”

A browser sniffer, typically a simple javascript file, can quickly determine which type of browser is being used to display the page. If you know which browser is being used, you can deduce (in most cases) which mobile device is being used. In the file itself, we’ll need to define two variables: (1) the URL path of the mobile site, and (2) which browsers to ‘sniff’ for. Defining variable 1 is simple, it probably looks something like http://www.yourdomain.com/mobile/index.html. Defining variable 2 is a bit harder. In order to ‘sniff’ all mobile devices, you have to define all of the browser types, or “user agent strings” as they are officially called. These strings look something like mozilla/5.0 (macintosh; u; intel mac os x 10.6; en-us; rv:1.9.1.2) gecko/20090729 firefox/3.5.2.

Defining a list of all of these user agent strings can take awhile, but luckily, you can download some ready made js files that have all the main strings packaged nicely for you–including strings for iPhones, Blackberries, Droids, iPads, Windows based devices, and other smart- and mediocre- phones. Also, Wikipedia has a nice, up-to-date list to make life easier for you.

So, once you have built your mobile site and defined which mobile devices you wish to sniff for, all that’s left to do is call the js file in the section of your website. This may be in your index.html file or in an include such as header.php if you’re using a dynamically driven framework like WordPress. Either way, the include would look something like:

<script type="text/javascript" src="js/sniffer.js"></script>

So, there you have it. You now know how to automatically direct mobile users to a mobile-optimized site. If you have any thoughts on the matter, an easier implementation, or resources that might be helpful, please share them!

Update: Note that user agents are case sensitive. For example, “Blackberry” is not the same as “BlackBerry” (and the latter is correct.)