Skip to content

Instantly share code, notes, and snippets.

View akatrevorjay's full-sized avatar
🌙

Trevor Joynson akatrevorjay

🌙
View GitHub Profile
@akatrevorjay
akatrevorjay / chromium-update-nightly.sh
Last active December 16, 2015 19:39
Chromium Nightly Updater
#!/bin/bash -exv
# __________________________
# chromium-update-nightly.sh
#
# Simple updater that keeps track of partial downloads and if an update is even needed.
#
# ~trevorj 043013
#
fn="$HOME/Downloads/chrome-linux-latest.zip"
@akatrevorjay
akatrevorjay / keychain-wrapper.sh
Last active January 26, 2016 06:06
Keychain auto-spawning wrapper for SSH/GPG/whatevs
#!/bin/bash
# ___________________
# keychain-wrapper.sh
#
# -- Simple wrapper to auto-spawn keychain for a target command.
#
# * Installation via shell pipe:
#
# curl -sL https://gist.github.com/akatrevorjay/5487632/raw/keychain-wrapper.sh | bash
#
@akatrevorjay
akatrevorjay / getkwargs.sh
Last active March 23, 2017 03:20
Python-esque arguments for Bash. If you like this, check out https://github.com/akatrevorjay/bashism
#!/bin/bash -e
# ____________
# getkwargs.sh
#
# -- Gives you simple Python-esque arguments in Bash
# ie: your_function_or_script never=always sync daemon=True
#
# TODO Enhance interface with standard opts support: -p|--path[=blah]
#
# ~trevorj 05/05/2013
@akatrevorjay
akatrevorjay / google-io-2014-crawler.py
Last active August 29, 2015 13:59
Google IO 2014 Crawlers
#!/usr/bin/env python
##
## -----
## ATTN: Latest version has been moved to a repo, see: https://github.com/akatrevorjay/crawlfisher
## -----
##
## Crawls through URLs looking for goo.gl links, verifies they are IO event
## invites before saving them to sqlite.
## If it's a Youtube video watch link, also check annotations.
##

Keybase proof

I hereby claim:

  • I am akatrevorjay on github.
  • I am trevorj (https://keybase.io/trevorj) on keybase.
  • I have a public key ASDdnoVxUD5OTmamHPjWEZIIJDCFOaHFO4dcnUjKreiL8Ao

To claim this, I am signing this object:

#!/usr/bin/env ruby
require 'erb'
bootlocalsh = %Q(#/bin/bash
sudo umount /Users
sudo /usr/local/etc/init.d/nfs-client start
sudo mount -t nfs -o noacl,async <%= vboxnet_ip %>:/Users /Users
)
@akatrevorjay
akatrevorjay / docker-machine-wrapper.sh
Last active November 5, 2015 23:56
Wrapper for docker and docker-compose commands to use a specific env if one is not in env
#!/bin/bash -eo pipefail
# ______________________
# docker-machine-wrapper: Wraps a command with your docker-machine dev environment
#
# * Put a directory in the beginning of $PATH somewhere in your shell init,
# ala ~/.bashrc, with a line such as the following at the end of the file:
#
# export PATH="$HOME/.bin:$PATH"
#
# Then save this file as "$HOME/.bin/docker". You can symlink it to the same
@akatrevorjay
akatrevorjay / setuptools_parse_all_requirements.py
Last active February 12, 2020 19:25
Parse a glob of requirements file(s) to fill in your requirements for you, or just as a generic parser.
import glob
import itertools
import os
# This is getting ridiculous
try:
from pip._internal.req import parse_requirements
from pip._internal.network.session import PipSession
except ImportError:
try:
@akatrevorjay
akatrevorjay / python-fuse-basic-passthrough.py
Created April 1, 2016 23:59
Python FUSE filesystem example (passthrough)
#!/usr/bin/env python
"""
Originally from: https://www.stavros.io/posts/python-fuse-filesystem/
All credit goes to the author, not me.
"""
from __future__ import with_statement
import os
import sys
@akatrevorjay
akatrevorjay / dd-resume.sh
Last active May 7, 2023 14:52
Resume partial dd transfer
#!/bin/bash -e
# Blocksize to truncate to and buffer by
BS=${BS:-4096}
SELF="`basename $0`"
death() { echo "$SELF:" "$@" >&2; exit 1; }
[ $# -eq 2 ] || death "Usage: $SELF original copy"
SRC="$1"; DST="$2"