Archive for April, 2017

Listing AWS IAM Permission Names by System

Tuesday, April 18th, 2017

A tiny shell script for listing the AWS IAM permission for a particular system, like “ec2” or “s3”.

Does not handle every possible case, as some URL paths are inconsistent. YMMV.

Example:


lap ~> iam-permissions ec2 | head -5
ec2:AcceptReservedInstancesExchangeQuote
ec2:AcceptVpcPeeringConnection
ec2:AllocateAddress
ec2:AllocateHosts
ec2:AssignPrivateIpAddresses

Script below…

(more…)

Datomic: Relationships and refs within a transaction

Wednesday, April 12th, 2017

Not being able to figure this out is what killed all my previous attempts to use Datomic.

You want to transact two Entities that have a relationship between them. You’ve tried all the different variations that Google shows you, but they all give you :db.error/not-an-entity

What you want is the TWO ARGUMENT version of #db/id

Here, Verna gets a Temporary ID of -1 in this transaction. We can then reference that same Temporary ID later under :mother

This of course assumes that you have a Schema that defines :mother as a Datomic Reference, such as:

Also note that #db/id is simply a Tagged Element (similar to a reader macro), not an inline function or symbol reference or anything else.

Notes on Component (Part 1)

Tuesday, April 11th, 2017

Stuart Sierra’s Component library for Clojure took awhile for me to really understand. Hence these notes.

(more…)