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 / pdf-conversion-fun.md
Last active December 10, 2023 15:11
Using ImageMagick to easily: Split, Merge, Remove a page from PDF.

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 / 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 / nginx_s3_proxy.conf
Last active March 7, 2023 07:31
Simple Nginx Proxy to S3 Bucket Asset
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 / 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 / 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 / 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 <code@josuerodriguez.com>
//
// @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 / MAMP-DOCK-INVISIBLE.sh
Created March 27, 2012 03:53
Hide or show the MAMP Pro dock icon.
#!/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: