Skip to content

Instantly share code, notes, and snippets.

View lanimall's full-sized avatar

Fabien Sanglier lanimall

View GitHub Profile
@lanimall
lanimall / aws_mfa_simple_script.sh
Created July 30, 2020 15:34
Simple Linux/Mac function to easily generate an AWS MFA token for AWS CLI access
#!/bin/sh
MFA_SERIAL="arn:aws:iam::ACCOUNT:USER"
AWS_PROFILE=PROFILE
function awstoken() {
output=$(aws sts get-session-token --profile $AWS_PROFILE --serial-number $MFA_SERIAL --token-code "$@");
aws_access_key_id=$(echo $output | jq -r '.Credentials.AccessKeyId')
aws_secret_access_key_id=$(echo $output | jq -r '.Credentials.SecretAccessKey')
aws_session_token=$(echo $output | jq -r '.Credentials.SessionToken')

Keybase proof

I hereby claim:

  • I am lanimall on github.
  • I am lanimall (https://keybase.io/lanimall) on keybase.
  • I have a public key ASC_zdJK7YxDUYyrdSK3qlaTxuAvj1Q3AWlSRLMKJLiIHAo

To claim this, I am signing this object:

@lanimall
lanimall / gist:cb808a11a058f7fb620a
Last active December 7, 2023 09:49
SSL Protocol Tests - TLSv1.2
public class SSLProtocolTests {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getInstance("TLSv1.2");
context.init(null,null,null);
SSLSocketFactory factory = (SSLSocketFactory)context.getSocketFactory();
SSLSocket socket = (SSLSocket)factory.createSocket();
String[] protocols = socket.getSupportedProtocols();
@lanimall
lanimall / gist:cb7d84c8d6c6301d4d0c
Created April 13, 2015 17:54
SSL Protocol Tests - Default
public class SSLProtocolTests {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getDefault();
SSLSocketFactory factory = (SSLSocketFactory)context.getSocketFactory();
SSLSocket socket = (SSLSocket)factory.createSocket();
String[] protocols = socket.getSupportedProtocols();
System.out.println("Supported Protocols: " + protocols.length);
for(int i = 0; i < protocols.length; i++)