Code snippets

AWS Code Snippets

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[].id" --output text); do aws apigateway delete-api-key --api-key $id done

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 |