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
查看当前系统下所有连接状态的数: | |
[root@vps ~]#netstat -n|awk '/^tcp/{++S[$NF]}END{for (key in S) print key,S[key]}' | |
TIME_WAIT 286 | |
FIN_WAIT1 5 | |
FIN_WAIT2 6 | |
ESTABLISHED 269 | |
SYN_RECV 5 | |
CLOSING 1 |
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
id selecttype table type possible_keys key key_len ref rows extra各列。 | |
其中: | |
type=const表示通过索引一次就找到了; | |
key=primary的话,表示使用了主键; | |
type=all,表示为全表扫描; | |
key=null表示没用到索引。 | |
type=ref,因为这时认为是多个匹配行,在联合查询中,一般为REF。 | |
前者可以得出一个表的字段结构等等,后者主要是给出相关的一些索引信息,而今天要讲述的重点是后者。 | |
举例 |
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
一、数组操作的基本函数 | |
数组的键名和值 | |
array_values($arr); 获得数组的值 | |
array_keys($arr); 获得数组的键名 | |
array_flip($arr); 数组中的值与键名互换(如果有重复前面的会被后面的覆盖) | |
in_array("apple",$arr); 在数组中检索apple | |
array_search("apple",$arr); 在数组中检索apple ,如果存在返回键名 | |
array_key_exists("apple",$arr); 检索给定的键名是否存在数组中 | |
isset($arr[apple]): 检索给定的键名是否存在数组中 | |
数组的内部指针 |
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
class Thrift < Formula | |
desc "Framework for scalable cross-language services development" | |
homepage "https://thrift.apache.org/" | |
url "https://www.apache.org/dyn/closer.cgi?path=/thrift/0.10.0/thrift-0.10.0.tar.gz" | |
sha256 "2289d02de6e8db04cbbabb921aeb62bfe3098c4c83f36eec6c31194301efa10b" | |
bottle do | |
cellar :any | |
sha256 "20b9fd54b8aaf036d5c9c85f53ab084819f1b6bbb392bd266e4f7c7e2dbbc48b" => :high_sierra | |
sha256 "a0d93b6f61524775ec194daa25a3a8da16f5e858823822847074711c718f1618" => :sierra |
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
brew unlink thrift | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/16ebe5f1843e6cb54856311ff0f676be53007329/Formula/thrift.rb |
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
diff --git a/components/Folder.php b/components/Folder.php | |
index 2a84f32..1e757c4 100644 | |
--- a/components/Folder.php | |
+++ b/components/Folder.php | |
@@ -267,9 +267,13 @@ class Folder extends Ansible { | |
$currentTmp = sprintf('%s/%s/current-%s.tmp', rtrim($this->getConfig()->release_library, '/'), $project, $project); | |
// 遇到回滚,则使用回滚的版本version | |
$linkFrom = Project::getReleaseVersionDir($version); | |
- $cmd[] = sprintf('ln -sfn %s %s', $linkFrom, $currentTmp); | |
- $cmd[] = sprintf('chown -h %s %s', $user, $currentTmp); |
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
worker_processes 1; # we could enlarge this setting on a multi-core machine | |
error_log logs/error.log warn; | |
events { | |
worker_connections 2048; | |
} | |
http { | |
lua_package_path 'conf/?.lua;;'; |
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
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
autocmd VimEnter * | |
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) | |
\| PlugInstall --sync | q | |
\| endif |
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
" ---------------------------------------------------------------------------- | |
" vimawesome.com | |
" ---------------------------------------------------------------------------- | |
function! VimAwesomeComplete() abort | |
let prefix = matchstr(strpart(getline('.'), 0, col('.') - 1), '[.a-zA-Z0-9_/-]*$') | |
echohl WarningMsg | |
echo 'Downloading plugin list from VimAwesome' | |
echohl None | |
ruby << EOF | |
require 'json' |
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
this.$emit('change', { perpage: this.perpage, page: page }) |
NewerOlder