Skip to content

Instantly share code, notes, and snippets.

View nxtonic's full-sized avatar

Angus McMillan nxtonic

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nxtonic on github.
  • I am nxtonic (https://keybase.io/nxtonic) on keybase.
  • I have a public key whose fingerprint is 81D7 2F6A 1D14 41DF 9637 4531 1318 94C3 FC8F 88CA

To claim this, I am signing this object:

@nxtonic
nxtonic / check_internet.sh
Created May 12, 2016 00:21
a quick bash script with a notification when the internet connection is up / restored
#!/bin/bash
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
ESC=$(printf "\e"); Ys="$ESC[33m"; Ye="$ESC[0m"; Rs="$ESC[31m"; Re="$ESC[0m";
P=$(echo "$ESC[35m[${BASH_SOURCE[0]}]$ESC[0m");
before_exit () {
if ping -c 1 google.com &> /dev/null
then {
echo "$P Yay, there is internet!";