Skip to content

Instantly share code, notes, and snippets.

View major0's full-sized avatar
🏠
Working from home

Mark Ferrell major0

🏠
Working from home
View GitHub Profile
@major0
major0 / git-rewrite-author.sh
Last active March 2, 2022 18:11
Write Author Name/Email in git's commit history.
#!/bin/sh
# git-rewrite-author.sh
#
# Rewrite git-commit author's Name/EmailAddress.
#
# Based on previous versions of this tool This version runs in POSIX compliant
# shell and .. IMHO .. cleans up a large portion of the filter logic and the
# core syntax such that is is readable and not full of back-slash escape hell.
#
# Other versions:
@major0
major0 / crash.log
Created January 9, 2019 05:38
Terraform Remote State File Triggers Memory Corruption
2019/01/08 21:22:38 [INFO] Terraform version: 0.11.11 ac4fff416318bf0915a0ab80e062a99ef3724334
2019/01/08 21:22:38 [INFO] Go runtime version: go1.11.1
2019/01/08 21:22:38 [INFO] CLI args: []string{"/home/hq.apfm.local/mark.ferrell/.local/bin/terraform", "refresh"}
2019/01/08 21:22:38 [DEBUG] Attempting to open CLI config file: /home/hq.apfm.local/mark.ferrell/.terraformrc
2019/01/08 21:22:38 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/01/08 21:22:38 [INFO] CLI command args: []string{"refresh"}
2019/01/08 21:22:39 [INFO] command: empty terraform config, returning nil
2019/01/08 21:22:39 [DEBUG] command: no data state file found for backend config
2019/01/08 21:22:39 [DEBUG] New state was assigned lineage "45be0d12-9d55-c802-b328-ceb0d9a76dbb"
2019/01/08 21:22:39 [INFO] command: backend initialized: <nil>

Keybase proof

I hereby claim:

  • I am major0 on github.
  • I am majortrips (https://keybase.io/majortrips) on keybase.
  • I have a public key ASCDTY9Puey-jbSVOeBFoEKUaPAostZ3yEXtd3AKEbNC-Qo

To claim this, I am signing this object:

@major0
major0 / glusterd-zfs-snapshots.log
Created April 14, 2017 21:23
Glusterfs snapshots on ZFS
==> gluster-zfs: Running provisioner: shell...
gluster-zfs: Running: inline script
==> gluster-zfs: Running provisioner: shell...
gluster-zfs: Running: inline script
==> gluster-zfs: Running provisioner: shell...
gluster-zfs: Running: inline script
==> gluster-zfs: Running provisioner: shell...
gluster-zfs: Running: inline script
==> gluster-zfs: Running provisioner: shell...
gluster-zfs: Running: inline script
@major0
major0 / glusterfs-btrfs.log
Last active April 13, 2017 21:23
Testing glusterfs w/ btrfs in vagrant
==> gluster-btrfs: Running provisioner: shell...
gluster-btrfs: Running: inline script
==> gluster-btrfs: btrfs-progs v4.4
==> gluster-btrfs: See http://btrfs.wiki.kernel.org for more information.
==> gluster-btrfs:
==> gluster-btrfs: Label: (null)
==> gluster-btrfs: UUID: 65a63f79-9231-4a23-842a-f78c3108410b
==> gluster-btrfs: Node size: 16384
==> gluster-btrfs: Sector size: 4096
==> gluster-btrfs: Filesystem size: 10.00GiB
@major0
major0 / git-backport.sh
Created April 11, 2017 18:10
Tool to aid back-porting a dev->topic_branch onto a release->integration branch.
#!/bin/sh
# Backport a topic-branch based on a development line back to a release branch.
# Generally this is a proof-of-concept/notes on overall process. Needs a number
# of sanity checks added before it is a real tool.
set -e
error() { echo "error: $*" >&2; }
die() { error "$*"; exit 1; }
## Update Branches
# FIXME we need to sanity check all the arguments
start="${1}" # What rev to reset the target to before merging
@major0
major0 / gist:498f83a8606d4b1c5f54
Last active August 29, 2015 14:02
Non-working git config for aiding in a PQM based workflow
[push]
default = current
[remote "origin"]
url = git@example.com:project.git
fetch = +refs/heads/master:refs/remotes/origin/master
[remote "pqm"]
url = git@example.com:project.git
fetch = +refs/heads/personal/user/pqm/*:refs/remotes/personal/user/pqm/*
[branch "master"]
remote = origin
# One of two versions of seq() borrowed from shlib and used for some benchmarks of various /bin/sh implementations
seq()
{
test "$#" -eq 1 && set -- 1 "${1}"
test "$#" -eq 2 && set -- "${1}" 1 "${2}"
test "$#" -gt 3 && die "seq: extra operand '${4}'"
if test "${2}" -gt '0'; then
while test "${1}" -le "${3}"; do
echo "${1}"
set -- "$((${1} + ${2}))" "${2}" "${3}"
@major0
major0 / gist:159c0e25d0d24fced074
Created May 16, 2014 21:16
Bash fails to call exit_handler() if an error happens in the function called within a subshell.
set -e
exit_handler() { echo "exit code: $?"; }
false() { !:; }
main()
{(
trap exit_handler 0
"$@" >> /dev/null 2>&1
)}
main "$@"