This file contains 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 characters
<?php | |
// TP-Link 外网IP获取脚本 | |
// 用于旧版普通路由器 | |
// 测试通过:TL-WR840N | |
function tp_link_old($ip = '192.168.1.1', $username = 'admin', $password = 'admin') { | |
$address = "http://{$ip}/userRpm/StatusRpm.htm"; | |
$userpwd = "{$username}:{$password}"; | |
$ch = curl_init(); |
This file contains 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 characters
<?php | |
define('MSSQL_HOST', '127.0.0.1'); | |
define('MSSQL_USER', '[USERNAME]'); | |
define('MSSQL_PASS', '[PASSWORD]'); | |
define('BACKUP_TEMP_DIR', 'd:\\mssql_backup\\tmp\\'); | |
define('BACKUP_DIR', 'd:\\mssql_backup\\'); | |
$start_time = time(); |
This file contains 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 characters
#!/usr/bin/php | |
<?php | |
define('MYSQL_HOST', 'localhost'); | |
define('MYSQL_USERNAME', '[USERNAME]'); | |
define('MYSQL_PASSWORD', '[PASSWORD]'); | |
define('BACKUP_TEMP_DIR', '/tmp/mysql_backup/'); | |
define('BACKUP_DIR', '/var/backup/'); | |
$start_time = time(); |
This file contains 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 characters
<?php | |
define ('DB_SOURCE', 'd:\\data'); | |
define ('CACHE_LIMIT', 4194304); | |
define ('RESULT_LIMIT', 1000); | |
define ('TIME_LIMIT', 600); | |
$begin = microtime(true); | |
set_time_limit(TIME_LIMIT + 100); | |
ob_end_flush(); |
This file contains 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 characters
#!/usr/bin/php -q | |
<?php | |
echo "PHP Time Protocol Client\n"; | |
echo "-----------------\n"; | |
/* NTP服务器列表 */ | |
$ntp_server_list = array( | |
'0.hk.pool.ntp.org', | |
'0.asia.pool.ntp.org', | |
'1.asia.pool.ntp.org', |
This file contains 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 characters
<?php | |
$uptime = file_get_contents('/proc/uptime'); // 1164820.24 4655047.46; | |
$upsecond = (int)explode(' ', $uptime)[0]; | |
$datediff = date_diff(date_create(), date_create("{$upsecond} second ago"), true); | |
echo $datediff->y . "\r\n"; | |
echo $datediff->m . "\r\n"; | |
echo $datediff->d . "\r\n"; | |
echo $datediff->h . "\r\n"; | |
echo $datediff->i . "\r\n"; |
This file contains 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 characters
<?php | |
set_time_limit(300); | |
mb_internal_encoding("UTF-8"); | |
header('Content-Type: text/html; charset=utf-8'); | |
define('APP_DIR', __DIR__ . DIRECTORY_SEPARATOR); | |
define('TWIP_URL', 'TWIP O 模式地址'); // TWIP O 模式地址,实在懒得去处理OAuth的东西了 | |
define('TWITTER_ID', 'Twitter User ID'); // Twitter 用户的 ID,防止用户改名 | |
define('ADD_STR', '#土豪 的日常 RT @[USERNAME] '); // 要附加在原始推文前的内容 |
This file contains 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 characters
<?php | |
$path = '/var/www'; | |
`chown -R www-data:www-data {$path}`; | |
`chown root:root {$path}`; | |
mod_dir($path); | |
function mod_dir($path) { | |
$files = scandir($path); |
This file contains 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 characters
<?php | |
define('SMS_NUMBER', ''); | |
define('SMS_TOKEN', ''); | |
define('SMS_API', 'http://www.2-waysms.com/my/api/sms.php'); | |
$to = ''; | |
$message = ''; | |
$senderid = ''; | |
echo sendsms($to, $message, $senderid); |
This file contains 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 characters
<?php | |
/** | |
* Windows 路由添加脚本生成工具 | |
* 由路由列表文件,生成Windows适用的路由添加脚本 | |
* vibbow @ 2014/5/23 | |
* | |
* 参考路由列表文件: | |
* http://www.dnspod.cn/misc/iplist.txt | |
* 可从中截取出要生成的运营商路由表 |
OlderNewer