Scratching an itch: Cocaine

Cocaine Context Menu

Ever have a file you need to quickly upload to a remote location so that you can share it with others? I have. For example, some photo I want to show someone, real quick.

So I wrote a script to do just that. It uploads a file to a previously specified location, and then puts the URL to that file in the clipboard, for easy pasting in whatever esoteric communication device you’re using, like IRC, IM, or E-mail. In fact, it copies the URL first, and then uploads the file, so you can paste the URL even before the file has uploaded.

Get it here: Cocaine v1.0

It’s a python script with about 30 functional lines. It requires pyGTK to interact with the clipboard. Edit the file and insert your ftp-server, username, password, and HTTP-subpath. I recommend using Nautilus-actions for Gnome users to add Cocaine to your context-menu, so you can easily right-click->upload any file straight out of nautilus.

(Both pygtk and nautilus-actions are in Ubuntu repositories)

This entry was posted in Cocaine, Code Poetry. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">