uname -r
cat /proc/version
uname -a
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
function int2bin ( $int=0 ){ | |
if ( $int>0 ) { | |
return int2bin ( floor($int/2) ) . $int % 2; | |
} | |
} |
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
#!/bin/bash | |
#llcolor | |
T='RGB' | |
fgs_a=(' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m') | |
echo | |
echo -e "01234567012345670123456701234567012345670123456701234567012345670123456701234567" | |
echo -e "--------------------------------------------------------------------------------" | |
echo "fg \ bg | no-bg | 40m | 41m | 42m | 43m | 44m | 45m | 46m | 47m |" | |
echo -e "--------+-------+-------+-------+-------+-------+-------+-------+-------+-------" |
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
javascript:(function(){ var rm=['#OSC_Banner','#OSC_NavigatorMenu','#toolbar_wrapper','.ProjectOfNews','.NewsPrevAndNext','.RelatedNews','.HomeHotNews','.Comments','.CommentForm','.right', '#OSC_Banner2','#OSC_Topbar','.QuestionRelations','.SameQuestions','.ask_toolbar','.QuestionReplies','.AnswerForm']; $(rm).each(function(i, n){ $(n).remove(); }); var preTitle = ((new Date()).toISOString()).split('T')[0]; $('#OSC_Footer').css('padding-bottom','0px'); $('head title').text(preTitle+'_'+$('head title').text()); window.print(); })(); |
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 | |
/** | |
* 测试用例 | |
* 用于处理需要绑定hosts的主机服务,比如某些接口调用等 | |
*/ | |
$apiurl = 'http://{$ServerRealIP}/weibo/send/mutil/'; // 修改原有的servername方式的url,使用真实服务器ip | |
$header = array('Host: {$ServerName}'); // 设置header中的伪造hosts主机地址 | |
$data = array( | |
'param1' => 'value1', | |
'param2' => 'value2', |
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 | |
/** | |
* 提交GET请求,curl方法 | |
* @param string $url 请求url地址 | |
* @param mixed $data GET数据,数组或类似id=1&k1=v1 | |
* @param array $header 头信息 | |
* @param int $timeout 超时时间 | |
* @param int $port 端口号 | |
* @return array 请求结果, |
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
############################################################################# | |
# current prompt | |
############################################################################# | |
# \d – Current date | |
# \t – Current time | |
# \h – Host name | |
# \# – Command number | |
# \u – User name | |
# \W – Current working directory (ie: Desktop/) | |
# \w – Current working directory, full path (ie: /Users/Admin/Desktop) |
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 | |
/** | |
* dos2unix | |
* @author Robert <[email protected]> | |
*/ | |
// 待处理的目录 | |
$work_dir = getcwd(); | |
$opts = array( |
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
function sys_userAgent(){ | |
var userAgent = navigator.userAgent, | |
rMsie = /(msie\s|trident.*rv:)([\w.]+)/, | |
rFirefox = /(firefox)\/([\w.]+)/, | |
rOpera = /(opera).+version\/([\w.]+)/, | |
rChrome = /(chrome)\/([\w.]+)/, | |
rSafari = /version\/([\w.]+).*(safari)/; | |
var browser,version,ua; | |
ua = userAgent.toLowerCase(); |
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
-- 在 MySQL 中拷贝表,将 old_table 表拷贝为 new_table 表。 | |
-- 1. 不拷贝表数据,只拷贝结构。 | |
CREATE TABLE new_table LIKE old_table | |
-- 2. 通过 SELECT 查询来拷贝,new_table 表会丢失主键、索引等信息。 | |
CREATE TABLE new_table AS |
OlderNewer