Skip to content

Instantly share code, notes, and snippets.

View sylr's full-sized avatar

Sylvain Rabot sylr

View GitHub Profile
@sylr
sylr / internet_check.sh
Last active September 23, 2020 09:24 — forked from SuperQ/internet_check.sh
A script to check internet connectivity with the node_exporter textfile
#!/usr/bin/env sh
URLS[0]="https://www.google.com"
URLS[1]="http://169.254.169.254/metadata/instance?api-version=2020-06-01" # azure internal endpoint
HEADERS[O]=""
HEADERS[1]="-H 'Metadata: true'"
OUTPUT=${OUTPUT:-/tmp/curl.prom}
SLEEP=${SLEEP:-10}
# command line can be amazing and so simple ( just a terminal! ) at the same time
# Show apps that use internet connection at the moment
lsof -P -i -n
# all parameters from latest command
!*
#edit current command line in your editor
<ctrl-x> <ctrl-e>