Skip to content

Instantly share code, notes, and snippets.

View davispeixoto's full-sized avatar

Davis Peixoto davispeixoto

View GitHub Profile
@felipecwb
felipecwb / pre-commit
Last active August 29, 2015 14:22
My new git pre-commit hook after an outage.
#!/usr/bin/env bash
set -u
CRED="\033[0;31m"
CYELLOW="\033[1;33m"
CBLUE="\033[0;34m"
CGREEN="\033[0;32m"
CCYAN="\033[0;36m"
CDEFAULT="\033[0m"
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active May 25, 2024 20:19
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@thwarted
thwarted / sshpub-to-rsa
Created June 14, 2011 09:12
converts an openssh RSA public key into a format usable by openssl rsautl (if you don't have openssh 5.6 or later with ssh-keygen PEM export format)
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
import sys
import base64
import struct