Skip to content

Instantly share code, notes, and snippets.

View ianmariano's full-sized avatar

Ian Mariano ianmariano

View GitHub Profile
@ianmariano
ianmariano / git-sync-all-upstream
Last active October 16, 2025 00:50
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-tagrelease
Last active October 16, 2025 00:50
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]
@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-fork-sync
Last active October 16, 2025 00:55
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: