Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: housemaister/shell-scripts
base: 730f4d9455
...
head fork: housemaister/shell-scripts
compare: 3aa96cee09
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 30 additions and 2 deletions.
  1. +24 −0 net/generate_graph
  2. +6 −2 net/netspeed
View
24 net/generate_graph
@@ -0,0 +1,24 @@
+#!/bin/bash
+# gnuplot script file for plotting bandwidth over time
+
+
+/usr/bin/gnuplot <<EOF
+reset
+set terminal png
+
+set xdata time
+set timefmt "%s.%N"
+set format x "%H:%M"
+set output "$2"
+
+set xlabel "time"
+set ylabel "kbytes/s"
+
+set title "eth0 network speed"
+set key below
+set grid
+
+plot "$1" using 1:2 smooth unique title "tx" \
+ ,"" using 1:3 smooth unique title "rx"
+EOF
+
View
8 net/netspeed
@@ -3,8 +3,9 @@
raw=0
kb=0
byte=0
+frequency=1
-while getopts ":rkbi:" opt; do
+while getopts ":rkbf:i:" opt; do
case $opt in
r)
raw=1
@@ -18,6 +19,9 @@ while getopts ":rkbi:" opt; do
i)
IF=$OPTARG
;;
+ f)
+ frequency=$OPTARG
+ ;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
@@ -48,7 +52,7 @@ do
R1=$R2
T1=$T2
OLDTIMESTAMP=$TIMESTAMP
- sleep 1
+ sleep $frequency
R2=`cat /sys/class/net/$IF/statistics/rx_bytes`
T2=`cat /sys/class/net/$IF/statistics/tx_bytes`
TIMESTAMP=`date +%s.%N`

No commit comments for this range

Something went wrong with that request. Please try again.