Posts

Showing posts from March, 2015

DIY screenshot sharing service

I often find it useful to send someone a screenshot - to facilitate some explanation, to point out a bug in some app, or maybe even just brag about my awesome desktop. Obviously, I can open a terminal, start some screenshot app, save screenshot to file, upload a file somewhere, then figure out the link, etc - quite repetitive, I think. Or I could use some of the new-and-popular screenshot uploading services - like  Gyazo  for example. But all those services require you to install some package or application, which looks ridiculous for such a simple task. But we are Linux users, aren't we? We can always do better! Especially when we have some rusty bash skills, barely alive web-facing server somewhere in our closet, and half an hour of free time on our hands. #!/bin/bash f=$(mktemp -u screenshot_XXXXXX.png) import /tmp/$f scp /tmp/$f server:/some/webroot/ rm /tmp/$f url="http://your.server.hostname/$f" echo $url | xclip echo $url | xclip -sel c echo $url The abov...