Skip to content

Instantly share code, notes, and snippets.

View rhowe's full-sized avatar
💭
Just being

Russell Howe rhowe

💭
Just being
View GitHub Profile
@rhowe
rhowe / user-data
Created February 29, 2020 20:39
Cloudinit nocloud userdata
#cloud-config
bootcmd:
- echo this is very unsafe >> /root/helloworld
@rhowe
rhowe / aoc2019day1part1-ansible
Created November 29, 2020 20:07
Advent of Code 2019 (ansible)
- hosts: localhost
tasks:
- name: Calculate fuel per item
debug: msg="{{ ((item | int) / 3) | int - 2 }}"
loop: "{{ lookup('file', 'input').splitlines() }}"
register: output_things
- name: Calculate total fuel
debug: msg="{{ output_things.results | map(attribute='msg') | map('int') | sum }}"
@rhowe
rhowe / aoc2020day01part1
Last active December 12, 2020 10:39
Advent of Code 2020
- hosts: localhost
tasks:
- name: Read input
set_fact:
input: "{{ lookup('file', 'input').splitlines() | map('int') | list }}"
- name: Prune impossible values from input
set_fact:
pruned_input: "{{ input | map('int') | reject('gt', 2020 - input | min | int) | reject('lt', 2020 - input | max | int) | list }}"
- name: Find items which sum to 2020
set_fact:
@rhowe
rhowe / summarise-aws-sdk-changelog
Last active July 21, 2023 14:44
Generate a digest of the AWS Java SDK changelog
curl -sf https://raw.githubusercontent.com/aws/aws-sdk-java/master/CHANGELOG.md |\
sed \
-e 's/Amazon Simple Storage Service/Amazon S3/' \
-e 's/^# /- /' \
-e 's/^## / - ## /' \
-e "s/#.*/'&'/" \
-e 's/: / - /g' \
-e 's/^ \(.*\)/ \1/' \
-e 's/^ -/ -/' \
-e 's/^ -/ -/' \