Skip to content

Instantly share code, notes, and snippets.

@addiedx44
addiedx44 / cryptography-file-formats.md
Created October 23, 2023 15:09 — forked from tuansoibk/cryptography-file-formats.md
Cryptography material conversion and verification commands
  1. Introduction
  2. Standards
  3. Common combinations
  4. Conversion
  5. Verification/Inspection
  6. Tips for recognising

Introduction

It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.

@addiedx44
addiedx44 / aws_assume_role
Created May 17, 2022 16:40 — forked from gene1wood/aws_assume_role
Workaround AWS CLI lack of support for IAM assume-role
#!/bin/bash
usage () {
cat <<DOCUMENTATIONXX
Usage : . $0 ROLE_ARN [PARENT_PROFILE_NAME]
^--- Note that this script must be sourced not executed
This tool will generate temporary credentials for an assumed role, save
those ephemeral credentials in the awscli config and set the alias of
"aaws" to use this new ephemeral awscli profile
@addiedx44
addiedx44 / gravatar.sh
Created June 20, 2016 19:35 — forked from kristopherjohnson/gravatar.sh
Download Gravatar image for an email address
curl "http://gravatar.com/avatar/$(md5 -q -s myemail@example.com)" > avatar.png
@addiedx44
addiedx44 / active_support_test_unit_pass_count.rb
Last active June 2, 2016 14:46 — forked from pmatsinopoulos/active_support_test_unit_pass_count.rb
ActiveSupport::Testing to count the Passed Tests when using Test::Unit
require 'active_support/concern'
require 'active_support/callbacks'
module ActiveSupport
module Testing
module SetupAndTeardown
module ForClassicTestUnit
# This redefinition is unfortunate but test/unit shows us no alternative.
# Doubly unfortunate: hax to support Mocha's hax.
def run(result)
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
ALEX ARSON
ALFONSE RAPISTKILLER
ANGELO BRASSKNUCKLE
ARNOLD TWATPOUNDER
AXE BURLY
BLADE SPINERIPPER
BLAKE STONE
BOARD RAZORFIST
BRANDON BEERBONG
BROCK STEAL
#MySQL Client
ln -s /Applications/MySQLWorkbench.app/Contents/Resources/mysql /usr/bin/mysql
#MySQL Dump
ln -s /Applications/MySQLWorkbench.app/Contents/Resources/mysqldump /usr/bin/mysqldump
#How to fix the "Library not loaded: libmysqlclient.18.dylib (LoadError)" error
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
-- DESCRIPTION --
If you accidentally commit a huge file, you have a problem. Sure, you can remove it from the working tree and commit,
but the file is still reachable from your history and therefore causes every clone to be as huge as the commented
binary file.
Fixing this can be very ugly, time consuming and might not even work as you wish. Luckily, this script can protect
you from committing such monsters in the first place.
It looks through the staged files (the ones that are added with the "git add"-command) and checks for their file-size.
If they are larger then the given size, the commit is aborted and you get a message telling you what file takes so