Skip to content

Instantly share code, notes, and snippets.

View josue's full-sized avatar
:shipit:
Crushing it from 1999 to Present

Josué Rodriguez josue

:shipit:
Crushing it from 1999 to Present
View GitHub Profile
@josue
josue / kairos-api.go
Last active April 30, 2018 16:52
Golang - Kairos API
package main
import (
"flag"
"time"
"fmt"
"strings"
"net/http"
"io/ioutil"
"encoding/json"
@josue
josue / main.go
Created April 21, 2018 15:42
Golang API example using Kairos API with detect method
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
@josue
josue / es_backup_index_to_new_host.sh
Created October 3, 2014 00:55
ElasticSearch - backup production index from host (1) to host (2) with new index
#!/bin/sh
# Required: npm install elasticdump
# Usage: ./{script} {host-1} {index-to-backup} {host-2} {new-index}
ES_OLD_HOST=$1
ES_OLD_INDEX=$2
ES_NEW_HOST=$3
ES_NEW_INDEX=$4
@josue
josue / MinocaOS.sh
Created December 19, 2016 00:21
MinocaOS - Download and convert the latest (PC) IMG file to VDI (VirtualBox)
#!/bin/bash
URL="http://www.minocacorp.com/download/"
VERSION=`curl -s ${URL} | egrep '/download/Minoca-pc-[0-9]+\.zip' | sed -E 's/.+\/download\/(.*-pc-[0-9]+)\.zip.+/\1/g'`
ZIP="${VERSION}.zip"
echo "- Downloading version: $VERSION"
curl --progress-bar -o /tmp/$ZIP "$URL/$ZIP"
@josue
josue / keybase.md
Created November 17, 2016 17:44
Keybase

Keybase proof

I hereby claim:

  • I am josue on github.
  • I am josue (https://keybase.io/josue) on keybase.
  • I have a public key whose fingerprint is 6541 1A36 1AD4 7B3F DE71 BA63 0FDD C51D 0813 AEC7

To claim this, I am signing this object:

@josue
josue / docker-mysql.sh
Last active November 16, 2016 00:41
Docker: Create a persistent MySQL data-only container & attach a separate db server:
#!/bin/bash
# author: Josue Rodriguez <code@josue.io>
# (c) October 2016
display_usage_help () {
echo -e "[Usage]"
echo -e "\t${0} -c <mysql data dir> <data-only name> <server name> <server port>"
echo
echo -e "[Examples]"
@josue
josue / xdebugger.sh
Last active May 12, 2016 13:24
xdebugger - Execute php file and outputs xdebug trace and script logs to file for further analyzing.
#/bin/bash
check_xdebug_installed () {
INSTALLED=`php -m | grep xdebug`
if [ "$INSTALLED" = "" ]; then
echo "PHP extention 'xdebug' must be installed."
exit 1
fi
}
@josue
josue / diff-uniq
Created December 30, 2013 16:42
Output unique lines not common in two files.
#!/bin/sh
FILE1=$1
FILE2=$2
grep -n -v "`cat $FILE1`" $FILE2
@josue
josue / gonna.learn.today.js
Last active December 16, 2015 15:28
MESSING WITH DAVID TO SEE IF HE IS REALLY TESTING
(function(){
if(window.console && (Math.round(Math.random() * 10))<7) {
var a = (Math.round(Math.random() * 2)) % 2 ? 'background-image:url(http://i.imgur.com/hHcgxw9.gif); padding:0 0px 185px 45px; color:red;' : 'background-image:url(http://i.imgur.com/67qDKDC.gif); padding:0 0px 225px 355px; color:red;';
console.log("%c Here is a bug for you\n\n"+(new Array(18)).join("\n"),a);
}
})();
@josue
josue / cs-error.sh
Last active December 11, 2015 14:18
#!/usr/sh
curl -s http://pastebin.com/raw.php?i=gWHNJQyE
say "Happy Birthday to You, Happy Birthday to You"
say "Happy Birthday Dear Andre Castillo, Happy Birthday to You."
say "From good friends and true,"
say "From old friends and new,"
say "May good luck go with you,"
say "And happiness too."
echo "\n\nHappy Birthday Peter :)\n"