Skip to content

Instantly share code, notes, and snippets.

View fern4lvarez's full-sized avatar

Fernando Álvarez fern4lvarez

View GitHub Profile
@fern4lvarez
fern4lvarez / fetch-slow-queries.sh
Last active February 7, 2017 18:26
Download RDS slow query logs and zip it into a single file
#!/bin/bash
set -ex
instanceID=$1
date=$(date +%Y%m%d)
function downloadLog () {
local log=$1
@fern4lvarez
fern4lvarez / listening.sh
Last active April 9, 2017 13:55
What are you listening to now?
#!/usr/bin/env bash
# http://www.last.fm/api/account/create
API_KEY=""
USER=""
TRACKS=$(curl -s https://ws.audioscrobbler.com/2.0/\?method\=user.getRecentTracks\&user\=${USER}\&api_key\=${API_KEY}\&limit\=1\&format\=json)
TRACK=$(echo $TRACKS | sed 's/#//g' | jq '.recenttracks.track[0]')
elasticsearch:
image: elasticsearch:latest
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "9200:9200"
- "9300:9300"
logstash:
image: logstash:latest
command: logstash -f /etc/logstash/conf.d/logstash.conf
volumes:
@fern4lvarez
fern4lvarez / keybase.md
Last active August 29, 2015 14:23
KeyBase

Keybase proof

I hereby claim:

  • I am fern4lvarez on github.
  • I am fern4lvarez (https://keybase.io/fern4lvarez) on keybase.
  • I have a public key whose fingerprint is 9A9E 8E62 4F9E 1AEE 88CF 5C20 BB8B 0CE6 6690 29EF

To claim this, I am signing this object:

@fern4lvarez
fern4lvarez / draw.py
Created March 24, 2014 17:02
kicker tournament for cctrl
import random
import time
backend = ['mk', 'sf', 'tr', 'oh', 'rm', 'tw', 'fa', 'cl']
frontend = ['sf', 'eo', 'tr', 'oh', 'hp', 'dv', 'pe', 'fa']
teams = []
def draw(backend, frontend):
a = backend[random.randint(0, len(backend) - 1)]
@fern4lvarez
fern4lvarez / install_gitsh.sh
Last active August 29, 2015 13:56
gitsh install script for GNU/Linux OSs
#!/usr/bin/env bash
# Execute as super user
# chmod +x install_gitsh.sh
# sudo ./install_gitsh.sh
VERSION="0.9"
curl -O http://thoughtbot.github.io/gitsh/gitsh-${VERSION}.tar.gz
@fern4lvarez
fern4lvarez / Aptofile
Created January 25, 2014 22:33
Aptofile example
# This is a comment, it is echo'ed to the stdout
# Aptofile: 8 Things To Do After Installing Ubuntu 13.10
# 1. Install some extra AppIndicators (applets)
install indicator-multiload
add atareao/atareao -p my-weather-indicator
add peterlevi/ppa -p variety
install diodon diodon-plugins
@fern4lvarez
fern4lvarez / sentences.md
Last active December 20, 2016 19:36
Spanish sentences I can't find a natural translation in english
  • Eres un pesao
  • Yo es que lo flipo
  • Ya te digo
  • No me digas
  • Sin darte cuenta
  • Ya te estás rajando
  • Que no veas
  • Tú sabrás lo que haces
  • Me traes por la calle de la amargura
  • Entrar en barrena
git clone https://github.com/fern4lvarez/chatzilla.git
cd chatzilla
cctrlapp APP_NAME create python
cctrlapp APP_NAME/default push
cctrlapp APP_NAME/default deploy
@fern4lvarez
fern4lvarez / Credentials.java
Created September 27, 2012 16:09
Get credentials from addons json file
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;