Skip to content

Instantly share code, notes, and snippets.

View fitz123's full-sized avatar

Anton Lugovoi fitz123

View GitHub Profile
@fitz123
fitz123 / vpnc-script
Last active April 18, 2018 16:30 — forked from rexroof/vpnc-script
A custom OpenConnect script to set DNS using `networksetup` on OSX, which makes it work with things that don't read from `/etc/resolv.conf`. Change by Rex: move the provided DNS servers to be first in the search path. Change by fitz123: replace path to ip command in order to use BSD-like ip system-wide
#!/bin/sh
#
# Originally part of vpnc source code:
# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
# © 2009-2012 David Woodhouse <dwmw2@infradead.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@fitz123
fitz123 / netspeed.sh
Last active February 24, 2017 16:33 — forked from joemiller/netpps.sh
#!/bin/bash
sleep_time="${1:-1}"
while read int; do
let "rx_bytes0+=$(<${int}statistics/rx_bytes)"
let "tx_bytes0+=$(<${int}statistics/tx_bytes)"
done < <(ls -d /sys/class/net/*/)
sleep $sleep_time