Skip to content

Instantly share code, notes, and snippets.

@poliveira89
poliveira89 / libcloud_docker.py
Created Apr 7, 2016
Libcloud client for Docker with TLS
View libcloud_docker.py
import libcloud.security
from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
import ssl
from time import sleep
# this code is to declare private CA Root - created specifically for docker TLS connection
libcloud.security.SSL_VERSION = ssl.PROTOCOL_TLSv1
libcloud.security.CA_CERTS_PATH.append('/path/to/ca.pem')
@poliveira89
poliveira89 / certgen.rb
Created Mar 23, 2016 — forked from sheerun/certgen.rb
Docker TLS certificate generator
View certgen.rb
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?
@poliveira89
poliveira89 / output
Created Jul 3, 2015
hapijs testing with lab
View output
$ lab
.
1 tests complete
Test duration: 28 ms
No global variable leaks detected
@poliveira89
poliveira89 / installSublime.sh
Created Sep 11, 2013
Small script for installing Sublime Text 2.0.2 on Linux debian/ubuntu-based distro
View installSublime.sh
# download source files of Sublime
wget http://c758482.r82.cf2.rackcdn.com/Sublime\ Text\ 2.0.2\ x64.tar.bz2
# extract files from tarball
tar xf Sublime\ Text\ 2.0.2\ x64.tar.bz2
# move extracted files to opt directory
sudo mv Sublime\ Text\ 2 /opt/
# create a link on bin directory
View install-erlang.sh
# You will need to make this file executable (chmod u+x) and run it with sudo
apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
mkdir -p /src/erlang
cd /src/erlang
wget http://www.erlang.org/download/otp_src_R16B01.tar.gz
tar -xvzf otp_src_R16B01.tar.gz
chmod -R 777 otp_src_R16B01
cd otp_src_R16B01
./configure
make
@poliveira89
poliveira89 / gist:5966434
Created Jul 10, 2013
How to use WebDav on Linux+XFCE+Thunar
View gist:5966434
davs://poliveira@some.webserver.pt/webdav/someFolder
@poliveira89
poliveira89 / top.sh
Created Jun 26, 2013
Top 10 shell commands
View top.sh
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head