Skip to content

Instantly share code, notes, and snippets.

Steve M shmick

  • Toronto
Block or report user

Report or block shmick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View docker with temp creds
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.
View docker with temp creds
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.
@shmick
shmick / config
Created Feb 13, 2019
~/.aws/config example
View config
# ~/.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
@shmick
shmick / mute
Created Sep 18, 2018
Twitter mute words
View mute
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
@shmick
shmick / boto3_sts_assumerole
Last active May 24, 2018
A quick example for using roles within a boto3 script
View boto3_sts_assumerole
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"
View picoin.sh
#!/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}')
@shmick
shmick / verifyAkamaiIp.sh
Created Jan 24, 2017 — forked from rafaelfelix/verifyAkamaiIp.sh
Shell script to programmatically check if an IP address belongs to Akamai. Requires Akamai login, password and permission to access https://control.akamai.com/partner-tools/index.action?target=VerifyAkamaiIP
View verifyAkamaiIp.sh
#!/bin/bash
#
# Issue request to Akamai tool verifyAkamaiIpInternal to check if
# the given IP address belongs to Akamai
#
## defining helper functions first
# show usage
@shmick
shmick / ColorTwinkles.ino
Created Nov 30, 2016 — forked from kriegsman/ColorTwinkles.ino
Twinkling 'holiday' lights that fade in and out.
View ColorTwinkles.ino
#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.
@shmick
shmick / stripedTwinkle.ino
Created Nov 21, 2016 — forked from hsiboy/stripedTwinkle.ino
fastled - striped twinkle
View stripedTwinkle.ino
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;
View inoise8_pal_demo.ino
/* 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
You can’t perform that action at this time.