Skip to content

Instantly share code, notes, and snippets.

from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.
@tkda-h3
tkda-h3 / list.txt
Created June 9, 2022 02:02 — forked from shortjared/list.txt
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@tkda-h3
tkda-h3 / iterm_keycode_for_emacs.itermkeymap
Last active March 12, 2020 13:58
mac ox X iterm2 setting file
{"Touch Bar Items":[],"Key Mappings":{"0xf704-0x20000":{"Text":"[1;2P","Action":10},"0xf700-0x260000":{"Text":"[1;6A","Action":10},"0x37-0x40000":{"Text":"0x1f","Action":11},"0x32-0x40000":{"Text":"0x00","Action":11},"0xf709-0x20000":{"Text":"[17;2~","Action":10},"0xf70c-0x20000":{"Text":"[20;2~","Action":10},"0xf729-0x20000":{"Text":"[1;2H","Action":10},"0xf72b-0x40000":{"Text":"[1;5F","Action":10},"0xf705-0x20000":{"Text":"[1;2Q","Action":10},"0xf703-0x260000":{"Text":"[1;6C","Action":10},"0xf700-0x220000":{"Text":"[1;2A","Action":10},"0xf701-0x280000":{"Text":"0x1b 0x1b 0x5b 0x42","Action":11},"0x38-0x40000":{"Text":"0x7f","Action":11},"0x33-0x40000":{"Text":"0x1b","Action":11},"0xf703-0x220000":{"Text":"[1;2C","Action":10},"0x2c-0x40000":{"Action":11,"Text":"18 40 63 2c\n18 40 63 2c\n18 40 63 2c"},"0x3c-0x60000":{"Action":11,"Text":"18 40 63 3c"},"0xf701-0x240000":{"Text":"[1;5B","Action":10},"0xf70d-0x20000":{"Text":"[21;2~","Action":10},"0xf702-0x260000":{"Text":"[1;6D","Action":10},"0x3b-0x40000":{"Act
@tkda-h3
tkda-h3 / async_sample.py
Last active January 15, 2020 10:07 — forked from rhoboro/async_sample.py
asyncio, aiohttpを利用した並列処理のサンプルコード
import asyncio
import aiohttp
import async_timeout
from aiohttp import ClientError
async def _fetch(session, url, coro):
"""HTTPリソースからデータを取得しコルーチンを呼び出す
@tkda-h3
tkda-h3 / push_pull_heroku_database.md
Created September 3, 2018 15:21 — forked from Mardiniii/push_pull_heroku_database.md
Pull and push DATABASE with Heroku

# Some tips to pull and push a database with Heroku

Some tips to improve test flow dealing with database on local and production environments.

I. Pull database from Heroku

It is really usefull if you want to fill your local database with real data from production environment.

1. Drop Local Database

#!/usr/bin/env ruby
# encoding: utf-8
require "open-uri"
require "nokogiri"
require "uri"
require 'fileutils'
require 'parallel'
##################################################################
## 1. てきとーなディレクトリAを作る