This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
bootcmd: | |
- echo this is very unsafe >> /root/helloworld | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/^ -/ -/' \ |
OlderNewer