![]() If there is a collision, it tries again.īecause Automator requires it. Second, it checks whether an image already exists in the bucket with that filename by checking the exit code of s3cmd info. First, it combines a number of Unix commands to generate a random 6-digit alphanumeric filename. This script by Ben Alman fixes the resolution of screenshots taken on Retina displays. Retina MacBook Pros take high-res screenshots by virtue of their kickass pixel density, but the resulting images appear scaled up as a result. # -devel because `s3cmd info` breaks on subdirectories in 1.0.1. First, you will need to install and set up S3cmd, a command line client for S3. Our screenshot tool will be a simple bash script. Note: My script is specific to OS X, but you can easily adapt it for Linux by substituting scrot for screencapture and xclip for pbcopy, among other things. If you choose to use a custom domain name, you’ll also need to add a CNAME record from your custom domain name to your unsexy CloudFront domain. If you have a custom domain name you want to use for your image host, add it to “Alternative Domain Names (CNAMES).” Otherwise, you’ll have to use an unsexy domain name like. For Origin Access Identity, select “Create a New Identity,” and for Grant Read Permissions on Bucket, select “Yes, Update Bucket Policy.” Since we only want to serve images through CloudFront, select Yes for Restrict Bucket Access. Click into the Origin Domain Name field and select the S3 bucket you just created ( bucket-name.s3.). ![]() In the AWS console, go to the CloudFront console and click Create Distribution. Now we’ll need to connect our new S3 bucket to Amazon’s CDN, CloudFront. Here, I’ve named my bucket kevinwang-screenshots. Follow the instructions here to create a bucket. Buckets are where all objects in S3 are stored. To begin, we’ll need to create an S3 bucket for our screenshots. For comparison, Gyazo charges $2.99 a month for premium. The total cost of using these two hardcore, enterprise-class services for screenshot hosting is about ten cents a month. With AWS, you pay only for what you use, and when it comes to hosting images, that’s not much. Specifically, I use two AWS services: S3 for storage, and CloudFront for content delivery. I decided to host my screenshots using Amazon Web Services. I used SpeedCap for a while, but it frequently went down for maintenance and failed on large screenshots. So I googled “Gyazo alternatives” and found SpeedCap. I didn’t mind at first, but then they had the gall to add pop-ups and interstitial ads. A minute-long operation now took about a second. This was a huge improvement over my previous workflow which involved hitting Print Screen, pasting the image into an image editor, cropping, saving, going to (how nostalgic), and uploading. The screenshot then magically opens in your browser, and its URL has already been copied to your clipboard. Release the mouse button and Gyazo uploads the screenshot its servers. Its usage instructions are dead simple: Click and drag to select a region of your screen you want to capture. How to build your own Gyazo using Amazon S3 and CloudFront Ī few years back, I discovered Gyazo, a lightweight tool that allows you to effortlessly share screenshots.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |