This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/services/web/src/website/settings/base.py b/services/web/src/website/settings/base.py | |
index 25bb9c96..47edb55b 100644 | |
--- a/services/web/src/website/settings/base.py | |
+++ b/services/web/src/website/settings/base.py | |
@@ -569,9 +569,21 @@ if os.getenv("SENTRY_DSN"): | |
return None | |
return event | |
+ # Set up Sentry distributed tracing | |
+ # see https://docs.sentry.io/platforms/python/performance/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Sample Python code for making requests to the eTRM API | |
""" | |
import http.client | |
import json | |
TOKEN = "SETME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sts_assume_role () { | |
read -p "Enter a current MFA token code: " token_code | |
role_credentials=`aws sts assume-role \ | |
--role-arn <role-arn> \ | |
--role-session-name <session-name> \ | |
--serial-number <mfa-arn> \ | |
--token-code ${token_code}` | |
export AWS_ACCESS_KEY_ID=$(echo $role_credentials | jq -r .Credentials.AccessKeyId) | |
export AWS_SECRET_ACCESS_KEY=$(echo $role_credentials | jq -r .Credentials.SecretAccessKey) | |
export AWS_SESSION_TOKEN=$(echo $role_credentials | jq -r .Credentials.SessionToken) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample CloudFormation stack to create a bucket for AJAX uploads to S3 | |
# Includes a lifecycle policy, CORS settings, and a IAM policy | |
# aws cloudformation create-stack --capabilities CAPABILITY_IAM --stack-name my-bucket --template-body file://s3-bucket.yaml --parameters ParameterKey=BucketName,ParameterValue=my-bucket ParameterKey=ExpirationDays,ParameterValue=2 ParameterKey=Role,ParameterValue=my-role | |
AWSTemplateFormatVersion: '2010-09-09' | |
Parameters: | |
BucketName: | |
Type: String | |
Description: The name for the bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python | |
import os | |
import argparse | |
import requests | |
import json | |
from pprint import pprint | |
# Requires evironment variable UPTIMEROBOT_API_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (class_exists('Memcache')) { | |
$server = 'SETME'; # Memcached server hostname | |
$memcache = new Memcache; | |
$isMemcacheAvailable = @$memcache->connect($server); | |
if ($isMemcacheAvailable) { | |
$aData = $memcache->get('data'); | |
echo '<pre>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
A very basic script that emulates Sendmail's `mail` command, sending emails | |
with [aws-cli](https://github.com/aws/aws-cli). It replicates the minimum | |
amount of functionality for delivery [Munin notifications]( | |
http://munin-monitoring.org/wiki/HowToContact) (e.g. `contact.email.command | |
ses_mail -s "Munin-notification for ${var:group} :: ${var:host}" your@email | |
.address.here` | |
). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""memorised module - container for the memorise python-memcache decorator""" | |
__author__ = 'Wes Mason <wes [at] 1stvamp [dot] org>' | |
__docformat__ = 'restructuredtext en' | |
__version__ = '1.0.1' | |
import memcache | |
import itertools | |
from hashlib import md5 | |
from functools import wraps | |
import inspect |
NewerOlder