Skip to content

Instantly share code, notes, and snippets.


Ruan Bekker ruanbekker

Block or report user

Report or block ruanbekker

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
DaisukeMiyamoto /
Created Sep 12, 2018
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
mgaspari / youtube-to-mp3.rb
Created Aug 23, 2017 — forked from stefan-lz/youtube-to-mp3.rb
youtube vids to mp3 files (ruby)
View youtube-to-mp3.rb
#usage: youtube-to-mp3 <youtube-url>
#example: youtube-to-mp3
#desc: downloads a single youtube vid or a playlist, then converts to mp3.
# Requires youtube-dl and ffmpeg
url = ARGV[0]
system("youtube-dl -citA #{url}")
gene1wood /
Created Dec 29, 2016
Simple python function to assume an AWS IAM Role from a role ARN and return a boto3 session object
import boto3
def role_arn_to_session(**args):
Usage :
session = role_arn_to_session(
client = session.client('sqs')
greyli /
Last active Jan 21, 2020
Photo upload and manage with Flask and Flask-Uploads (Multiple file upload support!).
# -*- coding: utf-8 -*-
import os
import time
import hashlib
from flask import Flask, render_template, redirect, url_for, request
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import SubmitField
View html-share-buttons.html
<!-- I got these buttons from -->
<div id="share-buttons">
<!-- Buffer -->
<a href=";text=Simple Share Buttons" target="_blank">
<img src="" alt="Buffer" />
<!-- Digg -->
<a href="" target="_blank">
fgassert / ec2-get-security-credentials
Last active Jul 18, 2019
gets iam security credentials from instance metadata and writes them to awscli environment variables and .s3cfg (for s3cmd)
View ec2-get-security-credentials
# gets iam security credentials from instance metadata and writes them to
# awscli environment variables and .s3cfg (for s3cmd)
# Usage: ec2-get-security-credentials ROLENAME DEFAULT_REGION
# ROLE=$1
You can’t perform that action at this time.