Code snippets

AWS Code Snippets

Cloudformation Create cloudformation stack with parameter file (note, parameter file has to be json) aws cloudformation create-stack --stack-name dirks-sample-stack --template-body file://dirks-sample-stack.json --parameters file://dirks-sample-stack-dev.json # or aws cloudformation create-stack --stack-name dirks-sample-stack --template-body file://dirks-sample-stack.yaml --parameters file://dirks-sample-stack-dev.json Misc List all records of a zone and export them to CSV aws route53 list-resource-record-sets --hosted-zone-id <zone-id> | jq '.ResourceRecordSets[] | [.Name, .Type, .ResourceRecords[0].Value] | @csv' API gateway: delete all API keys for id in $(aws apigateway get-api-keys --name-query $1 --query "items[].

Python Code Snippets

Run benchmarks with timeit https://docs.python.org/3/library/timeit.html $ python3 -m timeit '"-".join(str(n) for n in range(100))' >>> timeit.timeit('"-".join(str(n) for n in range(100))', number=10000) Ruby’s binding.pry in Python import code; code.interact(local=dict(globals(), **locals()))

tmux snippets

Windows | | | |-|-| | c | create window | | & | kill window | | , | name window | | w | list windows | | f | find window | | n | next window | | p | previous window | Panes | | | |-|-| | % | vertical split | | “ | horizontal split | | cursor keys | switch between panes | | { | move current pane to previous position | | } | move current pane to next position |