Skip to content

Instantly share code, notes, and snippets.

View ernesto-butto's full-sized avatar

Ernesto Butto ernesto-butto

  • Planhat - Catwizard
  • Spain
  • 06:32 (UTC +02:00)
View GitHub Profile
@ernesto-butto
ernesto-butto / aws-temp-token.sh
Created August 2, 2021 11:03 — forked from ogavrisevs/aws-temp-token.sh
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws sts get-session-token \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://gist.github.com/ogavrisevs/2debdcb96d3002a9cbf2
#
@ernesto-butto
ernesto-butto / gist:1d316954968763bf2307
Last active October 26, 2015 17:52
Amazon s3 Versioning Enabled folder and sub folders recover using AWS SDK for Java
public void restoreObject() {
// INPUT VARIABLES
String BUCKET = "bucket-name";
// Adress to the root folder e.g. String key = "users/newhighglass";
String key = "tmp";
String dayBeforeDeletion = "25-Oct-2015"; // A day before the deletion