Skip to content

Instantly share code, notes, and snippets.

@poliveira89
poliveira89 / libcloud_docker.py
Created April 7, 2016 09:52
Libcloud client for Docker with TLS
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 March 23, 2016 15:56 — forked from sheerun/certgen.rb
Docker TLS certificate generator
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?
@poliveira89
poliveira89 / output
Created July 3, 2015 09:48
hapijs testing with lab
$ lab
.
1 tests complete
Test duration: 28 ms
No global variable leaks detected
@poliveira89
poliveira89 / installSublime.sh
Created September 11, 2013 10:59
Small script for installing Sublime Text 2.0.2 on Linux debian/ubuntu-based distro
# 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
# 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 July 10, 2013 13:51
How to use WebDav on Linux+XFCE+Thunar
davs://poliveira@some.webserver.pt/webdav/someFolder
@poliveira89
poliveira89 / top.sh
Created June 26, 2013 22:58
Top 10 shell commands
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head