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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu -o pipefail | |
export CERT_URL='https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/unclass-certificates_pkcs7_DoD.zip' | |
# Download & Extract DoD root certificates | |
cd ~/Downloads/ || exit 1 | |
/usr/bin/curl -LOJ "${CERT_URL}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$EUID" -ne 0 ] ; then | |
echo "Please run this installer as root (sudo -Hs)" | |
exit | |
fi | |
set +x | |
function step() { | |
echo "$@" "($((++n)) of 8)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALEX ARSON | |
ALFONSE RAPISTKILLER | |
ANGELO BRASSKNUCKLE | |
ARNOLD TWATPOUNDER | |
AXE BURLY | |
BLADE SPINERIPPER | |
BLAKE STONE | |
BOARD RAZORFIST | |
BRANDON BEERBONG | |
BROCK STEAL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the nuclear option. Use with extreme care | |
# Works up to and including Mountain Lion (10.8.x) | |
# Show all extended attributes | |
ls -lOe ~/dir-to-fix | |
# Remove no-change attributes | |
sudo chflags nouchg ~/dir-to-fix | |
# Recursively clear all entended attributes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs the last command with sudo if you curse at your terminal. | |
# | |
# $ whoami | |
# adam | |
# $ how about now, motherfucker? | |
# root | |
# | |
debug_trap () { | |
re="(fuck|shit)" | |
if [[ $BASH_COMMAND =~ $re ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $1 below refers to whatever filename you want removed from the repository | |
git filter-branch --index-filter "git rm --cached --ignore-unmatch $1" --prune-empty -- --all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo du -h / 2>/dev/null | grep '^\([0-9.]*G\|[0-9]\{3,\}M\)' | sort -h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kill -9 $(ps -ef | tail -n +2 | awk '{ print $2 }' | while read line; do echo "$RANDOM $line"; done | sort | awk '{ print $2 }' | head -n 1) |
NewerOlder