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