Resolving TinyURLS to the desination URL

Blogged under Programming, hacks by Arun on Friday 27 July 2007 at 5:14 am

After Twitter hugged TinyURL, there happens to be lots of talk about how to enhance TinyURL services.

for example:

http://preview.tinyurl.com/37dz8l

redirects to

http://www.webforth.com/

But how do we understand that the first URL is going to get redirected to the second URL. It is pretty clear that the string 37dz8l does the magic. TinyURL folk has written a smart algorithm to shrink bigger URLs to a hashed string (Anybody know how that works?). For the time being, I wrote a small snippet for resolving a tiny url to its original destination URL. The script will directly contact TinyURL server to see where the URL is getting redirected.

< ?php

// tinyurl.php?c=

$num = $_GET['c'];

if($fp = fsockopen ("tinyurl.com", 80, $errno, $errstr, 30))
{
if ($fp) {
fputs ($fp, "HEAD /$num HTTP/1.0\r\nHost: tinyurl.com\r\n\r\n");
while (!feof($fp)) {$headers .= fgets ($fp,128);}
fclose ($fp);
}
$arr1=explode("Location:",$headers);
$arr=explode("\n",trim($arr1[1]));
echo trim($arr[0]);
}
?>

It is a simple code which plays with http headers rather than HTML. It processes shorter strings and string manipulation is done using non-regexp tricks.

Ripping audio cds to MP3 with VLC

Blogged under hacks, software by Arun on Tuesday 15 May 2007 at 4:36 am

If you aware of, VLC(Video Lan Client) is one of the coolest media players available today. I recently digged out a way to rip Audio CDs to mp3 format using this cute little app. Honestly speaking, with VLC, you can convert CDA files to almost any audio format available.

This is how you can do it:

1) Insert your CD into the drive and open VLC.
2) Select File > Open File. Browse and select the track from the CD.
In the same window, look for Advanced Options


3) Check the Stream/Save checkbox. Click Settings to open the big settings window.
4) In the Output section, check the File checkbox. Click Browse and select your new file name. Check settings I used.

5)
Click OK (OK again) to start the conversion
6) Go back to step 1 for the next track (It is simple. You just have to change the filenames - keep the other settings as it is)

Sorry for the Microsoft style explanation; I am on a windows machine. You can always do all these using shell scripts in Linux, I guess. VLC won’t display any progress untill it finishes with the file. VLC supports conversion with upto 512Kbps stream with a maximum of 5 channels.

Don’t have VLC? Download

Is ‘C’ suitable for this?

Blogged under uncategorized, life by Arun on Monday 14 May 2007 at 5:17 pm


The correct title for this post would have been ‘Is C scalable enough for this?’. I was reading PHP scalability myth (one more time) and found that how people can be very partial about ‘their own’ (Just like they created it) programming languages. I think just like the above strip, people should use apt languages they are comfortable with.
(Thanks to Trisha for this strip.)

11 Most Beautiful “cloudy” Designs

Blogged under design by Arun on Thursday 10 May 2007 at 3:02 am

After going through many CSS galleries, I observed a common feature - clouds and the beautiful sky. It simply adds gradients and informal, illustrative and vast look to the headers. Some of the designs even went into details like mountains and flock of sheep in it.

But sometimes, the same objects; Sky and clouds have been used in a subtle way. See those effects inHopking Designs and Land Experts. Enough talk; See them.

#11) You Rant

#10) Hopking Design

#9) Land Experts

#8) El Pescadito

#7) Welika Villege

#6) Bin Slash Bash

#5) Global Zoo

#4) Joshua Brayant

#3) WiredTree Hosting

#2) Arty Papers

#1) UX Magazine

Scaling Twitter to the maximum

Blogged under web2.0, ruby, rails by Arun on Monday 23 April 2007 at 8:01 pm

Scaling Rails Applications has been a good topic over internet so far. From Jonathan Boutelle’s Barcamp Bangalore 2 session, had a good overview of how folks at Slideshare did it. It has been wounderfully architected with use of Amazon S3.

Twitter is Evan William’s newest product. Moreover, Twitter is this years success story. With millions of twits from millions of users, it has been reported that is struggling to scale. David posted couple of thuoghts over this issues in general last week.

Today evening I stumbled upon this wonderful slideshow on scaling rails. It has been created by Blaine Cook who works for Twitter.

Please find Slideshare scaling doc below

The douments like this really helped me rearranging my thoughts a lot. You guys rock!

Netscape enters videosharing arena

Blogged under web2.0, events by Arun on Sunday 8 April 2007 at 9:35 pm

I was trying to submit a story to Netscape and saw a link to upload videos. It was interesting. Netscape now allows you to upload your own videos to the portal. Netscape had already started some syndicated video features back in 2006.

Recently, many memediggers, including Digg had added video memedigging functionalities to their sites. But netscape allows you to upload the entire video (max limit 150MB) to be uploaded. Currently supported formarts are mpg, .mpeg, .mov, .avi, .mp4, .wmv *, or .m4v file. There is no limit on the number of videos you can upload. Just like YouTube, the format which the videos are displayed is flash. Netscape really want to build it’s own YouTube.

Till this moment I am not able find any open videos.

Amazon blocks Statsaholic

Blogged under web2.0 by Arun on Saturday 24 March 2007 at 3:06 am

It is happening again - this time worse. Amazon/Alexa is trying to shut down Statsaholic (formerly Alexaholic) by blocking the Alexa graphs. Statsaholic is a multiple site traffic comparison service that became popular lately for Seth Godin’s web 2.0 picks.

Statsholic responds in this way:

David vs. Goliath - On March 18, in response to legal action taken against me by Alexa over the use of their name in my domain alexaholic.com, I changed the name of this website to Statsaholic. Now, on March 23, Amazon/Alexa is still trying to shut this website down, this time by blocking their traffic graphs if you’re viewing them from this site (even though thousands of other websites, and Alexa’s own free widgets, serve their traffic graphs in exactly the same manner). I’m doing my best to keep the site up with some creative coding, but it’s not looking good for the little guy here. If you see a white box where the graph should be, that’s Alexa blocking us again. It appears that the decision makers at Amazon think mashups and creative use of their api is fine, unless you get successful with it.

The last point seems very true. Statsholic had started the comprehensive trafic comparison features much before Alexa itself (using Alexa’s own data). But it seems like Amazon’s API’s are not as open as they advertise it to be.

RIght now no clarification is available from Alexa / Amazon regarding this issue.

Update: It seems like Statsaholic wants to switch to other traffic data providers. Compete.com and Quantcast.com have already shown interest in providing their data.

10 things your manager doesn’t want to hear

Blogged under life by Arun on Saturday 24 February 2007 at 3:52 pm

Ten things your team manager doesn’t want to hear just before the deadline.

  1. But it works on my machine.
  2. Done. Just testing is left.
  3. I am waiting for x to give me the code for integration.
  4. I think there is a bug in SVN (a.k.a “We messed up with checkout”)
  5. Next time we should promise deadlines more realistically.
  6. UPS serviceman called up. It is raining outside his office.
  7. Your father in law is sitting in the lounge. Shall I tell him you are not in the office?
  8. Bug list has come: 7 showstoppers, 13 minor defects.
  9. Our VP would love to have a minor documentation with this build.
  10. Hi man. Hope everything is on track.

Top programming jobs in 2006 - oDesk List

Blogged under uncategorized by Arun on Tuesday 23 January 2007 at 1:19 pm

Today I got an email from oDesk (Yes. I am getting it regularly) about their performance in the year 2006. They have served a total of 35000 manhours of work through around 8555 jobs posted.

Skill Set Job Openings Average Expected Duration (hours) Average Payout
PHP/MySQL

1632

187

$411

Flash/Macromedia

535

178

$174

ASP.NET+ADO

396

332

$488

PHP

387

151

$403

C#/.NET

338

483

$668

AJAX

299

340

$194

Graphics

283

176

$154

ASP

279

289

$608

HTML/DHTML/Javascript

251

263

$530

Interesting thing is that PHP/MySQL duo continues to excel in the job market with the largest number of projects posted. But when it comes to payout, .Net with C\# gets an upper hand with ASP in the second (Never thought ASP is still alive?). I love these kind of statistics. It gives a good direction to people where to go for his bread and butter. Of course, It will be interesting to watch what will happen this year.

Gandhi video still available in YouTube

Blogged under life by Arun on Sunday 14 January 2007 at 1:57 pm

Even after indian newspapers reported that YouTube has taken down the disgraceful pole-dancing video portraying a Mahatma Gandhi look-alike, the video is still available in YouTube.

Next Page »
Proudly powered by Wordpress 2.1.3 - theme by neuro, styled by webforth.