Skip to content

Instantly share code, notes, and snippets.

View twysto's full-sized avatar
😀
Enthusiastic

Loïc Liné twysto

😀
Enthusiastic
View GitHub Profile
@twysto
twysto / ajax.js
Created October 17, 2016 09:31 — forked from xeoncross/ajax.js
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@twysto
twysto / README.md
Created October 17, 2016 09:31 — forked from renchap/README.md
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@twysto
twysto / dipl.io.conf
Created October 12, 2016 12:09 — forked from spamguy/dipl.io.conf
An nginx configuration featuring HTTP/2, IPv6, Let's Encrypt SSL, and a decent cipher suite
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name www.dipl.io dipl.io;
return 301 https://dipl.io$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
@twysto
twysto / meteor-windows-vagrant-tutorial.md
Created January 2, 2016 21:15 — forked from gabrielhpugliese/meteor-windows-vagrant-tutorial.md
Tutorial for running Meteor in Windows using Vagrant

Tutorial: Meteor in Windows using Vagrant

BEFORE YOU CONTINUE:

  • Now, Meteor runs in any Windows without any line of this tutorial. Just download the Meteor binary! Yay!!
  • mrt is no longer used with Meteor 1.0

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on

@twysto
twysto / php7.sh
Created December 31, 2015 12:56
PHP 7.0.0 (release) on Debian 8
#!/bin/bash
set -e
PHP_VERSION=7.0.0
# Dependencies
apt-get update
apt-get install -y \