Skip to content

Commit 3b83cb0

Browse files
committed
Site updated: 2020-03-22 17:51:05
1 parent d9ba205 commit 3b83cb0

File tree

14 files changed

+162
-139
lines changed

14 files changed

+162
-139
lines changed

atom.xml

+15-10
Large diffs are not rendered by default.

categories/Linux/index.html

+121-94
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<meta name="description" content="A journey of a thousand miles begins with single step">
8686
<meta property="og:type" content="website">
8787
<meta property="og:title" content="javasgl">
88-
<meta property="og:url" content="https://javasgl.github.io/categories/linux/index.html">
88+
<meta property="og:url" content="https://javasgl.github.io/categories/Linux/index.html">
8989
<meta property="og:site_name" content="javasgl">
9090
<meta property="og:description" content="A journey of a thousand miles begins with single step">
9191
<meta property="og:locale" content="en">
@@ -119,13 +119,13 @@
119119

120120

121121

122-
<link rel="canonical" href="https://javasgl.github.io/categories/linux/"/>
122+
<link rel="canonical" href="https://javasgl.github.io/categories/Linux/"/>
123123

124124

125125

126126

127127

128-
<title> Category: linux | javasgl </title>
128+
<title> Category: Linux | javasgl </title>
129129
</head>
130130

131131
<body itemscope itemtype="http://schema.org/WebPage" lang="en">
@@ -291,7 +291,7 @@
291291
<section id="posts" class="posts-collapse">
292292
<div class="collection-title">
293293
<h2 >
294-
linux
294+
Linux
295295
<small>Category</small>
296296
</h2>
297297
</div>
@@ -304,19 +304,131 @@ <h2 >
304304

305305
<h1 class="post-title">
306306

307-
<a class="post-title-link" href="/codis-dashboard/" itemprop="url">
307+
<a class="post-title-link" href="/linux-sort/" itemprop="url">
308308

309-
<span itemprop="name">codis dashboard 无法启动处理流程</span>
309+
<span itemprop="name">Linux sort 命令使用</span>
310310

311311
</a>
312312

313313
</h1>
314314

315315
<div class="post-meta">
316316
<time class="post-time" itemprop="dateCreated"
317-
datetime="2017-08-31T15:03:20+08:00"
318-
content="2017-08-31" >
319-
08-31
317+
datetime="2017-08-21T11:18:53+08:00"
318+
content="2017-08-21" >
319+
08-21
320+
</time>
321+
</div>
322+
323+
</header>
324+
</article>
325+
326+
327+
328+
329+
330+
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
331+
<header class="post-header">
332+
333+
<h1 class="post-title">
334+
335+
<a class="post-title-link" href="/umount-device-when-its-buzy/" itemprop="url">
336+
337+
<span itemprop="name">Linux强制卸载设备</span>
338+
339+
</a>
340+
341+
</h1>
342+
343+
<div class="post-meta">
344+
<time class="post-time" itemprop="dateCreated"
345+
datetime="2017-05-12T11:04:07+08:00"
346+
content="2017-05-12" >
347+
05-12
348+
</time>
349+
</div>
350+
351+
</header>
352+
</article>
353+
354+
355+
356+
357+
358+
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
359+
<header class="post-header">
360+
361+
<h1 class="post-title">
362+
363+
<a class="post-title-link" href="/shell-change-path/" itemprop="url">
364+
365+
<span itemprop="name">shell脚本修改环境变量</span>
366+
367+
</a>
368+
369+
</h1>
370+
371+
<div class="post-meta">
372+
<time class="post-time" itemprop="dateCreated"
373+
datetime="2017-04-28T12:04:50+08:00"
374+
content="2017-04-28" >
375+
04-28
376+
</time>
377+
</div>
378+
379+
</header>
380+
</article>
381+
382+
383+
384+
385+
386+
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
387+
<header class="post-header">
388+
389+
<h1 class="post-title">
390+
391+
<a class="post-title-link" href="/Linux-zgrep/" itemprop="url">
392+
393+
<span itemprop="name">Linux zgrep使用笔记</span>
394+
395+
</a>
396+
397+
</h1>
398+
399+
<div class="post-meta">
400+
<time class="post-time" itemprop="dateCreated"
401+
datetime="2017-03-17T17:20:05+08:00"
402+
content="2017-03-17" >
403+
03-17
404+
</time>
405+
</div>
406+
407+
</header>
408+
</article>
409+
410+
411+
412+
413+
414+
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
415+
<header class="post-header">
416+
417+
<h1 class="post-title">
418+
419+
<a class="post-title-link" href="/Linux-iptables/" itemprop="url">
420+
421+
<span itemprop="name">iptables使用笔记</span>
422+
423+
</a>
424+
425+
</h1>
426+
427+
<div class="post-meta">
428+
<time class="post-time" itemprop="dateCreated"
429+
datetime="2017-03-17T15:07:10+08:00"
430+
content="2017-03-17" >
431+
03-17
320432
</time>
321433
</div>
322434

@@ -849,90 +961,5 @@ <h1 class="post-title">
849961

850962

851963

852-
</body>
853-
</html>
854-
for(var i = 0; i < entries.length; i++) {
855-
var url = entries[i];
856-
var element = document.getElementById(url);
857-
var countSpan = $(element).find(COUNT_CONTAINER_REF);
858-
if( countSpan.text() == '') {
859-
countSpan.text(0);
860-
}
861-
}
862-
})
863-
.fail(function (object, error) {
864-
console.log("Error: " + error.code + " " + error.message);
865-
});
866-
}
867-
868-
function addCount(Counter) {
869-
var $visitors = $(".leancloud_visitors");
870-
var url = $visitors.attr('id').trim();
871-
var title = $visitors.attr('data-flag-title').trim();
872-
var query = new AV.Query(Counter);
873-
874-
query.equalTo("url", url);
875-
query.find({
876-
success: function(results) {
877-
if (results.length > 0) {
878-
var counter = results[0];
879-
counter.fetchWhenSave(true);
880-
counter.increment("time");
881-
counter.save(null, {
882-
success: function(counter) {
883-
var $element = $(document.getElementById(url));
884-
$element.find('.leancloud-visitors-count').text(counter.get('time'));
885-
},
886-
error: function(counter, error) {
887-
console.log('Failed to save Visitor num, with error message: ' + error.message);
888-
}
889-
});
890-
} else {
891-
var newcounter = new Counter();
892-
/* Set ACL */
893-
var acl = new AV.ACL();
894-
acl.setPublicReadAccess(true);
895-
acl.setPublicWriteAccess(true);
896-
newcounter.setACL(acl);
897-
/* End Set ACL */
898-
newcounter.set("title", title);
899-
newcounter.set("url", url);
900-
newcounter.set("time", 1);
901-
newcounter.save(null, {
902-
success: function(newcounter) {
903-
var $element = $(document.getElementById(url));
904-
$element.find('.leancloud-visitors-count').text(newcounter.get('time'));
905-
},
906-
error: function(newcounter, error) {
907-
console.log('Failed to create');
908-
}
909-
});
910-
}
911-
},
912-
error: function(error) {
913-
console.log('Error:' + error.code + " " + error.message);
914-
}
915-
});
916-
}
917-
918-
$(function() {
919-
var Counter = AV.Object.extend("Counter");
920-
if ($('.leancloud_visitors').length == 1) {
921-
addCount(Counter);
922-
} else if ($('.post-title-link').length > 1) {
923-
showTime(Counter);
924-
}
925-
});
926-
</script>
927-
928-
929-
930-
931-
932-
933-
934-
935-
936-
937964
</body>
938965
</html>

content.json

+1-1
Large diffs are not rendered by default.

css/main.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ pre .javascript .function {
16911691
width: 4px;
16921692
height: 4px;
16931693
border-radius: 50%;
1694-
background: #f75c4d;
1694+
background: #7dc89e;
16951695
}
16961696
.links-of-blogroll {
16971697
font-size: 13px;

elasticsearch-function-doc/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ <h2 id="范例文档"><a href="#范例文档" class="headerlink" title="范例
412412
<h2 id="doc"><a href="#doc" class="headerlink" title="doc"></a>doc</h2><p>doc 可以很方便的使用文档中的字段,通过 doc[‘field_name’]来访问,访问速度比较快,因为相关的值已经加载到内存中了。<br>但是它有一些使用限制: 访问的字段不能是 object 类型;只对 not-analyzed 字段有效</p>
413413
<p>例如:对于上述的文档,doc[“skus”] 是无效的:<br><figure class="highlight haxe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="type"></span>"<span class="keyword">for</span>(sku <span class="keyword">in</span> doc[<span class="string">'skus'</span>])&#123;<span class="keyword">if</span>(sku.price&gt;<span class="number">5</span>)&#123;<span class="keyword">return</span> <span class="literal">true</span>;&#125;&#125;;<span class="keyword">return</span> <span class="literal">false</span>;<span class="string">" //No field found for [skus] in mapping!</span></span><br></pre></td></tr></table></figure></p>
414414
<p>而 doc[“categories”] 和 doc[“price”] 这是可以的:<br><figure class="highlight scilab"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"for(category in doc['</span>categories'])&#123;<span class="keyword">if</span>(category&gt;<span class="number">2</span>)&#123;<span class="keyword">return</span> true;&#125;&#125;;<span class="keyword">return</span> false;<span class="string">"</span></span><br><span class="line"><span class="string">"</span>script<span class="string">": "</span>doc[<span class="string">'price'</span>])&gt;<span class="number">100</span><span class="string">"</span></span><br></pre></td></tr></table></figure></p>
415-
<p>doc[“name”] 无效是因为 name 为 analyzed 的字段:<br><figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"doc['name'].value.length()&gt;=10"</span> <span class="comment">//not found</span></span><br></pre></td></tr></table></figure></p>
416-
<p>虽然访问 doc[‘name’]无效,但是并不报错,其实对于这种分词的字段,访问 doc[‘name’] 其实访问的是分词过后的 token,所以不会报 no field found for [name] in mapping 错误。<br>doc[‘name2’]有效,因为 name2 字段 是 not_analyzed 的(可以理解为不分词):<br><figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"doc['name2'].value.length()&gt;=10"</span> <span class="comment">//found</span></span><br></pre></td></tr></table></figure></p>
417-
<h2 id="fields"><a href="#fields" class="headerlink" title="_fields"></a>_fields</h2><p>_fields 使用方式同 doc 一样的,不过需要注意的是 _fields 必须是 mapping 中 store 的字段,例如 price 字段:<br><figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"_fields['price'].value&lt;=param1"</span>,</span><br></pre></td></tr></table></figure></p>
415+
<p>doc[“name”] 无效是因为 name 为 analyzed 的字段:<br><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"doc['name'].value.length()&gt;=10"</span> <span class="comment">//not found</span></span><br></pre></td></tr></table></figure></p>
416+
<p>虽然访问 doc[‘name’]无效,但是并不报错,其实对于这种分词的字段,访问 doc[‘name’] 其实访问的是分词过后的 token,所以不会报 no field found for [name] in mapping 错误。<br>doc[‘name2’]有效,因为 name2 字段 是 not_analyzed 的(可以理解为不分词):<br><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"doc['name2'].value.length()&gt;=10"</span> <span class="comment">//found</span></span><br></pre></td></tr></table></figure></p>
417+
<h2 id="fields"><a href="#fields" class="headerlink" title="_fields"></a>_fields</h2><p>_fields 使用方式同 doc 一样的,不过需要注意的是 _fields 必须是 mapping 中 store 的字段,例如 price 字段:<br><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="string">"_fields['price'].value&lt;=param1"</span>,</span><br></pre></td></tr></table></figure></p>
418418
<p>同时性能会低于加到内存中的doc。<br>默认情况下,创建 mapping 时候如果没有指定 store为 true 则 相应的字段是没有 stored 的。</p>
419419
<h2 id="source"><a href="#source" class="headerlink" title="_source"></a>_source</h2><p>如果创建 mapping 的时候没有禁用 source , 则在脚本中可以使用 _source 来访问文档内容。_source的内容实质上就是一段 json。所以可以通说 _source.obj2.obj1.field3 来访问。<br><figure class="highlight haxe"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"script"</span>: <span class="type"></span>"<span class="keyword">for</span>(sku <span class="keyword">in</span> _source.skus)&#123;<span class="keyword">if</span>(sku.price&gt;<span class="number">22</span>)&#123;<span class="keyword">return</span> <span class="literal">true</span>;&#125;&#125;;<span class="keyword">return</span> <span class="literal">false</span>;<span class="string">",</span></span><br></pre></td></tr></table></figure></p>
420420
<p>skus 字段是 object 类型的,可以用过 _source.skus 来访问。其实通过 _source[‘skus’]也是可以访问,这两者是否有区别暂不清楚。<br>由于 _source是每个文档加载、解析再使用的,所以比已经加载到内存中的 doc 慢很多,不过和 _fields 来比则需要区分使用场景。</p>

git-submodule/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<meta property="og:site_name" content="javasgl">
9191
<meta property="og:description" content="初始git 项目中,可以使用以下命令为项目添加submodule 1git submodule add -b branch_name [email protected]:javasgl/xxx.git module_path 执行以上命令后,会在当前项目下生成一个.gitmodules 文件,内容如下 1234[submodule &quot;module_path&quot;] path = module_path ur">
9292
<meta property="og:locale" content="en">
93-
<meta property="og:updated_time" content="2020-03-22T09:44:40.935Z">
93+
<meta property="og:updated_time" content="2020-03-22T09:50:26.428Z">
9494
<meta name="twitter:card" content="summary">
9595
<meta name="twitter:title" content="修改 git submodule">
9696
<meta name="twitter:description" content="初始git 项目中,可以使用以下命令为项目添加submodule 1git submodule add -b branch_name [email protected]:javasgl/xxx.git module_path 执行以上命令后,会在当前项目下生成一个.gitmodules 文件,内容如下 1234[submodule &quot;module_path&quot;] path = module_path ur">
@@ -415,6 +415,7 @@ <h2 id="初始"><a href="#初始" class="headerlink" title="初始"></a>初始</
415415
<figure class="highlight asciidoc"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="title">.git/modules</span></span><br><span class="line">└── module<span class="emphasis">_path</span></span><br></pre></td></tr></table></figure>
416416
<h2 id="变更"><a href="#变更" class="headerlink" title="变更"></a>变更</h2><p>有时候,对于已经添加了submodule的项目,如果想更换 <code>submodule</code> 的地址,那个这就比较麻烦,目前<code>git</code>并没有直接提供相关命令,需要进行一系列的手工操作</p>
417417
<p>简单记录如下,备查</p>
418+
<a id="more"></a>
418419
<p>比如,想把 <code>submodule</code> 的地址换为 <code>github.com/xxx/xxx.git</code></p>
419420
<ol>
420421
<li><p><code>submodule</code> 移除 <code>git</code> 版本控制</p>

0 commit comments

Comments
 (0)