TIL June 11

Creating AWS S3 buckets from command line

If you have necessary AWS credentials

export AWS_ACCESS_KEY_ID="XXXX"
export AWS_SECRET_ACCESS_KEY="YYYY"

you can install aws cli with

pip3 install --user aws

and create an S3 bucket from command line without opening a web browser.

aws s3api create-bucket --acl public-read --bucket my-unique-bucket-name --region eu-central-1 --create-bucket-configuration LocationConstraint=eu-central-1

which will create a bucket readable by public in http://my-unique-bucket-name.s3.amazonaws.com.

Then you can copy your files with

aws s3 cp my-file.zip s3://my-unique-bucket-name/subdir/my-file.zip

and share the link, http://my-unique-bucket-name.s3.amazonaws.com/subdir/my-file.zip with anybody you want to share the file.

Literate Programming with markdown

I’m returning to my Ottoman language project time to time and most of the time I spend is actually trying to understand what I have done last time. I decided that the actual parsing and simple morphological analysis modules should use Literate Programming with markdown.

I’m currently using Dart to rewrite all the application and the application is fundamentally simple. It receives words in Turkish or Ottoman and translates these to Ottoman or Turkish. However the parsing module needs more rules to divide the words (and phrases) into roots and suffixes. There are hundreds of rules and using just code to describe the reasoning behind parsing seems the main culprit I spend my time to understand my work.

I decided that I can just use knot to write the rules in a document and generate the files by this. It will surely take more time than writing the code but at the end I will have a document describing the analysis and parsing rules that even I can understand.