This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Permanently deletes the given users and resets the system to an empty state | |
# Ensure that it runs as root | |
if [ "$(id -u)" != "0" ]; then | |
echo "${0} must be run as root, or using sudo" | |
exit 1 | |
fi | |
if [ ! "${1}" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# Adds "upgrade" to `brew cask`. Accepts "--greedy" as an option. Just delegates to "reinstall" | |
# | |
#!/bin/bash | |
set -o pipefail | |
source /etc/profile | |
GREEDY="" | |
if [ "${1}" == "--greedy" ]; then GREEDY="${1}"; shift; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# Checks if the given cask needs to be upgraded. | |
# | |
#!/bin/bash | |
set -o pipefail | |
source /etc/profile | |
if [ $# -eq 0 ]; then | |
ARGS=($(brew cask list)) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# Copies a kext to a temporary location and test loading it (to make sure that all | |
# library linkages are in place). This is a standalone script because in order | |
# for a kext to be loaded, it must have ownership of root:wheel - which requires | |
# root to change. | |
# | |
# This script will call sudo on itself if it is run as non-root. | |
# | |
# In order to prevent this script for prompting for a password (i.e. for use in | |
# continuous integration or for other cases where you are too lazy to type in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -n "${SSH_CONNECTION}" ]; then | |
exec "/usr/local/bin/rmate" -w "$@" | |
else | |
exec "/usr/local/bin/mate" -w "$@" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
# Helper script that adds the ability to point to a perforce workspace using git command line | |
# | |
#!/bin/bash | |
PARENT_BRANCH="$(git branch -r -a --merged | sed -nE 's|^[ \*]+remotes/origin/(master\|branches/.*)$|\1|p')" | |
[ -n "${PARENT_BRANCH}" -a "$(echo "${PARENT_BRANCH}" | wc -l)" -eq 2 ] && { | |
PARENT_BRANCH="$(echo "${PARENT_BRANCH}" | grep -v '^master$')" | |
} | |
[ -n "${PARENT_BRANCH}" -a "$(echo "${PARENT_BRANCH}" | wc -l)" -eq 1 ] || { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function shutdown() | |
{ | |
# INSERT HERE THE COMMAND YOU WANT EXECUTE AT SHUTDOWN OR SERVICE UNLOAD | |
exit 0 | |
} | |
function startup() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default Settings (run from recovery partition before user creation) | |
cd "/Volumes/Macintosh HD" | |
curl -sSL -o data https://gist.githubusercontent.com/toonetown/c5664875177e8253a99814c6184db41b/raw | |
chroot . | |
/bin/bash data | |
exit | |
rm data | |
# First-run setup, create user, set auto-login, download folder options, Parallels Tools (if on VM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ -f "${OC_CONFIG:="${HOME}/.oc-config"}" ] || { echo "Not configured - set up ${OC_CONFIG}" >&2; exit 1; } | |
if [ "$(id -u)" != "0" ]; then OC_CONFIG="${OC_CONFIG}" sudo "${0}" "$@"; exit $?; fi | |
OC_PID="/var/run/openconnect.pid" | |
OC_LOG="/var/log/openconnect.log" | |
case "${1}" in | |
connect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
: ${BASEDIR="${HOME}/Documents/Programming"} | |
: ${MAXDEPTH=6} | |
find "${BASEDIR}" -maxdepth ${MAXDEPTH} -type f \( -name pom.xml -o -name build\.sh \) -print0 \ | |
| while read -d $'\0' _f; do | |
find "$(dirname "${_f}")" -maxdepth 1 -type d \( -name target -o -name build \) -exec tmutil addexclusion {} \; | |
done |