Skip to content

Instantly share code, notes, and snippets.

View ngendlio's full-sized avatar
🌴
On vacation

Lionel Ngendakuriyo ngendlio

🌴
On vacation
View GitHub Profile
@ngendlio
ngendlio / sec_tutorial.md
Created October 24, 2017 15:57 — forked from tgrall/sec_tutorial.md
MongoDB Security Tutorial

#Simple MongoDB Security Tutorial

###1 - Start mongod without any "security option"

$ mongod --port 27017

@ngendlio
ngendlio / mongodb_specials.md
Created June 9, 2017 11:41 — forked from alain-andre/mongodb_specials.md
Les Aggregations sous MongoDB (informations issues de leurs cours)

Aggregation

Pipeline

  • $project - Sélectionnez, remodeler - 1:1
  • $match - Filtrer - n:1
  • $group - Agréger - n:1
  • $sort - Trier - 1:1
  • $skip - Sauter - n:1
  • $limit - Limiter - n:1
  • $unwind - Découper un champ (array) - 1:n
@ngendlio
ngendlio / google-font-dl.py
Created April 17, 2017 06:10 — forked from fedir/google-font-dl.py
Script to download google fonts locally (for web development off-line, for example). Use : python getAllGoogleFonts.py Dosis
#!/usr/bin/env python
#
# Downloader for Google Web Fonts
#
# For usage information run with "--help"
#
# Works on Python 2.6 and later, 3 and later
# Requires tinycss (and argparse for Python 2.6) from pip
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@ngendlio
ngendlio / client.js
Created March 2, 2017 17:48 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@ngendlio
ngendlio / nginx.conf
Last active July 26, 2016 11:34 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096

Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.

Install

$ npm install mongoose --save

Connect

const mongoose = require('mongoose');
@ngendlio
ngendlio / LetsEncrypt.md
Created June 14, 2016 16:49 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
@ngendlio
ngendlio / package.json
Created June 4, 2016 21:10 — forked from jokecamp/package.json
Demo for Passport.js authentication in a Node.js Express application
{
"name": "securehelloworld",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@ngendlio
ngendlio / flightplan-html.md
Created May 19, 2016 21:47 — forked from learncodeacademy/flightplan-html.md
Deploy HTML site with Flightplan

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder

sudo apt-get install nodejs npm
// Ensuite pour que nodemon puisse marcher fo faire
// Car Ubuntu package nodejs provide a binary as a /usr/bin/nodejs,
/ not a /usr/bin/node, so most of cli tools can't find it. To solve the problem you need to make a symlink:
sudo ln -sT /usr/bin/nodejs /usr/bin/node
// si turencontre une erreur de type :
SyntaxError: Unexpected token
Redemarre le PC tout simplement
----------------PUG (old JADE)--------------