Skip to main content

Online Storage Solutions

Problem:

I often need to have some files readily available online so that I can access them from any computer. There are many ways to go about solving this problem and each comes with its set of shortcomings:
  1. Yahoo! Briefcase - 30MB limit
  2. Online storage services like Box.net, Xdrive, MediaMax - usually cost money; signing up is cumbersome
  3. Email to myself as an attachment - enough said there
It's time to find a home-made solution.
The solution I am about to suggest is intended for --
  • A *NIX user
  • someone with access to a *NIX web server
Solution:

I am a linux user and I have user level access to a web server. The web server is configured such that the public does not have access to directory structure. So, I would need to write a script that copies my files to the web server and creates an index listing my files. Password protection of the storage would follow after that.

Client Side:

Use the following script to transfer file to server, make the file readable by public and execute indexing script on the server.

#!/bin/tcsh

scp -r $1 user@server:path_to_storage_directory
ssh user@server 'chmod 644 path_to_storage_directory/$1; source path_to_storage_directory/script'

Server Side:

Put the script below in the storage and it will be executed every time a file is transferred to the storage directory. It creates a new index file every time you transfer file. The script is necessary because most web servers don't allow outsiders to see their directory/file structure. So, this script is needed to create an index of files.

#!/bin/tcsh

cd
path_to_storage_directory;
echo "<html><pre>" > index.html ;
ls -lth | sort -r -k 6 | awk '{print $3"\t"$5"\t"$6"\t"$7"\t\t" "<a href=\""$8"\">"$8"</a>"}' >> index.html;
echo "</pre></html>" >> index.html
Next will come the password protection of the online storage.


P.S. The source code formatting courtesy of http://formatmysourcecode.blogspot.com/

Comments

Popular posts from this blog

Distribution of Wealth in the US

The rich get richer and the poor get poorer. I heard this statement quite a bit lately particularly in light of the sub-prime mortgage and general housing crisis in the US. The country has enjoyed significant economic prosperity and both Clinton and Bush boasted economic growth under their reign. Unfortunately, the beneficiaries of the economic boom are not people from all economic backgrounds, but rather the top 10%. To make things worse, Bush gave tax cuts mainly targeting the top 10%. Being more of a numbers guy, I always wanted showing the validity of the-rich-get-richer-n-the-poor-get-poorer statement. Thanks to Wikipedia , I have finally found it!! Both the mean and median net worth of families for the bottom 50% of the population has remained absolutely flat while the 75th-90th percentile see a decent growth and the top 10% enjoy the most appreciation on their net worth. So, if you factor in inflation, the-rich-get-richer-n-the-poor-get-poorer probably holds true. The g...

An Exercise in Obstinacy, Deception, and Self-Destruction

There is no other way to describe the policies of the current leadership in Eritrea. Please watch this appalling interview of the Eritrean President Isaias Afewerki with Riz Khan of Aljazeera and come up with your own series of adjectives to describe that incredible exchange. The fact that Eritreans are dying under the oppressive and misguided dictatorship of Isaias Afeworki frightens and saddens me very much. The fact that there is no immediate hope is downright depressing.

Victim of Asylum Roulette

Not too many stories resonate with me as much as the plight of legitimate asylum seekers whose desperate plea to find refuge in the US is ultimately decided by the questionable preference, judgment and mood of a single asylum officer (with some oversight from a regional asylum director) on one fateful day. That decision, according to numerous credible and through studies, depends largely on the location of the regional asylum center, the legal representation of the the applicant, the gender of the asylum officer just as much as the merit of the asylum case, while in fact the legitimacy of the asylum case should be the only relevant factor. This phenomenon has become so real that researchers at the Georgetown University law school have dubbed it the Refugee Roulette . Why am I so sensitive about this subject? My most devastating tragedy of late has been the denial of my legitimate and honest application for political asylum at the Chicago Asylum Office. When I applied believing the ...