Skip to content

Instantly share code, notes, and snippets.

View giordanocardillo's full-sized avatar
😎
Always improving

Giordano Cardillo giordanocardillo

😎
Always improving
View GitHub Profile
@giordanocardillo
giordanocardillo / install-docker-ubuntu-14.04.sh
Last active August 30, 2016 09:14
Install Docker on Ubuntu 14.04
#!/bin/sh
apt-get update
apt-get install apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-get install linux-image-extra-$(uname -r)
apt-get install apparmor
apt-get install docker-engine
@giordanocardillo
giordanocardillo / command.md
Created November 17, 2016 16:50
Install windows npm build tools

npm install --global --production windows-build-tools

@giordanocardillo
giordanocardillo / README.MD
Last active November 23, 2016 11:16
nginx + proxy + Let's encrypt configuration

Let's Encrypt authentication virtual host

If you need to use a docker machine or any other server listening on other port than 80, you can use this snippet to authenticate your domain with Let's encrypt.

  1. Add the content of site.conf to your nginx configuration
  2. Create the folder /var/www/letsencrypt
  3. Run the certbot-auto using the webroot plugin --webroot -w /var/www/letsencrypt/
@giordanocardillo
giordanocardillo / Custom shells in a JetBrains IDE.md
Last active February 15, 2017 08:37
Using Cygwin's bash terminal in a JetBrains IDE

Using Cygwin's (or Babun) bash terminal in a JetBrains IDE

Custom shells in a JetBrains IDE

alt text

Click File then Settings and search for terminal. Change the Shell path to C:\Users\YOUR-USERNAME\.babun\cygwin\bin\bash.exe if you're using Babun. Cygwin users should use C:\cygwin\bin\bash.exe or similar, depending on where you've it installed. Click Ok, open a new terminal (tab) and try running ls -l. Tada!

@giordanocardillo
giordanocardillo / README.md
Last active February 15, 2017 09:17
Install meteor up from source
  1. Clone repository: git clone https://github.com/giordanocardillo/meteor-up.git && cd meteor-up
  2. Run npm install
  3. Run npm run prepublish
  4. Run npm install -g
@giordanocardillo
giordanocardillo / README.md
Last active March 6, 2017 16:23
Comment toggle trick

So, I guess I'm not the only one that need some way of easily toggling code in and out of the code.

This trick below can be used to toggle between two sets of code, with one symbol in the code with no additional short-keys to learn, and no tool dependencies!

//*                      /*
someCode();              someCode();
/*/                      /*/
someOtherCode();         someOtherCode();
//*/ //*/
@giordanocardillo
giordanocardillo / compile.sh
Created March 7, 2017 00:47
Compile Janus
#!/bin/sh
cd /home
mkdir janus-sources
cd janus-sources
apt-get update
apt-get install -y curl git libmicrohttpd-dev libjansson-dev libnice-dev libssl-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libcurl4-openssl-dev pkg-config gengetopt libtool automake cmake
curl -O -L https://github.com/cisco/libsrtp/archive/v2.0.0.tar.gz
tar xfv v2.0.0.tar.gz
cd libsrtp-2.0.0
./configure --prefix=/usr --enable-openssl
@giordanocardillo
giordanocardillo / webpack.config.js
Created April 14, 2017 20:05
Webpack Express conf
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, 'client'),
entry: './entry.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'public/javascripts'),
@giordanocardillo
giordanocardillo / README.md
Last active May 9, 2017 10:57
Using SSH with git

Put in your .git/config

[remote "origin"]
        ...
        url = ssh://git@gitolite-as-alice/my-repo
        ...

Even if the user and host are the same, they can still be distinguished in ~/.ssh/config. For example, if your configuration looks like this:

@giordanocardillo
giordanocardillo / README.md
Last active May 10, 2017 07:44
Mounting Samba share on Ubuntu

Mounting Samba share on Ubuntu

  1. Install package cifs-utils

     sudo apt-get install cifs-utils
    
  2. Create folder to mount the share into

     sudo mkdir /media/Share