Skip to content

Instantly share code, notes, and snippets.

View lamductan's full-sized avatar

Tan Lam lamductan

  • Dallas, TX, USA
View GitHub Profile

Terraforming API Gateway to SQS queue

Example of a bare-minimum terraform script to setup an API Gateway endpoint that takes records and puts them into an SQS queue.

SQS

Start by creating the SQS queue.

resource "aws_sqs_queue" "queue" {
@rkitover
rkitover / python-3.6.3-custom-static-openssl.patch
Created November 16, 2017 21:38
Patch for Python 3.6.3 to use a custom static OpenSSL
diff -ruN Python-3.6.3.orig/setup.py Python-3.6.3.new/setup.py
--- Python-3.6.3.orig/setup.py 2017-10-02 22:52:02.000000000 -0700
+++ Python-3.6.3.new/setup.py 2017-11-16 13:35:45.000000000 -0800
@@ -811,10 +811,15 @@
exts.append( Extension('_socket', ['socketmodule.c'],
depends = ['socketmodule.h']) )
# Detect SSL support for the socket module (via _ssl)
+ openssl_root = os.getenv('OPENSSL_ROOT')
+
search_for_ssl_incs_in = [
@chatton
chatton / SendObjectsOverSockets.java
Created September 26, 2017 15:27
Example of how to send an Object over a Socket in Java.
import java.io.Serializable;
// must implement Serializable in order to be sent
public class Message implements Serializable{
private final String text;
public Message(String text) {
this.text = text;
}
@vihari
vihari / tf_print.py
Last active April 10, 2019 09:06
Tensorflow's tf.Print to stdout instead of default stderr
"""
The default tf.Print op goes to STDERR
Use the function below to direct the output to stdout instead
Usage:
> x=tf.ones([1, 2])
> y=tf.zeros([1, 3])
> p = x*x
> p = tf_print(p, [x, y], "hello")
> p.eval()
hello [[ 0. 0.]]
@w121211
w121211 / spikes.ipynb
Last active May 9, 2024 02:15 — forked from jkibele/spikes
Identifying Spikes in timeseries data with Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psanford
psanford / meraki_strongswan_notes.md
Last active September 3, 2024 06:19
connect to meraki client vpn from strongswan (ubuntu 16.04 edition)

These are my notes for connecting to a meraki client vpn from ubuntu 16.04. This configuration assumes you are using a psk for the ipsec auth.

Install the following packages:

apt-get install -y strongswan xl2tpd

Configure strong swan

@vasanthk
vasanthk / System Design.md
Last active November 14, 2024 11:31
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rogerallen
rogerallen / us_state_abbrev.py
Last active November 5, 2024 05:21
A Python Dictionary to translate US States to Two letter codes
# United States of America Python Dictionary to translate States,
# Districts & Territories to Two-Letter codes and vice versa.
#
# Canonical URL: https://gist.github.com/rogerallen/1583593
#
# Dedicated to the public domain. To the extent possible under law,
# Roger Allen has waived all copyright and related or neighboring
# rights to this code. Data originally from Wikipedia at the url:
# https://en.wikipedia.org/wiki/ISO_3166-2:US
#