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
Using the saml2aws utility, you can get a set of temporary AWS credentials that you can export to your docker container. | |
Use this command to put those credentials into a local environment file for docker: | |
$ saml2aws exec env | egrep 'AWS_(ACC|SECR|SES)' > env.file | |
Running command as: arn:aws:sts::123456789012:assumed-role/AWS-MyRole/username@globeandmail.com | |
You should now see AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN inside of env.file | |
Now start your container with the --env-file option, using the env.file you just created. |
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/config example | |
[profile org-master] | |
aws_access_key_id=AK... | |
aws_secret_access_key=AY... | |
region=us-east-1 | |
[profile org-acctfoo] | |
role_arn = arn:aws:iam::111111111111:role/OrganizationAccountAccessRole | |
source_profile = org-master |
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
suggest_recycled_tweet_inline | |
suggest_activity_tweet | |
suggest_recycled_tweet | |
suggest_recap | |
suggest_who_to_follow | |
suggest_activity | |
suggest_pyle_tweet | |
suggest_ranked_timeline_tweet |
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
import boto3 | |
acct1_arn = 'arn:aws:iam::111111111111:role/S3-Write-Role' | |
acct2_arn = 'arn:aws:iam::222222222222:role/S3-Read-Role' | |
def switch_role(role_arn): | |
sts_client = boto3.client('sts') | |
response = sts_client.assume_role( | |
RoleArn=role_arn, | |
RoleSessionName="AssumeRoleSession" |
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 | |
BASEURL="https://bitcoin.org/bin" | |
ARCH="arm-linux-gnueabihf" | |
VER=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/releases | grep -m 1 tag_name | awk -F\" '{print $4}' | cut -c 2-) | |
DIR="bitcoin-core-$VER" | |
FILE="bitcoin-$VER-$ARCH.tar.gz" | |
FILEURL="$BASEURL/$DIR/$FILE" | |
SHA256HASH=$(curl -s $BASEURL/$DIR/SHA256SUMS.asc | grep $FILE | awk '{print $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
#!/bin/bash | |
# | |
# Issue request to Akamai tool verifyAkamaiIpInternal to check if | |
# the given IP address belongs to Akamai | |
# | |
## defining helper functions first | |
# show usage |
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
#include "FastLED.h" | |
#define LED_PIN 3 | |
#define LED_TYPE WS2811 | |
#define COLOR_ORDER RGB | |
#define NUM_LEDS 50 | |
CRGB leds[NUM_LEDS]; | |
// Twinkling 'holiday' lights that fade up and down in brightness. | |
// Colors are chosen from a palette; a few palettes are provided. |
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
void stripedTwinkle(){ | |
int twinkle = 0; | |
int flash = 15; // twinkle flash time | |
int lag = 50; // time between twinkles | |
for (i = 0; i <LED_NUM i++) | |
{ | |
if (i % 2 == 0) | |
{ | |
leds[twinkle] = CRGB::Red; |
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
/* Title: inoise8_pal_demo.ino | |
* | |
* By: Andrew Tuline | |
* | |
* Date: August, 2016 | |
* | |
* This short sketch demonstrates some of the functions of FastLED, including: | |
* | |
* Perlin noise | |
* Palettes |
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
#include "FastLED.h" | |
// How many leds in your strip? | |
#define NUM_LEDS 60 | |
// For led chips like Neopixels, which have a data line, ground, and power, you just | |
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock, | |
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN | |
#define DATA_PIN 3 | |
#define CLOCK_PIN 13 |