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.

Prison Break

After I finished catching up on The Tudors (Showtime) seasons 1-3, I moved on to Prison Break. They’re both great shows in their own right (parts of The Tudors is pretty risque, but it was never meant for children, either.) Anywho, I’m about 10 episodes in to Prison Break and it’s pretty dang addictive. It’s a Fox show, so it PG-14 rated, but that doesn’t keep it from being action packed and psychologically engaging. If you haven’t seen either of these shows, check them out. You can stream Seasons 1-3 of both shows on Netflix.

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

Reboot

New look, new purpose. The new iteration of my blog will be used more like a micro blog for things like code snippets, how-tos, and other random posts. Most of it won’t be directly related to my personal life, but stay tuned…ya never know.