Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

April 17 2015

July 31 2014

Using YQL servers as proxy to load resources cross domain

To load a HTML5 file from another domain use this query.

select * from html where url="https://www.yahoo.com/" and compat="html5" and xpath='*'

This will return the whole HTML page in the results tag of the generated XML. If you want to use JSONP just add a "callback=[funcName]" query parameter in the end and instead of an XML a JSON will be sent out. Here is an example of how it will be sent out. I am using callback function as "test". Depending on which framework or library you are using you will need to set it accordingly.

Also the YQL servers support CORS so it won't be that difficult if you do a direct XHR to get the file instead of using script tags for JSONP. I also tested it using text files and they can also be downloaded using this method.

If you want other types of resources which are less than 25KB you can use another YQL query to get the results.

select * from data.uri where url="http://l.yimg.com/a/i/us/pps/yql32.png"

This only works for resources which are less than 25KB. But here it could be an image or any other resource and it will work.

September 24 2013

Using CONNECT method on a http proxy using telnet

The simplest way to connect to an external server using a proxyserver.

C:\Work>telnet proxyserver 8080
Connected to proxyserver.
Escape character is '^]'.
CONNECT irc.freenode.org:6667 HTTP/1.1

HTTP/1.1 200 Connection established

:kornbluth.freenode.net NOTICE * :*** Looking up your hostname...
:kornbluth.freenode.net NOTICE * :*** Checking Ident
:kornbluth.freenode.net NOTICE * :*** Found your hostname
:kornbluth.freenode.net NOTICE * :*** No Ident response

In this case we are connecting to a proxyserver on port 8080. After that we open a http tunnel to irc.freenode.org on port 6667. Then you need to press enter twice to establish the connection. After that you have an open socket and you can send the commands accordingly based on the protocol being used. Here we connect to an IRC server.

We could do the same thing by connecting to a HTTP server. You can apply the logic by opening a socket to the proxy server and then sending and receiving over the socket if you are doing socket programming. The only extra things you need to take care is to open the tunnel the rest of the logic remains the same.
C:\Work>telnet proxyserver 8080
Connected to proxyserver.
Escape character is '^]'.
CONNECT www.google.com:80 HTTP/1.0

HTTP/1.1 200 Connection established

GET / HTTP/1.0

HTTP/1.0 200 OK
Date: Tue, 24 Sep 2013 08:34:43 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: [a dozen cookies]
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic

May 21 2013

May 10 2013

The best tool for clipping backgrounds

Been using this amazing tool to clip backgrounds which otherwise is a real pain to do in most other software.

Really like the simplicity of the application. Visit  http://clippingmagic.com to see it in action. Only 4 steps after that.

  1. Upload photo
  2. Select background
  3. Select object to extract 
  4. Wait for magic and you are done.

February 13 2013

December 31 2012

2012 in a nutshell

This year has been relaxed (lack of a better word) to say the least. Did nothing much besides work. For once in many years I did not work or passionately work on any personal project. The list of personal projects is still there but have not been able to find the right structure to get it done. And for once I really enjoyed being lazy at home. Hopefully I have had enough rest and get something going in 2013 as far as personal projects are concerned.

There is the next version of pics.fefoo, fefoo.com and the windows based twitter client which has been languishing in the dark for the last 3 years now. Not sure if it will ever be used by anyone else but me. I like using it but still need to get the kinks out and reduce the number of features and make a public version that someone else besides me can use and test.

Here is hoping I release something in 2013 and also streamline my webhosting accounts.
Tags: personal

December 11 2012

Einstein was right!


  Having a Coffee...


Get-together in a restaurant... 

Enjoying the beauty of a museum...   

Pleasantly chatting in a cafe ...  
Enjoying a day at the beach...   


At the stadium supporting the team...   

A couple spending quality time together  


Appreciating the city in a convertible ..   


Einstein was right!!
Albert Einstein:   
"I fear the day when the technology overlaps with our humanity. The world will only have a generation of idiots."  

Permalink | Leave a comment  »

October 22 2012

Chrome OS and WinRT

I still don't get WinRT or the new windows applications. If I really wanted to go back 20 years where I could run one application at a time I would use an iPad instead. This whole paradigm shift brings me to Chrome OS which works fine on ARM architecture and since most of the applications are just web applications I really don't see any difference from the WinRT applications.

Maybe in a year or two I might have to eat my own words but at this point of time I don't see WinRT going anywhere. If WinRT does work out it will surely push Chrome OS adoption as well. Its cheaper and lighter than WinRT.

September 29 2012

Using the ASUS RT-B13U with Tata DOCOMO eStick

To setup the router for Tata DOCOMO eStick set the following values and it should work. You don't need to do anything else.

3G/3.5G USB AdapterAUTO APN service(optional) Username
I bought the router from flipkart and it took 3 weeks to get it. I had posted this a review but flipkart removed it. 

Dear Customer,

Thank you for posting your review for "Asus RT-N13U", dated 28th September 2012.

We sincerely apologize for the poor service you experienced with Flipkart. We have shared your feedback with our customer support team for further follow-up.

As per our review policy (www.Flipkart.com/s/help), we solicit only product-specific reviews on the product page and hence your review on our service has been removed.

We are in the process of rolling out a customer-centric forum welcoming your experiences and feedback on our services and products. In the meanwhile, please feel free to share your concerns or queries with us at cs@flipkart.com.

Yours Sincerely,
[name retracted]
Customer Review Team

I will try and post what I had written in the review. They had a reason to remove the review as it was projecting flipkart in a slightly negative light even though I had no intentions to do that.

Had ordered the router on the 6th of September. As luck would have it, it went out of stock the very next day. Can't blame flipkart for it but when I ordered it it was in stock. It took 2 weeks to get it delivered. I received it on 21st. I tried to set it up the whole evening but unfortunately the USB on that device was defective. I finally figured that out once I had plugged in every USB storage device that I had. Called up flipkart and it was returned back in 1 working day. Unfortunately for me the device was still out of stock so flipkart gave me store credit. 

When it was finally in stock I was still not sure if buying this router would be a right decision or if none of my devices were compatible with this device.I eventually took a risk and ordered the same device again. Got the delivery in 2 days and was up and running in less than 5 minutes. 

As far as the device is concerned it is really worth the price. Have not been able to use any other USB functions as I am using a USB modem. Will try and buy a usb hub and see if it works with it.

September 21 2012

Panchkula Electricity Complaint Numbers

I've been trying to search for a customer care number to file a complaint but its so difficult to find the numbers. So in case you are one of the unlucky ones here are the numbers.

9316065982, 2591033, 2591037, 2595549
Toll free- 155333

Its almost impossible to get through the 93* number. But thankfully people tend to pick up the landlines. If you still have a landline then it should be easy to call up on their toll free number.

June 28 2012

Installing Android SDK without or a slow internet conection

If you are on slow internet connection this blog post should help. The only change is that to get the latest APIs instead of using https://dl-ssl.google.com/android/repository/repository.xml use https://dl-ssl.google.com/android/repository/repository-7.xml or keep whichever is the latest version.

Some more information is available at http://www.hariadi.org/android/manual-download-of-android-sdk-components/

December 01 2011

Using Voicemail with Airtel Prepaid Karnataka

  • Call  *321*671# to activate the service on your phone.
  • It will ask you for permission if you want to enable it.
  • To customize the account dial 52555
  • To disable voicemail dial *321*673#
  • You can also activate it by sending out a SMS
  • Send START VMS to 54321 for activation 
  • Send STOP VMS to 54321 for de-activation 

This post if for my own reference. If you have any questions leave a comment and if I know about it I will try and answer it.

October 24 2011

Which mobile OS will win the battle?

tl;dr If I had to predict today which OS will finally win the battle it has to be Android.

Once the market stabilizes there are only so many OS's that can survive. Android is to the mobile what Windows is to the PC. It might not be the best to begin with but given enough time it can finally catch up to the competition. There are only that many new features that you can add. Once you've added those there will hardly be any differentiating feature amongst the competing OS's.

In the end it will be about hardware. And as of now only Android is the only OS which can run from a very low end smartphone to the top of the line phone.

September 12 2011

Running node.exe windows

Finally node.js is available as a windows binary without requiring Cygwin to be installed.

As of writing this post you can download the node.js binary 0.5.6. Currently npm does not work with node.js on windows. You need to download and use ryppi.py instead of npm. It works similar to npm but requires python. To setup node.js first set the PATH and NODE_PATH to the where you have copied node.exe.

             set PATH=%PATH%;c:\node
             set NODE_PATH=c:\node

It is better to set these environment variables in the System Properties so that you don't have to set these variables every time. Follow the following steps to do that.
  1. Right-click Computer, and then click Properties.
  2. Click the Advanced system settings in the left side bar.
  3. Click the Advanced tab.
  4. Click Environment variables.
  5. Append the node path to the PATH variable
  6. Create a new variable NODE_PATH and set it to the path where node is installed
Once you are done with it need to install Python as ryppi.py is a python script which works like npm. Once you are done with it you can install any of the libraries by using the following command.

             python ryppi.py install socket.io express

Am assuming here that python is setup using the installer which also will also setup the path of python in the environment variables. 

May 06 2011

TIL: In JavaScript function.length returns the number of arguments it supports

function test(a, b, c)



In this piece of code if you use .length on a function it returns the number of named arguments that this function accepts.

Tags: javascript

April 15 2011

Play fullscreen
Simon and Garfunkel - Bridge Over Troubled Water Original Version
Play fullscreen
Simon and Garfunkel - Bridge Over Troubled Water Original Version

April 07 2011

Conditional compilation in IE

I normally know about conditional compilation of JS in IE using <!--[if gt IE 6] --> but here is something new I figured out today.

var IE;
//@cc_on IE = parseFloat(navigator.appVersion);

The best part here is that the JS code stays in your JS files and does not uglify the HTML if you ever have to use conditional compilation. Here is some more information about it from MSDN article Conditional Compilation (Windows Scripting - JScript).

Speed up your JavaScript

This post is just for my own reference. Here are the slides and the video of the presentation by Nicholas Zakas. Goes into great detail in ways to improve the speed of your javascript code.

The article summarizes most of the points in the slides and video http://james.padolsey.com/javascript/zakas-javascript-performance-tips/

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!