Skip to content

Instantly share code, notes, and snippets.

View ianmariano's full-sized avatar

Ian Mariano ianmariano

View GitHub Profile
@ianmariano
ianmariano / pfxextract
Created March 12, 2020 12:33
pfxextract to extract unencrypted key and certs from a pfx certificate file. Copy somewhere in your path and chmod +x it.
#!/usr/bin/env bash
set -Eeuo pipefail
_usage() {
cat <<__EOF
$0 usage:
$0 [options]
@ianmariano
ianmariano / git-sync-all-upstream
Last active June 26, 2024 17:52
Sync (reset) your local and origin branches to canonical upstream branches. For when you want to hard reset everything to upstream. Add to your PATH and make executable. Do git sync-all-upstream
#!/usr/bin/env bash
set -Eeuo pipefail
_die() {
echo "$*" >&2
exit 1
}
bold=$(tput bold)
@ianmariano
ianmariano / baconscan.py
Last active September 21, 2017 17:30
little thing to scan files for urls and get you a status about them
# for the love of bacon!
# by Ian Mariano @ianmariano https://twitter.com/ianmariano https://github.com/ianmariano
#
# Free and provided AS-IS with no warranty. No license required.
#
import os
import mimetypes
import re
import sys
@ianmariano
ianmariano / git-tagrelease
Last active June 26, 2024 17:54
Quick and dirty tag and release notes git plugin. Put in path and chmod +x it. git tagrelease -h for instructions.
#!/bin/bash
VERSION="20170125"
OUTPUT_FILE="./RELEASE_NOTES.md"
usage() {
cat << __EOF
git tagrelease usage:
git tagrelease [options]
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
@ianmariano
ianmariano / genhash
Created December 4, 2014 05:35
generate a base-64 encoded sha-256 password hash with openssl on the command line
# generate an SHA-256 password hash base64 encoded
echo -n "password" | openssl dgst -sha256 -binary | openssl base64
# better yet, use pepper (suffix the password with the pepper)
echo -n "passwordpepper" | openssl dgst -sha256 -binary | openssl base64
# better yet, use salt (prefix the password with the salt)
echo -n "saltpassword" | openssl dgst -sha256 -binary | openssl base64
@ianmariano
ianmariano / cassandra-service
Last active August 29, 2015 14:10
Firing up Cassandra, OpsCenter and a DataAgent locally on OS X for development. This has some presumptions like the install locations (change to suit your purposes). This also presumes these services have already been configured and run properly without resorting to this script. Add to your path and chmod a+x it.
#!/bin/bash
CASSANDRA_HOME=/opt/apache/cassandra
OPSCENTER_HOME=/opt/apache/opscenter
CASS_LOG_DIR=$CASSANDRA_HOME/logs
CASS_LOGFILE=$CASS_LOG_DIR/system.log
CASS_PIDFILE=$CASSANDRA_HOME/cassandra.pid
OPSCENTER_LOGFILE=$CASS_LOG_DIR/opscenter.log
@ianmariano
ianmariano / install-oracle-java-8-ubuntu
Created October 26, 2014 15:43
Install Oracle Java 8 Ubuntu
sudo add-apt-repository ppa:webupd8team/java
sudo aptitude update
sudo aptitude install oracle-java8-installer oracle-java8-set-default
@ianmariano
ianmariano / nokogiri cygwin
Created October 9, 2014 15:27
nokogiri cygwin
Make sure libxml2-devel, libxslt-devel and libiconv-devel are installed:
$ gem install nokogiri -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib --with-xslt-dir=/usr/include/libxslt --with-iconv-include=/usr/include --with-iconv-lib=/usr/lib
@ianmariano
ianmariano / git-change-committer
Created June 19, 2014 21:46
Rewrite an author/committer in your git history. Place on your path and do: git change-committer name new_name new_email
#!/bin/bash
usage() {
echo "$0 usage:"
echo " $0 name new_name new_email"
exit 1
}
if [ "$#" -ne 3 ]; then
usage