May 2012

HOW TO : Use screen to multitask

Want your terminal to look like this? 

In addition to the coolness, factor it also helps you do (monitor) multiple things at  a time. In this screenshot

  • I am checking the resource utilization on my web server
  • Tailing the web server logs to look for errors
  • have a small console for me to run any commands

You can achieve this by using the nifty screen utility. Screen allows you to multiplex between multiple consoles.  So you can open one terminal and have multiple consoles on it. The commands for using screen are a bit hard to get used to. Here are the shortcuts I used to achieve the screen above

  1. Install the screen package
  2. Create a new screen session by running[code] screen [/code]
  3. Add a new screen console by executing[code] ctrl + a [/code]

    [code]c[/code]

  4. Split the screen by executing[code]ctrl + a [/code]

    [code] Shift + s [/code]

  5. Name the different consoled by executing[code]ctrl + a[/code]

    [code]Shift + a[/code]

As you might have figured out by now, “ctrl + a” puts you into screen command mode. You can get a list of all available options by executing

[code]ctrl +a[/code]

 

[code]?[/code]

Here’s a quick reference guide that has more details http://aperiodic.net/screen/quick_reference 

Have fun multitasking 🙂

Brilliant use of DNS

I was listening to this week’s edition of Steve Gibson’s Security Now podcast and Steve talked about a unique way of using DNS. His spintrite application uses DNS to check for the latest version of the application. Most applications use http to check version information. This might pose a problem in environments with proxy servers. DNS traffic on the other hand is generally allowed in most environments. He says his application does a DNS lookup for something like application.version.grc.com and the “IP” address that is returned denotes the major and minor versions of the code. And depending on the response, the application will prompt with a “need to update” message.

Brilliant!!!

Here’s a more technical post way back from 2006 by Jan-Piet Mens on the same subject

http://jpmens.net/pages/checking-current-application-or-data-versions-using-dns/

Project PaaS : Day 2 on Google App Engine

It looks like I was able to accomplish writing the application that I wanted to on the App Engine in 2 days!!  at least in it’s basic form.  After some help from Google, I updated the application I created yesterday (http://samurai-apps.appspot.com/) to display the User Agent string being sent by the client.

The code has been updated to github at https://github.com/kudithipudi/google-app-engine/

Lessons from day 2?

  • Python doesn’t like tabs :). Always use spaces to ident. I was using Notepad++ as the editor and it automatically puts tabs when you hit enter. Why? Looks like that is the best practice according to this style guide (http://www.python.org/dev/peps/pep-0008/)
  • The “Logs” console in the SDK toolkit should be your best friend. It let’s you know if there is any error in your code and what line it believes the error is at.

Next, I will try to pretty it up a bit.

Isn’t it amazing that I was able to create a simple app in a matter of 2 days and host it on an “infinitely” scalable  platform without even taking our my credit card.

Project PaaS : Day 1 on Google App Engine

Following up on my public resolution for his month..I started playing with Google App engine. I think a lot has been written about what it is and how it works, but in a nutshell, think of it as an environment to deploy your applications and not have to worry about underlying system capacity. It provides support for Java, Python and more recently Google’s own Go programming languages.

I chose Python, since I have been meaning to dabble in it for a while now. So without further adieu, here is a link to my first application on Google App Engine

http://samurai-apps.appspot.com/

And obviously it has to be hello world :).

How did I get here?

  1. As any good programmer would do, I first tried to find a good place to store my source code. I chose Github, since it seems to be the goto place for hackers (in the good sense 🙂 ) in recent times. I opened a free account on it and created a repository called google-app-engine at https://github.com/kudithipudi/google-app-engine/ .
  2. Following instructions listed here https://developers.google.com/appengine/docs/python/gettingstartedpython27/ and created the helloworld script.
  3. Enabled App Engine on my account by validating myself. Had to use my mobile phone to do the validation.
  4. Created an app called samurai-apps in the Google App Engine control panel
  5. Deployed the helloworld script to the Google Apple engine using the deploy function in the SDK tool. (note: make sure that the name of the app you create in the SDK is the same as the one you created in the app engine control panel. Or you will get an error stating “This application does not exist (app_id=u’xxx’).” where  xxx is the name of the app in the SDK tool)

Pretty simple eh.. 🙂

Now the challenge is to program something more useful than print hellworld :).

 

2012 May Project

Continuing on my project/month theme.. here is what I want to accomplish in May 2012

  • Understand Google App Engine and Windows Azure Platforms
  • Write a simple application and deploy it both the platforms
  • The application that I am envisioning will display the “user agent” string of the client trying to access the application. I know there are tons of sites that already do this.. but I think this is an useful tool to have in your bag of tricks :). It is simple enough that I think I can program it in a month.

Why am I doing this? I understand the IaaS area pretty well, but am not well versed in the PaaS arena. Hoping this adventure will teach me some new things. And yes, I do plan on documenting my journey :).

Wish me luck 🙂