Skip to content

Instantly share code, notes, and snippets.

mikeguidry

Block or report user

Report or block mikeguidry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikeguidry
mikeguidry / download_docker_image.sh
Last active Jun 14, 2019
modification of moby github's download frozen image.. allows bandwidth limit, resumes properly, and does some layer caching..
View download_docker_image.sh
#!/usr/bin/env bash
BW=8
#using realpath = linux dependent i believe
HOMEDIR=`realpath ~`
LAYER_CACHE="${HOMEDIR}/.docker_layer_cache"
if [[ "$1" == "BW:"* ]]; then
NEWBW=`echo $1|cut -d: -f2`
if [ "$NEWBW" != "" ]; then
BW=$NEWBW
View gdrive_dl.sh
#!/bin/bash
#do we wanna limit bandwidth? pass argument BW:limit (ie: BW:10)
if [[ "$1" == "BW:"* ]]; then
NEWBW=`echo $1|cut -d: -f2`
if [ "$NEWBW" != "" ]; then
BW="--limit-rate=${NEWBW}k"
echo using bw limit ${NEWBW}
fi
shift
You can’t perform that action at this time.