<commit_before>#!/bin/bash

sleep 30

LOCAL=$(date)
LOCALSECONDS=$(date -d "$LOCAL" +%s)
UTC=$(date -u -d "$LOCAL" +"%Y-%m-%d %H:%M:%S")  #remove timezone reference
UTCSECONDS=$(date -d "$UTC" +%s)
UTCOFFSET=$(($LOCALSECONDS-$UTCSECONDS))

pushd $HOME/ubundiagd
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 25 HOUR;" | sed 's/\t/;/g;s/\n//g' > /tmp/sql21b.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 8 DAY;"   | sed 's/\t/;/g;s/\n//g' > /tmp/sql21c.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 32 DAY;"  | sed 's/\t/;/g;s/\n//g' > /tmp/sql21d.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 370 DAY;" | sed 's/\t/;/g;s/\n//g' > /tmp/sql21e.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM wind where (sample_time) >=NOW() - INTERVAL 50 HOUR;" | sed 's/\t/;/g;s/\n//g' > /tmp/sql29.csv

  touch /tmp/ubundiagd/graph.lock

  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21b.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21c.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21d.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21e.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph29.gp
  ./graph29.py<commit_msg>deprecating wind graph<commit_after>#!/bin/bash

sleep 30

LOCAL=$(date)
LOCALSECONDS=$(date -d "$LOCAL" +%s)
UTC=$(date -u -d "$LOCAL" +"%Y-%m-%d %H:%M:%S")  #remove timezone reference
UTCSECONDS=$(date -d "$UTC" +%s)
UTCOFFSET=$(($LOCALSECONDS-$UTCSECONDS))

pushd $HOME/ubundiagd
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 25 HOUR;" | sed 's/\t/;/g;s/\n//g' > /tmp/sql21b.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 8 DAY;"   | sed 's/\t/;/g;s/\n//g' > /tmp/sql21c.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 32 DAY;"  | sed 's/\t/;/g;s/\n//g' > /tmp/sql21d.csv
  mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM temper where (sample_time) >=NOW() - INTERVAL 370 DAY;" | sed 's/\t/;/g;s/\n//g' > /tmp/sql21e.csv
 # mysql -h sql.lan --skip-column-names -e "USE domotica; SELECT * FROM wind where (sample_time) >=NOW() - INTERVAL 50 HOUR;" | sed 's/\t/;/g;s/\n//g' > /tmp/sql29.csv

  touch /tmp/ubundiagd/graph.lock

  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21b.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21c.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21d.gp
  gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph21e.gp
  #gnuplot -e "utc_offset='${UTCOFFSET}'" ./graph29.gp
  #./graph29.py
{'fraction_non_alphanumeric': 0.2160578911095796, 'fraction_numerical': 0.02343211578221916, 'mean_word_length': 3.43206106870229, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6559126', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1196, 'n_words': 285}