Terraform plan
Terraform will perform the following actions:
# module.ghe-engroot["3.11.2"].aws_ebs_volume.ghe[0] will be destroyed
# (because module.ghe-engroot["3.11.2"] is not in configuration)
- resource "aws_ebs_volume" "ghe" {
Terraform will perform the following actions:
# module.ghe-engroot["3.11.2"].aws_ebs_volume.ghe[0] will be destroyed
# (because module.ghe-engroot["3.11.2"] is not in configuration)
- resource "aws_ebs_volume" "ghe" {
aws sagemaker list-apps --query "Apps[?Status=='InService']" | jq -r '.[] | "\(.AppName) \(.DomainId) \(.UserProfileName) \(.AppType)"' | \ | |
while read AppName DomainId UserProfileName AppType; do \ | |
echo Deleting $AppName for user $UserProfileName ... && \ | |
aws sagemaker delete-app --domain-id $DomainId --app-type $AppType --app-name $AppName --user-profile $UserProfileName; done |
This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.
Then, you can use Structlog loggers or standard logging
loggers, and they both will be processed by the Structlog pipeline (see the hello()
endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!
Requests are assigned a correlation ID with the asgi-correlation-id
middleware (either captured from incoming request or generated on the fly).
All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented.
This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog.
You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom
# Example: | |
# $ python argparse_dict_argument.py --env a=b --env aa=bb | |
# Namespace(env={'a': 'b', 'aa': 'bb'}) | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--env', action = type('', (argparse.Action, ), dict(__call__ = lambda a, p, n, v, o: getattr(n, a.dest).update(dict([v.split('=')])))), default = {}) # anonymously subclassing argparse.Action | |
print(parser.parse_args()) |
#!/bin/bash | |
ME=$(basename $0) | |
function showHelp { | |
cat << EOF | |
Clean-up old git branches | |
Usage: $ME local show-last [AGE_IN_WEEKS] | |
$ME remote show-last REMOTE [AGE_IN_WEEKS] |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Upload your files</title> | |
</head> | |
<body> | |
<form enctype="multipart/form-data" action="upload.php" method="POST"> | |
<p>Upload your file</p> | |
<input type="file" name="uploaded_file"></input><br /> | |
<input type="submit" value="Upload"></input> |
@echo off | |
echo Uninstalling KB3075249 (telemetry for Win7/8.1) | |
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart | |
echo Uninstalling KB3080149 (telemetry for Win7/8.1) | |
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart | |
echo Uninstalling KB3021917 (telemetry for Win7) | |
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart | |
echo Uninstalling KB3022345 (telemetry) | |
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart | |
echo Uninstalling KB3068708 (telemetry) |
@echo off | |
AT > NUL | |
if %ERRORLEVEL% EQU 1 ( | |
echo Error: Not running as administrator. | |
echo Please right click the batch file and select 'Run as Administrator' | |
exit /b 1 | |
) | |
echo Uninstalling bad updates... |
sub print_to_pdf2 | |
if len(ThisComponent.getURL())=0 then | |
msgbox "Save document first!" | |
exit sub | |
end if | |
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then | |
GlobalScope.BasicLibraries.LoadLibrary("Tools") | |
End If |
# https://serverfault.com/a/633452 | |
stdbuf -oL -eL /usr/sbin/tcpdump -A -s 10240 -i lo "tcp port 82 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | egrep -a --line-buffered ".+(GET |HTTP\/|POST )|^[A-Za-z0-9-]+: " | perl -nle 'BEGIN{$|=1} { s/.*?(GET |HTTP\/[0-9.]* |POST )/\n$1/g; print }' |