Skip to content

Instantly share code, notes, and snippets.

@rivetmichael
rivetmichael / gist:a7bbca38371b4533229f42a75b034232
Created July 3, 2019 09:48
check that a key and pem / cert are valid
# run these 2 commands
openssl rsa -noout -modulus -in your.key | openssl md5
openssl x509 -noout -modulus -in your.pem | openssl md5
# compare the results, if they match, the key and pem/cert are working together !
@rivetmichael
rivetmichael / instructions.md
Created October 25, 2018 15:40 — forked from douglasmiranda/instructions.md
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret > keybase-private.key
@rivetmichael
rivetmichael / snippets.md
Last active February 28, 2016 01:00
Docker snippet

Backing up data from data container

$ docker run --rm --volumes-from [DATA_CONTAINER_NAME] -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar [/path/to/the/data/to/backup]

Restoring data to data container

$ docker run --rm --volumes-from [DATA_CONTAINER_NAME] -v $(pwd):/backup ubuntu bash -c "cd [/path/to/datadir] && tar xvf /backup/backup.tar --strip 1"
@rivetmichael
rivetmichael / gist:eaf907fe20226b46b798
Created December 8, 2015 09:29 — forked from astorm/gist:2572772
Magento's Tax Calculation Based On setting

Info here is based on a Magento CE 1.6.1 install. Your version may vary. Also, there's lots of conjecture on my part near the end, so DANGER WILL ROBINSON.

Configuration setting is located at

System -> Configuration -> Tax -> Calculation Settings

Label is "Tax Calculation Method Based On"

Possible Settings are

# Enabling copy / paste in tmux¬
set-option -g default-command "reattach-to-user-namespace -l zsh"¬
# Enabling mouse support¬
set -g mode-mouse on¬
set -g mouse-resize-pane on¬
set -g mouse-select-pane on¬
set -g mouse-select-window on¬
# set-window-option -g mode-mouse on¬
set -g @plugin 'tmux-plugins/tmux-resurrect'¬
@rivetmichael
rivetmichael / gist:245833c1e16a89604adb
Created October 12, 2015 07:56
Useful Magento snippets
snippet help
Mage::helper('${1}')
snippet app
Mage::app()
snippet model
Mage::getModel('${1}')
snippet single
Mage::getSingleton('${1}')
snippet sess
Mage::getSingleton('${1}/session')
@rivetmichael
rivetmichael / profiler_new_vs_reflection.php
Created September 15, 2015 08:10
A simple comparison between reflection instantiation and new object instantiation
<?php
require __DIR__ . '/app/bootstrap.php';
$config = [
'drivers' => [
[
'output' => [
'type' => 'html',
'thresholds' => [
'sum' => 0

Keybase proof

I hereby claim:

  • I am rivetmichael on github.
  • I am michael_r (https://keybase.io/michael_r) on keybase.
  • I have a public key whose fingerprint is 876C 1522 5C46 61C4 2F02 D74B 8138 3A29 56BC 996B

To claim this, I am signing this object: