3 ms·
I use the following script (activated by a system-level shortcut key) to take a screenshot, upload to S3 bucket (using the minio client[0]) and place the URL in
by geoka9 2y ago
I use the following script (activated by a system-level shortcut key) to take a screenshot, upload to S3 bucket (using the minio client[0]) and place the URL in the X selection buffer, ready to be pasted:
#!/bin/bash
set -e
dbus-update-activation-environment DISPLAY XAUTHORITY
FNAME=`cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32`.png
flameshot gui --raw > /tmp/$FNAME
~/go/bin/mc -q cp --attr x-amz-acl=public-read /tmp/$FNAME s3/your.s3.bucket/dir/$FNAME
echo -n https://s3-us-west-2.amazonaws.com/your.s3.bucket/dir/$FNAME | xsel
[0] https://min.io/docs/minio/linux/reference/minio-mc.html https://min.io/docs/minio/linux/reference/minio-mc.html
- wzyboy 2y agoI have a similar setup but with SHA256 hash of the file as the object key.
- aendruk 2y agoIn mine the hash is encoded as z-base-32 and namespaced with an uncommon first character: $ publish example.png https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih And for when it matters, the filename can optionally be attached: $ publish --named example.png https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih $ http --headers 'https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih' | grep 'Content-Disposition' Content-Disposition: inline; filename="example.png"
- sandinmyjoints 2y agoI forget, do you pay for bandwidth serving from S3 in this case? I have been looking for a good screenshot hosting solution to replace Cloudup, which was perfect and still usually works but I figure it might stop any day now. My only worry would be the unlikely case of a surprise high bill from a screenshot gone viral or something along those lines.
- djbusby 2y agoDoesn't R2 have no egress fee?
- byteknight 2y agoImplement a cloudflare cache infront?
- mfkp 2y agoMy workflow uses SFTP to upload to a cheap webhost, with cloudflare in front acting as a cdn. Easy peasy
- AnthOlei 2y agoI wonder: if we set a TTL on the image, and also make it require a signed link that gets copied the same way, is it now a secure & ephemeral service?
- endgame 2y agoYou may want to modernise your script because Bucket ACLs are disabled by default these days: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-...