In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):
- Add
ptvsd
to your requirements.txt file
ptvsd == 4.3.2
- To your
launch.json
, add this:
If your EC2 instances in AWS are managed through Auto Scaling Groups, it is easy to schedule startup and shutdown of those instances, e.g. to save money.
This tutorial walks you through setting up an AWS Lambda function that is triggered by CloudWatch Events and automatically changes the min, max and desired instances in your Auto Scaling Group(s).
The idea is to toggle between 0 (stop
) and a specifed min, max and desired amount of instances (start
), so you only need a single Lambda function. The premise is that you do not touch these Auto Scaling Group settings manually, or you might make your EC2 instances nocturnal.
Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.
This will create a job that collects required information about the vault.
$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
from wagtail.wagtailcore.models import Page, Site | |
def forwards_func(apps, schema_editor): | |
HomePage = apps.get_model('website', 'HomePage') |
- Create a CA, keys and certificates | |
- Source: https://docs.docker.com/engine/security/https/ | |
# Create certs dir | |
mkdir ~/certs | |
cd ~/certs | |
# Ca key | |
openssl genrsa -aes256 -out ca-key.pem 4096 |
ptvsd
using the same Python interpreter Qgis uses.
E.g. on Windows:C:\OSGeo4W64\apps\Python37\python.exe -m pip install ptvsd==4.3.2
launch.json
:{
"name": "Python: Remote Attach",
Below describes the only way I was able to get (programmatic) access to the YouTube Analytics API on behalf of our Brand Account. Google documentation is convoluted, to say the least, so if you know a more straightforward way, please do share.
Library
tab and enable desired APIs (e.g. YouTube Analytics)OAuth consent screen
and make project external
. Select Test mode