Skip to content

Instantly share code, notes, and snippets.

View psaussure's full-sized avatar

Psau psaussure

View GitHub Profile
@psaussure
psaussure / openresty-ubuntu-install.sh
Last active January 4, 2017 19:24 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.2.tar.gz
tar zxvf openresty-1.11.2.2.tar.gz
cd openresty-1.11.2.2
# If message: you need to have ldconfig in your PATH env when enabling luajit.
#export PATH=$PATH:/sbin
@psaussure
psaussure / nginx.conf
Created January 4, 2017 19:12 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
@psaussure
psaussure / auth.guard.ts
Created December 5, 2016 15:28 — forked from Zyzle/auth.guard.ts
Angular 2 Firebase auth guard
import { Injectable } from '@angular/core';
import { CanActivate, Router } from '@angular/router';
import { FirebaseAuth, FirebaseAuthState } from 'angularfire2';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class AuthGuard implements CanActivate {
constructor(private auth: FirebaseAuth, private router: Router) { }