Skip to content

Instantly share code, notes, and snippets.

@TemporaryJam
TemporaryJam / Howto convert a PFX to a seperate .key & .crt file
Last active April 4, 2024 10:52
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@TemporaryJam
TemporaryJam / Install AMQP for PHP
Last active June 17, 2021 10:19
How to install the PHP AMQP library
#install cmake
yum install cmake
#install libtool
yum install libtool
#install a perl pkgconfig requirement
yum install perl-ExtUtils-PkgConfig.noarch
#get rabbitmq-c library
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><![CDATA[ACER Discover]]></title>
<link>https://www.acer.org/discover</link>
@TemporaryJam
TemporaryJam / detect-click-outside.js
Created July 21, 2015 06:17
Detect a click outside of an element
$(document).click(function(event) {
if(!$(event.target).closest('#id-of-thing-youre-detecting-the-click-outside-of').length) {
//close something or do something
}
});
@TemporaryJam
TemporaryJam / forms.js
Last active June 3, 2019 03:42
Get comma separated list of forms from FormAssembly
names = $('.form-name');
ids = $('.slds-text-heading--label');
mod = $('.slds-grid + .slds-text-body--small');
//Add <pre id="target"></pre> near top of page
$('#target').text('');
for (var i = 0; i < names.length; i++) {
$('#target').text($('#target').text() + $(names[i]).text().trim() + ', ' + $(ids[i]).text().trim() + ', ' + $(mod[i]).text().trim() + '\n');
}
@TemporaryJam
TemporaryJam / extension_end_script.patch
Last active June 3, 2019 03:41
Stop ExpressionEngine nested hook calls from failing when using the end_script flag in a nested call.
From 2c06ccd60184aeb56e13692b42559247c552265a Mon Sep 17 00:00:00 2001
Date: Fri, 4 May 2018 16:19:02 +1000
Subject: [PATCH] Patching EE extension bug where a nested call to extensions
and use of end_script will exit all currently running hooks instead of just
the current one
---
public/system/ee/legacy/libraries/Extensions.php | 33 +++++++++++++++++++++---
1 file changed, 29 insertions(+), 4 deletions(-)
@TemporaryJam
TemporaryJam / radios-and-checkboxes.html
Created May 16, 2019 23:24
Accessible custom styled radios and checkboxes - 100% CSS IE10+
<!DOCTYPE html>
<head>
<title>A11y radios</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
.section input[type="radio"],
.section input[type="checkbox"]{
https://stackoverflow.com/questions/38194032/how-to-update-ruby-version-2-0-0-to-the-latest-version-in-mac-osx-yosemite#
$ brew update
$ brew install rbenv ruby-build
$ rbenv init
rbenv install --list
rbenv install 2.4.4
rbenv global 2.4.4
rbenv rehash
@TemporaryJam
TemporaryJam / Remove BOM linux
Created September 29, 2013 12:55
How to remove the byte order mark (BOM) from a file on Linux CLI
tail --bytes=+4 text.txt > text_no_bom.txt
@TemporaryJam
TemporaryJam / Gluster (Glusterfs) setup and install
Last active March 10, 2016 20:54
Gluster (Glusterfs) setup and install
#http://www.gluster.org
#nathan's notes https://gist.github.com/f58f3aa963f2165a0caa
#install gluster repo
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
#create brick directory
[root@re-sw-cen-web1 ~]# mkdir -p /gluster/var-www-html
#install client & server software