• Showing Cowsay and Fortune in every Terminal

    I was wondering today…I used to see this screenshot of a ASCII cow in a terminal that was giving some sort of advice or fortune. After a little googling I found the application fortune which shows you a simple fortune when run from a terminal on linux/unix. I also found the application cowsay which is the app that shows the ASCII art of animals with a comic balloon. By default a cow, however there are many others. I chose tux.

    
    $ fortune | cowsay
     _______________________________________
    / Don't go around saying the world owes 
    | you a living. The world owes you      |
    | nothing. It was here first.           |
    |                                       |
     -- Mark Twain                         /
     ---------------------------------------
               ^__^
               (oo)_______
                (__)       )/
                    ||----w |
                    ||     ||
    

    Why the pipe? because fortune echos a string, and cowsay reads in a string.

    Now the problem was I had to type the command every single time. To solve this we turn to your users .bashrc file. Located ~/.bashrc for Ubuntu users. Edit the file with your favorite text editor and add the following lines at the bottom.

    
    if [ -x /usr/games/cowsay -a -x /usr/games/fortune ]; then
        fortune | cowsay
    fi
    

    (if statement checks to make sure both cowsay and fortune are installed)
    Now, everytime you open a terminal or command prompt you’ll have a cool animal telling you a fortune!

    Sources:
    http://askubuntu.com/questions/16428/showing-a-cowsays-in-every-new-terminal-session
    Cool Android app here. This will send SMS text messages from your phone as cowsay!!

  • BIGIP F5 iRule — Return Splash Page When No Members Are Available

    I wrote a iRule post located here, where I describe the essentials behind how beneficial iRules can be and the many use cases they have. I stumbled across a situation the other day for a client. This client had an F5 VIP load balancing 2 web servers of theirs. Now if those web servers for some reason are not available due to their healthcheck monitor failing, the users of that web site will receive a white page as the F5 will not proxy the traffic because there are no available pool members. I thought what if this was a big site, should users be left in the dark about a web site they use frequently when it’s not available? Then the idea of having the F5 LTM bounce back a well-formed splash page. This splash page would inform the user that the web site temporarily down, and if they believe this result is in error to contact their helpdesk.

    This situation can be remedied with a couple of lines in an iRule.

    when HTTP_REQUEST {
        #check if no members available
        if { [active_members [LB::server pool]] == 0 } {
           #create data variables with HTML content to send to client
           set httphost [string tolower [HTTP::host]]
           set data "

    $httphost

    NOTICE: Site Unavailable.

    If you believe you are receiving this message in error, contact your site administrator.

    " #send string HTTP::respond 200 content $data } #unset variables unset $httphost unset $data }

     

    Or:

    when HTTP_REQUEST {
       #check if no members available
       if { [active_members [LB::server pool]] == 0 } {
          HTTP::respond 200 content {
          
          Unavailable
          
          

    If you believe you are receiving this message in error, contact your site administrator.

    } #end of content block }

     
    This iRule uses the when HTTP_REQUEST event, and the HTTP::respond function. You could also use the HTTP::redirect function, however for something as small as a few lines, might as well have the F5 handle it directly.

    You could easily use links from other sources to make a more authentic looking page for your users.

  • BIGIP F5 iRules — What are they?

    What is an iRule? What are iRules? What can I do with iRules? What is an iRule example?

    One of the most advantageous features that an BIG IP F5 Local Traffic Manager brings is it’s iRule feature. This feature allows the F5 to manipulate and perform event driven functions to the application traffic as it passes through the F5 LTM. This is very useful and has many use cases. For example, a common iRule is as follows. Let’s say you have a typical load balancing setup, with 5 web servers being balanced in a round robin fashion. The traffic that passes through is HTTP. For security purposes only HTTP-SSL is allowed to this site, however you don’t want users to have to remember to put https:// rather than http:// in their internet browser’s address bar. Instead of putting a redirect page on the port 80(insecure) instance on each of the 5 web servers, a simple iRule will take care of that!

    Example HTTP to HTTPS redirect iRule:

    #my first iRule
    when HTTP_REQUEST {
        HTTP::redirect "https://[HTTP::host][HTTP::uri]"
    }

     

    When we look at this iRule we see a few things. We see an event that must be triggered in order to for the iRule to execute, “when HTTP_REQUEST“. Next we see a HTTP redirect function being performed with a few parameters. HTTP::redirect is the function and the target URL string “https://[HTTP::host][HTTP::uri]”. Let’s break this statement down as it is the meat and potatoes of the iRule.

    https:// is what protocol to send the users browser when it performs the redirect.

    [HTTP::host] which is derived from the clients host-header as it comes across to the F5 LTM. The host header is set when you open a new browser and type the domain/host you are requesting to go to. For example, if you type http://www.google.com in your browser, when you hit enter in the HTTP stream the host-header is set to www.google.com. This is essential when using SSL, but more on that in another post.

    [HTTP::uri] the last part is the URI the user is trying to GET. If this is a standalone site such as www.mysite.com, usually users will hit that first and be redirect already via our iRule before they browse to any URIs. However, perhaps a user tries to go to http://yousite.com/URI, they are not coming across HTTPS so the iRule will intercept it and redirect them to https://yoursite.com, but wait we don’t want them to get kicked back to the root of the site, so the [HTTP::uri] is appended to the redirect target string.

    URIs vs URLs:
    You will see people use these interchangeably, or used in-properly. Even Wikipedia’s article on them is confusing. Since I’ve been an IT engineer working in web-centric environments a URI is what is appended at the end of the host or FQDN, and a URL is the whole thing.

    So,
    http://en.wikipedia.org/wiki/Computer

    FQDN = en.wikipedia.org
    URI = wiki/Computer
    URL = http://en.wikipedia.org/wiki/Computer

  • What is BIGIP F5 (LTM and GTM)?

    I’ve worked with BIGIP F5 hardware for over two years now, and have become quite familiar with the great features it provides. For those who are unfamiliar with BIGIP F5 hardware, it is network hardware company specializing in load balancing at both the local and global layers of an enterprises network infrastructure. Their website is located here.

    BIGIP F5 product family consists of many different components, however the two major ones most network engineers are familiar with are the Local Traffic Manager(LTM) and the Global Traffic Manager(GTM). Both are network rackable load balancers.

    The GTM

    is used as an “Intelligent DNS” server, handling DNS resolutions based on intelligent monitors and F5’s own iQuery protocol used to communicate with other BIGIP F5 devices. Seen at the top level of a data center, especially in multiple data center infrastructures, deciding where to resolve requesting traffic to. The GTM also includes other advanced features, such as DNSSEC and intelligent resolution based on many different algorithms.

    The LTM

    is a full reverse proxy, handling connections from clients. The F5 LTM uses Virtual Services(VSs) and Virtual IPs(VIPs) to configure a load balancing setup for a service. LTMs can handle load balancing in two ways, first way is a nPathconfiguration, and second is a Secure Network Address Translation(SNAT) method.

    nPath, the F5 does the job of load balancing by intelligently deciding which server endpoint to pass traffic to. nPath, however, does so by bypassing the F5 in the return path. For example you have two servers 192.168.0.10 and 192.168.0.11, and an F5 listening for this particular set up on VIP 172.16.0.2. Now when the traffic from a client destined for the 172.16.0.2 hits the F5, the F5 intelligently passes it to either 192.168.0.10 or 192.168.0.11. The tricky part is when the traffic leaves from the F5 to either server, the IP packet’s source address is that of the F5. Therefore each server mush have a loopback address configured that matches the F5s source IP address of the interface (on the F5) the original packet leaves from., in this example 172.16.0.2. This prevents each server endpoint from sending it back to the F5 directly and forces the server to use it’s gateway of last resort.

    Secure Network Address Translation(SNAT), is a more common BIGIP F5 implementation. In this scenario the F5 is configured essentially as a reverse-proxy server. Think Many-to-One. Client’s target Virtual IPs that sit in front of a pool of endpoint servers. However, the Client never sees behind the VIP, to there perspective the VIP is the server they are requesting. For example, you have a VIP 192.168.0.55 which routes to an F5 who is listening for requests destined for that IP. The F5 has a configuration in place that knows 4 server endpoints that can serve requests destined for that IP, 10.0.0.5, 10.0.0.6, 10.0.0.6, 10.0.0.7. When a request comes from a client to the VIP the F5 acts as the server for the client. In the back-end the F5 acts as a client sending the identical request to one of the four endpoint servers. The response is then proxied back from the F5 to the “real” client.

    Tying them together.

    GTMs and LTMs used in conjunction with each other provide a robust and resilient, and network optimized environment. This is especially true when dealing with multiple Data Centers or Service Sites. The GTMs will handling the initially network path to take by resolving clients with the best route option. The LTMs will handle the load optimization of the service by logically proxying the endpoint servers.

    Below is a diagram of a typical GTM/LTM setup. In this example, there are two Data Centers, the GTM sites at the front of the Data Centers and hands out the VIP that will handle the client’s request. The LTMs are localized in each Data Center (They don’t have to be :-p) in a High Availability pair. The LTMs will reverse proxy the clients connections with the actual server endpoint.

     
    null

  • File Encryption with ccrypt, axcrypt, and more

    Are you someone who keeps a text file on their Desktop with all there passwords in it? Do you write you account information and passwords on a sticky-note? I sure hope not! But if you do, consider encrypting that password file with high-grade encryption using reliable freeware.

    I will review three free encryption applications; CCrypt, AxCrypt, and OpenSSL.

    [Read More…]

  • Online Threat Management Services

    I had the privileges of working with two very sophisticated and detailed threat managment systems(TMS). Symantec Deepsight(Deepsight) and Internet Storm Center(ISC), both of which have worldwide visibility and insight into the threat landscape.

    1. The obvious first comparison item of the two is Deepsight is commericalware, while ISC is sponsored by SANS.

    2. Deepsight is a Symantec product, thus has a larger infrastructure consisting of multiple honeypot networks spread out through the globe. ISC is community/volunteer driving with daily reports generated by a designated volunteer. ISC relies on volunteer/community member threat information to be submitted.

    3. Both contain main page headlines regarding most current threats and vulnerabilities either discovered or publicly disclosed. (For example, Microsoft release vulnerability information affecting a service)

    [Read More…]

  • Sendmail via VBscript

    This is a fun one, you can find numerous examples of this script all over the internet. Figured I’d share…

    
    Set objEmail = CreateObject("CDO.Message")
    objEmail.From = "from@domain.com"
    objEmail.To = "to@domain.com"
    objEmail.Subject = "My Subject"
    objEmail.Textbody = "Only use if you want to send a text email and not an HTML email"
    objEmail.HTMLBody = "" &_
    "
    " &_ "HTMLPretty Font lalallala " &_ "
    AIS-IUS" &_ "More pretty font HTML woot
    " objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ "{your mail server}" objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = {mail server port} objEmail.Configuration.Fields.Update objEmail.Send

    This sends a pretty simple text email. If you want to send an HTML email simple craft your HTML in your favorite text editor and copy and past it to the line:

    
    
    objEmail.HTMLBody = "HTMLCODE" 
    

    Use &_ to append to the next line.

  • Batch removal of single file from server list….

    Since I posted how to deploys splash page using VBscript I figured it was only appropriate to post an article on how to remove it. Original post here.


    Requirements:
    1. VBscripting skills.
    2. splash.html (HTML file that will be removed).
    3. servers.txt (txt file listing each server to delete/remove the splash.html file from).
    4. Assumes you have appropriate user privileges.

    [Read More…]

  • Batch file copy using VBscripting…

    One of my jobs long ago was to maintain the process for deploying splash pages to MS terminal server users when planned maintenance would be performed. The creation of the splash HTML page was simply a white page with red and black text informing the user when the service would be down. Pretty basic right? The opportunity I saw was to automatically deploy it, rather than remoting in or remotely copying each splash file to each Terminal Server. I wrote the following script to copy the splash page to a list of servers identified in a txt file.“


    Requirements:
    1. VBscripting skills
    2. splash.html (HTML file that will be deployed)
    3. servers.txt (txt file listing each server to push the splash.html file to)
    4. Assumes you have appropriate user privileges.

    [Read More…]

  • First Post, Hello Interwebs…..

    Hello Interwebs Users,

    I’ve been planning on starting my own blog for quite some time now. I wanted to start a blog to write posts for IT things I have done or experienced. But before that a little bit about myself.

    My name is Jim, born and raised in New England. I started my IT career at an early age, as with most IT pros, fixing family and friends computers. I studied Computer Science at Rhode Island University. Here is where I landed my first “real” computer related position, working at a Help-desk for facility and staff. From here I took on additional responsibilities as a Network Administrator, working with routing and switching TCP/IP and the likes. After college I landed a position working for an Insurance company in a rotational program moving from IT engineering department to department. The program was very beneficial for me as it exposed me to many different components and engineering teams comprising of an Enterprises IT infrastructure. I’ve bee working at the company for about five years now, and took a full-time position as a Network Services Engineer, configuring and supporting BIGIP F5 Network Load Balancers.

    That’s all the IT related stuff. I am an avid tennis player, and have been playing since I was ten years old. I also played baseball growing up and currently am in a slow pitch softball league with friends from work. For leisure I like relax play my guitar or keyboard, and on nice days take a ride on my Yamaha V1100 motorcycle cruiser.

    Well that’s enough about me, thanks for visiting and I hope you enjoy your stay.

    -Jim

↓