Skip to content

Instantly share code, notes, and snippets.

@DexterShin
DexterShin / letsencrypt_2017.md
Created September 20, 2017 14:58 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@DexterShin
DexterShin / dnsmasq OS X.md
Created September 8, 2017 02:31 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

import groovy.transform.Field
import hudson.AbortException
import hudson.scm.SubversionSCM
import org.tmatesoft.svn.core.SVNDepth
import java.util.concurrent.ConcurrentHashMap
@Field int slaves = 4;
@Field int threadsPerSlave = 2;
@Field boolean coverageBuild = false
@DexterShin
DexterShin / osx-10.10-setup.md
Last active August 29, 2015 14:27 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@DexterShin
DexterShin / node_debian_init.sh
Created November 23, 2012 14:14 — forked from obazoud/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@DexterShin
DexterShin / thumbnail.js
Created November 14, 2012 23:21 — forked from gigablah/thumbnail.js
nodejs + gearman + gm + pngquant + pngcrush thumbnail generator
#!/usr/bin/env node
var path = require('path'),
exec = require('child_process').exec,
when = require('when'),
gm = require('gm'),
Gearman = require('node-gearman'),
gearman = new Gearman(),
options = {
thumbDir: path.join(__dirname, 'thumb'),
@DexterShin
DexterShin / install.sh
Created October 13, 2012 00:04 — forked from padcom/install.sh
Gitorious installation on Ubuntu 12.04
#!/bin/bash
#------------------------------------------------------------------------------
# SETTINGS
#------------------------------------------------------------------------------
MYSQL_ROOT_PASSWORD=password
MYSQL_GITORIOUS_PASSWORD=password
GITORIOUS_HOST=gitorious
SYSADMIN=sysadmin
@DexterShin
DexterShin / extensions.js
Created August 20, 2012 07:15 — forked from firejune/extensions.js
The minimap provides you with a new way to visualize your site.
/** pQuery! LOL **/
Object.extend($, Prototype);
Object.extend($, Object);
/**
* Returns window dimensions and scroll positions
* @author Firejune<[email protected]>
* @license MIT
*/
@DexterShin
DexterShin / gist:3365308
Created August 16, 2012 01:19 — forked from limeyd/gist:3356221
Meteor injected Models
Model = function(attrs) {
attrs = attrs || {};
_.extend(this, attrs);
_raw_attr_keys = _.keys(attrs);
this.errors = {};
}
Model.bind = function(model, collectionName){
var pt = new Model({});
_.extend(pt, model.prototype);
@DexterShin
DexterShin / app-views-index.jade
Created July 23, 2012 17:02 — forked from scottkf/app-views-index.jade
railwayjs environment config
- var items = ["facebook", "github", "twitter", "instagram"]
- if (!everyauth.loggedIn)
h2 Not Authenticated
each item in items
a(href='/auth/' + item)
span Connect with <span style="text-transform: capitalize">!{item}</span><br />
- else
h2 Authenticated
#user-id Logged in with `user.id` #{user.id} - aka `everyauth.user.id` #{everyauth.user.id}