-
-
Save silasp/7d6cb52c037d3c9ec7a1 to your computer and use it in GitHub Desktop.
Revisions
-
silasp revised this gist
Sep 1, 2014 . 1 changed file with 32 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,37 +1,44 @@ <?php session_start(); if (!isset($_SESSION['offset'])) { $_SESSION['offset'] = 0; } if (isset($_GET['ajax'])) { $file = 'system.log'; $handle = fopen($file, 'r'); fseek($handle, 0, SEEK_END); $eof_pos = ftell($handle); if ($eof_pos != $_SESSION['offset']) { $data = file_get_contents($file, NULL, NULL, $_SESSION['offset'] - 1); $output = nl2br(preg_replace('/\n$/', '', $data, 1)); echo $output; $_SESSION['offset'] = $eof_pos; } exit(); } $_SESSION['offset'] = 0; ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://creativecouple.github.com/jquery-timing/jquery-timing.min.js"></script> <script> $(function() { $.repeat(5000, function() { $.get('tail.php?ajax', function(data) { $('#tail').append(data); }); }); }); </script> </head> <body> <div id="tail">Starting up...</div> </body> </html> -
Firefishy revised this gist
Jul 24, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ <script> $(function() { $.repeat(1000, function() { $.get('tail.php?ajax&s=<?=$randomSession;?>', function(data) { $('#tail').append(data); }); }); -
Firefishy revised this gist
Jul 24, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ <?php if (isset($_GET['ajax'])) { $sessionID = 'log'.$_GET['s']; session_id($sessionID); session_start(); $handle = fopen('/private/var/log/system.log', 'r'); if (isset($_SESSION['offset'])) { -
Firefishy revised this gist
Jul 24, 2014 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ <?php if (isset($_GET['ajax'])) { $sessionID = 'log'.$_GET['s']; session_start(); $handle = fopen('/private/var/log/system.log', 'r'); if (isset($_SESSION['offset'])) { @@ -10,7 +11,8 @@ } $_SESSION['offset'] = ftell($handle); exit(); } $randomSession = rand(); ?> <!doctype html> <html lang="en"> @@ -21,7 +23,7 @@ <script> $(function() { $.repeat(1000, function() { $.get('tail.php?ajaxs&s=<?=$randomSession;?>', function(data) { $('#tail').append(data); }); }); -
Firefishy revised this gist
Jul 24, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,8 @@ echo nl2br($data); } else { fseek($handle, 0, SEEK_END); } $_SESSION['offset'] = ftell($handle); exit(); } ?> -
Chris Burke created this gist
Oct 6, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ <?php if (isset($_GET['ajax'])) { session_start(); $handle = fopen('/private/var/log/system.log', 'r'); if (isset($_SESSION['offset'])) { $data = stream_get_contents($handle, -1, $_SESSION['offset']); echo nl2br($data); } else { fseek($handle, 0, SEEK_END); $_SESSION['offset'] = ftell($handle); } exit(); } ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://creativecouple.github.com/jquery-timing/jquery-timing.min.js"></script> <script> $(function() { $.repeat(1000, function() { $.get('tail.php?ajax', function(data) { $('#tail').append(data); }); }); }); </script> </head> <body> <div id="tail">Starting up...</div> </body> </html>