Rapid fire: one-liners useful during an incident.
IntermediateConceptBest practices & rapid-fire commands
Answer
python3 -m http.server 8000 --bind 127.0.0.1 # serve a directory
python3 -m json.tool response.json # pretty-print JSON
python3 -c 'import yaml,sys,json; print(json.dumps(yaml.safe_load(sys.stdin)))' < values.yaml
python3 -c 'import secrets; print(secrets.token_urlsafe(32))'
python3 -c 'import socket; print(socket.gethostbyname("db.internal"))'
python3 -m timeit '"-".join(map(str, range(100)))'
More on Best practices & rapid-fire commands
What does a production-quality automation script always include?IntermediateHow do you handle configuration in a Python tool?IntermediateWhat are the most common security mistakes in Python ops code?AdvancedBash or Python for this task: how do you decide?BeginnerRapid fire: set up a project environment from scratch.BeginnerRapid fire: pytest commands.Beginner