From 79d91e5b070a41a19fc78c16d6ea1bc169945aea Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Sun, 23 Sep 2018 09:50:33 +0000 Subject: [PATCH] Template staff --- bashrc | 1 + mysqltuner.pl | 7 +++++ template_example.tpl | 64 +++++++++++++++++++++++++++----------------- 3 files changed, 47 insertions(+), 25 deletions(-) diff --git a/bashrc b/bashrc index 1f7f503..6913dbb 100644 --- a/bashrc +++ b/bashrc @@ -5,3 +5,4 @@ alias ll='ls -ls' alias lh='ls -lsh' alias la='ls -lsa' alias gam='git status | grep "modified" | cut -d: -f2 | xargs -n 1 git add' +alias serve="python -m $(python -c 'import sys; print("http.server" if sys.version_info[:2] > (2,7) else "SimpleHTTPServer")')" diff --git a/mysqltuner.pl b/mysqltuner.pl index 93875f7..3951ede 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -962,6 +962,13 @@ sub select_array { return @result; } +sub human_size { + my( $size, $n ) =( shift, 0 ); + ++$n and $size /= 1024 until $size < 1024; + return sprintf "%.2f %s", + $size, ( qw[ bytes KB MB GB ] )[ $n ]; +} + # MySQL Request one sub select_one { my $req = shift; diff --git a/template_example.tpl b/template_example.tpl index 8300281..6b987b9 100644 --- a/template_example.tpl +++ b/template_example.tpl @@ -1,39 +1,48 @@ - MySQL Tuner report + - - - - + + MySQL Tuner report + + + + + + + + + +

MySQLTuner Report

-
+ - + \ No newline at end of file