Skip to content

Instantly share code, notes, and snippets.

Create an AMI using Packer

What is Packer?

Packer is a tool from Hashicorp that allows you to create machine images in a variety of formats from a single spec file. This can be a very powerful thing when you want to automate the deployment of applications to a variety (or even just more than one, really) platforms.

In our case, we want to deploy an application to VMware and AWS, and soon to Docker. Doing that with a single spec file gives us

  • platforms that are consistent, even if they're different
@brasey
brasey / Generate a Linux password hash suitable for shadow file.md
Last active July 3, 2020 00:56
Generate a Linux password hash suitable for shadow file

Generate a Linux password hash suitable for shadow file

Need

Someone gives me a password to configure for a local Linux user account. We're managing local user accounts with Puppet, which needs a hash just like the one that's in /etc/shadow. Setting the password through manual means is not an option.

Solution

This Python foo:

@brasey
brasey / Configure systemd-resolved to use a specific DNS nameserver for a given domain.md
Created October 25, 2019 14:38
Configure systemd-resolved to use a specific DNS nameserver for a given domain

Configure systemd-resolved to use a specific DNS nameserver for a given domain

Use case

Given

  • I use a VPN to connect to my work network
  • I'm on a Linux computer that uses systemd-resolved
  • I have a work domain called example.com
  • example.com is hosted by both public and private DNS nameservers
@brasey
brasey / Create kickstart ISO image for RHEL.md
Created January 6, 2015 18:28
Create kickstart ISO image for RHEL

Create kickstart ISO image for RHEL

Notes

I'm mounting the downloaded disk image in a directory called 'cd'.

I'm creating the new disk image in a directory called 'cd.new'.

Steps