This is an adjusted version of EC2 CloudWatch stats for Dashing which is not bound to EC2 metrics but a generic widget for cloudwatch graphs. Visualization is done by Rickshawgraph as in the original example.
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
Greg's Stop Loss Kata | |
Testing is very hard when time is involved ... | |
A trailing stop loss is a term used in financial trading. For a very in depth explanation you can read here http://www.investopedia.com/articles/trading/03/080603.asp and http://en.wikipedia.org/wiki/Order_(exchange)#Stop_orders | |
However we do not need a huge amount of background in order to do the kata as we are going to limit the problem a bit. | |
The general idea is that when you buy into a stock at a price say $10. You want it to automatically get sold if the stock goes below $9 (-$1). If we use the term "trailing" that means that id the price goes up to $11 then the sell point becomes $10. |
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
description "Fluentd" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
respawn | |
respawn limit 5 60 | |
exec sudo -u fluentd /opt/fluentd/usr/bin/fluentd -c /opt/fluentd/etc/fluent.conf --log /opt/fluentd/var/log/fluentd.log |
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
//header | |
<script> | |
var NREUMQ=[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]); | |
(function(){var d=document;var e=d.createElement("script"); e.type="text/javascript"; e.async=true;e.src="https://d7p9czrvs14ne.cloudfront.net/10/eum/rum.js"; | |
var s=d.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s);})() | |
</script> | |
// footer | |
<script type="text/javascript" charset="utf-8"> | |
NREUMQ.push(["nrf2","beacon-1.newrelic.com","api-key",appID,"cV5eEkBfCF1WRBgECFZEQwNAbwVBQ1peAgdGWF8IQR8LR1ZEQQgDRQ==",6,707]) |
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
#!/bin/bash | |
# generate new personal ed25519 ssh keys | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>" | |
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>" | |
# generate new host cert authority (host_ca) ed25519 ssh key | |
# used for signing host keys and creating host certs | |
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Create a Route53 Fail Whale failover setup from ELB to S3. You need a preexisting ELB, S3 bucket configured as a Website endpoint, and Hosted Zone.", | |
"Parameters" : { | |
"ELBDnsName" : { | |
"Type" : "String", | |
"Description" : "Your ELB's DNS Name" | |
}, |
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 | |
import boto3 | |
import datetime | |
import time | |
ENABLED_REGIONS = [ | |
"us-east-1", | |
"us-west-2", | |
"eu-west-1", | |
"eu-central-1", |
- AWS Account
- AWS API User API Key/Secret
- Bitbucket Account
- Create or update an existing Bitbucket repo
- Open https://bitbucket.org/USERNAME/REPO/addon/pipelines/deployments
Add this to your .profile, .bashrc, .zshrc...
BASE64_DECODER_PARAM="-d" # option -d for Linux base64 tool
echo AAAA | base64 -d > /dev/null 2>&1 || BASE64_DECODER_PARAM="-D" # option -D on MacOS
decode_base64_url() {
local len=$((${#1} % 4))
local result="$1"
if [ $len -eq 2 ]; then result="$1"'=='
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
# AWS SSM Agent RPi Installation | |
# First get an SSM agent activate code | |
# - Login to the AWS web console and browse to the AWS Systems Manager service (SSM). | |
# - Under Instances & Nodes, select Hybrid Activations | |
# - Select 'Create activation', fill-out the form and get an activation code | |
# Login to your server via SSH and run the following commans, entering the code, id and region values | |
mkdir /tmp/ssm | |
sudo curl https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_arm/amazon-ssm-agent.deb -o /tmp/ssm/amazon-ssm-agent.deb |
OlderNewer