$ wpa_passphrase > .config
$ iw dev link $ iw dev scan
| ip -o a | grep wlp | grep "inet " | grep -E "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+" -o |
| cd /tmp | |
| wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
| wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
| wget http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz | |
| gunzip GeoIP.dat.gz | |
| gunzip GeoLiteCity.dat.gz | |
| gunzip GeoIPASNum.dat.gz |
| # netcheck --dns google.com@8.8.8.8 --ping 8.8.8.8 --dhcp 192.168.0.1 | |
| for OPT in "$@" | |
| do | |
| case "$OPT" in | |
| --dns) | |
| d=`echo $2 | sed -e "s/@/ /"` | |
| addr=`echo $d | cut -f1 -d " "` | |
| server=`echo $d | cut -f2 -d " "` |
| version=v0.14.0 | |
| uname -m | grep v7 | |
| if [ $? -eq 0 ]; then | |
| file=node_exporter-0.14.0.linux-armv7 | |
| else | |
| file=node_exporter-0.14.0.linux-armv6 | |
| fi | |
| v=0.13.0 | |
| version=v$v | |
| file=snmp_exporter-$v.linux-amd64 | |
| service=snmp_exporter | |
| wget https://github.com/prometheus/snmp_exporter/releases/download/$version/$file.tar.gz \ | |
| -O /tmp/$file.tar.gz |
| v=0.14.0 | |
| version=v$v | |
| file=alertmanager-$v.linux-amd64 | |
| service=alertmanager | |
| wget https://github.com/prometheus/alertmanager/releases/download/$version/$file.tar.gz \ | |
| -O /tmp/$file.tar.gz | |
| systemctl is-enabled $service |
| 'use strict'; | |
| const exec = require("child_process").execSync; | |
| const fs = require("fs"); | |
| let val = ""+exec("i2cget -y 1 0x48 0x00 w"); | |
| let lsb = val.slice(2,3); | |
| let msb = val.slice(4,6); |
| v=0.17.0 | |
| version=v$v | |
| file=node_exporter-${v}.linux-amd64 | |
| service=node_exporter | |
| wget https://github.com/prometheus/node_exporter/releases/download/${version}/${file}.tar.gz \ | |
| -O /tmp/$file.tar.gz | |
| #!/bin/env bash | |
| function getName () { | |
| ip -o link | while read line | |
| do | |
| t=`echo $line | sed -e "s/^[^:]\+: \([^:]\+\):.*/\1/"` | |
| if [[ $t = "usb0" || $t =~ enp.s..u. ]]; then | |
| echo $t | |
| break | |
| fi |