Saturday, 14 December 2019

Running a Linux shell on AWS... and more

Yes, another tedious noob post about exciting adventures in AWS. My desire was simple, I wanted a Linux console to run Python so I could play adventofcode. I can run Python on my Windoze box but any number of deeply irritating things then occur, so I abandoned that. I them played with Virtualbox which is nice enough but I had trouble choosing a distro, and then was faced with downloading too much and waiting forever or too little and not having what I wanted. And then I found that setting up "shared folders" was Really Painful and gave up, thinking that it was about time I learn something of AWS anyway.

So I created a (free) account wmconnolley, and there's also a bucket by the same name which you probably can't see, and some credentials, and then "spun up" (as the Kool Kidz say) an instance, and uploaded stuff into the bucket, and worked out that "aws s3 cp s3://wmconnolley/day1-input.txt day1.txt" works, once the credentials are installed, and I'm away. Woot.

My dashboard is here (but I'm pretty sure that if you follow that you'll get to your dashboard).

Just as a check I stopped the thing and restarted it, and my files were still there. But my IP address had changed.

Connect to it with something like ssh -i c:\users\william\.ssh\MyKeyPair.pem ec2-user@18.222.108.197. I think the tutorial I followed was this one.

All this is free. I guess I'm getting an el cheapo machine but I really can't say I've noticed. It tells me it is good practice to shut down the server to save money when I'm not using it, I wonder if I'll remember to, and anyway how much would it cost just to leave it running?

numpy isn't installed by default. pip install numpy works, if you have privilege, so it needs to be sudo pip install numpy.

A website


There's a tutorial on building a website. So I thought I'd try following it. I get http://wmconnolley-mm-bucket.s3-website-eu-west-1.amazonaws.com/. The steps are given there; they're fairly simple. The IDE allows you to use vi.