|!Punctuation|!Location|!Function|\n|{{{@@...@@}}}|surrounding text|@@highlighted text@@|\n|{{{//...//}}}|surrounding text|//italicized text//|\n|{{{==...==}}}|surrounding text|==strikethrough text==|\n|{{{''...''}}}|surrounding text|''boldfaced text''|\n|{{{__...__}}}|surrounding text|__underlined text__|\n|{{{[[text|url]]}}}|around text/url pair|[[text|http://gri.gallaudet.edu/]] link to url|\n|{{{ {...} }}}|''__tripled__'' surrounding text|{{{in-line literal text}}}|\n|{{{ {...} }}}|''__tripled__'' surrounding ''__lines__''|literal block|\n|{{{<<<}}}|surrounding ''__lines__''|blockquotes|\n|{{{!}}}|at start of line|subheading|\n|{{{|...|...|}}}|line sectioned by vertical bars|table row|\n|{{{!}}}|in a table|!table heading|\n|{{{----}}}|alone on line|horizontal rule|\n|{{{*}}}|at start of line|bulleted list item|\n|{{{#}}}|at start of line|numbered list item|\nsource: Kevin Cole, January 2007
TTiddlyWiki uses Wiki style markup, a way of lightly "tagging" plain text so it can be transformed into HTML. Edit this Tiddler to see samples.\n\n! Header Samples\n!Header 1\n!!Header 2\n!!!Header 3\n!!!!Header 4\n!!!!!Header 5\n\n! Unordered Lists:\n* Lists are where it's at\n* Just use an asterisk and you're set\n** To nest lists just add more asterisks...\n***...like this\n* The circle makes a great bullet because once you've printed a list you can mark off completed items\n* You can also nest mixed list types\n## Like this\n\n! Ordered Lists\n# Ordered lists are pretty neat too\n# If you're handy with HTML and CSS you could customize the [[numbering scheme|http://www.w3schools.com/css/pr_list-style-type.asp]]\n## To nest, just add more octothorpes (pound signs)...\n### Like this\n* You can also\n** Mix list types\n*** like this\n# Pretty neat don't you think?\n\n! Tiddler links\nTo create a Tiddler link, just use mixed-case WikiWord, or use [[brackets]] for NonWikiWordLinks. This is how the GTD style [[@Action]] lists are created. \n\nNote that existing Tiddlers are in bold and empty Tiddlers are in italics. See CreatingTiddlers for details.\n\n! External Links\nYou can link to [[external sites|http://google.com]] with brackets. You can also LinkToFolders on your machine or network shares.\n\n! Images\nEdit this tiddler to see how it's done.\n[img[http://img110.echo.cx/img110/139/gorilla8nw.jpg]]\n\n!Tables\n|!th1111111111|!th2222222222|\n|>| colspan |\n| rowspan |left|\n|~| right|\n|colored| center |\n|caption|c\n\nFor a complex table example, see PeriodicTable.\n\n! Horizontal Rules\nYou can divide a tiddler into\n----\nsections by typing four dashes on a line by themselves.\n\n! Blockquotes\n<<<\nThis is how you do an extended, wrapped blockquote so you don't have to put angle quotes on every line.\n<<<\n>level 1\n>level 1\n>>level 2\n>>level 2\n>>>level 3\n>>>level 3\n>>level 2\n>level 1\n\n! Other Formatting\n''Bold''\n==Strike==\n__Underline__\n//Italic//\nSuperscript: 2^^3^^=8\nSubscript: a~~ij~~ = -a~~ji~~\n@@highlight@@\n@@color(green):green colored@@\n@@bgcolor(#ff0000):color(#ffffff):red colored@@\n
mrtg
Multi Router Traffic Grapher...implementation for tsp system
TADA on software design...\n1. Develop something that will acquire data asynchronously from the display activity, consider python and pyserial.\n2. Have the display activity acquire data from this pool. Use a bash script.\n\nThis is part of the [[Temperature Sensor Project|./tsp]]\nwe need to get the [[automatic configuration maker(s)|http://oss.oetiker.ch/mrtg/doc/cfgmaker.en.html]] working\n\n[[This series of articles tells a lot about mrtg configuration|http://www.informit.com/articles/article.aspx?p=102611&seqNum=4]]\n\nTo create the configuration try:\n{{{\n/usr/bin/cfgmaker --output=/etc/mrtg/mrtg.cfg.new -ifref=ip --global "Workdir: /var/www/mrtg/data" --global "Options[_]: growright,bits,unknaszero" --global "Weekformat[^]: V" public@localhost\n}}}\n\nDebugging test...\n{{{\nrm /var/www/htemp/logs/htemp.log && touch /var/www/htemp/logs/htemp.log && env LANG=C /usr/bin/mrtg /etc/mrtg/htemp.cfg 2>>/var/www/htemp/logs/htemp.log >> /var/www/htemp/logshtemp.log\n\n}}}\n\nClears logs every time... Monitor loggs in a different screen with:\n{{{\nwatch 'tail -10 /var/www/htemp/logs/htemp.log'\n}}}\n\ngeneral one line test...\n{{{\n for i in {1..10}; do env LANG=C /usr/bin/mrtg /etc/mrtg/htemp.cfg 2>>/var/www/htemp/logs/htemp.log >> /var/www/htemp/logshtemp.log; echo "just did "$i; done\n}}}\n\nWatch the logfile that stores the values\n{{{\nwatch 'head -10 /var/www/htemp/htemp.log'\n}}}\n\nLogfile stores in utc. To convert:\n{{{\ndate +%s\n}}}
overview
This is the thing that does the work in mrtg...\n\n file /usr/bin/rateup\n man rateup\n
[[Log File format mrtg |http://www.percom.org/2005/mrtg/logfile.html]]
Type the text for 'New Tiddler'
The command rateup is the basic gear within [[mrtg|http://www.manpagez.com/man/1/mrtg-reference/]].\n\nrateup and rrdtool\n\nGet current seconds from epoch which is how mrtg handles strings:\n{{{\necho $(date +%s)\n}}}\n\n\nReadable howto for [[mrtg snmp|http://lena.franken.de/mrtg/]]\n\n[[Original USENIX Paper|http://static.usenix.org/event/lisa98/full_papers/oetiker/oetiker.pdf]]
Here is what we are doing:\n\nssh into pbug with:\n{{{\nssh -X flint@10.0.1.45\n}}}\nbe in right directory {{{cd/var/www/htemp }}}\ntake root\nrun screen\nset up 5 screens (<alt> A C 5 times>\nin second screen monitor \n{{{\n watch 'echo $(date +%s);head -10 /var/www/htemp/htemp.log'\n}}}\n\nin third screen monitor log file.\n{{{\n watch 'tail -10 /var/www/htemp/logs/htemp.log'\n}}}\n\nin fourth screen keep this command handy \n{{{\n rm -rf /var/lock/mrtg/_etc_mrtg_htemp.cfg_l\n}}}\nor \n{{{\nrm /var/www/htemp/logs/htemp.log && touch /var/www/htemp/logs/htemp.log && rm -rf /var/lock/mrtg/_etc_mrtg_htemp.cfg_l\n}}}\n\n{{{\necho $(date +%F);echo $(date +%s); cat /var/www/htemp/htemp.data\n}}}
[[Source:|http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html]]\n\nIf you want to monitor something which does not provide data via snmp you can use some external program to do the data gathering.\n\nThe external command must return 4 lines of output:\n* Line 1 current state of the first variable, normally 'incoming bytes count'\n* Line 2 current state of the second variable, normally 'outgoing bytes count'\n* Line 3 string (in any human readable format), telling the uptime of the target.\n* Line 4 string, telling the name of the target.\n\nDepending on the type of data your script returns you might want to use the 'gauge' or 'absolute' arguments for the Options keyword.
\nAdd these lines to {{{.screenrc}}}\n\n{{{\nscreen 1\nscreen -t data 2 watch 'echo $(date +%s);head -10 /var/www/htemp/htemp.log'\nscreen -t log 3 watch 'tail -10 /var/www/htemp/logs/htemp.log'\nscreen -t log 4 watch 'echo $(date +%F);echo $(date +%s); cat /var/www/htemp/htemp.data'\nscreen 5\nscreen 6\n}}}
Steps:\n\n* build /etc/mrtg/<device>.cfg\n* run {{{indexmaker <device>.cfg --output=/var/www/<device>/<device>.html}}}\n* example:\n{{{\nindexmaker /etc/mrtg/htemp.cfg --output=/var/www/htemp/htemp.html\n}}}\n\n{{{\nindexmaker /etc/mrtg/itemp.cfg --output=/var/www/itemp/itemp.html\n}}}\n
What does this mean?\n\n{{{\nstty: standard input: Invalid argument\n}}}\n\n[[Is this the answer?|http://www.thedumbterminal.co.uk/php/knowledgebase/article/96]]\n\n
To kill the zombies try:\n\n{{{\nps aux | grep tparse |grep -v gedit | grep -v grep | tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx\nps aux | grep tparse |grep -v gedit | grep -v grep | wc -l\n}}}\n\nAparently the zombies of tempf and python are associated...\n
Here is how this temperature system works:\n\nThe [[dallas semi chip|http://docbox.flint.com:8081/tsp#overview]] is hooked to an [[arduino|]] which is running the following [[arduino code|]].\nThis code is output via the USB port to a computer running linux, using [[miniterm|]] the output is parsed and the appropriate values are extracted using the following [[code|]]\nThese values are ordered according to the [[mrtg specification|http://docbox.flint.com:8081/mrtg#mrtgTADA]] using the program [[mtemp.sh|]] in the following files:\n* \svar\swww\sotemp\sotemp.data - outside temprature\n* \svar\swww\shtemp\sitemp.data - inside house tempratures\n\nThe [[Multi Router Traffic Grapher (mrtg)|]] has two sites configured, [[\setc\smrtg\shtemp.cfg|]] and [[\setc\smrtg\sotemp.cfg|]] that use code in [[crontab|MRTGcrontab]] to update the graphs. \n\nThe following shell files are used:\n* [[tparse.sh]] - acquires and cleans the data\n* [[mtemp.sh]] - creates the temperature files\n* [[htemp.sh]] - outputs the inside temperature file\n* [[otemp.sh]] - outputs the outside temperature file.\n\nThe following log files are maintained:\n* /var/www/htemp/htemp.log - \n* /var/www/htemp/logs/htemp.log -\n\n[[Troubleshooting and Testing|MRTG_testing]]
tparse.sh\n\n{{{\n#!/bin/bash\n# pflint Tue 18 Dec 2012 07:35:16 AM EST Start Program Design\n# \nversion="0.02"\n#\ntset=$TERM\nunset TERM\n# hold environment\nexport S=$PWD\n#* move to the appropriate directorygrep '^\s#\s*' tparse.sh\n# cd ??\n#\n#* check location of vital programs, sanity check\n# timeout\n# python 2.6\n# pythhon serial\n# miniterm\n#\n#* check location of vital files, sanity check\n# ??\n#\n# Define files to be used\n# uid="" ; if [ "$uid" == "" ]; then echo "Set user id!"; exit; fi\n# passwd="" ; if [ "$passwd" == "" ]; then echo "Set user passwd!"; exit; fi\n# ??\n#\n#* function help - Help function for template basic help goes here\nfunction help(){\nclear;\necho "This is "$0" "$version\ncat $0 | grep '^## ' | sed -e 's/##//'\n# echo "This is the help function"\n## *****DOCUMENTATION*****\n## You get this documentation when you put in the wrong number of arguments...\n## The name of this program is tparse.sh, a collection of tools \n## This is released under GPL I\n## The syntax is:\n## - tparse.sh status details what the current situation is\n## - tparse.sh tempf <1-N> details a current or temperature\n## the output in Fahrenheit is delivered to the screen...\n## - tparse.sh tempc <1-N> details a current or temperature\n## the output in Centigrade is delivered to the screen...\n## - tparse.sh cleanup [test] optionally a rehearsal\n## Output is delivered to the directory you are in...\n## - tparse.sh dummy tests the dummy function\n## Output is delivered to the screen...\n## For structure information type "grep '^\s#\s*' tparse.sh"\n## :^)\n## (C) P Flint, Flint Information Technology, licensed under GPL1\n##\n# *****Documentation Loop ends here the rest is function******\n#\n} # Test: tparse.sh\n#\n#* function dummy - Rename and fill stuff in between braces\nfunction dummy(){\necho "This is the dummy function"\n} # Test:\n#\n#\n#* function status - Outputs the whole frame. Use this to troubleshoot. \nfunction status(){\necho "This is the status function to end use <ctrl> ]"\npython /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D |sed 's|\s\sx1b\s[2J|\sn|' \n} # Test:\n#\n#\n#* function tempf - Outputs only an integer\nfunction tempf(){\n# echo -n "in temp f ">> /var/www/htemp/logs/htemp.log;date >> /var/www/htemp/logs/htemp.log;\n# echo "args = "$#" var1= "$var1" var2= "$var2" var3= "$var3" ARGS= "$ARGS >> /var/www/htemp/logs/htemp.log #debug \n#debug echo -n "temp$var2 in Fahrenheit is: "\nresult=$(timeout 5 python /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D 2>/dev/null |\n while read line; \n do \n if [[ "$line" == *"temp$var2"* ]]; \n then \n echo $line; \n fi; \n done | \n rev | \n cut -d " " -f 1 | \n rev)\n# echo $result\nstty sane 2>/dev/null\ntest=$(echo $result | tr -d [:punct:])\nif ! [ "$test" -eq "$test" ] 2>/dev/null; then # is this a string or a number?\n# if [ "$test" -eq "$test" ] 2>/dev/null; then # is this a string or a number?\n # echo "error "$result # it is a string \n tempf $var2 \nelse \n echo $result | cut -d "." -f 1\nfi\n} # Test:./2tp.sh tempf 1\n#\n#* function tempc - Outputs the whole line...\nfunction tempc(){\n#debug echo $#" "$var1" "$var2" "$var3" "$ARGS \n# echo -n "temp$var2 in Centigrade is: "\nresult=$(timeout 5 python /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D 2>/dev/null |\n while read line; do if [[ "$line" == *"temp$var2"* ]]; then echo $line; fi; done | \n head -1 | \n rev | \n cut -d " " -f 3 | \n rev )\nstty sane 2>/dev/null\n# if ! [[ "$result" =~ ^[0-9]+([.][0-9]+)?$ ]] ; then\n# if [[ "$result" =~ ^[0-9]+([.][0-9]+)?$ ]] ; then\nif [ "$result" -eq "$result" ] 2>/dev/null; then\n echo "error" \n tempc $var2 \nelse \n echo $result \nfi\n} # Test:./2tp.sh tempc 1\n#\n#* function stmnth - Gives a status indication of the backup area for a paticular month...\nfunction stmnth(){\n#debug echo "This is the stmnth function"\necho "The current location is: "$PWD\nmonth=$(printf "%.2d" "$dmonth")\necho "Directories unfiled for "$(year=$(date +%y) ; echo $(date --date="$month/1/$year" +%B|tr [:upper:] [:lower:]))" are:"\n# ls -1 | grep backup | grep -e "\s-$month\s-" | grep -v "\s-$month\s-backup"\ndu -h --max-depth=1 2>/dev/null | grep backup | grep -e "\s-$month\s-" | grep -v "\s-$month\s-backup"\nspause\necho "Directories in "$PWD"/"$dname" are:"\ndu -h --max-depth=1 2>/dev/null $dname\n} # Test: tparse.sh stdmnth 11\n#\n#* function defvbl - default variables for no arguments\nfunction defvbl(){\n#debug echo "This is the defvbl function" #debug \n#debug echo $#" "$var1" "$var2" "$var3" "$ARGS #debug \ndmonth=$(date +%m) # month is the current month\ndname=$(year=$(date +%Y) ; echo $(date +%b|tr [:upper:] [:lower:]))"-"$(date +%Y)".bu" # current\necho "The month is: "$dmonth\necho "the backup location is: "$dname\n} # Test:\n#\n#\n#* function waiw - figures out which argument is which...\nfunction waiw(){\n#debug echo $#" "$var1" "$var2" "$var3" "$ARGS \n#debug echo "This is the waiw function"\nif [ "$var2" -eq "$var2" ] 2>/dev/null; then\n echo "The first variable is a number so it is the month"; dmonth=$var2; dtest=$var3\nelse\n echo " the first variable is not a number so it is the test directive"; dmonth=$var3; dtest=$var2\nfi\n#\nif [[ $dmonth -lt 1 || $dmonth -gt 12 ]]; then echo "out of range using default"; dmonth=$(date +%m); fi\nmonth=$dmonth\ndname=$(year=$(date +%Y) ; echo $(date --date="$month/1/$year" +%b|tr [:upper:] [:lower:]))"-"$(date +%Y)".bu"\necho "The month is: "$dmonth\necho "The test directive: "$dtest\necho "the backup location is: "$dname\n} # Test: tparse.sh waiw\n#\n#* function domnth - Rename and fill stuff in between braces\nfunction domnth(){\necho "This is the domnth function"\n#debug echo $#" "$var1" "$var2" "$var3" "$ARGS \n\n} # Test:\n#\n#\n#\n#* function cleanup - Cleanup function deletes all the day directories in current directory\nfunction cleanup(){\n#debug echo "This is the clean up function"\n#debug echo $#" "$var1" "$var2" "$var3" "$ARGS \n# Clean up stuff that remains in the current directory note TEST function\nvalf=$(printf "%.2d" "$dmonth"); #debug echo $dmonth $month $valf\ndirno=$(ls -1 | grep backup | grep -e "\s-$valf\s-" | grep -v "\s-$valf\s-backup" | wc -l)\n#\nif [ "$(echo $dtest | tr [:lower:] [:upper:])" == "TEST" ];\nthen\n echo "I was only kidding! We would have erased these $dirno directories:" \n du -h --max-depth=1 2>/dev/null | grep backup | grep -e "\s-$valf\s-" | grep -v "\s-$valf\s-backup" \n exit 1 \nfi\necho "we are cleaning these up now:"\n# ls -1 | grep backup | grep -e "\s-$month\s-" | grep -v "\s-$valf\s-backup"\ndu -h --max-depth=1 2>/dev/null | grep backup | grep -e "\s-$valf\s-" | grep -v "\s-$valf\s-backup" \nspause\necho "Deleting the following:"\nls -1 | grep backup | grep -e "\s-$valf\s-" | grep -v "\s-$valf\s-backup"\nls -1 | grep backup | grep -e "\s-$valf\s-" | grep -v "\s-$valf\s-backup" |xargs -I xxx rm -rf xxx\n} # Test: tparse.sh cleanup\n#\n# \n#*######################################STANDARD AND MAYBE USEFUL FUNCTIONS BELOW\n#\n#\n#\n#* function spause - A simple tarry...\nfunction spause(){\n # -t sets time\n # read -t $pt -p "$*" ans\n read -p "Hit enter to continue..." ans\n echo $ans\n}\n#\n#* function pause - Allows many ways to tarry...\nfunction pause(){\n#debug echo "Vairables in Pause are: "\n#debug echo $#" "$-e 1" "$ARGS \n # -t sets time\n # read -t $var3 -p "$*" ans$(ls -1 | grep backup |wc -l)\ncase "$ARGS" in\n "6") read -t $time -p "$prompt";;\n "5") read -p "$prompt";;\n\n "1") read;;\nesac # end of choices\n # echo $ans\n} # TESTS: tparse.sh pause; tparse.sh pause "Testing wait"; tparse.sh pause 3 "Testing 1,2,3";\n#\n#* function fwatch - Watches the end of a file indefinitely\nfunction fwatch(){\n#debug echo $#" "$var2" "$ARGS\n watch tail -20 $var2\n} # Test: tparse.sh fwatch var/log/messages\n#\n#\n#*###################################### MAIN ENTRY POINT AND COMPOUND CASE\n#\n# debug echo "tparse.sh v 0.2 starts"\n#* Evaluator Routine\n# Note the evaluator allows for many cases and error checking...\n# ARGS=$# # carries the number of args into the functions...\nif [ "$#" -eq "1" ] && [ "$1" = "status" ]; then ARGS="1"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "tempf" ]; then ARGS="2"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "tempc" ]; then ARGS="2"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "spause" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "pause" ]; then ARGS="1"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "pause" ]; then ARGS="5"; fi\nif [ "$#" -eq "3" ] && [ "$1" = "pause" ]; then ARGS="6"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "waiw" ]; then ARGS="2"; fi\nif [ "$#" -eq "3" ] && [ "$1" = "waiw" ]; then ARGS="3"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "cleanup" ]; then ARGS="7"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "cleanup" ]; then ARGS="8"; fi\nif [ "$#" -eq "3" ] && [ "$1" = "cleanup" ]; then ARGS="9"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "defvbl" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "dummy" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "help" ]; then ARGS="9"; fi\n# this tests the evaluator...\n#debug echo $#" "$1" "$2" "$3" "$ARGS \n# typical cases, be careful to make your own...\ncase "$ARGS" in\n "0") clear; cat $0 | grep '^## ' | sed -e 's/##//'; exit 1;; # got nothing, display help and go\n "1") $1 ;; # run the command\n "2") var2=$2; $1 ;; # run the command with an argument\n "3") var3=$3; var2=$2; $1 ;; # run the command with two arguments\n "4") var4=$4; var3=$3; var2=$2; $1 ;; # run the command with three arguments\n "5") prompt=$2; $1 ;; # run the command with a different argument\n "6") time=$3; prompt=$2; $1 ;; # run the command with two different arguments\n "7") defvbl; $1 ;; # run the command and default variables\n "8") var2=$2; waiw; $1 ;; # run the command and settle variables\n "9") var3=$3; var2=$2; waiw; $1 ;; # run the command and settle variables\n *) clear; cat $0 | grep '^## '| sed -e 's/##//'; exit 1;; # Anything else run help and exit...\nesac # End main loop. To TEST:\n#\n# echo " ";\necho "tparse.sh stops" >> /var/www/htemp/logs/htemp.log #debug\n#debug \n# That's all folks!!\n# Junk shop\n# if [ "$#" -eq "3" ] && [ "$1" = "get" ] && [ "$2" = "all" ]; then ARGS="7"; fi\n# "2") secs=$2; while read line ; do $1; done;; # read from a file and process\n# *) clear; cat $0 | grep '^## ' | sed -e 's/##//'; exit 1;;\n#* restore environment\ncd $S\nexport TERM=$tset\n\n}}}
mtemp.sh\n\n{{{\n#!/bin/bash\n# pflint Mon 18 Feb 2013 10:44:00 AM EST \n# \nversion="0.7"\n#\n# hold environment\nexport S=$PWD\ntset=$TERM\nunset TERM\nrm -rf /var/lock/mrtg/_etc_mrtg_htemp.cfg_l\n# pflint Sun 23 Dec 2012 01:28:59 PM EST \n# outputs mrtg compatible temperatures\n# echo "here we go"\nmsg1=$(uptime|cut -d "," -f 1| cut -d " " -f 5)\ntlog="/var/www/htemp/logs/htemp.log"\necho -n "starting mtemp.sh ">> $tlog ;date >> $tlog \n#* move to the appropriate directorygrep '^\s#\s*' mtemp.sh\ncd /var/www/htemp\n#\n#* check location of vital files and programs, sanity check\n# ??\n#\n# Define files to be used\n# uid="" ; if [ "$uid" == "" ]; then echo "Set user id!"; exit; fi\n# passwd="" ; if [ "$passwd" == "" ]; then echo "Set user passwd!"; exit; fi\n# ??\n#\n#* function help - Help function for template basic help goes here\nfunction help(){\nclear;\necho "This is "$0" "$version\ncat $0 | grep '^## ' | sed -e 's/##//'\n# echo "This is the help function"\n## *****DOCUMENTATION*****\n## You get this documentation when you put in the wrong number of arguments...\n## The name of this program is mtemp.sh, a collection of routines that \n## writes the files that the mrtg routine merely reads...\n## This is released under GPL I\n## The syntax is:\n## - mtemp.sh itemp writes itemp.data with proper information \n## - mtemp.sh otemp writes otemp.data with proper information \n## - mtemp.sh kz lists and kills related zombie processes\n## - mtemp.sh dummy the test program \n## For structure information type "grep '^\s#\s*' mtemp.sh"\n## :^)\n## (C) P Flint, Barre Open Systems Institute Liscensed under GPLI\n##\n# *****Documentation Loop ends here the rest is function******\n#\n} # Test: mtemp.sh\n#\n#* function dummy - Rename and fill stuff in between braces\nfunction dummy(){\necho "This is the dummy function"\n} # Test:\n#\n#* function otemp - get outside temp data...\nfunction otemp(){\nouto="/var/www/otemp/otemp.data"\necho "resetting "$outo;rm -rf $outo; touch $outo\necho -n "parsing temp 1 (outside temp) ">> $tlog;date >> $tlog\nbin/tparse.sh tempf 1 | cut -d "." -f 1 | tee --append $outo 2>/dev/null\necho 0 | tee --append $outo 2>/dev/null\necho $msg1 | tee --append $outo 2>/dev/null\necho "Outside temperature" | tee --append $outo 2>/dev/null\n} # Test: htemp.sh itemp\n#\n#* function itemp - get inside temp data...\nfunction itemp(){\nouth="/var/www/htemp/itemp.data"\n# get house temp data...\necho "resetting "$outh;rm -rf $outh; touch $outh\necho -n "parsing temp 2 ">> $tlog;date >> $tlog\nbin/tparse.sh tempf 2 | cut -d "." -f 1 | tee --append $outh 2>/dev/null\necho -n "parsing temp 3 ">> $tlog;date >> $tlog\nbin/tparse.sh tempf 3 | cut -d "." -f 1 | tee --append $outh 2>/dev/null\necho $msg1 | tee --append $outh 2>/dev/null\necho "steam and hot water temperature" | tee --append $outh 2>/dev/null\n# echo 0\n# echo "Inside temp"\n} # Test: mtemp.sh itemp\n#\n#* function nz - enumerates all tparse zombies\nfunction nz(){\necho -n "At ";date;echo -n "the number of zombies is: "; ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l\n} # Test: htemp.sh nz\n#\n#\n#* function kz - kill all tparse zombies\nfunction kz(){\necho -n "At ";date;echo -n "the number of zombies is: "; ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l\necho -n "number of temp.sh zombies is ">> $tlog;ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l>> $tlog\nps aux | grep tparse |grep -v gedit | tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\necho -n "number of temp.sh zombies is ">> $tlog;ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l>> $tlog\nps aux | grep tparse |grep -v gedit | tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\necho -n "Now there are this number of zombies "; ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l\n} # Test: htemp.sh kz\n#\necho "mtemp.sh v "$version" starts"\n#* Evaluator Routine\n# Note the evaluator allows for many cases and error checking...\n# ARGS=$# # carries the number of args into the functions...\nif [ "$#" -eq "1" ] && [ "$1" = "itemp" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "otemp" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "kz" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "nz" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "dummy" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "help" ]; then ARGS="9"; fi\n# this tests the evaluator...\n#debug echo $#" "$1" "$2" "$3" "$ARGS \n# typical cases, be careful to make your own...\ncase "$ARGS" in\n "0") clear; cat $0 | grep '^## ' | sed -e 's/##//'; exit 1;; # got nothing, display help and go\n "1") $1 ;; # run the command\n "2") var2=$2; $1 ;; # run the command with an argument\n "3") var3=$3; var2=$2; $1 ;; # run the command with two arguments\n "4") var4=$4; var3=$3; var2=$2; $1 ;; # run the command with three arguments\n *) clear; cat $0 | grep '^## '| sed -e 's/##//'; exit 1;; # Anything else run help and exit...\nesac # End main loop. To TEST:\n#\necho -n "mtemp.sh all done ">> $tlog ;date >> $tlog \necho "mtemp.sh stops"\n#\nexport TERM=$tset\n\n}}}\n
/var/www/htemp/htemp.sh\n\n{{{\n\n}}}
/var/www/otemp/otemp.sh\n\n{{{\n#!/bin/bash\n# pflint Sun 23 Dec 2012 01:28:59 PM EST \n# outputs mrtg like temperatures\n# echo "here we go"\ntset=$TERM\nunset TERM\ncd /var/www/otemp\nout="/var/www/otemp/otemp.data"\nrm -rf /var/lock/mrtg/_etc_mrtg_otemp.cfg_l\n# echo "resetting "$out;\nrm -rf $out; touch $out\n/var/www/htemp/mtemp.sh otemp >> /var/www/htemp/logs/htemp.log\ntlog="/var/www/otemp/logs/otemp.log"\necho -n "starting otemp.sh ">> $tlog ;date >> $tlog \necho -n "starting otemp.sh ">> /var/www/otemp/logs/otemp.log;date >> /var/www/otemp/logs/otemp.log\n# get data...\ncat $out\n/var/www/otemp/mtemp.sh kz >> /var/www/htemp/logs/htemp.log\n}}}
mtsp.sh\n\n{{{\n#!/bin/bash\n# pflint Tue 18 Dec 2012 07:35:16 AM EST Start Program Design\n# pflint Tue 18 Dec 2012 07:35:16 AM EST Start Program Design\n# pflint Mon 18 Feb 2013 10:44:00 AM EST \n# pflint Wed 20 Feb 2013 07:56:17 AM EST complete re-write 0.80\n# pflint Wed 20 Feb 2013 03:50:02 PM EST complete re-write 0.85\n# pflint Thu 21 Feb 2013 04:27:47 PM EST add test functionality\n# pflint Fri 22 Feb 2013 08:06:32 AM EST edit and test\n# pflint Fri 22 Feb 2013 01:57:31 PM EST killing the wrong zombies\n# pflint Fri 01 Mar 2013 07:24:48 AM EST refactor into three systems\n# add a test output feature puts test in description field\n# pflint Sun 03 Mar 2013 05:08:32 PM EST fixed the temp function\n# pflint Tue 05 Mar 2013 10:19:59 AM EST finally, a working version but not data reporting\n# pflint Wed 06 Mar 2013 07:11:56 AM EST fix zombies combine data acquisition. Refactor temp\n# pflint Thu 07 Mar 2013 05:14:02 PM EST add btemp in desiration.\n# pflint Mon 11 Mar 2013 01:02:50 PM EDT add sample data\n# \nversion="0.1303111"\n#\n# unset term to make crontab based stuff happy\ntset=$TERM\nunset TERM\n# echo $tset\n#\n# hold environment\nexport S=$PWD\n#\n#* move to the appropriate directorygrep '^\s#\s*' mtsp.sh\ncd /var/www\n# cd ??\n#\n#* check location of vital programs, sanity check\n# timeout\n# python 2.6\n# pythhon serial\n# miniterm\n#\n#* check location of vital files, sanity check\n# ??\n#\n# Define files to be used\n# uid="" ; if [ "$uid" == "" ]; then echo "Set user id!"; exit; fi\n# passwd="" ; if [ "$passwd" == "" ]; then echo "Set user passwd!"; exit; fi\n# ??\n# hold environment\nexport S=$PWD\ntset=$TERM\nunset TERM\nrm -rf /var/lock/mrtg/_etc_mrtg_itemp.cfg_l\n# pflint Sun 23 Dec 2012 01:28:59 PM EST \n# outputs mrtg compatible temperatures\n# echo "here we go"\n# msg1=$(uptime|cut -d "," -f 1| cut -d " " -f 5)\n# msg1=$(uptime|cut -d "," -f 1 | rev |cut -d " " -f 1 | rev)\n# msg1=$(uptime|cut -d "," -f 1 | rev |cut -d " " -f 1 | rev)\n# msg1=$($(uptime|cut -d " " -f 3-6)" Hours") \n# msg1=$(uptime|cut -d " " -f 3-6;echo -n " Hours")\nmsg1=$(date +%F" "%T)\n#\n# echo -n "starting mtsp.sh "#d >> $tlog ;date #d >> $tlog \n#* move to the appropriate directorygrep '^\s#\s*' mtsp.sh\n#\n#* check location of vital files and programs, sanity check\n# ??\n#\n# Define files to be used\n# uid="" ; if [ "$uid" == "" ]; then echo "Set user id!"; exit; fi\n# passwd="" ; if [ "$passwd" == "" ]; then echo "Set user passwd!"; exit; fi\n# ??\n#\n#\n#* function help - Help function for template basic help goes here\nfunction help(){\nclear;\necho "This is "$0" version "$version\ncat $0 | grep '^## ' | sed -e 's/##//'\n# echo "This is the help function"\n## *****DOCUMENTATION*****\n## You get this documentation when you put in the wrong number of arguments...\n## The name of this program is mtsp.sh, a collection of tools \n## This is released under GPL I\n## The syntax is:\n## - mtsp.sh itemp writes itemp.data with proper information \n## - mtsp.sh otemp writes otemp.data with proper information \n## - mtsp.sh stemp writes sample data to itemp.data and otemp.data \n## - mtsp.sh btemp writes itemp.data and otemp.data to file\n## - mtsp.sh temp writes itemp.data and otemp.data \n## - mtsp.sh cit outputs itemp.data for use in mrtg\n## - mtsp.sh cot outputs otemp.data for use in mrtg\n## - mtsp.sh testo <n> tests outside *must have <n> number*\n## - mtsp.sh testi <n> tests house *must have <n> number*\n## - mtsp.sh status outputs raw data from arduino\n## - mtsp.sh tempf <1-N> details a current or temperature\n## the output in Fahrenheit is delivered to the screen...\n## - mtsp.sh tempc <1-N> details a current or temperature\n## the output in Centigrade is delivered to the screen...\n## - mtsp.sh cleanup [test] optionally a rehearsal\n## Output is delivered to the directory you are in...\n## - mtsp.sh nz numbers zombie tparse processes\n## - mtsp.sh kz lists and kills related zombie processes\n## Output is delivered to the screen...\n## - mtsp.sh status details what the current situation is\n## where n is interger number end-to-end test \n## - mtsp.sh dummy the test program \n## For structure information type "grep '^\s#\s*' mtsp.sh"\n## :^)\n## (C) P Flint, Flint Information Technology Systems, licensed under GPL1\n##\n# *****Documentation Loop ends here the rest is function******\n} # Test: mtsp.sh\n#\n#* function dummy - Rename and fill stuff in between braces\nfunction dummy(){\necho "In version "$version" This is the dummy function"\n} # Test:\n#\n#\n#\n#* function rgrph - Resets the MRTG graphs.\nfunction rgrph(){\necho "args = "$#" var1= "$var1" var2= "$var2" var3= "$var3" ARGS= " #debug\necho "In version "$version" This is the rstgrph function"\nif [ "$var2" == "irgrph" ]; then test="itemp"; fi\nif [ "$var2" == "orgrph" ]; then test="otemp"; fi\n#\necho "we are cleaning these up now:"\ndata="/var/www/$test/$test.log"\nls -1 $data\nls -1 /var/www/$test | grep "png$"|while read line; do echo "/var/www/$test/"$line; done\ntarry\n echo "Resetting: "$data\n cp /var/www/$test/$test.log /var/www/$test/obe/$(date +%F"_"%T)_$test.log;\n cut -d " " -f 1 /var/www/$test/obe/$(date +%F"_"%T)_$test.log | while read line; \n do \n echo $line" 0 0 0 0"; \n done > /var/www/$test/$test.log\n ls -1 /var/www/$test | grep "png$"|while read line; \n do \n echo " storing /var/www/$test/"$line".png"; \n mv /var/www/$test/$line /var/www/$test/obe/$(date +%F"_"%T)_$line\n done\n#\n# cp $test.log obe/$(date +%F"_"%T)_$test.log;cut -d " " -f 1 obe/$(date +%F"_"%T)_$test.log | while read line; do echo $line" 0 0 0 0"; done > $test.log\n# cut -d " " -f 1 $test.log | while read line; do echo $line" 0 0 0 0"; done | less #zero graph\n# ls -1 | grep "png$" |while read line; do mv $line obe/$(date +%F"_"%T)_$line; done\n# cp $test.log obe/$(date +%F"_"%T)_$test.log;cut -d " " -f 1 obe/$(date +%F"_"%T)_$test.log | while read line; do echo $line" 0 0 0 0"; done > $test.log\n# cut -d " " -f 1 $test.log | while read line; do echo $line" 0 0 0 0"; done | less #zero graph\n# ls -1 | grep "png$" |while read line; do mv $line obe/$(date +%F"_"%T)_$line; done\n} # Test:\n#\n#* function ct - cat temps\nfunction ct(){\n# echo "args = "$#" var1= "$var1" var2= "$var2" var3= "$var3" ARGS= " #debug \n# cit or cot? \nif [ "$var2" == "cit" ]; then test="itemp"; fi\nif [ "$var2" == "cot" ]; then test="otemp"; fi\n#\ntlog="" # sets log output to screen\ntlog=">> /var/www/$test/logs/$test.log" #debug comment out for screeen output\noutt="/var/www/$test/$test.data"\n#\n# check data...\n# echo "otemp lines are "$(wc -l $outt) # >> $tlog\n# get data...\n# cat $outt\ntail -4 $outt\n# send log\n# tolog="";tolog="echo \s"$(date +%s) Ver. $version at $(date +%T) by $0 the $var2 in ct function $test, there are $(wc -l $outt) lines in\s" $tlog";eval $tolog\nlines=$(wc -l $outt| cut -d " " -f1)\ntolog="";tolog="echo \s"$(date +%s) Version $version at $(date +%T) by $0, $lines lines from the $var2 variable $test in the ct function\s" $tlog";eval $tolog\n#\n# Acquire data...\n# /var/www/bin/mtsp.sh $test \n} # Test:\n#\n#* function temp - actually fills in either itemp.data or otemp.data\nfunction temp(){\ntest=$var2 \n# test="stemp"\ntolog=""\ntlog="" # sets log output to screen\n# tlog=">> /var/www/$test/logs/$test.log" #debug comment out for screeen output\noutt="/var/www/$test/$test.data"\n#\n#debug tolog="";tolog="echo \s"Version $version begins at $(date +%T) This is $0 resetting $outt\s" $tlog";eval $tolog\nrm -rf \svar\slock\smrtg\s*\n# /var/www/bin/mtsp.sh kz >> /var/www/zombies.log\n# rm -rf $outt; touch $outt\n#\n# send data\n#debug tolog="";tolog="echo \s"Version $version at $(date +%T) by $0 testing the $test function\s" $tlog";eval $tolog\ncase $test in\n "otemp") for tf1 in "$(/var/www/bin/mtsp.sh tempf 1 | cut -d "." -f 1 | tee --append $outt)" \s\n "$(echo 0 | tee --append $outt)" \s\n "$(echo $msg1 | tee --append $outt)" \s\n "$(echo "Outside temperature" | tee --append $outt)"\n do\n tolog="";\n # tolog="echo -e \s"\st \st \st \st \st at $(date +%T) \st\s" $tf1 $tlog" \n tolog="echo -e \s" \s" $tf1 $tlog" \n eval $tolog \n done\n ;;\n "itemp") for tf1 in "$(/var/www/bin/mtsp.sh tempf 2 | cut -d "." -f 1 | tee --append $outt)" \s\n "$(/var/www/bin/mtsp.sh tempf 3 | cut -d "." -f 1 | tee --append $outt)"\s\n "$(echo $msg1 | tee --append $outt)" \s\n "$(echo "steam and hot water temperature" | tee --append $outt)"\n do\n tolog="";\n # tolog="echo -e \s"\st \st \st at $(date +%T) \st\s" $tf1 $tlog" \n tolog="echo -e \s" \s" $tf1 $tlog" \n eval $tolog \n done\n ;;\n * ) echo "nah..."\nesac\n} # Test:mtsp.sh otemp; mtsp.sh itemp;\n#\n#\n#* function stemp - fills in sample itemp.data and otemp.data\nfunction stemp(){\ntest=$var2\nobji="itemp"\nobjo="otemp" \nouti="/var/www/$obji/$obji.data"\nouto="/var/www/$objo/$objo.data"\n#\n# set up log\ntolog=""\ntlog="" # sets log output to screen\ntlog=">> /var/www/temp.log" #debug comment out for screeen output\n#\n# tolog="";tolog="echo \s"btemp in Version $version begins at $(date +%T) This is $0 resetting $outi and $outo \s" $tlog";eval $tolog\n# rm -rf $outi; touch $outi\n# rm -rf $outo; touch $outo\n#\n# send data\nstime=$(date +%s)\ntolog="";tolog="echo \s"btemp in ver $version at $stime by $0 filling $outi & $outo \s" $tlog";eval $tolog\n# tolog="";tolog="";tolog="echo \s"testing in tlog\s" $tlog";eval $tolog\n# tolog="";tolog="echo \s"At $stime elapsed time is $(($(date +%s)-stime)) seconds\s" $tlog";eval $tolog\n# note these are executed when loaded!\nfor cmd in in "$(echo 100 | tee --append $outi)" \s\n "$(echo 100 | tee --append $outi)"\s\n "$(echo $msg1 | tee --append $outi)" \s\n "$(echo "test data ignore" | tee --append $outi)"\s\n "$(echo 100 | tee --append $outo)" \s\n "$(echo 0 | tee --append $outo)" \s\n "$(echo $msg1 | tee --append $outo)" \s\n "$(echo "test data ignore" | tee --append $outo)"\ndo\n echo $cmd >> /var/www/temp.log \n # tolog="";\n # tolog="echo -e \s"\st \st \st \st \st at $(date +%T) \st\s" $cmd $tlog" \n # tolog="$cmd $tlog" \n # eval $tolog\ndone\necho "Done at $stime elapsed time is $(($(date +%s)-stime)) seconds" >> /var/www/temp.log\n} # Test:mtsp.sh stemp\n#\n#\n#* function btemp - actually fills in both itemp.data and otemp.data\nfunction btemp(){\ntest=$var2\nobji="itemp"\nobjo="otemp" \nouti="/var/www/$obji/$obji.data"\nouto="/var/www/$objo/$objo.data"\n#\n# set up log\ntolog=""\ntlog="" # sets log output to screen\ntlog=">> /var/www/temp.log" #debug comment out for screeen output\n#\n# send data\nstime=$(date +%s)\n#\ntolog="";tolog="echo \s"btemp in ver $version at $stime by $0 filling $outi & $outo \s" $tlog";eval $tolog\n /var/www/bin/mtsp.sh tempf 1 | cut -d "." -f 1 | tee --append $outi >> /var/www/temp.log\n echo 0 | tee --append $outi >> /var/www/temp.log\n echo $msg1 | tee --append $outi >> /var/www/temp.log\n echo "Outside temperature" | tee --append $outi >> /var/www/temp.log\n /var/www/bin/mtsp.sh tempf 2 | cut -d "." -f 1 | tee --append $outo >> /var/www/temp.log\n /var/www/bin/mtsp.sh tempf 3 | cut -d "." -f 1 | tee --append $outo>> /var/www/temp.log\n echo $msg1 | tee --append $outo >> /var/www/temp.log\n echo "steam and hot water temperature" | tee --append $outo >> /var/www/temp.log\necho "Done at $stime elapsed time is $(($(date +%s)-stime)) seconds" >> /var/www/temp.log\n} # Test:\n#\n#\n#* function old-btemp - actually fills in both itemp.data and otemp.data\nfunction old-btemp(){\ntest=$var2\nobji="itemp"\nobjo="otemp" \nouti="/var/www/$obji/$obji.data"\nouto="/var/www/$objo/$objo.data"\n#\n# set up log\ntolog=""\ntlog="" # sets log output to screen\ntlog=">> /var/www/temp.log" #debug comment out for screeen output\n#\n# tolog="";tolog="echo \s"btemp in Version $version begins at $(date +%T) This is $0 resetting $outi and $outo \s" $tlog";eval $tolog\n# rm -rf $outi; touch $outi\n# rm -rf $outo; touch $outo\n#\n# send data\nstime=$(date +%s)\ntolog="";tolog="echo \s"btemp in ver $version at $stime by $0 filling $outi & $outo \s" $tlog";eval $tolog\n# tolog="";tolog="";tolog="echo \s"testing in tlog\s" $tlog";eval $tolog\n# tolog="";tolog="echo \s"At $stime elapsed time is $(($(date +%s)-stime)) seconds\s" $tlog";eval $tolog\n# note these are executed when loaded!\nfor cmd in "$(/var/www/bin/mtsp.sh tempf 1 | cut -d "." -f 1 | tee --append $outi)" \s\n "$(echo 0 | tee --append $outi)" \s\n "$(echo $msg1 | tee --append $outi)" \s\n "$(echo "Outside temperature" | tee --append $outi)" \s\n "$(/var/www/bin/mtsp.sh tempf 2 | cut -d "." -f 1 | tee --append $outo)" \s\n "$(/var/www/bin/mtsp.sh tempf 3 | cut -d "." -f 1 | tee --append $outo)"\s\n "$(echo $msg1 | tee --append $outo)" \s\n "$(echo "steam and hot water temperature" >> $outo)"\n# for cmd in \ndo\n echo $cmd >> /var/www/temp.log \n # tolog="";\n # tolog="echo -e \s"\st \st \st \st \st at $(date +%T) \st\s" $cmd $tlog" \n # tolog="$cmd $tlog" \n # eval $tolog\ndone\necho "Done at $stime elapsed time is $(($(date +%s)-stime)) seconds" >> /var/www/temp.log\n} # Test: mtsp.sh old-btemp\n#\n#\n#* function testo - tests the house all the way through\nfunction testo(){\necho "In version "$version" This is the testo function" #debug \n#debug echo "args = "$#" var1= "$var1" var2= "$var2" var3= "$var3" ARGS= " \n#\n# first name the logs..\ntlog="/var/www/otemp/logs/otemp.log"\n#\n# remove log files and reset\nrm $tlog \ntouch $tlog \n# remove lock file\nrm -rf /var/lock/mrtg/*\n#\necho "do $var2 times"\n# do this thing.\nfor i in $(eval echo {1..$var2}) \ndo \n env LANG=C /usr/bin/mrtg /etc/mrtg/otemp.cfg 2>>$tlog >> $tlog \n echo "just did otemp "$i; \ndone\n} # Test:mtsp.sh testo\n#\n#\n#* function testi - tests the house all the way through\nfunction testi(){\necho "In version "$version" This is the testi function" #debug \n#debug echo "args = "$#" var1= "$var1" var2= "$var2" var3= "$var3" ARGS= " \n#\n# first name the logs..\ntlog="/var/www/itemp/logs/itemp.log"\n#\n# remove log files and reset\nrm $tlog \ntouch $tlog \nrm -rf /var/lock/mrtg/*\n#\n# echo $var2\necho "do $var2 times"\n# do this thing.\n# for i in {1..'$var2'};\nfor i in $(eval echo {1..$var2}) \ndo \n env LANG=C /usr/bin/mrtg /etc/mrtg/itemp.cfg 2>>$tlog >> $tlog \n echo "just did itemp "$i; \ndone\n} # Test:mtsp.sh testi\n#\n#\n#* function status - Outputs the whole frame. Use this to troubleshoot. \nfunction status(){\necho "This is the status function to end use <ctrl> ]"\npython /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D |sed 's|\s\sx1b\s[2J|\sn|' \n} # Test:\n#\n#\n#* function tempf - Outputs only an integer\nfunction tempf(){\n#debug echo "args = "$#" var1= "$var1" var2= "$var2" var3= "$var3" ARGS= "$ARGS >> /var/www/itemp/logs/itemp.log result=$(timeout 5 python /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D 2>/dev/null |\n#result=$(timeout 5 python /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D 2>/dev/null |\nresult=$(python /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D 2>/dev/null |\n while read line; \n do \n if [[ "$line" == *"temp$var2"* ]]; \n then \n echo $line; \n fi; \n done | \n rev | \n cut -d " " -f 1 | \n rev)\nstty sane 2>/dev/null\ntest=$(echo $result | tr -d [:punct:])\nif ! [ "$test" -eq "$test" ] 2>/dev/null; then # is this a string or a number?\n# if [ "$test" -eq "$test" ] 2>/dev/null; then # is this a string or a number?\n # echo "error "$result # it is a string \n # add an increment variable...fix zombie\n tempf $var2 \nelse \n echo $result | cut -d "." -f 1\nfi\n} # Test:./2tp.sh tempf 1\n#\n#* function tempc - Outputs the whole line...\nfunction tempc(){\n#debug echo $#" "$var1" "$var2" "$var3" "$ARGS \n# echo -n "temp$var2 in Centigrade is: "\nresult=$(python /usr/share/doc/python-serial/examples/miniterm.py -p /dev/ttyACM0 -D 2>/dev/null |\n while read line; do if [[ "$line" == *"temp$var2"* ]]; then echo $line; fi; done | \n head -1 | \n rev | \n cut -d " " -f 3 | \n rev )\nstty sane 2>/dev/null\n# if ! [[ "$result" =~ ^[0-9]+([.][0-9]+)?$ ]] ; then\n# if [[ "$result" =~ ^[0-9]+([.][0-9]+)?$ ]] ; then\nif [ "$result" -eq "$result" ] 2>/dev/null; then\n echo "error" \n tempc $var2 \nelse \n echo $result \nfi\n} # Test:./2tp.sh tempc 1\n#\n#\n#* function nz - enumerates all tparse zombies\nfunction nz(){\n# echo "* number args: "$#" var1" "$var1" var2: "$var2" var3: "$var3" "$ARGS" #debug \nif [ $var2 ] \nthen \n zombie=$var2; echo -n "At $(date +%T) the number of $zombie zombies is: "; ps aux | grep $zombie |grep -v gedit | grep -v grep | wc -l\nelse\n for zombie in mtsp tparse python \n do\n echo -n "At $(date +%T) the number of $zombie zombies is: "; ps aux | \n grep $zombie |\n grep -v gedit | \n grep -v grep | wc -l\n done\nfi\n#echo -n "At ";date;echo -n "the number of python zombies is: "; ps aux | grep python |grep -v gedit | grep -v grep | wc -l\necho "In addition there are $(ls -1 /var/lock/mrtg | wc -l) locks"\n} # Test: itemp.sh nz\n#\n#\n#* function kz - kill all tparse zombies\nfunction kz(){\nif [ $var2 ] \nthen \n zombie=$var2; \nelse\n for zombie in mtsp tparse python \n do\n echo "At $(date +%F" "%T) the number of $zombie zombies is: $(ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l)"\n # echo -n "Now there are this number of zombies ";ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l\n done\necho "In addition there are $(ls -1 /var/lock/mrtg | wc -l) locks"\n for zombie in mtsp tparse python \n do\n ps aux | grep $zombie |grep -v gedit | grep -i temp| tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\n ps aux | grep $zombie |grep -v gedit | grep -i temp| tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\n echo "Now, at $(date +%F" "%T) the number of $zombie zombies is: $(ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l)"\n done\nfi\nrm -rf /var/lock/mrtg; echo "Now there are $(ls -1 /var/lock/mrtg | wc -l) locks"\n#\n# shoot the locks...\nrm -rf /var/lock/mrtg/*\n} # Test: itemp.sh kz\n#\n#\n#* function kz - kill all python zombies\nfunction kpz(){\nzombie="python"\necho -n "At ";date;echo -n "the number of zombies is: "; ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l\necho -n "number of temp.sh zombies is ">> $tlog;ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l>> $tlog\nps aux | grep $zombie |grep -v gedit | tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\nps aux | grep $zombie |grep -v gedit | tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\n# ps aux | grep mtsp |grep -v gedit | tr -s [:space:] |cut -d " " -f 2 |xargs -I xxx kill -9 xxx 2>/dev/null\necho -n "Now there are this number of zombies ">> $tlog;ps aux | grep tparse |grep -v gedit | grep -v grep | wc -l>> $tlog\n} # Test: itemp.sh kz\n#\n# \n#*######################################STANDARD AND MAYBE USEFUL FUNCTIONS BELOW\n#\n#\n#\n#* function tarry - A simple tarry...\nfunction tarry(){\n # -t sets time\n # read -t $pt -p "$*" ans\n read -p "Hit enter to continue..." ans\n echo $ans\n}\n#\n#* function pause - Allows many ways to tarry...\nfunction pause(){\n#debug echo "Vairables in Pause are: "\n#debug echo $#" "$-e 1" "$ARGS \n\n # -t sets time\n # read -t $var3 -p "$*" ans$(ls -1 | grep backup |wc -l)\ncase "$ARGS" in\n "6") read -t $time -p "$prompt";;\n "5") read -p "$prompt";;\n "1") read;;\nesac # end of choices\n # echo $ans\n} # TESTS: mtsp.sh pause; mtsp.sh pause "Testing wait"; mtsp.sh pause 3 "Testing 1,2,3";\n#\n#* function fwatch - Watches the end of a file indefinitely\nfunction fwatch(){\n#debug echo $#" "$var2" "$ARGS\n watch tail -20 $var2\n} # Test: mtsp.sh fwatch var/log/messages\n#\n#\n#* function cleanup - Cleanup function deletes all the day directories in current directory\nfunction cleanup(){\n# debug echo "This is the clean up function"\n# debug echo $#" "$var1" "$var2" "$var3" "$ARGS \n# Clean up stuff in logs, note TEST function\n#\nilog="/var/www/itemp/logs/itemp.log"\nolog="/var/www/otemp/logs/otemp.log"\nzlog="/var/www/zombie.log"\ntlog="/var/www/temp.log"\nif [ "$(echo $dtest | tr [:lower:] [:upper:])" == "TEST" ];\nthen\n echo "I was only kidding! We would have erased these logs:" \n for log in $ilog $olog $zlog $tlog\n do\n ls -alt $log\n done\n exit 1 \nfi\necho "we are cleaning these up now:"\n for log in $ilog $olog $zlog $tlog\n do\n ls -alt $log\n done\ntarry\n for log in $ilog $olog $zlog $tlog\n do\n echo "Resetting: "$log; rm -rf $log; touch $log;chmod 777 $ilog\n\n done\n} # Test: mtsp.sh cleanup\n#\n#\n#*###################################### MAIN ENTRY POINT AND COMPOUND CASE\n#debug echo "mtsp.sh version "$version" starts"\n#debug echo $#" "$1" "$2" "$3" "$ARGS #debug\n#\n#* Evaluator Routine\n# Note the evaluator allows for many cases and error checking...\n# ARGS=$# # carries the number of args into the functions...\nif [ "$#" -eq "1" ] && [ "$1" = "cit" ]; then ARGS="6"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "cot" ]; then ARGS="6"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "temp" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "btemp" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "itemp" ]; then ARGS="5"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "stemp" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "orgrph" ]; then ARGS="7"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "irgrph" ]; then ARGS="7"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "otemp" ]; then ARGS="5"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "twofr" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "kz" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "nz" ]; then ARGS="1"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "kz" ]; then ARGS="2"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "nz" ]; then ARGS="2"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "testo" ]; then ARGS="2"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "testo" ]; then ARGS="0"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "testi" ]; then ARGS="2"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "testi" ]; then ARGS="0"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "help" ]; then ARGS="9"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "status" ]; then ARGS="1"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "tempf" ]; then ARGS="2"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "tempc" ]; then ARGS="2"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "spause" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "pause" ]; then ARGS="1"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "pause" ]; then ARGS="5"; fi\nif [ "$#" -eq "3" ] && [ "$1" = "pause" ]; then ARGS="6"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "waiw" ]; then ARGS="2"; fi\nif [ "$#" -eq "3" ] && [ "$1" = "waiw" ]; then ARGS="3"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "cleanup" ]; then ARGS="1"; fi\nif [ "$#" -eq "2" ] && [ "$1" = "cleanup" ]; then ARGS="2"; fi\nif [ "$#" -eq "3" ] && [ "$1" = "cleanup" ]; then ARGS="3"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "dummy" ]; then ARGS="1"; fi\nif [ "$#" -eq "1" ] && [ "$1" = "help" ]; then ARGS="9"; fi\n# this tests the evaluator...\n#debug echo $#" "$1" "$2" "$3" "$ARGS \n# typical cases, be careful to make your own...\ncase "$ARGS" in\n "0") clear; cat $0 | grep '^## ' | sed -e 's/##//'; exit 1;; # got nothing, display help and go\n "1") $1 ;; # run the command\n "2") var2=$2; $1 ;; # run the command with an argument\n "3") var3=$3; var2=$2; $1 ;; # run the command with two arguments\n "4") var4=$4; var3=$3; var2=$2; $1 ;; # run the command with three arguments\n "5") var2=$1; temp ;; # run the command temp and change arguments\n "6") var2=$1; ct ;; # run the command ct and change arguments\n "7") var2=$1; rgrph ;; # run the command rgrph and change arguments\n *) clear; cat $0 | grep '^## '| sed -e 's/##//'; exit 1;; # Anything else run help and exit...\nesac # End main loop. To TEST:\n#\n# echo " ";\n#debug echo "mtsp.sh stops" # >> /var/www/itemp/logs/itemp.log #debug\n# That's all folks!!\n# Junk shop\n# if [ "$#" -eq "3" ] && [ "$1" = "get" ] && [ "$2" = "all" ]; then ARGS="7"; fi\n# "2") secs=$2; while read line ; do $1; done;; # read from a file and process\n# *) clear; cat $0 | grep '^## ' | sed -e 's/##//'; exit 1;;\n#* restore environment\ncd $S\n#d export TERM=$tset\n\n}}}
make itemp to gain peace\ndepreciate htemp.\n\n{{{\n/usr/bin/indexmaker /etc/mrtg/itemp.cfg --output /var/www/itemp/index.html\n}}}
Type the text for 'New Tiddler'\n\n{{{\n######################################################################\n# Multi Router Traffic Grapher -- Example Configuration File\n######################################################################\n# This file is for use with mrtg-2.0\n# Created by \n# /usr/bin/cfgmaker ./itemp.cfg\n### Global Config Options\n\n# for Debian\nWorkDir: /var/www/itemp\n\nEnableIPv6: no\n# Where should the logfiles, and webpages be created?\n\n# Minimal mrtg.cfg\n#--------------------\nWorkDir: /var/www/itemp \n# overrides all other settings\nHtmldir: /var/www/itemp\nImagedir: /var/www/itemp/images\nLogdir: /var/www/itemp/logs\nTitle[itemp]: Flint House Systems Temperature\nPageTop[itemp]: <H1>This Data Generated By "itemp.sh" V4</H1>\nTarget[itemp]: `/var/www/itemp/itemp.sh`\nLegend2[itemp]: `Degrees F`\nYLegend[itemp]: `Degrees F`\nShortLegend[itemp]: `Degrees F`\nMaxBytes[itemp]: 20\nAbsMax[itemp]: 200\nOptions[itemp]: nopercent,growright,expscale,gauge\nNoMib2: Yes\n#\n# Legend1[itemp]: Incoming Traffic in Bits per Second\n# Legend2[itemp]: Outgoing Traffic in Bits per Second\nLegendI[itemp]: Heat\nLegendO[itemp]: H.W.\n# Options[itemp]: gauge,growright,bits\n# Options[itemp]: nopercent,growright,expscale,gauge,noo\n# Options[itemp]: absolute\n# Options[itemp]: growright\n# Options: growright\n# make with this:\n# /usr/bin/indexmaker /etc/mrtg/itemp.cfg --output /var/www/itemp/index.html\n#\n######################################################################\n# System: Flint House Systems Temperature \n# Description: Temperature around house\n# Contact: Flint\n# Location: various\n######################################################################\n\n\n}}}
Type the text for 'New Tiddler'\n\n{{{\n######################################################################\n# Multi Router Traffic Grapher -- Example Configuration File\n######################################################################\n# This file is for use with mrtg-2.0\n# Created by \n# /usr/bin/cfgmaker ./otemp.cfg\n### Global Config Options\n\n# for Debian\nWorkDir: /var/www/otemp\n\nEnableIPv6: no\n# Where should the logfiles, and webpages be created?\n\n# Minimal mrtg.cfg\n#--------------------\nWorkDir: /var/www/otemp \n# overrides all other settings\nHtmldir: /var/www/otemp\nImagedir: /var/www/otemp/images\nLogdir: /var/www/otemp/logs\nTitle[otemp]: Flint House Outside Temperature\nPageTop[otemp]: <H1>This Data Generated By "otemp.sh" V4</H1>\nTarget[otemp]: `/var/www/otemp/otemp.sh`\nLegend2[otemp]: `Degrees F`\nYLegend[otemp]: `Degrees F`\nShortLegend[otemp]: `Degrees F`\nMaxBytes[otemp]: 20\nAbsMax[otemp]: 200\nOptions[otemp]: nopercent,growright,expscale,gauge\nLegendI[otemp]: Out\nLegendO[otemp]: \nNoMib2: Yes\n#\n# Options[otemp]: gauge,growright,bits\n# Options[otemp]: nopercent,growright,expscale,gauge,noo\n# Options[otemp]: absolute\n# Options[otemp]: growright\n# Options: growright\n# make with this:\n# /usr/bin/indexmaker /etc/mrtg/otemp.cfg --output /var/www/otemp/index.html\n#\n######################################################################\n# System: Flint House Systems Temperature \n# Description: Temperature around house\n# Contact: Flint\n# Location: various\n######################################################################\n\n\n}}}
{{{\n /var/www/bin/mtsp.sh otemp 2>>/var/www/otemp/logs/otemp.log >> /var/www/otemp/logs/otemp.log; echo "At $(date +%T) crontab otemp ends" >> /var/www/otemp/logs/otemp.log\n /var/www/bin/mtsp.sh itemp 2>>/var/www/itemp/logs/itemp.log >> /var/www/itemp/logs/itemp.log; echo "At $(date +%T) crontab itemp ends" >> /var/www/itemp/logs/itemp.log\n}}}
In each screen type\n{{{\nsudo pbug-debug.sh\n}}}\n\npbug-debug.sh\n{{{\n#!/bin/bash\n# pflint Tue 19 Feb 2013 07:46:49 AM EST \n# pbug debug environment\n# sudo bash\n# sudo ~flint/bin/pbug-debug.sh\n# Make sure only root can run our script\nif [ "$(id -u)" != "0" ]; then\n echo "This script must be run as root" 1>&2\n exit 1\nfi\ncp pds.screen .screenrc\ncd /var/www/\nscreen\n}}}\n\nNote stuff at the bottom of this .screenrc\npds.screen\n{{{\n# $Id: screenrc,v 1.15 2003/10/08 11:39:03 zal Exp $\n#\n# /etc/screenrc\n#\n# This is the flint screenrc.\n#\n# You can use this file to change the default behavior of screen system wide\n# or copy it to ~/.screenrc and use it as a starting point for your own\n# settings.\n#\n# Commands in this file are used to set options, bind screen functions to\n# keys, redefine terminal capabilities, and to automatically establish one or\n# more windows at the beginning of your screen session.\n#\n# This is not a comprehensive list of options, look at the screen manual for\n# details on everything that you can put in this file.\n#\n\n# ------------------------------------------------------------------------------\n# SCREEN SETTINGS\n# ------------------------------------------------------------------------------\n\n#startup_message off\n#nethack on\n\n#defflow on # will force screen to process ^S/^Q\ndeflogin on\n#autodetach off\n\n# turn visual bell on\nvbell on\nvbell_msg " Wuff ---- Wuff!! "\n\n# define a bigger scrollback, default is 100 lines\ndefscrollback 1024\n\n# ------------------------------------------------------------------------------\n# SCREEN KEYBINDINGS\n# ------------------------------------------------------------------------------\n\n# Remove some stupid / dangerous key bindings\nbind ^k\n#bind L\nbind ^\s\n# Make them better\nbind \s\s quit\nbind K kill\nbind I login on\nbind O login off\nbind } history\n\n# An example of a "screen scraper" which will launch urlview on the current\n# screen window\n#\n#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"\n\n# ------------------------------------------------------------------------------\n# TERMINAL SETTINGS\n# ------------------------------------------------------------------------------\n\n# The vt100 description does not mention "dl". *sigh*\ntermcapinfo vt100 dl=5\sE[M\n\n# turn sending of screen messages to hardstatus off\nhardstatus off\n# Set the hardstatus prop on gui terms to set the titlebar/icon title\ntermcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\sE]0;:fs=\s007:ds=\sE]0;\s007\n# use this for the hard status string\nhardstatus string "%h%? users: %u%?"\n\n# An alternative hardstatus to display a bar at the bottom listing the\n# windownames and highlighting the current windowname in blue. (This is only\n# enabled if there is no hardstatus setting for your terminal)\n#\n#hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"\n\n# set these terminals up to be 'optimal' instead of vt100\ntermcapinfo xterm*|linux*|rxvt*|Eterm* OP\n\n# Change the xterm initialization string from is2=\sE[!p\sE[?3;4l\sE[4l\sE>\n# (This fixes the "Aborted because of window size change" konsole symptoms found\n# in bug #134198)\ntermcapinfo xterm 'is=\sE[r\sE[m\sE[2J\sE[H\sE[?7h\sE[?1;4;6l'\n\n# To get screen to add lines to xterm's scrollback buffer, uncomment the\n# following termcapinfo line which tells xterm to use the normal screen buffer\n# (which has scrollback), not the alternate screen buffer.\n#\n#termcapinfo xterm|xterms|xs|rxvt ti@:te@\n\n# ------------------------------------------------------------------------------\n# STARTUP SCREENS\n# ------------------------------------------------------------------------------\n\n# Example of automatically running some programs in windows on screen startup.\n#\n# The following will open top in the first window, an ssh session to monkey\n# in the next window, and then open mutt and tail in windows 8 and 9\n# respectively.\n#\n# screen top\n# screen -t monkey ssh monkey\n# screen -t mail 8 mutt\n# screen -t daemon 9 tail -f /var/log/daemon.log\n#\n# pflint \n# Thu Feb 9 23:24:52 EST 2006\n# added so pine will live...\nbindkey -k k; stuff ";a"\nbindkey -k F1 stuff "as"\nbindkey -k F2 stuff ";cn"\n# the new spam key...\nbindkey -k F3 stuff "d"\n# \n# Sat Mar 4 22:25:07 EST 2006\n#\n# screen top\n# screen -t monkey ssh monkey\nscreen 1\nscreen -t itemp 2 watch 'echo $(date +%s);head -20 /var/www/itemp/itemp.log'\nscreen -t otemp 3 watch 'echo $(date +%s);head -20 /var/www/otemp/otemp.log'\n# screen -t itemp 4 watch 'tail -20 /var/www/itemp/logs/itemp.log'\n# screen -t otemp 5 watch 'tail -20 /var/www/otemp/logs/otemp.log'\nscreen -t itemp.data 4 watch 'echo $(date +%F);echo $(date +%s); tail -20 /var/www/itemp/itemp.data'\nscreen -t otemp.data 5 watch 'echo $(date +%F);echo $(date +%s); tail -20 /var/www/otemp/otemp.data'\nscreen -t itemp.log 6 watch "echo $(date +%F);echo $(date +%s); tail -20 /var/www/itemp/logs/itemp.log"\nscreen -t otemp.log 7 watch "echo $(date +%F);echo $(date +%s); tail -20 /var/www/otemp/logs/otemp.log"\nscreen 8\n# screen -t mail 8 pine\n# screen -t daemon 9 tail -f /var/log/daemon.log\n#\n# pflint \n}}}
\n{{{\n <script type="text/javascript"\nsrc="http://www.gas-cost.net/widget.php?lang=en">\n</script>\n}}}
This is not easy.\n\n[[daemontools?|http://thedjbway.b0llix.net/daemontools/envdir.html]]
crontab we have been playing with is:\n\n{{{\nSHELL=/bin/bash\nHOME=/root\nPATH=/home/flint/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin\n# m h dom mon dow command\n*/1 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/pbug.cfg 2>>/var/www/pbug/logs/pbug.log >> /var/www/pbug/logspbug.log \n*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/itemp.cfg 2>>/var/www/itemp/logs/itemp.log >> /var/www/itemp/logs/itemp.log \n*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/otemp.cfg 2>>/var/www/otemp/logs/otemp.log >> /var/www/otemp/logs/otemp.log \n# */1 * * * * . /etc/profile; /var/www/bin/mtsp.sh stemp 2>>/var/www/temp.log >> /var/www/temp.log\n*/1 * * * * . /etc/profile; /var/www/bin/btemp.sh 2>>/var/www/temp.log >> /var/www/temp.log\n*/30 * * * * /var/www/bin/mtsp.sh kz 2>>/var/www/zombie.log >> /var/www/zombie.log\n# ; echo "Killed Zombies at $(date +%F_%T)">> /var/www/otemp/logs/otemp.log \n*/1 * * * * /usr/bin/touch /var/www/foo\n\n}}}
|!Reference HTML|! Description|\n|[[Google Search|http://www.google.com/search?client=ubuntu&channel=fs&q=pyserial+capturing+periodic+serial+data&ie=utf-8&oe=utf-8]]||\n|[[Serial data in background |http://stackoverflow.com/questions/11609994/capturing-serial-data-in-background-process]]||\n|[[Pyserial Examples|http://pyserial.sourceforge.net/examples.html#wrapper-class]]||\n|[[Stack overflow background serial |http://stackoverflow.com/questions/11609994/capturing-serial-data-in-background-process]]||\n|[[pyserial wrapper class |http://pyserial.sourceforge.net/examples.html#wrapper-class]]||\n|[[Serial inWaiting |http://pyserial.sourceforge.net/pyserial_api.html#serial.Serial.inWaiting]]||\n|[[Active State |http://stackoverflow.com/questions/tagged/pyserial?sort=active&pagesize=15]]||\n|[[Stackoverflow how to open serial port programatically |http://stackoverflow.com/questions/15176055/how-to-open-serial-port-programatically]]||\n|[[comp.lang.python |http://coding.derkeiler.com/Archive/Python/comp.lang.python/2006-02/msg03969.html]]||\n|[[reading-large-amount-of-serial-data-from-an-arduino |http://boxed.dk/reading-large-amount-of-serial-data-from-an-arduino/]]||\n|[[/how-to-get-time-of-a-python-program-execution |http://stackoverflow.com/questions/1557571/how-to-get-time-of-a-python-program-execution]]||\n
fmd.sh \n\n{{{\n#!/bin/bash\n# starts you with pbug development\ngnome-terminal gnome-terminal --geometry 160x25+0+0 -e 'ssh -X flint@10.0.1.45' # 2>error' # top window\ngnome-terminal gnome-terminal --geometry 160x10+0+550 -e 'ssh -X flint@10.0.1.45' # sudo bash' # bin/pbug-debug.sh' # bottom window\n# firefox 10.0.1.45 \n\n}}}
\n\n[[Binary Split|http://pythonhosted.org/bitstring/slicing.html]]
\n|!Reference HTML|! Description|\n|[[set up rsync |http://troy.jdmz.net/rsync/index.html]]||\n|[[set up ssh |http://www.thegeekstuff.com/2011/07/rsync-over-ssh-without-password/]]||\n
Do [[something like this:|http://www.informit.com/articles/article.aspx?p=102611&seqNum=4]]\n\n{{{\n <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n <html>\n <head>\n <title>MRTG Graphs</title>\n <meta http-equiv="Content-Type" content="text/html;\n charset=iso-8859-1">\n <meta http-equiv="Refresh" content="300">\n <meta http-equiv="Cache-Control" content="no-cache">\n <meta http-equiv="Pragma" content="no-cache">\n <meta name="robots" content="noarchive">\n </head>\n <body bgcolor="#FFFFFF" text="#000000">\n <h1>MRTG Graphs</h1>\n <blockquote>\n <a href="router1.html">router1</a> <br>\n <a href="router2.html">router2</a> <br>\n <a href="router3.html">router2</a> <br>\n </blockquote>\n </body>\n </html>\n\n}}}