From 29c59cb62397b36d2747e562dbc3dbaa78f5cccd Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Mon, 14 Jan 2019 07:53:58 +0100 Subject: [PATCH] plotpipe: Simple 1D or 2D plotter reading from stdin. --- Makefile | 11 ++--- duplicate-packets/duplicate-packets | 21 +++++++-- plotpipe/plotpipe | 66 +++++++++++++++++++++++++++++ vid/vid | 4 +- 4 files changed, 92 insertions(+), 10 deletions(-) create mode 100755 plotpipe/plotpipe diff --git a/Makefile b/Makefile index acd8a63..2078290 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ CMD = blink bsearch duplicate-packets em encdir field forever G \ gitnext gitundo goodpasswd histogram mtrr mirrorpdf neno off \ - pdfman puniq ramusage rand rclean rina rn rrm shython \ - sound-reload stdout swapout T timestamp tracefile transpose \ - upsidedown vid w4it-for-port-open wifi-reload wssh ytv yyyymmdd + pdfman plotpipe puniq ramusage rand rclean rina rn rrm \ + shython sound-reload stdout swapout T timestamp tracefile \ + transpose upsidedown vid w4it-for-port-open wifi-reload wssh \ + ytv yyyymmdd all: blink/blink.1 bsearch/bsearch.1 encdir/encdir.1 G/G.1 \ gitnext/gitnext.1 gitundo/gitundo.1 goodpasswd/goodpasswd.1 \ histogram/histogram.1 mirrorpdf/mirrorpdf.1 neno/neno.1 \ - off/off.1 pdfman/pdfman.1 puniq/puniq.1 rand/rand.1 \ - rina/rina.1 rn/rn.1 rrm/rrm.1 shython/shython.1 \ + off/off.1 pdfman/pdfman.1 plotpipe/plotpipe.1 puniq/puniq.1 \ + rand/rand.1 rina/rina.1 rn/rn.1 rrm/rrm.1 shython/shython.1 \ sound-reload/sound-reload.1 stdout/stdout.1 \ timestamp/timestamp.1 tracefile/tracefile.1 \ transpose/transpose.1 T/T.1 upsidedown/upsidedown.1 vid/vid.1 \ diff --git a/duplicate-packets/duplicate-packets b/duplicate-packets/duplicate-packets index eeced38..0990c7e 100755 --- a/duplicate-packets/duplicate-packets +++ b/duplicate-packets/duplicate-packets @@ -1,7 +1,22 @@ #!/bin/bash -IF=wls1 -sudo tc qdisc del dev $IF root netem duplicate 50 -sudo tc qdisc add dev $IF root netem duplicate 50 + +doit() { + IF=$1 + adddel=$2 + sudo tc qdisc $adddel dev $IF root netem duplicate 50 +} +del() { + doit $1 del +} +add() { + doit $1 add +} + +. `which env_parallel.bash` +ifconfig -a | + perl -ne '/^(\S+):/ and print "$1\n"' | + env_parallel 'del {}; add {}' + #sudo tc qdisc del dev $IF root netem duplicate 100% delay 300ms #sudo tc qdisc add dev $IF root netem duplicate 100% delay 300ms diff --git a/plotpipe/plotpipe b/plotpipe/plotpipe new file mode 100755 index 0000000..43fe9a2 --- /dev/null +++ b/plotpipe/plotpipe @@ -0,0 +1,66 @@ +#!/bin/bash + +#!/bin/bash + +: <<=cut +=pod + +=head1 NAME + +plotpipe - Plot 1D-data or 2D-data from a pipe + + +=head1 SYNOPSIS + +I | B + + +=head1 DESCRIPTION + +B is a simple wrapper for GNUPlot to simply plot 1D and 2D-data. + + +=head1 EXAMPLE + +Plot the points (1,101) .. (100,200): + + paste <(seq 100) <(seq 101 200) | plotpipe + + +=head1 AUTHOR + +Copyright (C) 2019 Ole Tange, +http://ole.tange.dk and Free Software Foundation, Inc. + + +=head1 LICENSE + +Copyright (C) 2012 Free Software Foundation, Inc. + +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 3 of the License, or +at your option any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +=head1 DEPENDENCIES + +B uses B. + + +=head1 SEE ALSO + +B + + +=cut + +gnuplot -p -e 'plot "/dev/stdin"' diff --git a/vid/vid b/vid/vid index 5e0cf18..2236465 100755 --- a/vid/vid +++ b/vid/vid @@ -95,11 +95,11 @@ update_list() { (cd "$full_path_vidlist_dir" && # Find video files, print them with size prepended ionice -c 3 find . -iregex \ - '.*\(webm\|rm\|mov\|mpg\|mpeg\|asf\|avi\|wmv\|flv\|mp4\|3gp\)$' \ + '.*\(webm\|rm\|mkv\|mov\|mpg\|mpeg\|asf\|avi\|wmv\|flv\|mp4\|3gp\)$' \ -type f -printf '%s\t%p\n' || # If ionice -c 3 fails, try without find . -iregex \ - '.*\(webm\|rm\|mov\|mpg\|mpeg\|asf\|avi\|wmv\|flv\|mp4\|3gp\)$' \ + '.*\(webm\|rm\|mkv\|mov\|mpg\|mpeg\|asf\|avi\|wmv\|flv\|mp4\|3gp\)$' \ -type f -printf '%s\t%p\n') | # Sort by size sort -rn |