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 / keybase.md
Created September 15, 2019 07:26
Keybase - Verification

Keybase proof

I hereby claim:

  • I am josue on github.
  • I am josue (https://keybase.io/josue) on keybase.
  • I have a public key ASCVJPZJPCusTI54250g5hLVI7r9RmihTv9m0EAjanvD0Qo

To claim this, I am signing this object:

@josue
josue / fetch_random_user_profiles.go
Last active August 28, 2019 08:04
Golang - Fetch random user profiles and output the their emails
// Fetches random user profiles and outputs their emails.
//
// @author - Josue Rodriguez <[email protected]>
//
// @date - Aug 23, 2019
package main
import (
"encoding/json"
"flag"
@josue
josue / slackme.sh
Last active May 15, 2019 16:17
Slackme - quick send to slack hook
#!/bin/bash
function slackme {
local MESSAGE=${1}
if [ "${MESSAGE}" == "" ]; then
echo "Missing first param: slackme {message}"
return
fi
if [ "${SLACK_HOOK_URL}" == "" ]; then
@josue
josue / config.json
Last active October 18, 2018 17:42
grpc benchmark testing using ghz with kairosnet.proto
{
"host": "orchestrator:6777",
"proto": "kairosnet.proto",
"call": "kairosnet.Api.Detect",
"n": 1000,
"c": 50,
"D": "data.json"
}
@josue
josue / server.go
Last active August 4, 2023 21:23
Simple Golang HTTP server with signal capturing (ie: SIGINT/SIGTERM) & pprof debugger
/*
go build for linux:
env GOOS=linux go build -o /tmp/server server.go
run with docker:
docker run -it --rm --name test -v /tmp/server:/server -p 3000:80 -p 3001:6060 alpine /server
run pprof debugger:
go get github.com/google/pprof
pprof --seconds 30 -http=:4444 /tmp/server http://localhost:3001/debug/pprof/profile
@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 / 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 / Kairos.java
Last active May 7, 2021 13:46
Kairos - Java API wrapper
import java.io.BufferedWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.FileInputStream;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Base64;
@josue
josue / urlheaders.go
Created June 30, 2017 04:20
Golang - Get HTTP headers from given string, and/or the value from specific header key
package main
import (
"log"
"net/http"
"strings"
)
/*
Returns a map array of all available headers.
@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"