Skip to content

Instantly share code, notes, and snippets.

View noecker's full-sized avatar

Tony Noecker noecker

  • Omaha, NE
  • 08:22 (UTC -05:00)
View GitHub Profile
@aspyatkin
aspyatkin / generate_csr.rb
Last active October 7, 2023 18:20
Generate X509 CSR with SAN extension in Ruby
require 'openssl'
# Generate X509 CSR (certificate signing request) with SAN (Subject Alternative Name) extension and sign it with the RSA key
def generate_csr(common_name, organization, country, state_name, locality, domain_list)
# create signing key
signing_key = OpenSSL::PKey::RSA.new 2048
# create certificate subject
subject = OpenSSL::X509::Name.new [
['CN', common_name],
@Pross
Pross / functions.php
Last active December 14, 2015 10:19
Delete transients older than 7 days.
<?php
class PurgeTransients {
var $expire = '7 days';
function __construct(){
add_action( 'admin_init', array( &$this, 'init' ) );
}
function init(){
$this->purge( $this->expire );
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@mitfik
mitfik / ruby_csr_example.rb
Created February 27, 2012 10:13
Ruby example of CSR with openssl
require 'openssl'
def gen_key(name)
key = OpenSSL::PKey::RSA.new 1048
file = File.new(name, "w")
file.write(key)
file.close
end
def get_key(name)