Skip to content

Instantly share code, notes, and snippets.

View chrishowell's full-sized avatar
🌭

Chris Howell chrishowell

🌭
View GitHub Profile
@chrishowell
chrishowell / STSTesting.scala
Created September 18, 2017 08:28
Using STS with MFA and longer lived session credentials
import com.amazonaws.auth.profile.internal.{BasicProfile, ProfileStaticCredentialsProvider}
import com.amazonaws.auth.profile.{ProfileCredentialsProvider, ProfilesConfigFile}
import com.amazonaws.auth.{AWSCredentials, AWSCredentialsProvider, AWSStaticCredentialsProvider, BasicSessionCredentials, DefaultAWSCredentialsProviderChain}
import com.amazonaws.services.s3.AmazonS3ClientBuilder
import com.amazonaws.services.securitytoken.model.{AssumeRoleRequest, GetSessionTokenRequest}
import com.amazonaws.services.securitytoken.{AWSSecurityTokenServiceClient, AWSSecurityTokenServiceClientBuilder}
import scala.collection.JavaConversions._
object STSTesting {
@chrishowell
chrishowell / keybase.md
Created October 12, 2019 18:18
Keybase Proof

Keybase proof

I hereby claim:

  • I am chrishowell on github.
  • I am chrishowell (https://keybase.io/chrishowell) on keybase.
  • I have a public key ASCRqn-p4Qg44ptN-kKXQxU3wBX1dl_NmfT2fiv5_sIokgo

To claim this, I am signing this object:

@chrishowell
chrishowell / output.log
Created October 13, 2019 10:20
TF Debug Output
2019/10/13 11:18:47 [INFO] Terraform version: 0.12.10
2019/10/13 11:18:47 [INFO] Go runtime version: go1.13.1
2019/10/13 11:18:47 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan"}
2019/10/13 11:18:47 [DEBUG] Attempting to open CLI config file: /Users/chrishowell/.terraformrc
2019/10/13 11:18:47 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/10/13 11:18:47 [INFO] CLI command args: []string{"plan"}
2019/10/13 11:18:47 [DEBUG] New state was assigned lineage "82e0a1e7-46ff-02b2-ab73-2f5a0db58cbc"
2019/10/13 11:18:47 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2019/10/13 11:18:47 [TRACE] Meta.Backend: instantiated backend of type <nil>
2019/10/13 11:18:47 [DEBUG] checking for provider in "."
@chrishowell
chrishowell / LambdaMultiRegionCopy.js
Created November 3, 2022 17:33
LambdaReplicator
console.log('Loading function');
const aws = require('aws-sdk');
const s3 = new aws.S3({ apiVersion: '2006-03-01' });
exports.handler = async (event, context) => {
const bucket = event.Records[0].s3.bucket.name;
const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' '));
@chrishowell
chrishowell / SerdeCodec.java
Created November 28, 2022 15:32
Getting Micronaut Serde working with Redisson
import io.micronaut.serde.ObjectMapper;
import jakarta.inject.Singleton;
import lombok.RequiredArgsConstructor;
import org.redisson.client.protocol.Decoder;
import org.redisson.client.protocol.Encoder;
import org.redisson.codec.JsonCodec;
import static io.netty.buffer.Unpooled.wrappedBuffer;
import static java.nio.charset.StandardCharsets.UTF_8;