Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile
@ikennaokpala
ikennaokpala / install.sh
Created July 28, 2016 10:40
install nginx with ngx_lua automatically under debian/ubuntu like system
#!/bin/bash
set -e
NGX_VER="1.8.0"
NDK_VER="0.2.19"
NGX_LUA_VER="0.9.16"
LUAJIT_VER="2.0.4"
LUAROCKS_VER="2.2.1"
WORKDIR=$(pwd)
NGX_INSTALL_DIR="/usr/local/nginx"
if ! [ -e "nginx-${NGX_VER}.tar.gz" ]; then
FROM debian:jessie
MAINTAINER Jonathan Gautheron "jgautheron@neverblend.in"
ENV DEBIAN_FRONTEND noninteractive
# Define versions
ENV OPENRESTY_VERSION 1.9.7.2
ENV PAGESPEED_VERSION 1.10.33.5-beta
ENV PAGESPEED_PSOL_VERSION 1.10.33.5
ENV OPENSSL_VERSION 1.0.2f
FROM debian:jessie
MAINTAINER Jonathan Gautheron "jgautheron@neverblend.in"
ENV DEBIAN_FRONTEND noninteractive
# Define versions
ENV OPENRESTY_VERSION 1.9.7.2
ENV PAGESPEED_VERSION 1.10.33.5-beta
ENV PAGESPEED_PSOL_VERSION 1.10.33.5
ENV OPENSSL_VERSION 1.0.2f
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
@ikennaokpala
ikennaokpala / letsencrypt.md
Created July 25, 2016 08:44 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

Install s3fs on Mac OS X
1 - Install Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install s3fs
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
BELOW ARE A COLLECTION OF HANDY GOVUK SCRIPTS
@ikennaokpala
ikennaokpala / git_branch_name.sh
Last active May 27, 2016 11:00
Git branch name in terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)\/.*/ \1/'` #get only the preceding name