News for hackers. Stuff that matters.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by uams on Monday October 01, 2012 @03:43PM (#4598978)
Something I threw together over the weekend. I've been using filepicker on a website of mine. Realized that I could hack it to upload and share files in a simple tool.

Inspired by cloudApp, when I found myself wanting a command line version.

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by chefsurfing on Monday October 01, 2012 @05:38PM (#4599488)
Well done! Also you deserve a big thanks from Filepicker.io - this is great inbound marketing for them.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by adlwalrus on Monday October 01, 2012 @08:47PM (#4600144)
Seems like this could be done with more respect for user/data sovereignty if done with Node.js. Essentially, you'd cat the file into the script, it would spin up an HTTP server, do some port knocking or whatever NAT-traversal-fu is necessary, then spit out a link with either your raw IP, or a preconfigured dynDNS domain name.

This way we aren't carelessly littering our data all over the "cloud".

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by HerraBRE on Monday October 01, 2012 @11:20PM (#4600494)
Tooting my own horn again, but you just asked for https://pagekite.net/:

$ pagekite.py /path/to/file.blah yourname.pagekite.me

... send people a link to https://yourname.pagekite.me/file.blah and it streams from your disk. CTRL+C and it's offline with no copies stored anywhere in the cloud. Works with entire folders too (append +indexes to generate indexes), which is good for static HTML demos. If you want a harder-to-guess URL, append the +hide flag to the command above.

And yes, it's open source and you can run your own relay/reverse-proxy if you don't want to rely on me. Give it a try! :-)

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by voltagex_ on Tuesday October 02, 2012 @01:31AM (#4600712)
Be proud, your domain has made BlueCoat's list of "proxy avoidance" sites and is blocked at my workplace.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by HerraBRE on Tuesday October 02, 2012 @06:20AM (#4601323)
Woah, I'm in the big leagues now! Blocking us actually makes perfect sense, PageKite can be used to avoid a lot of quite reasonable corp security policies.

Can you access sites on other domains which are connected via. PageKite? For example my personal site, http://bre.klaki.net/ or my kite http://bre.pagekite.me/ ?

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by voltagex_ on Tuesday October 02, 2012 @09:00AM (#4601679)
Nothing on pagekite.me, will check the other tomorrow.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by HerraBRE on Tuesday October 02, 2012 @10:14AM (#4602050)
This probably doesn't belong on this thread, but I would really appreciate e-mail: bre at pagekite dot net.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by lukeholder on Tuesday October 02, 2012 @01:29AM (#4600709)
awesome. thanks for sharing!
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by wizard_2 on Monday October 01, 2012 @11:16PM (#4600486)
Know any port knocking as a service companies? If there was a reliable way to get a udp connection between hosts that I didn't have to write myself, I'd be tempted to take this on.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by tcas on Tuesday October 02, 2012 @01:29AM (#4600708)
I think the term you're looking for is UDP hole punching, port knocking is performing a special sequence of connections (i.e. try TCP on 8100 then UDP on 4000 then TCP on 2000) to open up an additional port (like SSH) to a certain IP.

I'd be curious if there exists such a company or even any good open source libraries that can tie into other servers.

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by charliesome on Tuesday October 02, 2012 @01:40AM (#4600727)
> Know any port knocking as a service companies?

Are you serious?

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by nyan_sandwich on Monday October 01, 2012 @04:01PM (#4599056)
Another:

    cat file | curl -F 'sprunge=<-' sprunge.us
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by teach on Monday October 01, 2012 @05:59PM (#4599573)
Does sprunge work for non-textual data?
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by crohr on Tuesday October 02, 2012 @05:16AM (#4601179)
In the same vein, you can try http://flag.io/:

  curl -T /path/to/any/file flag.io
  # or
  cat some-file | curl -T - flag.io
Basically, pipe anything you want into it. It can also syntax-highlight your text files.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by cleverjake on Monday October 01, 2012 @06:19PM (#4599640)
no it doesnt.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by corford on Tuesday October 02, 2012 @09:16AM (#4601760)
Nice work and very handy.

I hadn't come across filepicker.io before and reading through the geturl code something jumped out at me:

APIKEY = check_output(['curl', '--silent', "%(fpurl)s/getKey?email=%(email)s" % {'fpurl': FPAPIURL, 'email': email}])

From that, it looks like any random person can fill up your filepicker.io space providing they have your API key or know the email address you used to register the account with. Made sense when I read a bit more about what filepicker.io actually does (i.e. a client-side embeddable javascript file uploader) but it's something to be aware of (especially if you link your account up to an S3 backend!).

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by liyanchang on Tuesday October 02, 2012 @01:54PM (#4603265)
One of the founders, just wanted to reply and say, yes, you are entirely right. We put up that endpoint for a separate purpose, didn't expect people to find it (underestimating people is clearly a bad strategy) and will be locking it down to require a password to create/find a apikey.

In general, the apikey doesn't actually provide very much security as is; by it's public by it's very nature as you have to put it client side and expose it to all your users. We've got HMAC and secret keys in the pipeline for next week :D

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by xxbondsxx on Friday October 05, 2012 @12:17PM (#4617467)
Will those security changes break GetURL?

Also, isn't it normal to check the referrer when using API keys? That's what Facebook does -- API keys only work from certain domains, which effectively restricts their access. The downside is that you need to maintain separate API keys for every domain (staging, sandbox, etc), but the advantage is that they don't rely on the honor system :P

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by nvk on Monday October 01, 2012 @04:40PM (#4599234)
Neat, +1 on the 'brew' addition intent :)
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by asdfprou on Monday October 01, 2012 @04:41PM (#4599241)
Please submit to brew!
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by uams on Monday October 01, 2012 @08:50PM (#4600156)
Submitted to brew. Not sure if I did everything right (first time)

https://github.com/mxcl/homebrew/pull/15229

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by Zash on Monday October 01, 2012 @11:59PM (#4600569)
I have no idea why I haven't installed xsel already. The help mentions a secondary clipboard. X has a secondary clipboard? Is there a way to paste that (like middle click for the primary)?
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by icebraining on Tuesday October 02, 2012 @02:43AM (#4600842)
Following the old zero-one-infinity rule[1], X has an arbitrary number of clipboards; the most commonly used are PRIMARY (select+middle click), CLIPBOARD (usually C-c/C-v or edit→copy menus) and SECONDARY which, as far as I know, can only be pasted using applications that support it (e.g. xclip -o).

[1]: http://www.catb.org/jargon/html/Z/Zero-One-Infinity-Rule.htm...

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by ralph on Tuesday October 02, 2012 @05:19AM (#4601186)
You can ignore the bit about Emacs if you wish. http://www.jwz.org/doc/x-cut-and-paste.html
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by TazeTSchnitzel on Monday October 01, 2012 @05:06PM (#4599343)
Since I have web hosting and use GitHub, here's my method:

    cp file_name ~/Projects/2012/ajf.me/ajf.me/imagedump/ && cd ~/Projects/2012/ajf.me/ajf.me/ && git add imagedump && git commit -m 'new file' && cd .. && ./update.sh
Elaborate, sure, but it does the job. update.sh runs git push and then does an SSH into my server and a git pull. (Because I'm too lazy to actually set up git on my own server)
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by SoftwareMaven on Monday October 01, 2012 @08:54PM (#4600168)
You don't need to set up a git server on your own sever. Just create a git repo, add it as a remote revenue to your local repo, and use ssh+git to push changes directly.

But if you have your own server, why don't you just scp it directly there? That's the piece most people are missing.

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by xxbondsxx on Friday October 05, 2012 @12:21PM (#4617484)
SCP is really the solution here. But to be fair, I only discovered scp after a year or two of CLI work. I might have been tempted to hack something together like Taze's solution in my earlier days
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by lttlrck on Monday October 01, 2012 @05:08PM (#4599349)
This is awesome, it actually makes filepicker.io useful for me. My main use-case for Dropbox has turned out to be for this kind of sharing... geturl is waaaaaay easier.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by netvarun on Tuesday October 02, 2012 @12:40AM (#4600637)
This a nice nifty script. Thanks!

Something I noticed (https://www.filepicker.io/pricing/): Since filepicker.io charges by number of files and NOT by total size of files, a free account could potentially host a huge amount of data.

Eg: 5000 files, each of 1 GB = 5 TB!!!

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by Synthpixel on Tuesday October 02, 2012 @12:04AM (#4600574)
It couldn't handle files with spaces, plus the link it gives initiates a download for the file instead allowing you to view it in the browser. Considering most of the time I want to quickly upload a file in this manner the file is a screenshot, this is basically useless for me.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by egonschiele on Monday October 01, 2012 @04:07PM (#4599086)
Very nice! But no Python 2.6 support?
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by voltagex_ on Monday October 01, 2012 @09:50PM (#4600305)
As of an hour ago it works on 2.6 :D
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by robertskmiles on Monday October 01, 2012 @04:57PM (#4599300)
The key problem seems to be `check_output` in the `subprocess` module.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by voltagex_ on Monday October 01, 2012 @07:48PM (#4599946)
https://github.com/uams/geturl/issues/7

Edit: pull request submitted.

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by grakic on Monday October 01, 2012 @06:54PM (#4599771)
What about storage usage?

  > To make it easier to get started, if you haven't
  > put in your S3 credentials we will store them on
  > our servers, but as your usage increases we will
  > ask you to move to your own storage.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by tldnr on Monday October 01, 2012 @07:36PM (#4599906)
Nice tool, I made something similar for dropbox a while back that symlinks/copies files into your DB folder.

https://github.com/BRMatt/dotfiles/blob/master/bin/dropup

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by slig on Monday October 01, 2012 @03:50PM (#4599011)
Nice! There's an opportunity for some company sponsor this (a la localtunnel.com and twilio).
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by brettcvz on Monday October 01, 2012 @03:55PM (#4599028)
Given that it uses Filepicker.io, probably makes sense for us to take a look. The idea of turning files into URLs is one that we really like
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by MateusCaruccio on Tuesday October 09, 2012 @01:27PM (#4632829)
Inspired by geturl, I built this: http://news.ycombinator.com/item?id=4626779

pro: no storage backend needed con: works only behind a UPnP router (most are ok)

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by soraggi on Tuesday October 02, 2012 @08:44PM (#4605194)
I really liked it, so I ported it to perl implementing a basic caching system (SHA1), I hope you don't mind: https://github.com/psychotropic/Get--Url/
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by 3rd3 on Monday October 01, 2012 @10:12PM (#4600347)
I still prefer Dropbox because you have better control about what you upload.

Simply copy your files into ~/Dropbox/Public, right-click and choose Dropbox > Copy Public URL. Voilà!

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by cowsaysoink on Monday October 01, 2012 @10:13PM (#4600352)
Except that Dropbox has now discontinued their public folders in exchange for there get link everywhere (which requires you to click add to dropbox or a download button rather than direct access).
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by 3rd3 on Monday October 01, 2012 @10:39PM (#4600406)
I’m not sure what you mean. The method I wrote about still seem to work.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by cowsaysoink on Monday October 01, 2012 @10:48PM (#4600421)
All new accounts no longer have a public folder.
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by azernik on Monday October 01, 2012 @10:55PM (#4600438)
Yes - all that means is that now you can move a file into anywhere in your Dropbox, right-click it, and click (in the Nautilus plugin) "Share Link" and get a publicly available link.

The only thing that the Public folder did differently was that it did the equivalent of "Share Link" for every file in it, and also had a public index of files in the folder.

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by syassami on Monday October 01, 2012 @03:53PM (#4599025)
Very awesome tool, it's a great way of sharing nice and quickly!
Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by Macphisto on Monday October 01, 2012 @03:57PM (#4599035)
Nice utility!

Just a note:

28: exit("`curl` is requrired. Please install it")

Re:ShowHN: GetURL - A CLI tool to get a public link for any ... by uams on Monday October 01, 2012 @04:05PM (#4599079)
Haha. I'll fix that when I get a chance; pull requests are encouraged :D