Monday, March 9, 2015

Connecting to a Netgear Nighthawk VPN with Android

According to Netgear, neither iOS or Android devices are supported by Netgear OpenVPN routers. This post is in reference to Android only, so don't make much of my comments if you are looking for iOS help. The lack of Netgear VPN support for Android is for two sensible reasons, though they aren't explained by Netgear.



  1. Netgear uses OpenVPN. Most built-in in VPN support on mobile devices is intended for use with PPTP VPNs, not OpenVPN. At first, you might be frustrated with Netgear for using a protocol without the widest support, but they have very good reason: security. PPTP is the least secure VPN protocol. Even Microsoft, who helped to develop PPTP, advises using a different VPN protocol for security reasons. BestVPN put together a great comparison of VPN protocols that reiterates the issues with PPTP and makes the advantages to OpenVPN clear. After reading this, you may be thanking Netgear for selecting OpenVPN and questioning their competitors for sticking with PPTP VPNs.
  2. Netgear's OpenVPN is TAP, not TUN. OpenVPN is operated in one of two main modes: TAP or TUN. The main difference being that TAP is layer 2 and works more like a switch or bridge and TUN is layer 3 and works on the network level to route packets on the VPN. Netgear isn't very obvious that it utilizes TAP and that is a problem for Android users as Android only supports TUN. Download most any OpenVPN client on Android and you'll be trying to make a TUN connection, which simply won't work with Netgear.
The simple solution, an Android app called OpenVPN Client. This is the only OpenVPN client on Android that currently supports TAP as far as I am aware. It also is a stable app with good developer support. Before you go and install this app and start trying to connect, let me save you a few headaches and save the developer from some support emails as well.

To connect your Android to 4.0+ device to your Netgear Nighthawk OpenVPN:
  1. Setup your VPN on your router as per steps 1-6 on these instructions from Netgear.
  2. Download the "Windows" setup zip from your router. 
  3. Extract the files to a dedicated/new folder on your Android where you can easily find them.
  4. Install the PAID version of the OpenVPN Client app (the free version does not support TAP)
  5. Tap the circular green "+" icon when you open the app. 
  6. Select Import VPN.
  7. Navigate to the folder where you extracted the setup files in step 3 and select the .opvn file.
  8. Open the new VPN connection in the app and select the Edit icon.
  9. Select Custom Options. 
  10. Add the option "route-gateway" with the value set to 192.168.1.1 (in most cases, your local network).
  11. Save changes and connect to the VPN.
OpenVPN Client is well worth the money and you'll be off to taking full advantage of your Netgear Nighthawk OpenVPN TAP VPN via your Android anywhere you may go.

Thursday, December 18, 2014

Charles Maier Carbon Fiber Wallet Review, 1 Year Later

Last Christmas I received a Carbon Fiber Wallet by Charles Maier much to my excitement. Carbon fiber has gone from an industrial, aerospace, and motorsports exclusive to a fashion statement and Charles Maier is the best of the best in that respect. When I found out Charles Maier was releasing a line up of handmade Italian leather wallets and bags with real high quality carbon fiber integrated into the design, I was intrigued to see them since I have seen lots of low quality and imitation carbon fiber goods in the past.

When I received the wallet a year ago, I was immediately impressed with the quality and workmanship. The wallet looked as good in real life as it does in the photos on the Charles Maier site. The leather took a little breaking in, but everything fit perfectly in the wallet. Since then, I've used the wallet daily and it has not stretched, cracked, or degraded in any way. It still holds my cards firmly and the carbon fiber still looks as glossy as the day I got it. I even accidentally put the wallet in the wash with my pants for a few minutes and it came out unscathed. The Charles Maier carbon fiber wallet is perfect for anyone into motorsports, technology, fashion or luxury.

Here are real life pictures of my Charles Maier carbon fiber wallet after one year of daily use. If you are thinking of investing in a wallet that will not only make a statement about you but also hold up to daily use, this is the right wallet for you. Most other wallets I've had fall apart after about a year and the rugged wallets I've had are just ugly and made of unappealing materials. The Charles Maier wallet is made of high quality leather, high quality carbon fiber, and lasts.


Tuesday, November 25, 2014

Tracking Multiple Subdomains in Universal Analytics

The new Universal Analytics has improved subdomain tracking ease out-of-the-box, no longer requiring the core tracking code to be modified to support multiple subdomains. The older ga.js tracking code would set cookies at the subdomain level, while the Universal Analytics tracking code sets cookies at the root domain level. This means that it doesn't matter what subdomain the the Universal Analytics tracking code runs on, the cookies will still be valid.


Just because Universal Analytics works out-of-the-box for subdomain tracking, doesn't mean it does what you need it to of course. Without any further setup, you won't be able to different subdomain traffic within your reports... you'll just see plain URIs like /contact-us and /learn-more. You won't be able to differentiate which subdomain that URI belonged to when the visitor loaded it. Further, you won't be able to report on subdomain traffic only without further setup.

The resolution of these short-falls is actually pretty easy.

First, make sure you have your basic Universal Analytics tracking code installed on every subdomain.

Next, your primary view needs custom filters setup:

  1. Go to Admin and select your primary view.
  2. Click Filters on the View column.
  3. Click +New filter
  4. Set the name as the full domain with subdomain (i.e. xyz.google.com)
  5. Set the Type to Custom
  6. Select Advanced as the subtype
  7. Set Field A -> Extract A to "Hostname" and "(xyz.google.com)" respectively
  8. Set Field B -> Extract B to "Request URI" and "(.*)" respectively
  9. Set Output To -> Constructor to "Request URI" and "$A1$B1" respectively
  10. Check Field A Required
  11. Uncheck Field B Required
  12. Check Override Output Field
  13. Uncheck Case Sensitive
  14. Save
This will track subdomain URLs separately from the primary domain URLs within your primary view. This will help differentiate traffic between your core domain and subdomains as well as between the subdomains themselves.



Finally, the new Views for the subdomains need to be setup:

  1. Go to Admin and click on the dropdown at the top of the View column
  2. Click Create New View
  3. Set the name of the view as the full domain (i.e xyz.google.com)
  4. Set the timezone as the same as your primary view (Eastern)
  5. Save this new view and click on Filters under the Admin > View column
  6. Click +New Filter
  7. Name it Subdomain Only
  8. Set the Type to Predefined and "Include Only" "traffic to the hostname" "that contain"
  9. Set the Hostname to the full subdomain (i.e. xyz.google.com)
  10. Save

This will add a new view tracking only the traffic on the subdomain.




Wednesday, November 12, 2014

Samsung Galaxy S5 Black Friday Deals at WalMart, Target, and Best Buy

If you have been waiting to pick up a Galaxy S5 until Black Friday comes around, you are in luck this year! Wal-Mart, BestBuy, and Target all have excellent deals.

Starting at Best Buy, you can get the Galaxy S5 for $1. A few hours later, you can get the Galaxy S5 for $0.01 at Target. The next morning, on Black Friday itself, you can get paid $1 to get the Galaxy S5 from Wal-Mart. Yes, they charge $99 and include a $100 Wal-Mart gift card! All of these deals require new/upgrade 2yr contracts of course, but that doesn't mean there aren't good cash and finance deals as well. I will be looking for a good deal on a Galaxy Note 4 but will likely go for the practically free Galaxy S5.

Samsung Galaxy S5 at Best Buy for $1 at 5pm Thanksgiving, Day before Black Friday

Samsung Galaxy S5 at Target for $0.01 at 9pm Thanksgiving, Day before Black Friday

Samsung Galaxy S5 at Wal-Mart for -$1 at 6am on Black Friday ($99 w/ $100 Gift Card Included)

Good luck to all you Black Friday shoppers!

Sunday, September 7, 2014

ColdFusion CFHTTP and WebDav

As it turns out, I recently ran into the need to interface with a WebDAV server via ColdFusion. Surprisingly, there is practically no information online regarding this topic. I just wrapped up a test PUT file snippet and figured I would share it with all you ColdFusioneers who aren't finding the copy/paste you are looking for :-).

First off, you can't simply use cfhttpparam type="file" as you'll end up sending file data with headers included in the body of the request. The WebDAV server will write these headers into the file content and you'll end up with a corrupted file. Instead, the WebDAV spec calls for the entire body of the request to be file data.

That leads us to the following code. You'll see this is uploading a simple jpeg to the WebDAV server. The cffile readbinary file attribute is being set to the full local file path. The cfhttpparams include the typical Content-Type header, but also Overwrite and Translate which are commonly supported and sometimes required by WebDAV servers. The body of the request is the raw binary file data. Simple!


<cffile action="readBinary" file="#loc.images[curr_image]#" variable="loc.curr_binary">
<cfhttp method="PUT"
url="#This.webDAVsettings.server#/import/#loc.curr_filename#.jpg"
username="#This.webDAVsettings.username#" password="#This.webDAVsettings.password#"
throwonerror="true">
<cfhttpparam type="header" name="Content-Type" value="image/jpeg">
<cfhttpparam type="header" name="Overwrite" value="T">
<cfhttpparam type="header" name="Translate" value="F">
<cfhttpparam type="body" value="#loc.curr_binary#">
</cfhttp>

Tuesday, September 2, 2014

Taming the Elusive 5 Column Bootstrap Layout

Twitter Bootstrap is one of the best things to happen to web development in recent years. Bootstrap 3 brought some awesome changes, but still there are troublesome areas. One the most common is setting up 5 column rows. Sure, you can build a custom compiled Bootstrap with a 20 column grid system or something, but most of us use vanilla Bootstrap. Thanks to SICC, we have a great solution for 5 column rows in Bootstrap 3. Simply add the following to a custom CSS file (no need to alter the Bootstrap CSS).

Core CSS

.col-xs-15,
.col-sm-15,
.col-md-15,
.col-lg-15 {
    position: relative;
    min-height: 1px;
    padding-right: 10px;
    padding-left: 10px;
}
.col-xs-15 {
    width: 20%;
    float: left;
}
@media (min-width: 768px) {
    .col-sm-15 {
        width: 20%;
        float: left;
    }
}
@media (min-width: 992px) {
    .col-md-15 {
        width: 20%;
        float: left;
    }
}
@media (min-width: 1200px) {
    .col-lg-15 {
        width: 20%;
        float: left;
    }
}


General Use

<div class="row">
    <div class="col-md-15">
    ...
    </div>
    <div class="col-md-15">
    ...
    </div>
    <div class="col-md-15">
    ...
    </div>
    <div class="col-md-15">
    ...
    </div>
    <div class="col-md-15">
    ...
    </div>
</div>


Sunday, April 13, 2014

Forcing Google to NOT Crawl and Index Mobile Site

Let's assume you've got a desktop site and a mobile version on different subdomains or subdirectories. Google might actually index your mobile site's URLs and serve them up in desktop search results... yes, I have been a victim of this and seen it myself (see screenshot below). It is surprising, but Google can't get this right 100% of the time.
Desktop search result with mobile URL in Google index
So what do you do?

You have two main options to force Google desktop to crawl your desktop site and Google mobile to crawl your mobile site. Setup Webmaster Tools to specify this setup and/or modify your robots.txt. The Webmaster Tools option pretty much consists of registering both sites in Webmaster Tools and setting up distinct sitemaps. This still leaves a lot to chance assuming Google will take these directions when indexing your URLs. Also, this only works if your mobile site is on a different subdomain. If your mobile site resides in a subdirectory, like http://www.gtautomax.com's mobile site (http://www.gtautomax.com/mobile/), then you are left with robots.txt modification as your main option.

The strategy is to direct Googlebot and other desktop search bots away from the mobile site and allow Googlebot-Mobile and other mobile search bots to access the mobile site. (This assumes your site is already redirecting users from desktop URLs to mobile URLs automatically.)


If you have different desktop/mobile subdomains, your robots.txt will look something like this:

Desktop Site:
User-agent: Googlebot
User-agent: Slurp
User-agent: bingbot
Allow: /

User-agent: Googlebot-Mobile
User-Agent: YahooSeeker/M1A1-R2D2
User-Agent: MSNBOT_Mobile
Disallow: /

Mobile Site:
User-agent: Googlebot
User-agent: Slurp
User-agent: bingbot
Disallow: /

User-agent: Googlebot-Mobile
User-Agent: YahooSeeker/M1A1-R2D2
User-Agent: MSNBOT_Mobile
Allow: /


If your desktop/mobile sites are differentiated by subdirectory, then your robots.txt will look something like this:

Desktop Site:
User-agent: Googlebot
User-agent: Slurp
User-agent: bingbot
Disallow: /mobile/

Mobile Site:
User-agent: Googlebot-Mobile
User-Agent: YahooSeeker/M1A1-R2D2
User-Agent: MSNBOT_Mobile
Allow: /mobile/


As always, make sure and check your robots.txt file in Webmaster Tools for any errors and to ensure mobile URLs and desktop URLs are handled properly.