-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
413 lines (348 loc) · 52.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Jason's Blog - 人总是要变得越来越好</title><meta name="author" content="JasonChio"><meta name="copyright" content="JasonChio"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="让琐碎的记录变为成长的基石">
<meta property="og:type" content="website">
<meta property="og:title" content="Jason's Blog">
<meta property="og:url" content="https://blog.961110.xyz/index.html">
<meta property="og:site_name" content="Jason's Blog">
<meta property="og:description" content="让琐碎的记录变为成长的基石">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://images.961110.xyz/images/2022/04/29/avatar.png">
<meta property="article:author" content="JasonChio">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://images.961110.xyz/images/2022/04/29/avatar.png"><link rel="shortcut icon" href="https://blog.961110.xyz/images/favicon.png"><link rel="canonical" href="https://blog.961110.xyz/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容:${query}"}},
translate: undefined,
noticeOutdate: {"limitDay":365,"position":"top","messagePrev":"本博文距离上次更新已有","messageNext":"天,文中内容可能会过期,请自行辨别或联系博主。"},
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '天',
date_suffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
source: {
justifiedGallery: {
js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
}
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'Jason\'s Blog',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2023-01-26 18:53:56'
}</script><noscript><style type="text/css">
#nav {
opacity: 1
}
.justified-gallery img {
opacity: 1
}
#recent-posts time,
#post-meta time {
display: inline !important
}
</style></noscript><script>(win=>{
win.saveToLocal = {
set: function setWithExpiry(key, value, ttl) {
if (ttl === 0) return
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = url => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
document.head.appendChild(script)
})
win.activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><link rel="stylesheet" href="/css/custom.css"><link rel="stylesheet" href="/css/iconfont.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.css" /><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiperstyle.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.css" media="print" onload="this.media='all'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.1"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://images.961110.xyz/images/2022/04/29/avatar.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">70</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">43</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/gallery/"><i class="fa-fw fas fa-images"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/fcircle/"><i class="fa-fw fa fa-puzzle-piece"></i><span> 朋友圈</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://images.961110.xyz/images/2021/12/29/index_img.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Jason's Blog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/gallery/"><i class="fa-fw fas fa-images"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/fcircle/"><i class="fa-fw fa fa-puzzle-piece"></i><span> 朋友圈</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Jason's Blog</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/jasonchio-cn" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:[email protected]" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://blog.961110.xyz/images/WeChat-QRCode.jpg" target="_blank" title="WeChat"><i class="fab fa-weixin"></i></a><a class="social-icon" href="tencent://AddContact/?fromId=45&fromSubId=1&subcmd=all&uin=389120217&website=www.oicqzone.com" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/posts/48304.html" title="重拾 MySQL"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/12/04/mysql_logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 MySQL"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/48304.html" title="重拾 MySQL">重拾 MySQL</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-01T14:46:00.000Z" title="发表于 2022-12-01 22:46:00">2022-12-01</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/48304.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">常规
判断是否为空,应该使用 IS NOT null,而不是 <> null
null + 非空 = null
分组前用 where, 分组后用 having
select avg(sal) as avg_sal, deptno from emp group by dept_no having avg_sal < 2000;
FROM DUAL DUAL 是一张虚拟表,可以看成占位符
查询第三个字母为 O
SELECT ename, sal FROM emp WHERE ename LIKE '__O%';
如果 select 语句同时包含有group by, having, limit, order by,那么他们的顺序是group by, having, order by, limit
自连接的含义
SELECT worker.ename AS '职员名', boss.ename AS '上级名' FROM emp worker, emp boss WHERE worker.mgr = bos ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/2290.html" title="重拾 Java 系列 —— 其他"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/10/11/Java-Logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 Java 系列 —— 其他"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/2290.html" title="重拾 Java 系列 —— 其他">重拾 Java 系列 —— 其他</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-11-09T15:23:00.000Z" title="发表于 2022-11-09 23:23:00">2022-11-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/2290.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">重拾 Java 系列 —— 其他JDK 工具javapJDK 提供的命令行工具,反编译 class 字节码文件
其他三元运算符要看作整体
Objdect obj = true? new Interge(1): new Double(2.0);System.out.println(obj); // 1.0(自动提升精度)
反射类加载流程图
加载阶段JVM 将字节码从不同数据源(可能是 class 文件,可能是 jar 包,也可能来源于网络)转化为二进制字节流加载到内存(方法区)中,并生成一个代表该类的 java.lang.Class 对象(堆中)。
连接阶段——验证
目的是为了确保 Class 文件的字节流中包含的信息符合当前虚拟机的要求,并且不会危害虚拟机自身的安全。
在类加载过程中会创建一个 securityManager 进行验证工作,包括:文件格式验证(是否以魔数 0xcafebabe 开头,固定格式)、元数据验证、字节码验证和符号引用验证
可以考虑使用-Xverify:none参数来关闭大部分的类验证措施,缩短虚拟机类加载的时间。
连接阶段——准备JVM 对静态变量分配 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/30000.html" title="重拾 Java 系列 —— 面向对象"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/10/11/Java-Logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 Java 系列 —— 面向对象"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/30000.html" title="重拾 Java 系列 —— 面向对象">重拾 Java 系列 —— 面向对象</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-16T14:26:00.000Z" title="发表于 2022-10-16 22:26:00">2022-10-16</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/30000.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">重拾 Java 系列 —— 面向对象类类和对象的内存分配机制
栈:一般存放基本数据类型(局部变量)
堆:存放对象(自定义类、数组等)
方法区:常量池(常量,比如字符串常量)、类加载信息
方法
Java 中允许方法重载,方法名相同,形参列表不同(类型或个数或顺序),返回值类型无要求
可变参数的实参可以为数组,其本质就是数组
int[] arr = {1, 2, 3};sum(arr); public int sum(int... nums){ }
构造方法/构造器构造方法的主要作用是完成新对象的初始化,并不是创建对象。
构造方法没有返回值;
方法名必须和类名字一样;
构造方法由系统自动调用;
构造方法可以重载;
没有显式定义构造方法,系统会生成默认无参构造方法。一旦显式定义了构造方法,默认构造方法就被覆盖;
Java 创建对象的流程class Person{ int age = 90; String name; Person(String n, int a){ name = n; ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/13522.html" title="重拾 Java 系列 —— 基础"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/10/11/Java-Logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 Java 系列 —— 基础"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/13522.html" title="重拾 Java 系列 —— 基础">重拾 Java 系列 —— 基础</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-11T14:26:00.000Z" title="发表于 2022-10-11 22:26:00">2022-10-11</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/13522.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">重拾 Java 系列 —— 杂七杂八细节
一个源文件中最多有一个 public 类;
如果一个源文件包含一个 public 类,则文件名必须按该类命名;
\r 回车:回到当前行首 \n 换行:另起一行;
注释
多行注释不能嵌套;
/*/*comments*/*/
文档注释
/** * @author JasonChio * @version 1.0 */
规范
源文件使用 utf-8 编码,大小可变(字母用一个字节,汉字用三个字节)
基本数据类型
默认浮点类型为float
float = 1.1; // 错误,1.1 为 double 类型float = 1.1f; // 正确
浮点数运算注意事项
double num11 = 2.7;double num12 = 8.1 / 3;// 在比较两个浮点数时,通过其差值的绝对值来判断if (Math.abs(num11 - num12 ) < 0.000001 ){ System.out.println("");}
char 类型赋值用单引号,双引号的含义是字符串
char 的本 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/16643.html" title="【转载】Go init 顺序"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/08/28/go-logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【转载】Go init 顺序"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/16643.html" title="【转载】Go init 顺序">【转载】Go init 顺序</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-10-09T13:54:00.000Z" title="发表于 2022-10-09 21:54:00">2022-10-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E4%BB%A3%E7%A0%81/">代码</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/16643.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">Go 程序初始化顺序Go 程序的初始化和执行总是从main.main函数开始的。但是如果main包里导入了其它的包,则会按照顺序将它们包含进main包里(这里的导入顺序依赖具体实现,一般可能是以文件名或包路径名的字符串顺序导入)。如果某个包被多次导入的话,在执行的时候只会导入一次。当一个包被导入时,如果它还导入了其它的包,则先将其它的包包含进来,然后创建和初始化这个包的常量和变量。然后就是调用包里的init函数,如果一个包有多个init函数的话,实现可能是以文件名的顺序调用,同一个文件内的多个init则是以出现的顺序依次调用(init不是普通函数,可以定义有多个,所以不能被其它函数调用)。最终,在main包的所有包常量、包变量被创建和初始化,并且init函数被执行后,才会进入main.main函数,程序开始正常执行。下图是 Go 程序函数启动顺序的示意图:
要注意的是,在main.main函数执行之前所有代码都运行在同一个Goroutine中,也是运行在程序的主系统线程中。如果某个init函数内部用go关键字启动了新的Goroutine的话,新的Goroutine和main.main ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/36855.html" title="Go 定时任务执行时间大于定时器间隔"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/08/28/go-logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Go 定时任务执行时间大于定时器间隔"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/36855.html" title="Go 定时任务执行时间大于定时器间隔">Go 定时任务执行时间大于定时器间隔</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-08-28T13:29:00.000Z" title="发表于 2022-08-28 21:29:00">2022-08-28</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E4%BB%A3%E7%A0%81/">代码</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/36855.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">问题当time.NewTicker()定时任务执行的时间比ticker设定的时间间隔长时,会发生什么事情?
验证有如下代码
func main(){ ScheduledTask()}func SleepTask(){ time.Sleep(6 * time.Second) fmt.Println("睡醒了")}func ScheduledTask(){ ticker := time.NewTicker(time.Second * 3) fmt.Println("ScheduledTask start.") for _ = range ticker.C { fmt.Println("三秒到了") SleepTask() }}
运行结果
2022/08/28 21:49:33.293 [I] 三秒到了2022/08/28 21:49:39.306 [I] 睡醒了2022/08/ ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/61140.html" title="博客从 GitHub 迁移到个人服务器"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/04/29/blog-main.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="博客从 GitHub 迁移到个人服务器"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/61140.html" title="博客从 GitHub 迁移到个人服务器">博客从 GitHub 迁移到个人服务器</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-29T13:12:00.000Z" title="发表于 2022-04-29 21:12:00">2022-04-29</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/61140.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">背景因为之前的服务器到期了,所以换了一台新的服务器,同时之前的写过的博客需要跟着迁移。
博客框架选择的是 Hexo,主题是 Butterfly,本教程理论上跟框架和主题无关。
操作方法前置条件(已有请跳过)
在本地已经搭建好了 Hexo 环境,参考链接
服务器有公网 IP
安装 Git sudo apt install git
服务器创建博客仓库
创建裸库
mkdir /home/jason/Blogcd /home/jason/Bloggit init --bare blog.git
创建博客页面存放目录
mkdir /home/jason/Blog/hexo
创建 Git 钩子
vim blog.git/hooks/post-receive
输入以下内容
#!/bin/shgit --work-tree=/home/jason/Blog/hexo --git-dir=/home/jason/Blog/blog.git checkout -f
给钩子赋予权限
chmod +x /home/jason/Blog/blog.git/hooks/post-receive
至此,服务器 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/7990.html" title="博客美化记录"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/04/29/blog-main.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="博客美化记录"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/7990.html" title="博客美化记录">博客美化记录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-28T14:18:00.000Z" title="发表于 2022-04-28 22:18:00">2022-04-28</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/7990.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">插件Gitcalendar参考链接:♪(^∇^*)欢迎回来!Gitcalendar | Akilarの糖果屋
效果图如下:
安装
在博客根目录下执行下面指令。
npm install hexo-filter-gitcalendar --save
添加配置信息。在站点配置文件_config.yml 或者主题配置文件如_config.butterfly.yml 中添加
# hexo-filter-gitcalendar# see https://akilar.top/posts/1f9c68c9/gitcalendar: enable: true # 开关 priority: 5 #过滤器优先权 enable_page: / # 应用页面 # butterfly挂载容器 layout: # 挂载容器类型 type: id name: recent-posts index: 0 user: jasonchio-cn #git用户名 apiurl: https://github-calendar-red.vercel.app minheight: pc ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/42019.html" title="Ubuntu 18.04 安装新版 nodejs"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/04/25/nodejs_logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Ubuntu 18.04 安装新版 nodejs"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/42019.html" title="Ubuntu 18.04 安装新版 nodejs">Ubuntu 18.04 安装新版 nodejs</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-25T13:18:00.000Z" title="发表于 2022-04-25 21:18:00">2022-04-25</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/42019.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">背景Ubuntu 18.04 上 apt 能安装的 nodejs 版本是 10.19.0,而官方早就更新到了 18.x,所以会有一些新的 module 不兼容。
安装方法安装根据官方 docs 的方法,需要增加 nodejs 的 repo 源
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -sudo apt install nodejs
安装完成后查看版本号
配置
建立 npm 包安装及缓存文件夹(如果建在/usr/local 目录下,后面运行安装的包会有权限问题)
mkdir -p ~/.npm/node_globalmkdir -p ~/.npm/node_cache
配置 npm
npm config set prefix "/home/jason/.npm/no ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/53233.html" title="群晖 Raid1 转 Basic"><img class="post_bg" src="https://images.961110.xyz:5001/i/2022/04/25/DS420.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="群晖 Raid1 转 Basic"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/53233.html" title="群晖 Raid1 转 Basic">群晖 Raid1 转 Basic</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-04-25T10:44:00.000Z" title="发表于 2022-04-25 18:44:00">2022-04-25</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/53233.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">背景博主没有公网 IP,所以两个常用 PT 站的分享率都不算很高。提高分享率只能靠赚魔力值,需要挂一些大文件的种子,因此对硬盘空间要求较大。群晖里两块 4T 的硬盘以 Raid1 的方式保障数据安全,也因此损失了接近 4T 的空间,于是就有了将其转为 Basic 的想法。
实操友情提示理论上无损,但是没有人能保证 100% 成功,备份好重要文件再进行下面的操作。
操作方法
群晖中插了两块硬盘,关机并拔出硬盘 2
开机,存储池会显示为堪用,不用慌,接着往下看。如果有报警可以在【控制面板】【硬件和电源】中【停止哔声】。
SSH 连接到群晖,输入如下命令查看硬盘的分区信息
cat /proc/mdstat
由于在操作时没有做记录,此处引用的是参考博文中的图。
第1个分区 md0 为群晖系统分区,第2个分区 md1 为群晖交换分区,第3个分区 md2 为群晖存储分区(不知道为什么,博主的第三个分区是 md3)
输入如下命令,将存储分区转为 Basic。可能需要的时间较长,耐心等待.
mdadm --grow --raid-devices=1 --force /dev/md2
刷新网 ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">…</span><a class="page-number" href="/page/7/#content-inner">7</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://images.961110.xyz/images/2022/04/29/avatar.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">JasonChio</div><div class="author-info__description">让琐碎的记录变为成长的基石</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">70</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">43</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div></div><a id="card-info-btn" href="https://blog.961110.xyz/images/WeChat-QRCode.jpg"><i class="fab fa-weixin"></i><span>等一个小红点</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/jasonchio-cn" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:[email protected]" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://blog.961110.xyz/images/WeChat-QRCode.jpg" target="_blank" title="WeChat"><i class="fab fa-weixin"></i></a><a class="social-icon" href="tencent://AddContact/?fromId=45&fromSubId=1&subcmd=all&uin=389120217&website=www.oicqzone.com" target="_blank" title="QQ"><i class="fab fa-qq"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">本博客正处于测试阶段,如有问题或建议请联系博主,谢谢!</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/48304.html" title="重拾 MySQL"><img src="https://images.961110.xyz:5001/i/2022/12/04/mysql_logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 MySQL"/></a><div class="content"><a class="title" href="/posts/48304.html" title="重拾 MySQL">重拾 MySQL</a><time datetime="2022-12-01T14:46:00.000Z" title="发表于 2022-12-01 22:46:00">2022-12-01</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/2290.html" title="重拾 Java 系列 —— 其他"><img src="https://images.961110.xyz:5001/i/2022/10/11/Java-Logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 Java 系列 —— 其他"/></a><div class="content"><a class="title" href="/posts/2290.html" title="重拾 Java 系列 —— 其他">重拾 Java 系列 —— 其他</a><time datetime="2022-11-09T15:23:00.000Z" title="发表于 2022-11-09 23:23:00">2022-11-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/30000.html" title="重拾 Java 系列 —— 面向对象"><img src="https://images.961110.xyz:5001/i/2022/10/11/Java-Logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 Java 系列 —— 面向对象"/></a><div class="content"><a class="title" href="/posts/30000.html" title="重拾 Java 系列 —— 面向对象">重拾 Java 系列 —— 面向对象</a><time datetime="2022-10-16T14:26:00.000Z" title="发表于 2022-10-16 22:26:00">2022-10-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/13522.html" title="重拾 Java 系列 —— 基础"><img src="https://images.961110.xyz:5001/i/2022/10/11/Java-Logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="重拾 Java 系列 —— 基础"/></a><div class="content"><a class="title" href="/posts/13522.html" title="重拾 Java 系列 —— 基础">重拾 Java 系列 —— 基础</a><time datetime="2022-10-11T14:26:00.000Z" title="发表于 2022-10-11 22:26:00">2022-10-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/16643.html" title="【转载】Go init 顺序"><img src="https://images.961110.xyz:5001/i/2022/08/28/go-logo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="【转载】Go init 顺序"/></a><div class="content"><a class="title" href="/posts/16643.html" title="【转载】Go init 顺序">【转载】Go init 顺序</a><time datetime="2022-10-09T13:54:00.000Z" title="发表于 2022-10-09 21:54:00">2022-10-09</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
<a class="card-more-btn" href="/categories/" title="查看更多">
<i class="fas fa-angle-right"></i></a>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Docker/"><span class="card-category-list-name">Docker</span><span class="card-category-list-count">19</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java/"><span class="card-category-list-name">Java</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E4%BB%A3%E7%A0%81/"><span class="card-category-list-name">代码</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/"><span class="card-category-list-name">基础知识</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%99%E7%A8%8B/"><span class="card-category-list-name">教程</span><span class="card-category-list-count">37</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/"><span class="card-category-list-name">数据库</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%99%BA%E8%83%BD%E7%BD%91%E8%81%94%E6%B1%BD%E8%BD%A6/"><span class="card-category-list-name">智能网联汽车</span><span class="card-category-list-count">1</span></a></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/%E7%94%9F%E6%B4%BB/" style="font-size: 1.15em; color: rgb(138, 170, 190)">生活</a><a href="/tags/%E7%A7%9F%E6%88%BF/" style="font-size: 1.15em; color: rgb(119, 186, 6)">租房</a><a href="/tags/%E6%95%99%E7%A8%8B/" style="font-size: 1.45em; color: rgb(41, 67, 112)">教程</a><a href="/tags/%E6%A0%91%E8%8E%93%E6%B4%BE/" style="font-size: 1.27em; color: rgb(162, 176, 136)">树莓派</a><a href="/tags/zsh/" style="font-size: 1.15em; color: rgb(141, 91, 43)">zsh</a><a href="/tags/shell/" style="font-size: 1.15em; color: rgb(125, 198, 117)">shell</a><a href="/tags/%E9%85%8D%E7%BD%AE/" style="font-size: 1.24em; color: rgb(185, 158, 191)">配置</a><a href="/tags/Linux/" style="font-size: 1.33em; color: rgb(64, 24, 119)">Linux</a><a href="/tags/%E4%BB%A3%E7%90%86/" style="font-size: 1.21em; color: rgb(192, 6, 77)">代理</a><a href="/tags/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91/" style="font-size: 1.15em; color: rgb(75, 140, 194)">科学上网</a><a href="/tags/%E6%B8%B8%E6%88%8F/" style="font-size: 1.15em; color: rgb(29, 99, 129)">游戏</a><a href="/tags/%E7%9B%91%E6%8E%A7/" style="font-size: 1.15em; color: rgb(163, 115, 89)">监控</a><a href="/tags/Docker/" style="font-size: 1.39em; color: rgb(191, 199, 117)">Docker</a><a href="/tags/%E5%9B%BE%E5%BA%8A/" style="font-size: 1.15em; color: rgb(188, 190, 54)">图床</a><a href="/tags/Python/" style="font-size: 1.15em; color: rgb(167, 4, 157)">Python</a><a href="/tags/%E8%99%9A%E6%8B%9F%E6%9C%BA/" style="font-size: 1.15em; color: rgb(111, 119, 25)">虚拟机</a><a href="/tags/VMware/" style="font-size: 1.15em; color: rgb(17, 20, 147)">VMware</a><a href="/tags/frp/" style="font-size: 1.15em; color: rgb(56, 29, 104)">frp</a><a href="/tags/%E7%AC%94%E8%AE%B0/" style="font-size: 1.42em; color: rgb(3, 38, 130)">笔记</a><a href="/tags/%E6%AF%95%E8%AE%BE/" style="font-size: 1.36em; color: rgb(149, 146, 82)">毕设</a><a href="/tags/Docker%E6%BA%90%E7%A0%81%E7%BC%96%E8%AF%91/" style="font-size: 1.15em; color: rgb(171, 62, 55)">Docker源码编译</a><a href="/tags/git/" style="font-size: 1.18em; color: rgb(136, 14, 83)">git</a><a href="/tags/Windows-10/" style="font-size: 1.18em; color: rgb(125, 84, 182)">Windows 10</a><a href="/tags/Powershell/" style="font-size: 1.15em; color: rgb(159, 160, 185)">Powershell</a><a href="/tags/C/" style="font-size: 1.15em; color: rgb(58, 155, 85)">C++</a><a href="/tags/%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/" style="font-size: 1.15em; color: rgb(185, 143, 41)">基础知识</a><a href="/tags/%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/" style="font-size: 1.3em; color: rgb(112, 57, 31)">源码分析</a><a href="/tags/%E5%86%85%E6%A0%B8%E8%A3%81%E5%89%AA/" style="font-size: 1.15em; color: rgb(62, 53, 66)">内核裁剪</a><a href="/tags/golang/" style="font-size: 1.15em; color: rgb(84, 46, 130)">golang</a><a href="/tags/%E8%B0%83%E8%AF%95/" style="font-size: 1.15em; color: rgb(171, 192, 181)">调试</a><a href="/tags/ARM/" style="font-size: 1.15em; color: rgb(162, 55, 77)">ARM</a><a href="/tags/%E4%BB%A3%E7%A0%81%E4%BC%98%E5%8C%96/" style="font-size: 1.15em; color: rgb(131, 127, 141)">代码优化</a><a href="/tags/Ubuntu-20-04/" style="font-size: 1.15em; color: rgb(55, 134, 97)">Ubuntu 20.04</a><a href="/tags/Ubuntu/" style="font-size: 1.15em; color: rgb(82, 190, 193)">Ubuntu</a><a href="/tags/%E8%A3%85%E6%9C%BA/" style="font-size: 1.15em; color: rgb(11, 131, 125)">装机</a><a href="/tags/%E6%A1%8C%E6%90%AD/" style="font-size: 1.15em; color: rgb(90, 114, 38)">桌搭</a><a href="/tags/%E7%BE%A4%E6%99%96/" style="font-size: 1.15em; color: rgb(5, 133, 58)">群晖</a><a href="/tags/Go/" style="font-size: 1.18em; color: rgb(162, 105, 194)">Go</a><a href="/tags/Java/" style="font-size: 1.21em; color: rgb(189, 63, 99)">Java</a><a href="/tags/%E6%99%BA%E8%83%BD%E7%BD%91%E8%81%94%E6%B1%BD%E8%BD%A6/" style="font-size: 1.15em; color: rgb(105, 150, 15)">智能网联汽车</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/archives/" title="查看更多">
<i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/12/"><span class="card-archive-list-date">十二月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/11/"><span class="card-archive-list-date">十一月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/10/"><span class="card-archive-list-date">十月 2022</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/08/"><span class="card-archive-list-date">八月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/04/"><span class="card-archive-list-date">四月 2022</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/03/"><span class="card-archive-list-date">三月 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">一月 2022</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/12/"><span class="card-archive-list-date">十二月 2021</span><span class="card-archive-list-count">11</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">70</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2019-09-09T16:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">101.1k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2023-01-26T10:53:56.116Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2023 By JasonChio</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a><br>
<img src="https://images.961110.xyz/images/2022/04/29/beian-logo.png">
<a href="https://beian.miit.gov.cn" style="color:#ffffff" target="_blank">晋ICP备2022004150号</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>(() => {
const getCommentUrl = () => {
const eleGroup = document.querySelectorAll('#recent-posts .article-title')
let urlArray = []
eleGroup.forEach(i=>{
urlArray.push(i.getAttribute('href'))
})
return urlArray
}
const getCount = () => {
const runTwikoo = () => {
twikoo.getCommentsCount({
envId: 'https://twikoo.961110.xyz:5001',
region: '',
urls: getCommentUrl(),
includeReply: false
}).then(function (res) {
document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => {
item.innerText = res[index].count
})
}).catch(function (err) {
console.log(err)
})
}
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(runTwikoo)
}
}
window.pjax ? getCount() : window.addEventListener('load', getCount)
})()</script><script>function subtitleType () {
if (true) {
window.typed = new Typed("#subtitle", {
strings: ["让琐碎的记录变为成长的基石"],
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50
})
} else {
document.getElementById("subtitle").innerHTML = '让琐碎的记录变为成长的基石'
}
}
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
}
} else {
subtitleType()
}</script></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
function butterfly_clock_injector_config(){
var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img class="entered loading" id="card-clock-loading" src="https://npm.elemecdn.com/hexo-butterfly-clock/lib/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading"/></div></div></div></div></div>';
console.log('已挂载butterfly_clock')
parent_div_git.insertAdjacentHTML("afterbegin",item_html)
}
var elist = 'null'.split(',');
var cpage = location.pathname;
var epage = 'all';
var flag = 0;
for (var i=0;i<elist.length;i++){
if (cpage.includes(elist[i])){
flag++;
}
}
if ((epage ==='all')&&(flag == 0)){
butterfly_clock_injector_config();
}
else if (epage === cpage){
butterfly_clock_injector_config();
}
</script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script data-pjax src="https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.js"></script><script data-pjax>
function butterfly_swiper_injector_config(){
var parent_div_git = document.getElementById('recent-posts');
var item_html = '<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="posts/52319.html" alt=""><img width="48" height="48" src="https://images.961110.xyz:5001/i/2021/11/29/2fe10549b3c93adcf3e25e7d0cff707e.png" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2023-01-26</span><a class="blog-slider__title" href="posts/52319.html" alt="">Docker 源码梳理文章索引暨容器生命周期相关源码梳理</a><div class="blog-slider__text">再怎么看我也不知道怎么描述它的啦!</div><a class="blog-slider__button" href="posts/52319.html" alt="">详情 </a></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div></div></div>';
console.log('已挂载butterfly_swiper')
parent_div_git.insertAdjacentHTML("afterbegin",item_html)
}
var elist = 'undefined'.split(',');
var cpage = location.pathname;
var epage = '/';
var flag = 0;
for (var i=0;i<elist.length;i++){
if (cpage.includes(elist[i])){
flag++;
}
}
if ((epage ==='all')&&(flag == 0)){
butterfly_swiper_injector_config();
}
else if (epage === cpage){
butterfly_swiper_injector_config();
}
</script><script defer src="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.js"></script><script defer data-pjax src="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper_init.js"></script><script data-pjax src="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.js"></script><script data-pjax>
function gitcalendar_injector_config(){
var parent_div_git = document.getElementById('recent-posts');
var item_html = '<div class="recent-post-item" style="width:100%;height:auto;padding:10px;"><style>#git_container{min-height: 280px}@media screen and (max-width:650px) {#git_container{min-height: 0px}}</style><div id="git_loading" style="width:10%;height:100%;margin:0 auto;display: block;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animatetransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animatetransform></path></svg><style>#git_container{display: none;}</style></div><div id="git_container"></div></div>';
parent_div_git.insertAdjacentHTML("afterbegin",item_html)
console.log('已挂载gitcalendar')
}
if( document.getElementById('recent-posts') && (location.pathname ==='/'|| '/' ==='all')){
gitcalendar_injector_config()
GitCalendarInit("https://github-calendar-red.vercel.app/api?jasonchio-cn",['#ebedf0', '#f0fff4', '#dcffe4', '#bef5cb', '#85e89d', '#34d058', '#28a745', '#22863a', '#176f2c', '#165c26', '#144620'],'jasonchio-cn')
}
</script><!-- hexo injector body_end end --></body></html>