My usual caveat here; many of you out there will probably look at my scripting and think, "I could do better than that". Well, there you go. I'm not claiming any great revelations or "leet skillz". This is just a little script that is working for me.
OK, so that's out of the way ... what does this little script do?
Well, I often use Pastebin services and Omploader for sharing code snippets and the temporary sharing of files. Temporary in the sense that I don't want to put them onto a website and they only need to be seen by a few people in a discussion.
This script will upload a file to my server, changing its name to a random string whilst keeping its file extension and echoing the URL to the CLI. There are also some bits in there to make sure that the script doesn't start overwriting or deleting files already on my desktop and to report failures.
I've also put a little bit of Emacs Lisp into my .emacs file so that I can upload a region from an Emacs buffer; in this case the file ends up as an html file with syntax highlighting done by code2html. The file's URL on the server is then returned to the kill ring for yanking (pasting) into a discussion on IRC or IM.
Unfortunately code2html doesn't support many syntaxes for highlighting so when I have time I may look at another way of doing that.
Where is all this?
I'm just starting to use one of my domains as a place for my bits of script and "anti-cloud" stuff.