Get shell access to ECS tasks using execute-command.
aws
CLIuv
- Install the Session Manager Plugin
- AWS Credentials
Get shell access to ECS tasks using execute-command.
aws
CLIuv
A generic configuration loader for Django. Configuration is the term I’m using for environment-specific settings values. Most settings are static and don’t change from environment-to-environment, but some like DATABASES
or SECRET_KEY
should.
Inspired by dataclasses and Pydantic.
Users should define a class which inherits from a Configuration class:
class Config(Configuration):
DEBUG: bool = False # value with default
SECRET_KEY: str # value with no default (raises an error if not provided)
--- | |
name: Update Python dependencies | |
on: | |
workflow_dispatch: {} | |
schedule: | |
# Run every Wednesday 6AM | |
- cron: "0 6 * * 3" | |
jobs: |
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <log_group_prefix> <log_stream_name>" | |
exit 1 | |
fi | |
LOG_GROUP_PREFIX=$1 | |
LOG_STREAM_NAME=$2 |
import json | |
import random | |
import http.client | |
# make call to cat facts API | |
# https://cat-fact.herokuapp.com/facts | |
conn = http.client.HTTPSConnection("cat-fact.herokuapp.com") | |
conn.request("GET", "/facts") | |
response = conn.getresponse() |
twitter.com##[aria-label$="Trending now" i] | |
twitter.com##article [aria-label^="Recommended Topic" i]:upward(article) |
(version 1) | |
(allow default) | |
(debug deny) | |
(define (home-subpath home-relative-subpath) | |
;; should be able to use something like (param "HOME_DIR") here, but it's not working for me | |
(subpath (string-append "/Users/pete" home-relative-subpath))) | |
;; can't write anywhere or read /Users by default | |
(deny file-write*) |
import psycopg2 | |
NEW_USER = "fred" | |
types = {"c": "TABLE", "t": "TABLE", "r": "TABLE", "S": "SEQUENCE", "i": "INDEX", "v": "VIEW"} | |
with psycopg2.connect(**kwargs) as conn: | |
conn.autocommit = True | |
with conn.cursor() as curs: | |
for kind, name in types.items(): | |
curs.execute( |
pip install awscli # if you don't have it installed already | |
export AWS_ACCESS_KEY_ID=your-access-key # starts with AK | |
export AWS_SECRET_ACCESS_KEY=your-secret-key | |
echo "hello world" | aws s3 cp - s3://your-bucket-name/test.txt | |
aws s3 cp s3://your-bucket-name/test.txt - # this should output "hello world" |
{ | |
"Mappings": { | |
"LBAccountId": { | |
"af-south-1": { | |
"AccountId": "098369216593" | |
}, | |
"ap-east-1": { | |
"AccountId": "754344448648" | |
}, | |
"ap-northeast-1": { |