Skip to content

Instantly share code, notes, and snippets.

@eug17
eug17 / letsencrypt_2017.md
Created March 28, 2018 22:03 — 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.

@eug17
eug17 / angular-on-ready.js
Created August 4, 2016 15:45 — forked from kennethlynne/angular-on-ready.js
Trigger event when angular has finished loading and $http has no pending requests
'use strict';
angular.module('theApp')
.directive('onReady', function ($rootScope, $http, $timeout) {
return {
restrict: 'A',
link: function ($scope) {
console.log('Waiting.');
var to;
@eug17
eug17 / example-download-and-open.js
Created July 14, 2016 04:17 — forked from devgeeks/example-download-and-open.js
Example file download and open in Cordova inAppBrowser
window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, gotFS, fail);
function fail(error) {
console.log(error)
}
function gotFS(fileSystem) {
fileSystem.root.getDirectory("data", {create: true, exclusive: false}, gotDir, fail);
}