Skip to content

Instantly share code, notes, and snippets.

0x8da8100730cf130ea1395ba945fa1767b2d10f72
@genaromadrid
genaromadrid / route_translator.rb
Last active December 9, 2016 17:21
A really small library to translate routes for better SEO
class RouteTranslator
def self.routes(rails_router, &block)
RouteTranslator.new(rails_router).instance_eval(&block)
end
def initialize(rails_router)
@rails_router = rails_router
end
@genaromadrid
genaromadrid / ca_validation.sh
Last active May 12, 2016 04:38
Validate a Certificate against a Certificate Authority using OpenSSL
#!/usr/bin/env bash
set -o errexit
set -o pipefail
cer=null
root_ca=null
usage ()
{
@genaromadrid
genaromadrid / ca_validation.md
Last active January 29, 2024 11:38
Validate a Certificate against a Certificate Authority using OpenSSL

Certificate CA Validation

The easy way

To validate a certificate agains a certificate authority you just have to run

openssl verify -trusted ca_root.pem -untrusted intermediate_ca.pem certificate.pem

You'll see a 'OK' message at the end of the output

Verifying I am +genaromadrid on my passcard. https://onename.com/genaromadrid
@genaromadrid
genaromadrid / bin_hex_functions
Created February 3, 2015 18:09
Binary & hex conversion functions
def bin_to_hex(s)
s.scrub.unpack('H*').first
end
def hex_to_bin(s)
s.scan(/../).map { |x| x.hex }.pack('c*')
end