Skip to content

Instantly share code, notes, and snippets.

View igorbarinov's full-sized avatar
🌿

Igor Barinov igorbarinov

🌿
View GitHub Profile
@igorbarinov
igorbarinov / openresty-nchan-redis-luarocks.sh
Last active May 5, 2019 11:10 — forked from jmealo/openresty-nchan-redis-luarocks.sh
OpenResty + LuaRocks + Nchan + Redis (with password, graph and bloom modules)
#!/bin/sh
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential git curl \
unzip
git clone https://github.com/RedisLabsModules/password.git /tmp/password
git clone https://github.com/RedisLabsModules/rebloom.git /tmp/rebloom
git clone https://github.com/RedisLabsModules/redis-graph.git /tmp/redis-graph
@igorbarinov
igorbarinov / etc.js
Created August 13, 2017 18:34 — forked from anonymous/etc.js
go!
const Web3 = require('web3');
const net = require('net');
const { Pool, Client } = require('pg');
let web3 = new Web3('/Users/user/repos/private_net/here.ipc', net);
const pool = new Pool({
user: 'readonly',
host: 'localhost',
@igorbarinov
igorbarinov / 0_reuse_code.js
Created July 24, 2016 03:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@igorbarinov
igorbarinov / server_certificates_to_pem.md
Created March 7, 2016 10:25 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample