Skip to content

Instantly share code, notes, and snippets.

View mpatnode's full-sized avatar

Mike Patnode mpatnode

View GitHub Profile
@mpatnode
mpatnode / SSLClientAuth.java
Created February 17, 2024 18:56
Java SSL Client Auth
/**
* Simple SSL Client Auth example.
*
* Download: httpclient-4.5.14.jar, httpcore-4.4.16.jar, commons-logging-1.2.jar, commons-codec-1.10.jar
*
*
* javac -cp httpclient-4.5.14.jar:httpcore-4.4.16.jar:. SSLClientAuth.java
* java -cp httpclient-4.5.14.jar:httpcore-4.4.16.jar:commons-logging-1.2.jar:commons-codec-1.10.jar:. SSLClientAuth
*/
@mpatnode
mpatnode / TemplateData.java
Last active February 1, 2024 00:22
Construct a generic Java class
private static class TemplateData<T extends ADObj> {
private String uuid;
private Class<T> type;
private T adObj;
public TemplateData(Class<T> type, String uuid) {
this.type = type;
this.uuid = uuid;
@mpatnode
mpatnode / docker-compose.yml
Created May 22, 2023 15:15
Hack for Lambda Layer support on localstack Community Edition
localstack:
container_name: localstack_main
hostname: localstack
image: localstack/localstack:latest
profiles: ["localstack"]
mem_limit: 2g
sysctls:
- net.ipv4.tcp_tw_reuse=1
- net.ipv4.tcp_fin_timeout=10
ports:
@mpatnode
mpatnode / Boto3 session.py patch
Last active April 25, 2023 22:50
Allow localstack Python lambda functions to talk to localstack:4566 vs AWS. Grab a copy of session.py, apply the patch and mount it into the LAMBDA docker containers
This is the latest session.py file from https://github.com/boto/boto3 version 1.26.118 with the following patch
to allow for the AWS_ENDPOINT_URL to override the defaults
~~~
diff --git a/boto3/session.py b/boto3/session.py
index bdda65ad..ba57fbb2 100644
--- a/boto3/session.py
+++ b/boto3/session.py
@@ -296,6 +296,9 @@ class Session:
:return: Service client instance
@mpatnode
mpatnode / AWSClientEnvConfig.java
Last active May 2, 2023 14:43
Generic Wrapper for AWSClient Builder to override the endpoint URL using environment variables
package com.britive.util;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import java.util.Collections;
import java.util.HashMap;
@mpatnode
mpatnode / engineering-roles.md
Created November 18, 2021 18:13 — forked from skyzyx/engineering-roles.md
Engineering Role Definitions

Engineering Role Definitions

Note: Although the levels may be different, these tend to map pretty cleanly to similar hierarchies at Google and Microsoft, but they have no correlation to hierarchies outside of the "club" of elite companies (Microsoft/Amazon/Google/Facebook, etc. on the west coast, Bloomberg/Goldman/HFT firms, etc. on the east coast).

People with 10-15 years of software engineering experience interview all the time at these companies, but they may not be fit for much more than a junior engineering role (SDE I or SDE II, depending on which company you're looking at).

Junior Engineer/Intern:

  • Is essentially a new and inexperienced (below the level of Amazon/Microsoft/Google engineers) junior engineer.
  • Attending college for computer science, or really good at teaching themselves from books and online tutorials.
@mpatnode
mpatnode / post-checkout
Last active September 16, 2016 17:26 — forked from kkopachev/post-checkout
composer install post-checkout hook
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
GIT_DIR=$(git rev-parse --git-dir)