AWS Snippets

AWS Command Line Interface Installation $ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install AWS Documentation RDS Export Database Configuration Export instance configuration aws rds describe-db-instances --db-instance-identifier arn:aws:rds:eu-central-1:123456789:db:hascode-prd-db --no-paginate Export parameter group configuration aws rds describe-db-parameters --db-parameter-group-name PARAM_GROUP_NAME >> param_group_conf.json Export option group configuration aws rds describe-option-groups --option-group-name OPT_GROUP_NAME >> option_group_conf.json Generate Signed URLs with Linux Tools e.g. for accessing a website behind a CloudFront distribution using a canned policy. Write the policy file ...

March 1, 2018 · 2 min · 407 words · Micha Kops

Python Snippets

Virtual Environments Create and activate a venv python -m venv /path/to/new-env (1) source /path/to/new-env/bin/activate (2) 1 Creates a new virtual environment 2 Activate the new virtual environment Deactivate venv deactivate Save used dependencies to a file pip freeze > dependencies.txt Install dependencies from file pip install -r dependencies.txt Storing and fetching Credentials from the System Keyring I am using jaraco/keyring here: pip install keyring import keyring keyring.set_password("system", "db.sample.password", "xoxo") print(keyring.get_password("system", "db.sample.password")) ...

March 1, 2010 · 2 min · 274 words · Micha Kops