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 / pdf-conversion-fun.md
Last active Nov 30, 2021
Using ImageMagick to easily: Split, Merge, Remove a page from PDF.
View pdf-conversion-fun.md

Install Required libraries:

sudo apt-get update && sudo apt-get install imagemagick gs

create directory to test commands

mkdir -p pdf_conversion/{merged,split}
cd pdf_conversion
@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 / nginx_s3_proxy.conf
Last active Feb 11, 2021
Simple Nginx Proxy to S3 Bucket Asset
View nginx_s3_proxy.conf
server {
listen 80;
listen 443 default_server ssl;
ssl on;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
server_name *.example.com;
root /var/www/vhosts/website;
@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 / 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 / MAMP-DOCK-INVISIBLE.sh
Created Mar 27, 2012
Hide or show the MAMP Pro dock icon.
View MAMP-DOCK-INVISIBLE.sh
#!/bin/bash
# Place this script in dir: /usr/bin
# Change permissions: sudo chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
#
# Ensure the MAMP 'Info.plist' file has the following entry:
# <key>LSUIElement</key>
# <string dock-visible="1">NO</string>
#
# Usage:
@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.