Kudithipudi.Org

August 19, 2011

Overheard : Random comments about technology

Filed under: Linux,OverHeard,Technology,Web — Vinay @ 8:04 am

Here are some interesting titbits from a executive summary event hosted by Redhat/Intel that I attended yesterday.

We decreased the execution times for our orders from 1.5 seconds to 5 milliseconds

This from an executive managing the technology organization for a large trading company. Imagine the geekiness in accomplishing this :) .

For every 450 smartphones that get activated a server is added to support them

This from an Intel executive. So if there are 500000 android phones being activated every day.. that’s around 1111 servers being added just to serve the android fans :) .

1 in 4 servers currently runs Linux

This from a Redhat executive. If anyone doubts that Linux is mainstream.. they are living under a rock :)

August 17, 2011

HOW TO : Use grep to search for credit card numbers

Filed under: HOWTO,Linux,Technology — Vinay @ 10:20 pm

I was looking for a quick way to search for credit card numbers in a file and ran across this excellent post by Adrian Rollett. I tweaked his suggestion a bit to show some additional data.

Original suggestion

 grep '\(^\|[^0-9]\)\{1\}\([345]\{1\}[0-9]\{3\}\|6011\)\{1\}[-]\?[0-9]\{4\}[-]\?\[0-9]\{2\}[-]\?[0-9]\{2\}-\?[0-9]\{1,4\}\($\|[^0-9]\)\{1\}' FILE_TO_SEARCH 

My modification

 grep '\([345]\{1\}[0-9]\{3\}\|6011\)\{1\}[ -]\?[0-9]\{4\}[ -]\?[0-9]\{2\}[-]\?[0-9]\{2\}[ -]\?[0-9]\{1,4\}' --color -H -n FILE_TO_SEARCH 

The modified command will show the name of the file the number was found and at which line. You can tweak it further using additional options for grep. A good reference guide can be found here.

July 27, 2011

Innovative Error Pages : Pandora

Filed under: Fun,Web — Vinay @ 2:42 pm

Ran across this application error message on Pandora

July 20, 2011

Innovative Error Pages : Arstechnica

Filed under: Fun,Web — Vinay @ 6:15 pm

Snapshot of the 503 error on Arstechnica

HOW TO : Export and import certificates using keytool

Filed under: HOWTO,Networking,Technology — Vinay @ 2:55 pm

Keytool is a java utility to manage SSL key databases (stores). Here are a couple of options for using this tool

  • List the certificates in the keystore
keytool -list -keystore NAME_OF_KEYSTORE_FILE 
  • Export a particular certificate from the keystore
keytool -export -alias ALIAS_NAME_OF_CERT -keystore NAME_OF_KEYSTORE_FILE 
  • Import a certificate into the keystore
keytool -import -alias ALIAS_NAME_YOU_WANT -keystore NAME_OF_KEYSTORE_FILE -file NAME_OF_CERT_FILE_TO_IMPORT 

July 14, 2011

HOW TO : Use netcat (nc) on Windows 7

Filed under: HOWTO,Networking,Technology,Windows — Vinay @ 11:28 am

netcat is a swiss army tool for network/security professionals. You can use it to listen on certain ports or connect to certain ports. For example, say, you configured your firewall to allow TCP 80 traffic to your web server. But your web server is not built yet and you want to validate the rule. You can run netcat on your workstation to listen on port 80, assign the IP address of the web server to your workstation and test the rule.

If I am not mistaken, nc comes as a default tool in most of the Linux distros. You can download the windows port of the tool at http://www.securityfocus.com/tools/139

The command to have netcat listen on a specific port is “nc -l PORT_NUMBER”. If you run this on a Windows 7 machine, you will get this dreaded message “local listen fuxored: INVAL”. The fix is to run it with a -L option. So the command would like this

nc -L -p 80

The -L means “listen harder, re-listen on socket close” :) .. Have to dig deeper and see what it really means though. I will leave that for another blog post.

And if you want to validate that netcat is indeed listening on that port, you can connect to that port from another workstation by using nmap.

June 23, 2011

HOW TO : for loop in bash

Filed under: Linux,Programming — Vinay @ 11:54 am

Quick post for my own reference down the road. the “for” loop comes in very handy, when you want to perform the same task on multiple items in a bash shell.

For example, I wanted to query the DNS results of a couple of sub domains (blog.gogoair.com, pr.gogoair.com, tracker.gogoair.com), I can do it the normal way (that 99% of us do :) )

 dig blog.gogoair.com

dig pr.gogoair.com

dig tracker.gogoair.com 

Or, I can use the for loop function and do this

 for i in {blog,pr,tracker}.gogoair.com; do echo "$i" ; dig +short "$i"; done 

Got to love technology :) .. Makes you lazy!!..err I meant to say productive.

Thx to Cliff for the inspiration.

May 25, 2011

Facebook is popular…but still

Filed under: Rantings,Technology,Web — Vinay @ 8:31 pm

I wanted to signup for the service offered by the Techcrunch 2011 Disrupt winner, GetAround (which by the way is a pretty cool service) and went to their website. And what do I see? I need a facebook account to use their service. I know Facebook is popular, but how fair is it to require a potential customer to have a Facebook account?? 

March 8, 2011

HOW TO : Enable global reverse proxy with certain exclusions in Apache

Filed under: HOWTO,Technology,Web — Vinay @ 7:37 pm

Say you want to enable reverse proxy on a site powered by Apache Web Server where all traffic to the web site it reverse proxied to a different server, but you want to exclude certain paths from being reverse proxies. I don’t know why you would want to do that :) .. but we ran into that scenario at work and I wanted to document the config for future reference. The picture below shows a high level view of the traffic

  • Ensure the following modules are being loaded in Apache.

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
  • In the virtual host configuration for kudithipudi.org add the following lines

ProxyRequests Off

<Proxy *>
 Order deny,allow
 Allow from all
</Proxy>

ProxyPass /static !
ProxyPass /media !
ProxyPass / http://INTERNAL_SERVER:8888
ProxyPassReverse / http://INTERNAL_SERVER:8888

March 4, 2011

HOW TO : Trick to find out your IP address from a web server farm

Filed under: HOWTO,Technology,Web — Vinay @ 11:12 am

This is a quick trick I came up with to find out the IP address of a client that is trying to access a farm of web servers that you have access to. The diagram below shows the network path for a typical web server.

You have a client that might be sitting behind a (or multiple) proxy server. And there is a load balancer involved because you have multiple web servers for redundancy.

We were recently working on some rewrite rules for our web servers at work and we needed to find out what IP address the web servers were seeing the client traffic come from. Couple of challenges

  • Which web server do you check? The load balancer can send you traffic to any server.
  • What IP address are you going to look for? Wait that is the original problem right :) .

The web servers usually write an entry to the error log when they serve a 404 error. So we can use that to figure out which web server you are hitting and what IP address the web server is seeing you as. Here’s the trick

  • On the client side go to http://WEBSITE_ADDRESS/Get_Me_My_IP (or some other URL, which you know doesn’t exist on the web site)
  • On the server side, grep for “Get_Me_My_IP” in the web server error logs

Here is an example, I ran on this website (http://kudithipudi.org)

root@samurai:/var/log/apache2# grep -i what_is_my_ip access_kudithipudi.log
199.27.130.105 - - [04/Mar/2011:16:07:18 +0000] "GET /what_is_my_ip HTTP/1.0" 40                 4 5495 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.14) Gecko/2                 0110218 Firefox/3.6.14 ( .NET CLR 3.5.30729; .NET4.0E)"
  • From this entry I can figure out that my client is appearing as "199.27.130.105" to the web server.
« Newer PostsOlder Posts »

Powered by WordPress