Skip to content

Instantly share code, notes, and snippets.

View prurigro's full-sized avatar

Kevin MacMartin prurigro

  • WilliamsNY
  • Ottawa, Canada
View GitHub Profile
@prurigro
prurigro / b64.sh
Created May 7, 2015 13:49
Wrapper to simplify base64 usage
#!/usr/bin/env bash
script_name=$(egrep -o "[^\/]*$" <<< "$0")
function help {
printf '%s\n' "Usage:"
printf '%s\n' " $script_name e input output → encode to output"
printf '%s\n' " $script_name e input → encode to stdout"
printf '%s\n' " $script_name d input output → decode to output"
printf '%s\n' " $script_name d input → decode to stdout"
@prurigro
prurigro / mkaurlive.sh
Last active August 29, 2015 14:17
Upload PKGBUILD to the AUR using burp
#!/usr/bin/env bash
user=username
# Load category from .cat, or fail if it can't be found
[[ ! -f '.cat' ]] && {
printf '%s\n' 'Error: could not find .cat' >&2
exit 1
}
category="$(<.cat)"
@prurigro
prurigro / vnotes.sh
Created March 3, 2015 13:58
Wrapper script for the Vim Notes plugin
#!/usr/bin/env bash
#
# VimNotes: Wrapper script for the Vim Notes plugin
#
# Version: 1.0
#
# Written by Kevin MacMartin <prurigro@gmail.com>
# Released under the MIT license
#
@prurigro
prurigro / browser-remote-watch.sh
Last active August 29, 2015 14:16
Reload the webpage in Firefox when the source file changes
#!/usr/bin/env bash
#
# browser-remote-watch: reload the page when the source changes
#
# Version 1.1
#
# Written by Kevin MacMartin (prurigro@gmail.com)
# Released under the MIT license
#
@prurigro
prurigro / bitprice.sh
Last active August 29, 2015 14:16
Bitcoin price grabber
#!/usr/bin/env bash
#
# bitprice - bitcoin price grabber
#
# Version 1.2
#
# By Kevin MacMartin (prurigro@gmail.com)
# Released under the MIT license
#
@prurigro
prurigro / json2weblist.js
Last active August 29, 2015 14:16
Converts json to tidy html
#!/usr/bin/env node
/*
* json2weblist: convert a heading in json to an HTML list, then tidy it up
* Version: 1.0.1
*
* Requirements:
* Node.js: http://nodejs.org/
* Tidy-HTML: http://tidy.sourceforge.net/
* * Experimental version with HTML5 support : https://github.com/w3c/tidy-html5
@prurigro
prurigro / archroot.sh
Last active June 17, 2021 22:31
An overlayfs-based chroot management script for deployable arch build environments
#!/usr/bin/env bash
#
# archroot
# An overlayfs chroot management script for deployable arch build environments
#
# Version 1.18
#
# Written by Kevin MacMartin
# Released under the MIT license
@prurigro
prurigro / contact.sh
Last active August 29, 2015 14:14
A pyCardDAV toolset wrapper for improved user experience on the command-line
#!/usr/bin/env bash
#
# Contact: A pyCardDAV toolset wrapper for improved user experience on the command-line
#
# Version 1.3.1
#
# Written by Kevin MacMartin (prurigro@gmail.com)
# Released under the MIT license
#
@prurigro
prurigro / codeget.sh
Last active August 29, 2015 14:13
A zbar wrapper utility to read barcodes from various sources
#!/usr/bin/env bash
#
# CodeGet: A zbar wrapper utility to read barcodes from various sources
#
# Version: 1.4.8
#
# Written by Kevin MacMartin and released under the MIT license
#
# Requirements:
# base64 | converts to and from base64 encoding
@prurigro
prurigro / aa-mirror-select.sh
Created November 18, 2014 12:27
(ArchAssault) Select the best set of AA mirrors
#!/usr/bin/env bash
MIRRORLIST="/etc/pacman.d/archassault-mirrorlist"
# if mirrorlist.pacnew exists, copy to mirrorlist.complete
[[ -f "${MIRRORLIST}.pacnew" ]] && mv "${MIRRORLIST}.pacnew" "${MIRRORLIST}.complete" && sed -i 's/^#//' "${MIRRORLIST}.complete"
# if mirrorlist.complete is missing, copy mirrorlist to mirrorlist.complete
if [ ! -f "${MIRRORLIST}.complete" ]; then
[[ -f "$MIRRORLIST" ]] \