Skip to content

Instantly share code, notes, and snippets.

View jmcarbo's full-sized avatar

Joan Marc Carbo jmcarbo

  • -
  • Barcelona (SPAIN)
View GitHub Profile
apt-get -y install golang
echo "export GOPATH=/golang" >> /root/.profile
echo "export GOBIN=/golang/bin" >> /root/.profile
mkdir -p /golang/bin
echo $GOPATH
apt-get -y install fuse git vim
@jmcarbo
jmcarbo / conditioning
Last active August 29, 2015 14:08
Ubuntu 14.04 conditioning script
curl -sSL https://get.docker.com/ubuntu/ | sudo sh
echo export DOCKER_HOST=tcp://localhost:2375 >> ~/.bashrc
sudo bash -c "echo DOCKER_OPTS=\"-H tcp://0.0.0.0:2375\" >> /etc/default/docker"
sudo service docker restart
sudo usermod -a -G docker jmcarbo
rm -rf /tmp/install
mkdir -p /tmp/install
cd /tmp/install
apt-get update
apt-get install -y wget unzip dnsutils
wget https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip
unzip 0.4.1_linux_amd64.zip
install consul /usr/local/bin/consul
mkdir -p /etc/consul
mkdir -p /var/lib/consul
@jmcarbo
jmcarbo / cluster
Last active August 29, 2015 14:09
rm -rf /tmp/install
mkdir -p /tmp/install
cd /tmp/install
apt-get update
apt-get install -y wget unzip dnsutils
curl -sSL https://get.docker.com/ubuntu/ | sudo sh
wget https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip
unzip 0.4.1_linux_amd64.zip
install consul /usr/local/bin/consul
mkdir -p /etc/consul
wget https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip
unzip 0.4.1_linux_amd64.zip
install consul /usr/local/bin/consul
mkdir -p /etc/consul
mkdir -p /var/lib/consul
cat >/etc/consul/consul.conf <<EOF
{
"data_dir": "/var/lib/consul/data",
"ui_dir": "/var/lib/consul/ui",
"client_addr": "0.0.0.0",
@jmcarbo
jmcarbo / searchpdf.go
Last active August 29, 2015 14:10
Search pdf
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
"path"
#cloud-config
hostname: myhostname
coreos:
etcd:
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
@jmcarbo
jmcarbo / main.go
Created April 30, 2015 10:14
create docker-machine certificates
package main
import (
"fmt"
"github.com/docker/machine/utils"
)
func main() {
err := utils.GenerateCert([]string{"192.168.2.11"}, "n2/server.pem", "n2/server-key.pem", "ca.pem", "ca-key.pem", "n1", 2048)
if err != nil {
CmdUtils.CreateCommand({
name: "gist-credentials",
//takes: {"login_name": noun_arb_text},
modifiers: {"login_name": noun_arb_text, "tok": noun_arb_text},
homepage: "http://www.sample.me.uk/ubiquity/",
author: { name: "Duncan Sample" },
description: "Sets the login credentials for github",
help: "service should be either 'delicious' or 'magnolia'",
license: "MPL",
preview: function( pblock ) {
/* This is a template command */
CmdUtils.CreateCommand({
name: "publicprbb",
icon: "http://example.com/example.png",
homepage: "http://example.com/",
author: { name: "Your Name", email: "you@example.com"},
license: "GPL",
description: "Em mostra les reserves de sales",
help: "how to use your command",
takes: {"input": noun_arb_text},