plotpipe: Simple 1D or 2D plotter reading from stdin.

This commit is contained in:
Ole Tange 2019-01-14 07:53:58 +01:00
parent 9d9e7c0e08
commit 29c59cb623
4 changed files with 92 additions and 10 deletions

View file

@ -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 \

View file

@ -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

66
plotpipe/plotpipe Executable file
View file

@ -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<datagenerator> | B<plotpipe>
=head1 DESCRIPTION
B<plotpipe> 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 <http://www.gnu.org/licenses/>.
=head1 DEPENDENCIES
B<pipeplot> uses B<gnuplot>.
=head1 SEE ALSO
B<gnuplot>
=cut
gnuplot -p -e 'plot "/dev/stdin"'

View file

@ -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 |