Skip to content

Instantly share code, notes, and snippets.

@coreone
coreone / fill_disk.sh
Created August 24, 2021 13:47
Script to fill a path with 32G files
#!/bin/bash
function usage() {
echo "usage: $0 <path> <total size in GB>"
}
if [ -z "$1" ]; then
usage
exit 1
fi

Keybase proof

I hereby claim:

  • I am coreone on github.
  • I am ateixeira (https://keybase.io/ateixeira) on keybase.
  • I have a public key whose fingerprint is D8F2 529A 2F6C 40E2 9FE4 8EDC 5B81 AED5 0E9A 3259

To claim this, I am signing this object:

#!/bin/bash
if [ -z "${1}" ]; then
PROG=$( basename $0 )
echo "usage: ${PROG} <Google token>"
exit 1
fi
token="${1}"
curl -H 'Accept: application/json' https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=${token}
#!/bin/bash
if [ -z "${1}" ]; then
PROG=$( basename $0 )
echo "usage: ${PROG} <JSON account file>"
exit 1
fi
keyfile="${1}"
client_email=$( jq -r '.client_email' $keyfile )
@coreone
coreone / fixDocker.sh
Created January 14, 2016 20:26
Fix Docker route on Mac after a VPN session
#!/bin/bash
NETRANGE='10.255.0.0/24'
VBOXINF=$( ifconfig | grep vboxnet | grep '<UP' | awk -F':' '{print $1}' )
netstat -rn | grep -q '^10\.255'
if [ $? -eq 0 ]; then
echo "route already exists"