Skip to content

Instantly share code, notes, and snippets.

@tarrynn
tarrynn / stuff
Last active April 21, 2020 13:32
lambda setup
README
## Setup runtime for this lambda function
1. `docker build -t lambda-ruby2.5-postgresql10 .` to create an environment in which we can build gems with native extensions that will run properly on lambda
2. `docker run --rm -it -v $PWD:/var/task -w /var/task lambda-ruby2.5-postgresql10` to run the docker container with a bash terminal
3. Run the following inside the bash terminal opened above
`bundle config --local build.pg --with-pg-config=/usr/pgsql-10/bin/pg_config` inside the bash terminal opened above
@tarrynn
tarrynn / aws-ec2-redis-cli.md
Created January 9, 2019 14:08 — forked from paladini/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

@tarrynn
tarrynn / gist:a1895363c3fc2f57da5fb467c14589f2
Created February 20, 2017 14:42
graceful nginx restart
#!/bin/bash
# script to gracefully restart nginx on the hostname
# will reside in /home/$DEPLOY_USER/scripts
# needs to run as user with sudo permissions
set -x
sudo nginx -t #test config file
if [ $? -ne 0 ]
then