Skip to content

Instantly share code, notes, and snippets.

View simone-sanfratello's full-sized avatar

Simone Sanfratello simone-sanfratello

View GitHub Profile
@simone-sanfratello
simone-sanfratello / DockerOnUbuntu16.md
Created January 13, 2017 16:48
Setup Docker on Ubuntu 16.x

Setup Docker on Ubuntu 16.x

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt-get update
sudo apt-cache policy docker-engine
sudo apt-get install -y docker-engine
sudo systemctl status docker
sudo usermod -aG docker $(whoami)
@simone-sanfratello
simone-sanfratello / gitlabOnDebian8-Ubuntu14-Ubuntu16.md
Last active January 15, 2017 02:38
Setup gitlab on Debian 8.x / Ubuntu 14.x / Ubuntu 16.x

gitlab on Debian 8.x / Ubuntu 14.x 16.x

cd /usr/src
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
sudo gitlab-ctl reconfigure
@simone-sanfratello
simone-sanfratello / nginxOnDebian8.md
Last active October 31, 2018 13:43
Setup nginx 1.14.0 on Debian 8.x

nginx 1.14.0 on Debian 8.x

review 2018-10-06

"bare" nginx on debian 8 without cgi modules

apt-get -y install zlib1g-dev libpcre3 libpcre3-dev libbz2-dev libssl-dev tar unzip git
cd /usr/local/src
wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar -xzvf nginx-*.tar.gz
@simone-sanfratello
simone-sanfratello / nodejsOnDebian8-Ubuntu12-1-4-16.md
Created January 13, 2017 16:57
Setup node.js 6.x in Debian 7.x, 8.x / Ubuntu 12.x, 14.x, 16.x

node.js 6.x in Debian 7.x, 8.x / Ubuntu 12.x, 14.x, 16.x

sudo apt-get install -y build-essential
cd /usr/local/src
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
@simone-sanfratello
simone-sanfratello / rdesktopOnUbuntu14.md
Last active January 13, 2017 16:59
Setup rdesktop on Ubuntu 14.x

rdesktop on Ubuntu 14.x

cd /user/local/src
git clone https://github.com/rdesktop/rdesktop.git
cd rdesktop/
./bootstrap
sudo apt-get install libx11-dev libgssglue-dev
./configure --disable-smartcard
make
@simone-sanfratello
simone-sanfratello / Swift3OnUbuntu14.md
Created January 13, 2017 17:00
Setup Swift 3.0.1 on Ubuntu 14.x

Swift 3.0.1 on Ubuntu 14.x

Reference: https://github.com/apple/swift/blob/master/docs/Ubuntu14.md

sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev autoconf libtool systemtap-sdt-dev

sudo apt-get install clang-3.6
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 100
@simone-sanfratello
simone-sanfratello / netdataOnUbuntu16.md
Created January 19, 2017 15:12
Setup netdata on Ubuntu 16.x

netdata on Ubuntu 16.x

sudo apt-get update
sudo apt-get install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl
cd /usr/local/src/
sudo curl -Ss 'https://raw.githubusercontent.com/firehol/netdata-demo-site/master/install-required-packages.sh' >/tmp/kickstart.sh && bash /tmp/kickstart.sh -i netdata-all
sudo git clone https://github.com/firehol/netdata.git --depth=1
cd netdata
sudo ./netdata-installer.sh
@simone-sanfratello
simone-sanfratello / hash.js
Created January 27, 2017 10:37
Node.js hash function (sha256)
const crypto = require('crypto')
function hash(data) {
return crypto
.createHash('sha256')
.update(data)
.digest('base64')
}
// hash('the-value')
@simone-sanfratello
simone-sanfratello / .gitignore
Created April 12, 2017 03:57
gitignore nodejs project
# dirs
/.vscode/
/dist/
/log/
/pid/
/node_modules/
/coverage/
# logs
*.log
@simone-sanfratello
simone-sanfratello / store.js
Created April 12, 2017 04:06
template for session store implementation
'use strict'
const util = require('util')
/**
* @see http://expressjs-book.com/index.html%3Fp=128.html
* @see https://github.com/expressjs/session#session-store-implementation
*/
const MyStore = function (session) {