Skip to content

Instantly share code, notes, and snippets.

## MFA Authentication
temp_role=$(aws sts get-session-token --serial-number arn:aws:iam::XXXXXXX:mfa/[email protected] \
--token-code 000000)
export AWS_ACCESS_KEY_ID=$(echo $temp_role | jq -r .Credentials.AccessKeyId)
export AWS_SECRET_ACCESS_KEY=$(echo $temp_role | jq -r .Credentials.SecretAccessKey)
export AWS_SESSION_TOKEN=$(echo $temp_role | jq -r .Credentials.SessionToken)
## Assume Role
export ASSUME_ROLE_ARN=arn:aws:iam::000000:role/foobar
@lrepolho
lrepolho / pycharm
Created April 24, 2020 05:23
PyCharm command script to launch project / MacOSx / Terminal / iTerm / /usr/local/bin/pycharm
#!/bin/sh
open -na "PyCharm CE.app" --args "${PWD}/$@"
@lrepolho
lrepolho / gist:5cc217eeebf822c2e57705c57873fe5d
Created May 1, 2018 03:32
Simple Kubernetes Service and Deployment
apiVersion: v1
kind: Service
metadata:
labels:
app: rev
name: rev
spec:
ports:
- name: http
port: 80
@lrepolho
lrepolho / renamefilestosha256.php
Last active April 4, 2017 10:18
Set filenames as it's equivalent SHA256
<?php
// usage: php renamefiles.php /path/to/dir
$photosDir = $_SERVER['argv']['1'];
$files = scandir($photosDir);
foreach ($files as $file) {
if ($file == '.' || $file == '..') {
continue;
}