Skip to content

Instantly share code, notes, and snippets.

View mlsaito's full-sized avatar

Makoto Saito mlsaito

View GitHub Profile
@mlsaito
mlsaito / ssl_version.md
Last active July 21, 2023 08:09
Specify SSL version (TLS 1.2) on HTTParty - a Ruby client library

Implementation

Some vendors require you to call their API via TLS 1.2 and I don't see that much documentation on how to do this.

2 ways to make an HTTP request using HTTParty:

  1. Directly calling Class method.
# Notice the `ssl_version` option, to specify ssl version of the HTTP request
response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow', ssl_version: :TLSv1_2)
@mlsaito
mlsaito / tunnel.md
Created August 14, 2018 00:20
SSH into ElastiCache - Redis

Create a tunnel on your local:

$ ssh -f -N -L6379:<your redis node endpoint>:6379 <your EC2 node that you use to connect to redis> -i "key.pem"

Connect to redis exposed on your local:

$ redis-cli -h 127.0.0.1 -p 6379