Skip to content

Instantly share code, notes, and snippets.

View brianjking's full-sized avatar
💭
Doin' cool stuff at BrandMuscle AI

Brian J King brianjking

💭
Doin' cool stuff at BrandMuscle AI
View GitHub Profile
#!/usr/bin/env ruby1.9.3
require 'pg'
require 'optparse'
require 'tmpdir'
require 'shellwords'
require 'socket'
require 'json'
require 'digest'
require 'public_suffix'
@brianjking
brianjking / about-rpi.md
Created February 19, 2016 00:25 — forked from arpanpal010/about-rpi.md
Raspberry Pi configurations

##Configurations for Raspberry Pi Home Server## #####Using Raspbian##### (although the procedures are similar/compatible with most debian based systems.)

###Added###

  • [sysctl.conf mods] (#file-sysctl-md)
  • [Firewall config] (#file-firewall-md)
  • [DNS Server] (#file-dns-md)
  • [Dynamic Dns] (#file-dyndns-md)
  • [Git Server] (#file-git-server-md)
@brianjking
brianjking / rpi_setup.md
Created February 19, 2016 00:24 — forked from dphiffer/rpi_setup.md
Raspberry Pi setup
@brianjking
brianjking / nginx_reverse_proxy.conf
Created February 19, 2016 00:20 — forked from rafaelfoster/nginx_reverse_proxy.conf
Reverse Proxy with Nginx
upstream targetwebservice {
server host2.example.com:8000 weight=1 fail_timeout=300s;
}
#server {
# listen 8081;
# server_name servername.exameple.com;
# add_header Strict-Transport-Security max-age=2592000;
# rewrite ^/.*$ https://servername.exameple.com/ permanent;
#}
server {
@brianjking
brianjking / URLs
Created February 19, 2016 00:20 — forked from strebl/URLs
Server, Admin Panels, Web
http://redd.it/1xizt0 Gentoo?
strebl.ch/21ai Ajenti
strebl.ch/1u0w Vesta Control Panel
strebl.ch/to6 cPanel
strebl.ch/1usg Choosing control panel management
strebl.ch/qrr ServerPilot
strebl.ch/1dz6 ServerPilot Experience
strebl.ch/ntg PuPHPet - A simple GUI to set up virtual machines for Web development.
strebl.ch/1ucq Phansible provides an easy-to-use interface to generate Ansible provisionings.
@brianjking
brianjking / ajenti.conf
Created February 19, 2016 00:18 — forked from wieshka/ajenti.conf
Working NGINX configuration for Ajenti reverse proxy
server {
listen *:443 ssl;
listen *:80;
ssl_certificate /etc/self-signed-ssl/cert.crt;
ssl_certificate_key /etc/self-signed-ssl/cert.key;
server_name FQDN;
access_log /var/log/nginx/ajenti-web-panel.access.log;
error_log /var/log/nginx/ajenti-web-panel.error.log;
@brianjking
brianjking / letsencrypt_with_autorenewal.md
Created February 19, 2016 00:18
Letsencrypt with automatic renewal
  • use Ubuntu 14.04 (check with lsb_release -a)
  • set up VPS like this
  • set up Nginx - (tutorial) - if you use Digital ocean, there are also many preconfigured images available that already have Nginx configured, e.g., I used the Django+PostgreSQL image, which has Nginx configured as reverse proxy in front of Gunicorn
  • further setup (optional, I actually didn't do this)
  • lets encrypt setup
  • make backup of /etc/letsencrypt
  • the current certificate, private key etc then are in /etc/letsencrypt/live/your_domain_name
  • for auto renewal: when using Nginx as a reverse proxy, i.e. when you do not have a tradition
#!/bin/bash
#
# Copyright (c) 2016 Katsuya SAITO
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
#
# @(#) letsencrypt_cert_autoupdate_webroot.sh ver.0.1.0 2016.01.31
#
# Usage:
#
@brianjking
brianjking / letsencrypt.md
Created February 19, 2016 00:17 — forked from g-p-g/letsencrypt.md
Using letsencrypt

Download

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Generate SSL certificate

@brianjking
brianjking / letsencrypt-renew
Created February 19, 2016 00:17 — forked from rhwilr/letsencrypt-renew
letsencrypt-renew
#!/bin/bash
web_service='nginx'
config_file=$1
le_path='/opt/letsencrypt'
exp_limit=30;
if [ $# -eq 0 ]; then
echo "Please specifie the path of the config file"