Get a random file using AWS services

Posted
This post is about or contains
AWS Programming Step-By-Step Tutorial

I have lately, in my projects, used random images. That will say that I am using an address to a source that redirects to a random address from an image pool. And I will, in this post, document the steps. Maybe, somebody else will find it interesting.

I will first set up a general website with a web domain. Ther is where I will store all the files. Most likely will be interesting for more of you, for this can, of course, be used for more than image files. I have used this procedure for this website combined with Publii and nothing more. 

Then I will set up a table in a database for storing the file addresses. And then connect it to a function that is internet accessible, api.images.t79.it/get-random. It will randomly choose an address from the table and send it in return. Technically it will be a 301 redirect. A web browser will then show the user the content of the redirected address. Like in the animation you see at the top of this post.

AWS is my cloud provider. So if not all, then almost everything I will do is specific to them. I will go through it step by step, except setting up the DNS for a possible domain. It will look nicer with that. And if you buy one at them, they will set up the DNS.

Do you need a website? I will now show you how to set that up.

Setting up a website for hosting the files, part 1

The first step is to go into the S3 service. It is a file storage service only, so it does not process the files. I maybe forgot to mention that. So no WordPress, but perfect for other website builders. I will now start by setting up what they are calling a bucket. That is the folder that will contain the website.

Figure 1
Figure 1

Fig 1 Select Create bucket. Fig 2 Then give it a Bucket name. And check then the AWS Region. The physical location of where the files are stored. And should be closest to your audience. For me, that will be Stockholm. Select Create bucket. And then, the bucket is ready. Only have to change a setting and some permissions, and it has transformed into a website host.

... continue to see the full post.

Trying out Bandcamp

Posted
This post is about or contains
Bandcamp

I like to have everything in one place. But not all music is on the service I am using. More and more of what I want to listen to are on Bandcamp. So today, I bought a record for the first time in years. 

I could use as much as 1600NOK a month on records when I was young. Nowadays, I am only using a streaming service to 99NOK a month. I do not think it is strange that artists earnings are less on records today than some years ago. So hopefully, the artist gets better paid when I now am starting to baying again. It's more cumbersome compared with streaming services, but luckily my service has the feature "access your entire library from anywhere", so I don't need one more app and only need to download it in one place.

So today, I bought a record with John Cage's "Number Pieces" performed by Apartment House. I like John Cage, Apartment House are excellent performers, and I found it in sixth place on a list of the 50 best releases this year. So I am looking forward to using some time with this record.