Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriele Turelli CappyT

View GitHub Profile
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
@jcward
jcward / create_self_extracting_script.sh
Last active Apr 9, 2022
Quick bash script to create self-extracting .sh files /w Base64 encoded contents (e.g. binary, zip, etc)
View create_self_extracting_script.sh
#!/bin/bash
#
# create_self_extracting_script.sh <INPUT_FILE> [<OUTPUT_SCRIPT>]
#
# Creates a self-extracting shell script containing INPUT_FILE as Base64-encoded
# bytes. When executed, the script writes INPUT_FILE and restores its permissions.
#
# (c) Jeff Ward, 2017
# MIT License