Skip to content

Instantly share code, notes, and snippets.

View ianmariano's full-sized avatar

Ian Mariano ianmariano

View GitHub Profile
@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 / 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-sync-all-upstream
Last active August 11, 2023 15:13
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 / git-fork-sync
Last active April 21, 2020 12:03
Syncs your repo fork with the upstream master and then pushes the synced master to origin. Presumes you have an 'upstream' remote which is from whence your fork was created. Put on your path and chmod a+x it then do: git fork-sync. Use -h for usage help.
#!/usr/bin/env bash
set -Eeuo pipefail
VERSION="20200421.1"
_usage() {
cat << __EOF
$0 usage:
@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 / solrcloud.md
Last active August 20, 2018 08:23
Setting up SolrCloud (Solr 4.6.0)

Setup SolrCloud

These instructions are for Ubuntu 13.10 x64. Each server should have a proper resolvable hostname!

Environment Setup

Java 7

sudo aptitude install openjdk-7-jre-headless java7-runtime-headless

@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 January 28, 2017 16:29
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 / aws-fingerprint
Created August 26, 2013 14:24
Get the AWS EC2 format fingerprint for an SSH private key, copy to somewhere on your path and chmod a+x it.
#!/bin/bash
usage() {
echo "$0 usage:"
echo " $0 file"
exit 1
}
if [ -z "$1" ]; then