I hereby claim:
- I am palazzem on github.
- I am palazzem (https://keybase.io/palazzem) on keybase.
- I have a public key ASCRinl2svThLRKvJf0vYiwH9MD2-ReufZWfDBN5uVvMIwo
To claim this, I am signing this object:
{ | |
"window.titleBarStyle": "custom", | |
"workbench.colorTheme": "Night Owl", | |
"git.autofetch": true, | |
"terminal.integrated.fontFamily": "'Fira Code'", | |
"editor.minimap.enabled": false, | |
"docker.groupImagesBy": "None", | |
"editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'", | |
"editor.fontLigatures": true, | |
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}${separator}${appName}", |
version: "3.7" | |
services: | |
traefik: | |
image: "traefik:v2.2" | |
container_name: "traefik" | |
command: | |
- "--accesslog=true" | |
- "--api.insecure=true" | |
- "--entrypoints.web.address=:80" |
# Install the Datadog Agent | |
mkdir -p /opt/datadog-agent/ | |
mkdir -p /var/log/datadog/ | |
mv ~/agent-armv7-package/agent /opt/datadog-agent/ | |
mv ~/agent-armv7-package/dist /opt/datadog-agent/ | |
mv ~/agent-armv7-package/datadog-agent /etc/ | |
# Create dd-agent user and set permissions | |
addgroup dd-agent | |
adduser --system --no-create-home --disabled-password --ingroup dd-agent dd-agent |
class Handler(object): | |
async def handle_request(self, request): | |
# set the current context | |
ctx = {} | |
set_current_context(ctx) | |
ctx['username'] = request.get('username', 'Anonymous') | |
result = await retrieve_user_data() | |
return result |
import asyncio | |
def set_current_context(ctx, loop=None): | |
# retrieves the current Task | |
loop = loop or asyncio.get_event_loop() | |
task = asyncio.Task.current_task(loop=loop) | |
# attach the Context to the task! | |
setattr(task, '__current_ctx', ctx) |
import requests | |
from datetime import datetime, timedelta | |
from datadog import initialize, statsd | |
options = { | |
'api_key':'your_datadog_key_here', | |
} | |
# don't use a trailing slash |
I hereby claim:
To claim this, I am signing this object:
import asyncio | |
def set_current_context(ctx, loop=None): | |
# retrieves the current Task | |
loop = loop or asyncio.get_event_loop() | |
task = asyncio.Task.current_task(loop=loop) | |
# attach the Context to the task! | |
setattr(task, '__current_ctx', ctx) | |
def get_current_context(loop=None): |
#!/usr/bin/env python | |
from __future__ import absolute_import, division, print_function, \ | |
unicode_literals | |
from concurrent.futures import ThreadPoolExecutor | |
from ddtrace import tracer | |
from ddtrace.contrib.tornado import trace_app | |
from random import uniform | |
from time import sleep |
#!/bin/bash | |
VENV=$1 | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
if [ -f ${VENV}/bin/postactivate ]; then | |
. ${VENV}/bin/postactivate |