Skip to content

Instantly share code, notes, and snippets.

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 Sep 15, 2019
Keybase - Verification
View keybase.md

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 Aug 28, 2019
Golang - Fetch random user profiles and output the their emails
View fetch_random_user_profiles.go
// Fetches random user profiles and outputs their emails.
//
// @author - Josue Rodriguez <code@josuerodriguez.com>
//
// @date - Aug 23, 2019
package main
import (
"encoding/json"
"flag"
@josue
josue / slackme.sh
Last active May 15, 2019
Slackme - quick send to slack hook
View slackme.sh
#!/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 Oct 18, 2018
grpc benchmark testing using ghz with kairosnet.proto
View config.json
{
"host": "orchestrator:6777",
"proto": "kairosnet.proto",
"call": "kairosnet.Api.Detect",
"n": 1000,
"c": 50,
"D": "data.json"
}
@josue
josue / server.go
Last active Dec 7, 2020
Simple Golang HTTP server with signal capturing (ie: SIGINT/SIGTERM) & pprof debugger
View server.go
/*
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 Apr 21, 2018
Golang API example using Kairos API with detect method
View main.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
@josue
josue / kairos-api.go
Last active Apr 30, 2018
Golang - Kairos API
View kairos-api.go
package main
import (
"flag"
"time"
"fmt"
"strings"
"net/http"
"io/ioutil"
"encoding/json"
@josue
josue / Kairos.java
Last active May 7, 2021
Kairos - Java API wrapper
View Kairos.java
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 Jun 30, 2017
Golang - Get HTTP headers from given string, and/or the value from specific header key
View urlheaders.go
package main
import (
"log"
"net/http"
"strings"
)
/*
Returns a map array of all available headers.
@josue
josue / MinocaOS.sh
Created Dec 19, 2016
MinocaOS - Download and convert the latest (PC) IMG file to VDI (VirtualBox)
View MinocaOS.sh
#!/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"