Showing posts with label star trek. Show all posts
Showing posts with label star trek. Show all posts

Wednesday, September 2, 2020

genesis device

GenesisDevice

A tiny Javascript library to kickstart Terraform projects.
GenesisDevice lets you generate Terraform configurations from Javascript data structures. This has the following benefits:
  • no need to memorize Terraform's DSL;
  • programatically generate multiple Terraform configurations;
  • write sanity-checking tests for Terraform files in Javascript.
The configurations generated by GenesisDevice are human-readable with optional comments.

Install

npm install genesis-device

Usage

The Javascript code below:
const GenesisDevice = require('genesis-device');
const genesis = new GenesisDevice();

genesis.addResource('aws_vpc', 'regional_vpc', {
  cidr_block: '10.0.0.0/16',
  instance_tenancy: 'default',
  enable_dns_hostnames: true,
  enable_dns_support: true,
}, [
  'AWS VPC',
  'Create a master VPC for all AZs in the region.',
]);

console.log(genesis.toString());
when run using node will write the following Terraform-syntax configuration to the console:
#
# AWS VPC
# Create a master VPC for all AZs in the region.
#
resource "aws_vpc" "regional_vpc" {
  cidr_block           = "10.0.0.0/16"
  enable_dns_hostnames = true
  enable_dns_support   = true
  instance_tenancy     = "default"
}
More complicated, nested Terraform constructions are also supported. For example, the code below (using the special $inlines key):
genesis.addResource('aws_security_group', 'db_security_group', {
  description: 'Only allow private IP traffic.',
  name: 'db_security_group',
  vpc_id: '${aws_vpc.regional_vpc.id}',
  $inlines: [
    ['ingress', {
      from_port: 0,
      to_port: 0,
      protocol: '-1',
      cidr_blocks: ['10.0.0.0/8'],
    }],
    ['egress', {
      from_port: 0,
      to_port: 0,
      protocol: '-1',
      cidr_blocks: ['10.0.0.0/8'],
    }],
  ],
}, [
  'AWS Security Group for RDS instances.',
]);
will generate the Terraform fragment below:
#
# AWS Security Group for RDS instances.
#
resource "aws_security_group" "db_security_group" {
  description = "Only allow private IP traffic."
  name        = "db_security_group"
  vpc_id      = "\${aws_vpc.regional_vpc.id}"

  egress {
    cidr_blocks = [
      "10.0.0.0/8"
    ]
    from_port   = 0
    protocol    = "-1"
    to_port     = 0
  }

  ingress {
    cidr_blocks = [
      "10.0.0.0/8"
    ]
    from_port   = 0
    protocol    = "-1"
    to_port     = 0
  }
}

Wednesday, July 1, 2020

prime directive


a redshirt's perspective on the prime directive surrounding us: a billion stars

Natasha Teller Dec 2013

a redshirt's perspective on the prime directive

surrounding us: a billion stars
in a time when a trip to mars is like walking around the block
and captain kirk and mister spock are arguing
about the prime directive.

we’re beaming to a planet’s surface. now listen:
i know about inverse tachyon beams
i know about coded klingon screams
i know about going to warp factor eight
i know about redshirts' survival rate.
(no. chance.)

i’m beaming down with the main crew
to the surface of minerva II
we've got a malfunctioning interstellar transceiver which is distressing-- dysgraphing? dismantling…
…i don't know.
scotty said it was defective.

so we’re on this planet,
standing on one side of a thick forest packed with monster janeks,
starfleet says we need to fix this thing yesterday, and we’re in a panic—
and **** it, mccoy is a doctor, not a lumberjack,
and kirk says we should just burn through the middle with phasers,
and spock says we must preserve respect for all life forms no matter the situation.

now please remember kirk’s the captain.
that means he runs this show
but kirk always listens to spock,
so
we spend two days walking through the forest.

surrounding us: a billion trees
in a place where a strange disease is rare as feathers in a flock
and captain kirk and mister spock are arguing
about the prime directive.

halfway through this dark-lit trip
things go wrong (obviously)
and an alien with shellac for skin captures the captain.
said alien grabs a vine, ascends into the canopy of the trees,
and for one glorious moment
i believe kirk’s the dead guy in this episode, not me!

but spock, in his calm and logical vulcan voice,
orders us to exercise any necessary force to recover the captain.
translation: **** EVERYTHING. JUST GET KIRK BACK.

we reach the janek village.
being a good redshirt, i rush in, phaser blasting, ready to complete the heroic rescue of our captain—
and get killed instantly.

as i was dying, i heard the sound of thousands of janeks dying beside me
saw spock help kirk off the ground
and the last words I heard were theirs:
“captain, are you in need of immediate medical attention?”
“nah, spock, i’m fine—”
“mr. scott. the captain is hurt. beam us aboard immediately.”
one’s arm over the other’s shoulders,
they vanished.

surrounding them: a billion stars
in a time when a trip to mars is like walking around the block
and captain kirk and mister spock are arguing
about the prime directive—

but the prime directive
was never the real objective.

My very first attempt at slam poetry, back in the day... this was written for a sci-fi slam. Live long & prosper.

 


God is dead