Skip to content

Instantly share code, notes, and snippets.

@oscarruesga
oscarruesga / KibanaDashboardExport.json
Last active January 21, 2016 21:32
PROYECTO FIN DE PROGRAMA EXPERTO EN BIG DATA UTAD - 2016
[
{
"_id": "MEETUP-Trending-Topics",
"_type": "dashboard",
"_source": {
"title": "MEETUP - Trending Topics",
"hits": 0,
"description": "",
"panelsJSON": "[{\"col\":1,\"id\":\"Evolución-de-los-trending-topics-por-pais\",\"panelIndex\":1,\"row\":1,\"size_x\":6,\"size_y\":8,\"type\":\"visualization\"},{\"col\":10,\"id\":\"Trending-Topics-por-País\",\"panelIndex\":2,\"row\":3,\"size_x\":3,\"size_y\":6,\"type\":\"visualization\"},{\"col\":7,\"id\":\"Global-Trending-Topics\",\"panelIndex\":3,\"row\":1,\"size_x\":3,\"size_y\":8,\"type\":\"visualization\"},{\"col\":10,\"id\":\"Total-Topics\",\"panelIndex\":4,\"row\":1,\"size_x\":3,\"size_y\":2,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Evolución-de-los-topics-por-pais-en-las-últimas-12-horas-en-intervalos-de-1-hora\",\"panelIndex\":5,\"row\":9,\"size_x\":12,\"size_y\":8,\"type\":\"visualization\"}]",
"optionsJSON": "{\"darkTheme\":true}",
@oscarruesga
oscarruesga / unshare_drive.py
Created March 17, 2016 05:40
Python script to unshare drive files and folders recursively
"""Delete domain permission from your Google Drive files.
The reason why I created this script is so that I can use this script to
recursively remove the domain permission item from all files.
By default, Google Drive will share files to all users in the domain (this
setting is recognised as the domain permission type for the file in
Google Drive). I don't really want certain files to be shared this way, but
there is no easy way recursively fix this in Google Drive, so that is why
this script is created.
@oscarruesga
oscarruesga / Vagrantfile
Created March 17, 2016 05:53
Vagrant File to deploy Confluent Plattform
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.50"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
@oscarruesga
oscarruesga / get_all_remotebrach
Last active August 18, 2016 11:13
Get all branches from a remote git repository
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
@oscarruesga
oscarruesga / docker-utils.sh
Last active December 3, 2016 21:45
Docker Utils
#! /bin/bash
# add 'source <pathToThisFile>/docker-util.sh' to ~/.bashrc. This makes this functions available in the current shell.
docker-stop-remove(){
docker stop $1 && docker rm $1
}
docker-remove-stopped(){
#docker rm $(docker ps -a -q)
docker ps -a -q | xargs docker rm
}
docker-nuke() {
for i in 1 2 3; do
docker-machine create -d virtualbox node-$i
done
eval $(docker-machine env node-1)
docker swarm init \
--advertise-addr $(docker-machine ip node-1)
docker swarm join-token -q manager
git clone https://github.com/vfarcic/go-demo.git
cd go-demo
docker-machine create -d virtualbox go-demo
docker-machine env go-demo
eval $(docker-machine env go-demo)
cd cloud-provisioning
scripts/dm-swarm.sh
eval $(docker-machine env swarm-1)
docker node ls
scripts/dm-test-swarm.sh
cd cloud-provisioning
git pull
cd terraform/aws-full
export AWS_ACCESS_KEY_ID=[...]
export AWS_SECRET_ACCESS_KEY=[...]
export DIGITALOCEAN_ACCESS_TOKEN=[...]
curl -X GET \
-H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN" \
"https://api.digitalocean.com/v2/regions" \
| jq '.'
export DIGITALOCEAN_REGION=sfo2
cd cloud-provisioning