No:The-Me http://blog.thinrhino.net.in A themeless blog posterous.com Fri, 03 Feb 2012 01:41:00 -0800 SSH between Mac OS X 10.6 host and Virtual Box guest? http://blog.thinrhino.net.in/ssh-between-mac-os-x-106-host-and-virtual-box http://blog.thinrhino.net.in/ssh-between-mac-os-x-106-host-and-virtual-box

Replicating a post from VirtualBox forum for self reference and archival. Original port is available here. Additionally, on my MBP, I could not see vboxnet0 adapter. The procedure to make it available is as follows:

  1. Goto VirtualBox Preferences (⌘ + ,)
  2. Click on 'Network'
  3. Click on the "+" sign to add the adapter

You are now set to follow the post below.

----

Has anybody been able to communicate by SSH between a Mac OS X 10.6 (Snow Leopard) host and a guest running on VirtualBox? My guest is Ubuntu Server 10.10 (64-bit). I have done the following, but to no avail:

  1. Installed OpenSSH Server on my Ubuntu Server 10.10 guest.
  2. Shut the guest down, and used VirtualBox Settings to enable a second virtual network adapter, named (by default) vboxnet0, and which I set as a host-only adapter.
  3. Ran ifconfig vboxnet0 in my host terminal:
    $ ifconfig vboxnet0
    vboxnet0: flags=8843 mtu 
    ether 0a:00:27:00:00:
    inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56
  4. Booted Ubuntu Server up again, and edited the /etc/network/interfaces file (sudo emacs /etc/network/interfaces) to append the following lines:
    auto eth1
    iface eth1 inet static
    address 192.168.56.10
    netmask 255.255.255.0
  5. Saved and closed the interfaces file.
  6. Ran sudo ifup eth1 from the Ubuntu command line.
  7. Switched to my host terminal and entered ssh 192.168.56.10.

But my Mac OS X ssh client just hung there without a response until it timed out. :-( There must be something else I am supposed to do to make this work—but what could it be? Does anybody know? Thank you!

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Sat, 31 Dec 2011 11:09:08 -0800 Dream. Dare. Soar. http://blog.thinrhino.net.in/dream-dare-soar http://blog.thinrhino.net.in/dream-dare-soar
Happynewyear

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Mon, 05 Dec 2011 19:24:46 -0800 Why did I attend Scientific Python conference? http://blog.thinrhino.net.in/why-did-i-attend-scientific-python-conference http://blog.thinrhino.net.in/why-did-i-attend-scientific-python-conference A few weeks back I noticed in my email an announcement for a conference on Scientific Python happening at IIT - Bombay. I immediately registered for the 4 day conference comprising of 2 day conference (talks) + 2 day tutorials + sprints. I could not attend the second half of the conference as my "Corporate" responsibilities did not allow me to spend so much time.

In my professional life, I use python on a day to day basis, but I solve the commercial world problems like how to make an application work better without flaws or how to make sure that a web-app works the way it is expected to work. I don't solve mathematical problems at work nor do I foresee any work in solving mathematical problems.

The only reason I went there was to vet my decision to move to using Python as my primary language for coding. About 3 years back, when I decided that I should have a skill set beyond MS Visual Basic / .Net and pick up an open source coding platform, I had a choice between Java and Python. Ruby and Rails were also promising and upcoming languages at that time. But I picked Python.

I am glad I picked up Python back then and after attending a scientific python conference I can safely say, python was the correct choice I made back then.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Tue, 25 Oct 2011 22:58:15 -0700 India's obsession with protests http://blog.thinrhino.net.in/indias-obsession-with-protests http://blog.thinrhino.net.in/indias-obsession-with-protests Today is Diwali & as I was half expecting, MSEDCL has cut the power supply. Reason mainly for this is the demand & supply gap. India's demand for power is increasing by the day as all of us start using more & more of electronic devices. On the other hand we are not able to build new power plants.
We should ideally be building more power plants to take care of or ever increasing demands. But we spend more time in opposing the decision taken by the bureaucrats and/or ministers. They decide to build a dam, we say no. Why? Forest land will vanish. Ok. They decide to build a thermal power plant, we say no again, why? Mining will destroy our forests. Ok. So they decide let build a nuclear power plant, we oppose again, why? This time we cite technical issues, environmental concerns, etc.
Now since we oppose everything and are not willing to provide alternatives we are essentially proving to be a road block in our own development.
Oh and btw, the people you fought for, the poor people in the villages don't have power for most of the day, do you know why? Because the power companies compensate the demand in cities by cutting the supply to villages.
So think again before you decide to champion an opposition for power plants!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Sat, 10 Sep 2011 02:08:00 -0700 Get your Reliance Broadband+ (ZTE AC2726) working on OS X Lion http://blog.thinrhino.net.in/get-your-reliance-zte-ac2726-working-on-os-x http://blog.thinrhino.net.in/get-your-reliance-zte-ac2726-working-on-os-x
A few months back I went the Apple MacBook Pro (MBP) way. My MBP was delivered on the day, OS X Lion was released. Soon, following the upgrade instructions, I upgraded for free to OS X Lion. On the new OS, my reliance ZTE AC2726 device did not work properly, it managed to crash the super stable OS X. Even the latest dialer from Reliance did not help.

After searching a lot for possible solutions, I was directed to the ZTEMT website (http://www.ztemt.com/ennewzte/service/ziliao.action). Here I found a dialer upgraded early in 2011, and decided to give it a try. On the above site, search for "ac2726 drivers for mac system" and download a file by the name of 1289779164594.zip, inside which you would find the installer, CrossPlatformUI-V2.0.6.dmg.

This solution works for Reliance and should work for other service providers too.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Tue, 06 Sep 2011 11:58:46 -0700 Are you invisible on GTalk? http://blog.thinrhino.net.in/are-you-invisible-on-gtalk http://blog.thinrhino.net.in/are-you-invisible-on-gtalk Do you like to remain invisible on GTalk or any IM service? Do you decide who you talk to & when?

Here are my thoughts for you. Just like the way you decide, who to talk to by remaining invisible, I am going to decide whether to respond to your chat ping or not.

Once in a while u r in invisible mode, I can understand, but everyday? If you don't want other's to ping you as you are busy, set the busy status & politely tell ppl, you will get back to them. If you have a pesky friend on the list delete / block him or her.

Note: This post is not for any one person but in general to all my invisible friends.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Thu, 04 Aug 2011 09:54:00 -0700 CPU Steal Time http://blog.thinrhino.net.in/cpu-steal-time http://blog.thinrhino.net.in/cpu-steal-time

Today morning, I was monitoring two EC2 AMI’s for their performance under load conditions for one applications in office. I was doing it in the most rudementary method, by obeserving the output from ‘top’. The last parameter in the CPU information line, ‘st’, drew my attention immediately as it was consuming nearly 60% of CPU time!

1:Def - 22:52:40 up 15:20,  1 user,  load average: 7.07, 3.30, 1.44
 Tasks: 110 total,   5 running, 105 sleeping,   0 stopped,   0 zombie
 Cpu(s): 30.9%us,  7.3%sy,  3.7%ni,  0.0%id,  0.0%wa,  0.0%hi, 0.0%si, 58.1%st
 Mem:   1747764k total,  1687264k used,    60500k free,    34288k buffers
 Swap:   917496k total,       88k used,   917408k free,   538928k cached

I guess I had missed it or never paid attention to that parameter earlier. Googled a little to find out that ‘st’ = ‘steal’, in the literal sense.

Steal time is the percentage of time a virtual CPU waits for a real CPU while the hypervisor is not scheduling this virtual CPU.

I found a very nice presentation from IBM, which explains what steal time is and why it exists –> http://t.co/XNhOIan

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Mon, 01 Aug 2011 21:51:51 -0700 Grounding the Apple plug! http://blog.thinrhino.net.in/grounding-the-apple-plug http://blog.thinrhino.net.in/grounding-the-apple-plug

When Apple ships their products to India I wonder why they cannot provide 3 pin India compatible plug?

Anyways, here comes the Indian jugaad to rescue! I took one pin of a broken 3 pin adapter & plugged it into another 3 pin international converter adapter. This pin can be aligned to coincide with the earthing or grounding plate of the plug provided by Apple. See attached photos for better understanding.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Sun, 31 Jul 2011 21:11:00 -0700 Configure Apache Reverse Proxy on Mac http://blog.thinrhino.net.in/configure-apache-reverse-proxy-on-mac http://blog.thinrhino.net.in/configure-apache-reverse-proxy-on-mac

Following up on the previous posts on configuring apache on Ubuntu, I now post the method to do the same on the Mac.

Step 1: You will need to download the mod_proxy_html module from http://apache.webthing.com/mod_proxy_html/

Step 2: Compile the code.

$ sudo apxs -ci -I /usr/include/libxml2 mod_xml2enc.c
$ sudo apxs -ci -I /usr/include/libxml2 -I . mod_proxy_html.c

Then update you httpd.conf to include

LoadFile /usr/lib/libxml2.dylib
LoadModule  proxy_html_module   libexec/apache2/mod_proxy_html.so
LoadModule  xml2enc_module   libexec/apache2/mod_xml2enc.so

Also take a look at the proxy-httpd.conf file that ships with mod_proxy_html for additional config you may want.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Sun, 31 Jul 2011 11:56:00 -0700 I deleted my Facebook account http://blog.thinrhino.net.in/i-deleted-my-facebook-account http://blog.thinrhino.net.in/i-deleted-my-facebook-account
Reaction 1:
Me : "I am no more active on Facebook & Google+, I deleted my account"
Other person : "What? Really? Why?"
Me : "Generally, no reason!"

And then suddenly you can feel the tone of the voice on the other end of the phone changing, to "is this guy alright? He deleted his Facebook account!"

While on the other side, I want to go 'Ha ha ha…' in the true evil style, something like the way Joker laughs

Reaction 2:

Me : "I am no more active on Facebook & Google+, I deleted my account"
Other person : "Really, hmm ok!"

and I am relieved I don't have to explain to that person why I took that 'extreme' step!

Reaction 3:

Me : "I am no more active on Facebook & Google+, I deleted my account"
Other person : "oh, even I was thinking, but… then I thought, I have connected with so many of my old friends … blah.. blah..."

While on the the other end, I go, 'yeh… yeh.. true, but you know… blah blah'

There was no real reason or spicy gossip or story behind me deleting my so called 'social' network account, I just thought I could do with less noise in my life!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Thu, 30 Jun 2011 05:41:00 -0700 Calendar July 2011 http://blog.thinrhino.net.in/calendar-july-2011 http://blog.thinrhino.net.in/calendar-july-2011

July_small

This summer like every summer I could not camp, I spent my days in an AC office, hammering away at the keyboard, just like any other 'IT Worker'. Last week I saw a small window to make good an escape from the AC office to a Tiger Sanctuary, before they closed down for the monsoons. Making a mad dash, I managed to join a group of friends heading to Kanha Tiger Reserve. The forest looked just plain beautiful, with shades of green and brown. Never had I had a chance to see Kanha in this season. It seemed like all the deers in the forest had come out into the meadows to celebrate and get wet in the rains. The male chital (spotted deers) sported beautiful antlers.

This July calendar, I send across a picture of one such male Chital.

Classic square monitor (4:3)
New modern full HD monitors, widescreen (16:9)
Laptop or HD compatible monitors, widescreen (16:10)

To download,
Firefox users: Right-click on the appropriate link and click “Save link as” to download.
Internet Explorer users: Right-click on the
appropriate link “Save target as” to download.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Sun, 29 May 2011 23:17:33 -0700 Update Swype beta on Galaxy 3 (Froyo 2.2) http://blog.thinrhino.net.in/update-swype-beta-on-galaxy-3-froyo-22 http://blog.thinrhino.net.in/update-swype-beta-on-galaxy-3-froyo-22 The official Samsung Galaxy 3 (Froyo) update from Samsung has a broken
install on Swype.

Since Swype comes as system app, you cannot update it or remove it
using the regular method. To remove old swype, you need to first root
your phone and then delete the swype.apk and then install swype.

Procedure I followed:
1. Did the "Super One Click Root(2.2)", instructions are available on
xda-developers forum thread
2. Then using adb, logged into the phone, executed the following
commands to get rid of default swype
su mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system rm -r /system/app/Swype* reboot
3. Registered for the beta program with swype

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Fri, 27 May 2011 10:43:18 -0700 Seth's Blog : Caring http://blog.thinrhino.net.in/seths-blog-caring http://blog.thinrhino.net.in/seths-blog-caring I am posting this on my blog, because I feel this is 100% true and a lot of company heads need to understand this.


---------- Forwarded message ----------
From: Seth Godin
Date: 27 May 2011 16:01
Subject: Seth's Blog : Caring
To:


Caring

No organization cares about you. Organizations aren't capable of this.

Your bank, certainly, doesn't care. Neither does your HMO or even your car dealer. It's amazing to me that people are surprised to discover this fact.

People, on the other hand, are perfectly capable of caring. It's part of being a human. It's only when organizational demands and regulations get in the way that the caring fades.

If you want to build a caring organization, you need to fill it with caring people and then get out of their way. When your organization punishes people for caring, don't be surprised when people stop caring.

When you free your employees to act like people (as opposed to cogs in a profit-maximizing efficient machine) then the caring can't help but happen.

[You're getting this note because you subscribed to Seth Godin's blog.]

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Mon, 23 May 2011 03:03:46 -0700 GWT Application Testing with Selenium http://blog.thinrhino.net.in/gwt-application-testing-with-selenium-0 http://blog.thinrhino.net.in/gwt-application-testing-with-selenium-0 This is a blog post from
http://i-proving.ca/space/Cynick+Young/blog/2009-09-25_1, which was
not available online, when I tried to access it. So have made a copy
of the blog on my site.

===========

Created by Cynick Young. Last edited by David Jones

One of the challenges in testing a GWT application using a tool like
Selenium, is to be able to accurately tell when all the asynchronous
requests have finished and that your application is in a state you
expect. I've searched around the internet and didn't find any useful
solutions on this topic so I'll share my implementation.

Defining Our Ajax Hook

Since GWT is all about Ajax, we need to inject some Ajax hooks into
our production web application. I'll create a new Semaphore that will
be included as part of the javascript that gets loaded into the html
of the GWT application. This will be our door in.

semaphore.js:
var IN_FLIGHT_AJAX = IN_FLIGHT_AJAX || function() {    // private variable bound through closure    var activeCallCount = 1;    return {        callsInFlight: function() {            return activeCallCount;        },        decrementCallsInFlight: function() {            activeCallCount--;        },        incrementCallsInFlight: function() {            activeCallCount++;        }    } }();

Notice how I've initialized the counter to be 1. This is important
because the GWT bootstrap process in itself can take a bit of time.
So, at a minimum we have to wait until the module is fully loaded.
Otherwise, you will get the occasional timing/synchronization failure
during test runs.

Bridge Between GWT and Our Testing Hook

I'll create a JavaScript Native Interface (JSNI) Java class to provide
the ability to manipulate our semaphore from within our GWT
application.

InFlightAjaxCallMarker.java
public class InflightAjaxCallMarker {    private boolean hasStartedCall = false;    private boolean hasEndedCall = false;    public InflightAjaxCallMarker() {        super();    }    public void startCall() {        if (!hasStartedCall) {            incrementCallsInFlight();            hasStartedCall = true;        }    }    public void endCall() {        if (!hasEndedCall) {            decrementCallsInFlight();            hasEndedCall = true;        }    }    private native void decrementCallsInFlight() /*-{        try {            if (($wnd.IN_FLIGHT_AJAX) && (typeof $wnd.IN_FLIGHT_AJAX.decrementCallsInFlight === "function")) {                $wnd.IN_FLIGHT_AJAX.decrementCallsInFlight();            }        } catch (ex) {            // Do error handling        }    }-*/;    private native void incrementCallsInFlight() /*-{        try {            if (($wnd.IN_FLIGHT_AJAX) && (typeof $wnd.IN_FLIGHT_AJAX.incrementCallsInFlight === "function")) {                $wnd.IN_FLIGHT_AJAX.incrementCallsInFlight();            }        } catch (ex) {            // Do error handling        }    }-*/; }

Marking Our Module Loaded

As I mentioned earlier, we want to wait for our module to be fully
loaded. This can be accomplished by adding a call to the end of
onModuleLoad().
public void onModuleLoad() {        ... perform some stuff        new InflightAjaxCallMarker().endCall();    }

Marking Our Ajax Calls

The easiest way to mark all our Ajax calls is to go through the
AsyncCallback interface. Since all our asynchronous interactions
require a callback, we can create a callback template to perform our
marking. From this point onward, developers will create new
AsyncCallbackAdapter classes instead of AsyncCallback.

AsyncCallbackAdapter.java
public abstract class AsyncCallbackAdapter<T> implements AsyncCallback<T> {    private InflightAjaxCallMarker inflightAjaxCallMarker;    public AsyncCallbackAdapter() {        this.inflightAjaxCallMarker = new InflightAjaxCallMarker();        this.inflightAjaxCallMarker.startCall();    }    @Override    public final void onFailure(Throwable caught) {        try {            onFailureBody(caught);        } finally {            inflightAjaxCallMarker.endCall();        }    }    protected abstract void onFailureBody(Throwable caught);    @Override    public final void onSuccess(T result) {        try {            onSuccessBody(result);        } finally {            inflightAjaxCallMarker.endCall();        }    }    protected abstract void onSuccessBody(T result); }

Getting Selenium to Wait

Finally, we will create a Selenium function to test our Ajax status.
String script = "selenium.isAjaxComplete = function() {    var appWindow = selenium.browserbot.getCurrentWindow();    if ((appWindow.IN_FLIGHT_AJAX) && (typeof appWindow.IN_FLIGHT_AJAX.callsInFlight === 'function')) {        return (appWindow.IN_FLIGHT_AJAX.callsInFlight() === 0);    }    return false; }"; selenium.addScript(script, scriptTagId);

Now, we can force Selenium to wait for Ajax calls to finish whenever we need.
selenium.waitForCondition("selenium.isAjaxComplete();", timeoutValue);

How Does the Semaphore Work With Multi-Threaded Rendering?

There are a few things that need to be clarified before I start
explaining about the workings of the semaphore.

The semaphore needs be included on each html page.
Javascript doesn't have threads. In all browser implementations, there
is only one thread of execution for javascript in each browser
window/tab.
Each browser will also have a native timer thread and any number of
native threads to do asynchronous XMLHttpRequest (XHR) calls. These
native threads are not accessible nor can we count on them in
javascript. When an asynchronouse response returns from the server, it
is the browser implementation that places the callback code onto the
javascript execution stack. No assumption should be made about the
order of execution.
In javascript, there are only 2 variable scopes: global, and function.

Now, on to the details.

Our semaphore is created in the global (top window) scope. If an
existing object already exists, it will use that existing object.
Otherwise, it will execute an anonymous function that returns us a new
object.
var IN_FLIGHT_AJAX = IN_FLIGHT_AJAX || function() {   ...    return {        ...    } }();

Our private counter is only accessible inside our semaphore object
because we defined it using function scope. Outside of the function,
activeCallCount cannot be modified and this validates the semaphore.
Through the "magic" of closure, we can provide accessors to our
counter even after the function has returned. Since javascript is
single threaded execution, we are guaranteed to serialize the
increment and decrement of the counter.
// private variable bound through closure    var activeCallCount = 1;
With multiple browser windows or tabs, there will be a single
semaphore loaded and associated within each window/tab. This works in
conjunction with the fact that each window/tab has its own global
environment. The asynchronous XHR calls in each window/tab will only
affect its associated semaphore, and that's what we want.

Conclusion

This is a comprehensive GWT testing solution for use with tools like
Selenium. The semaphore implementation can be used with any Javascript
framework, not just GWT. The JSNI bridge along with the AsyncCallback
template is the key to providing a seamless integration with GWT
applications. This approach to waiting for Ajax calls to finish will
deter developers from writing brittle web tests that depend on
specific pieces of text or UI elements. The drawback to this
implementation is that production code will contain small amounts of
testing hooks.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Mon, 09 May 2011 22:55:00 -0700 Funny demands! http://blog.thinrhino.net.in/funny-demands http://blog.thinrhino.net.in/funny-demands

A funny email I received from an acquaintance, I really do not know how to respond to this email.
Should I talk some sense into him or just laugh it off!!

*****************************
Hi guys,

Need your help for following:

My sister is starting a new company "some name" that will be working in green technologies.
They already have collaboration with some other international companies and are now trying to rope in investors for India center. For this a little help is needed, got to have some CVs and letter of interests to submit case to the investor.
So If possible please send in your updated CV's by tomorrow eve.

--
Thanks and Regards,
Acquaintance

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Thu, 05 May 2011 00:33:00 -0700 Apache2 reverse proxy with SSL http://blog.thinrhino.net.in/apache2-reverse-proxy-with-ssl http://blog.thinrhino.net.in/apache2-reverse-proxy-with-ssl

Following up on the last post, here I am outlining how to make reverse
proxy work with SSL,
$ sudo a2enmod ssl*
to enable all Apache SSL modules.
After this I appended the following code in the file
/etc/apache2/sites-available/default-ssl
AddDefaultCharset off Order deny,allow Allow from all SSLProxyEngine on SSLProxyCACertificateFile /etc/apache2/cacerts.crt ProxyPass /abc https://xxx.xxx.xx.xx:4400/abc ProxyPassReverse /abc https://xxx.xxx.xx.xx:4400/abc ProxyVia off
Since I was re-directing to a secure server, I faced two errors:
[error] [client xxx.xxx.xx.xx] SSL Proxy requested for 127.0.1.1:443 but not enabled [Hint: SSLProxyEngine] [error] proxy: HTTPS: failed to enable ssl support for xxx.xxx.xx.xx:4400 (xxx.xxx.xx.xx)
The main reasons being, first I had forgotten to add the
SSLProxyEngine parameter to the configuration.
Secondly, when apache acts as a proxy, it acts like a client
requesting over SSL. Hence it needs the server certificate (PEM
encoded) to do a successful handshake.
Using openSSL,
openssl s_client -connect xxx.xxx.xx.xx:4400 -showcerts
Copied the encoded content from -----BEGIN CERTIFICATE----- & -----END
CERTIFICATE----- , saved it to cacerts.crt.
After this apache started serving SSL access to remote server via proxy.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Tue, 03 May 2011 00:22:47 -0700 Apache reverse proxy using mod_proxy http://blog.thinrhino.net.in/apache-reverse-proxy-using-modproxy http://blog.thinrhino.net.in/apache-reverse-proxy-using-modproxy In the current project, we are using GWT on the front end and Django
on the back-end. To avoid SOP (Same Origin Policy) related issues, the
GWT code and the Django code has to be served from the same server. To
work around this problem, we setup a local (development machine)
Apache server, with reverse proxy.

http://localhost/abc was mapped to http://remote_aws_ip:8888/abc

To do this, follow the steps below:
$ sudo apt-get install libapache2-mod-proxy-html $ sudo a2enmod proxy*

Create a new file, remote_aws_ip, inside /etc/apache2/sites-available
<VirtualHost 127.0.0.1:80> DocumentRoot "/var/www" ServerName remote_aws_ip <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy> ProxyPass /abc http://remote_aws_ip:8888/hcm ProxyPassReverse /abc http://remote_aws_ip:8888.com/hcm ProxyVia off </VirtualHost>

Then enable the site, by running
$ sudo a2ensite remote_aws_ip
This will make a symlink to the file into sites-enabled.

Last but not the least
$ sudo service apache2 restart

Now I point my browser to http://localhost/abc and it fetches content
from http://remote_aws_ip:8888/abc

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Mon, 02 May 2011 05:25:00 -0700 Python Virtualenv Error: "--always-copy -U distribute failed with error code 1" http://blog.thinrhino.net.in/python-virtualenv-error-always-copy-u-distrib http://blog.thinrhino.net.in/python-virtualenv-error-always-copy-u-distrib

Faced the following error while initialising a virtualenv instance on ubuntu 11.04:

aditya@TR:~$ virtualenv virtualenvs/env_selenium --no-site-packages New python executable in virtualenvs/env_selenium/bin/python Installing distribute................................   Complete output from command /home/aditya/virtualenvs/env_s...ython -c "#!python \"\"\"Bootstrap distribu...1:]) " --always-copy -U distribute:   Extracting in /tmp/tmptp7iU4 Traceback (most recent call last):   File "<string>", line 477, in <module>   File "<string>", line 473, in main   File "<string>", line 74, in _install   File "<string>", line 444, in _extractall   File "/usr/lib/python2.7/tarfile.py", line 2083, in extract     self._extract_member(tarinfo, os.path.join(path, tarinfo.name))   File "/usr/lib/python2.7/tarfile.py", line 2159, in _extract_member     self.makefile(tarinfo, targetpath)   File "/usr/lib/python2.7/tarfile.py", line 2199, in makefile     copyfileobj(source, target)   File "/usr/lib/python2.7/tarfile.py", line 266, in copyfileobj     shutil.copyfileobj(src, dst)   File "/usr/lib/python2.7/shutil.py", line 48, in copyfileobj     buf = fsrc.read(length)   File "/usr/lib/python2.7/tarfile.py", line 817, in read     buf += self.fileobj.read(size - len(buf))   File "/usr/lib/python2.7/tarfile.py", line 735, in read     return self.readnormal(size)   File "/usr/lib/python2.7/tarfile.py", line 744, in readnormal     return self.fileobj.read(size)   File "/usr/lib/python2.7/gzip.py", line 252, in read     self._read(readsize)   File "/usr/lib/python2.7/gzip.py", line 299, in _read     self._read_eof()   File "/usr/lib/python2.7/gzip.py", line 338, in _read_eof     hex(self.crc))) IOError: CRC check failed 0xbf8917c9L != 0x59a4e93eL ---------------------------------------- ...Installing distribute...done. Traceback (most recent call last):   File "/usr/bin/virtualenv", line 3, in <module>     virtualenv.main()   File "/usr/lib/pymodules/python2.7/virtualenv.py", line 536, in main     use_distribute=options.use_distribute)   File "/usr/lib/pymodules/python2.7/virtualenv.py", line 626, in create_environment     install_distribute(py_executable, unzip=unzip_setuptools)   File "/usr/lib/pymodules/python2.7/virtualenv.py", line 367, in install_distribute     _install_req(py_executable, unzip, distribute=True)   File "/usr/lib/pymodules/python2.7/virtualenv.py", line 339, in _install_req     cwd=cwd)   File "/usr/lib/pymodules/python2.7/virtualenv.py", line 597, in call_subprocess     % (cmd_desc, proc.returncode)) OSError: Command /home/aditya/virtualenvs/env_s...ython -c "#!python \"\"\"Bootstrap distribu...1:]) " --always-copy -U distribute failed with error code 1

Hunting around the web realised the issue was with the replacement of setuptools with distribute. To get rid of the issue, updated virtualenv installation.

$ sudo pip install pip --upgrade $ sudo pip install virtualenvwrapper --upgrade

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Sat, 30 Apr 2011 21:23:08 -0700 Calendar May 2011 http://blog.thinrhino.net.in/calendar-may-2011 http://blog.thinrhino.net.in/calendar-may-2011
Small

This May, I dig into the archive to select a photo I clicked last may in Kanha.

There is no need for me to describe or say much about the national bird of India.

I hope you like it and look forward to your comments & critiques.

To download please click on the links below.

Classic square monitor (4:3)
New modern full HD monitors, widescreen (16:9)
Laptop or HD compatible monitors, widescreen (16:10)

To download,
Firefox users: Right-click on the appropriate link and click “Save link as” to download.
Internet Explorer users: Right-click on the
appropriate link “Save target as” to download.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate
Thu, 31 Mar 2011 09:15:00 -0700 Desktop Wallpaper April 2011 http://blog.thinrhino.net.in/calendar-april-2011 http://blog.thinrhino.net.in/calendar-april-2011

Sample

The colour of the month is Blue, because India entered the ICC World Cup 2011 finals. As a token of my support to the Indian Cricket Team, I have chosen a blue coloured bird to adorn your desktops.

The bird in the image is the Tickell's Blue Flycatcher (Cyornis tickelliae)

This month, the image will not have the calendar on it. I tried putting it at various locations, but it was spoiling the entire image.

Also, I have uploaded only 3 files, with the following sizes:

1. 1920 x 1200 (16:10)
2. 1920 x 1080 (16:9)
3. 1024 x 768 (4:3)

These days a lot of new laptops and new screens come in HD resolutions, i.e. 16:9 ratio, older screen came in a 16:10 ratio. If your monitor is a newer full HD monitor you can download the file number 2, if your monitor is a little older, you can download file number 1. If your monitor is of the real old type, square screen, please download file number 3.

And in-case neither of them fits your screen, please let me know the screen resolution, I shall custom make one for you and send it across.

To download,
Firefox users: Right-click on the appropriate link and click “Save link as” to download.
Internet Explorer users: Right-click on the
appropriate link “Save target as” to download.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1731211/Photo_on_17-12-11_at_10.04_PM.jpg http://posterous.com/users/4aARwucLk9zP Aditya Laghate thinrhino Aditya Laghate