WirelessPhreak.com

I like to travel, f*ck with technology, and partake in the occasional tropical drink.
I am also a co-host on The NBD Show podcast.
Follow Me
For some reason I thought to myself it would be cool to have an emoji URL for my site. So I searched the web to see if anyone had done it before and, sure enough, an app developer named Panic registered 💩.la in 2011. After that, emoji URLs never really picked up steam.  There were a few tutorials - none of which worked. Then on February 23rd The Washington Post wrote an article about Coke's ad campaign in Puerto Rico using Emoji URLs. In response to The Washington Post article Kaleigh Rogers at Motherborad wrote a post outlining the brief history of  emoji URLs and how to register one.  The only thing she left out was which registrars allowed non latin character URLs.  I tested Go Daddy and Hover neither of which would allow me to register my fancy new emoji URL.  Finally after searching the web I found a legit Domain Registrar that would allow the unicode URL: name.com.  There may be others but name.com was painless and simple.  Finding the Domain Registrar was the most difficult part of the process.

My Fancy new Emoji URL

Here are the steps to getting your own Emoji URL, surprisingly there are a few still out there:
  1. Go to punycoder.com and generate the unicode that you are going to register.
    • The Unicode will be translated by the browser and present the emoji if your device and browser support it.
    2.  Go to Name.com and search for the unicode string, example "xn--bw8h.tk" and register it.

Done!

With HTML5 and other modern web technologies IE has not aged gracefully. If your client base is an enterprise many times clients are locked into an older version of IE, and aren't allowed to install an auto-updating browser like Chrome or Firefox.

This iRule is strait forward, I am redirecting clients accessing a website using an older versions of IE to a browser friendly version. This is done by evaluating the HTTP request and identifying the browsers user-agent string. As part of the redirect the F5 presents a web page that informs the users their browser is unsupported instead of blindly redirecting them. It will auto redirect after a pre determined count down, this example is set for 15 seconds.

Disclaimer Microsoft does not make this easy, Compatibility modes and Document modes in IE can send a different user-agent string.  For example IE 11 users running in Compatibility mode may still be redirected because their browser sends an MSIE 7.0 user-agent string. I am sure your could right variables that would check for compatibility in the user agent string, but iI chose not to.

Here is the iRule:

when RULE_INIT {
    set static::refresh_time 15
set static::notification_page {
        <html lang=\"en_US\">
<head><title>System Notification</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\">
<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\">
<meta http-equiv=\"PRAGMA\" content=\"NO-CACHE\">
<meta http-equiv=\"refresh\" content=\"15;URL=http://myspace.com">
</head>
<body>
<h1>System Notification</h1>
<hr>
<p>You are using an unsupported browser and will be redirected to Myspace.com</p>
<p>Wait $static::refresh_time seconds to continue, or click <a href=\"http://myspace.com\">here to continue.</a></p>
</body>
</html>
}
}
when HTTP_REQUEST {
 switch -glob [ string tolower [HTTP::header User-Agent]] {
   "*msie 10.0*" -
   "*msie 9.0*" -
   "*msie 8.0*" -
   "*msie 7.0*" -
   "*msie 6.*" {
     HTTP::respond 200 content [subst $static::notification_page] Mime-Type "text/html"
     log local0. "Client  IP:[IP::client_addr]  has been redirected with user agent :[HTTP::header User-Agent]"
   }
   default {
     # go to a default location if nothing matches
   }
 }
}
The iRule below was spawn from a request to block access to specific URIs on a website and only allow access from whitelisted IP networks and hosts. 

In my first attempt I used concatenated OR statements which worked but was less sexy and probably less efficient then the switch I ended up using. 

As for the Data List in this example it's named "AllowedIPDatalist." I created a network data list not because it was efficient, its not, I wanted to make it easier for co workers that didn't feel comfortable editing an iRule a place to enter Networks and Hosts in a format they where used to.

when HTTP_REQUEST {
  switch -glob [string tolower [HTTP::uri]] {
    "*/uri/sample1*" -
    "*/uri/sample2*" -
    "*/uri/sample3*" {
      if { !([matchclass [IP::client_addr] equals AllowedIPDatalist])} {
         reject 
         log local0. "Client IP Discard: \ [IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port]"
      }
    }  
  }
}