-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.xml
1371 lines (655 loc) · 447 KB
/
search.xml
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>长沙理工大学:校园网共享指南</title>
<link href="/2023/09/csust-network-guide/"/>
<url>/2023/09/csust-network-guide/</url>
<content type="html"><![CDATA[<p>2016年11月7日通过的《<a href="http://www.cac.gov.cn/2016-11/07/c_1119867116.htm">中华人民共和国网络安全法</a>》第二十四条规定,「网络运营者为用户办理网络接入、域名注册服务,办理固定电话、移动电话等入网手续,或者为用户提供信息发布、即时通讯等服务,在与用户签订协议或者确认提供服务时,应当要求用户提供真实身份信息。用户不提供真实身份信息的,网络运营者不得为其提供相关服务。」</p><p>到了教育部这里落实,就变成了校园网一人一号。再到运营商这里,就变成了一人一终端,还不准使用路由器。这显然已经和合规没有任何关系,学生的需求也摆在这里,但限制却还是这个鸟样。好一点的大学,比如上海交大这种坐拥华东教育骨干网的学校可以做到校园网免费,为什么我们甚至不能放开连接设备数量上的限制呢?</p><blockquote><p>2015年以来……目前,我校IPV4/IPV6总出口带宽达到47GB,其中电信25GB、联通10GB、移动10GB、教育网2GB,校园网总注册用户数超过4.34万、活跃用户数超过2.43万。办公账户(免费)带宽由2MB升到36MB。宿舍区基本账户(付费)带宽由2MB升到12MB,网费不变。……</p></blockquote><p>这套<a href="https://www.csust.edu.cn/xxhjs/xxhcgzs/wljcjs.htm">数据</a>应该不是最新的,2022年寒假校园网又进行了一次大扩容,具体扩容了多少不得而知。如果按照这套数据计算,总出口 47GB,活跃用户数2.43万,则人均带宽是$ \dfrac{47GB * 1000 * 8}{24300} \approx 15Mbps $。这点可怜的带宽,还要给学校的官网防 DDoS,加上网安等种种因素,就变成了一人一终端这种限制。</p><p>现在的大学生还有几人是有且只有一台上网设备的?室友间的一些操作也需要一套局域网环境(文件共享、联机游戏……)指望推动学校在短时间做出这套改变不太现实。但需求总要解决,只能先自己想想办法,从技术上解决这个矛盾了。</p><h2 id="硬件"><a href="#硬件" class="headerlink" title="硬件"></a>硬件</h2><p>需要一台可以刷入 OpenWRT 的路由器,我采用的是一台 Nano Pi R2S,最好选择这种用户基数大固件多的产品,也最好能自己编译固件。</p><p>对于不会折腾/不想折腾的人群,可以去买淘宝上买别人做好的「校园网路由器」。</p><h2 id="接入路由器"><a href="#接入路由器" class="headerlink" title="接入路由器"></a>接入路由器</h2><p>通过一段时间的观察,可以得到我校校园网前端的计费系统采用城市热点的 Dr.COM,这是一套非常常见的计费系统;BRAS 终端是锐捷的设备,采用 POE 方式连接锐捷的 AP,似乎没有参与认证。</p><p>我将校园网分为三大类接入方式,无线,办公区有线,学生公寓有线。</p><p>前两者都是 DHCP+Portal 验证,网页表单提交账号即可完成验证。学生公寓区域的有线设备通过 PPPoE 认证,账号信息就是校园网账号本身。</p><p>因此路由的接入方式便确定了。<strong>宿舍的有线直接 PPPoE 认证就可以正常上网了。对于 Portal 的要麻烦一些,若无法连接外网则判断 Portal 能否访问,能访问的话提交一个构造好的 POST 包登录即可。</strong></p><p>Portal 认证的脚本校友已经写过不少:</p><p><a href="https://github.com/linfangzhi/CSUST_network_auto_login">https://github.com/linfangzhi/CSUST_network_auto_login</a></p><p><a href="https://github.com/eigeen/csust-cn-login">https://github.com/eigeen/csust-cn-login</a></p><p><a href="https://github.com/colawithsauce/csust-network-login">https://github.com/colawithsauce/csust-network-login</a></p><p>路由器上安好 <code>python</code> 和 <code>requests</code> 库然后运行这些脚本即可。如果因无网络不能安装,重新编译一个固件就行。再不行就写一个 Shell 脚本登录。</p><h2 id="封锁状况"><a href="#封锁状况" class="headerlink" title="封锁状况"></a>封锁状况</h2><p>此时已经可以通过路由器上网了,但依然不能全寝共享。</p><p>校园网多设备共享很被检测到会被临时屏蔽,此时会屏蔽所有的网络流量,据说还会强制重定向所有 HTTP 请求到<code>http://1.1.1.3/remind/proxy_remind.htm?tm=8</code>,不过我是没有遇上。</p><p>查阅资料发现,检测是否多设备共享有两种思路,一种是通过设备流量特征识别:</p><ul><li>TTL</li><li>IPID</li><li>时间戳</li><li>UA</li></ul><p>另一种是侵入式流量审计,这个可能看学校,不过我校肯定是有的:</p><blockquote><p>增强网络安全防护能力。……部署<strong>出口防火墙、出口行为审计</strong>……、IPS(入侵防御)等安全设备系统,加固学校网络和信息系统的整体安全。</p></blockquote><p>通过一次喊人来寝室修网络得知肯定是深信服的设备(修网络那人都登进深信服的后台了)。</p><p>通过路由器裸奔一段时间发现如下规律:</p><ul><li>两台不同平台的产品(如 Windows 电脑和 iPad)同时上网会在较短时间内被封锁</li><li>封锁时用代理可以连出去,B 站也能看,其他的不行,甚至无法 Ping 通校外 IP</li><li>被封锁后重新认证也无法上网,更换 MAC 地址后才能恢复</li></ul><p>得出的结论是大概率通过 UA 识别,检测到后封禁当前 MAC 地址一段时间。</p><h2 id="流量处理"><a href="#流量处理" class="headerlink" title="流量处理"></a>流量处理</h2><h3 id="统一-TTL"><a href="#统一-TTL" class="headerlink" title="统一 TTL"></a>统一 TTL</h3><p>将这行规则加入路由器的「网络」-「防火墙」-「自定义规则」(下同),即可统一 TTL 为 65,其中<code>-o br-lan</code>可以视情况更换,如<code>eth0</code>。</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">iptables -t mangle -I POSTROUTING -o br-lan -j TTL --ttl-set 65</span><br></pre></td></tr></table></figure><p>这条规则用到了 <code>ipopt</code> 模块,在官方编译的固件或其他一些极简的固件里默认不会安装。这种情况下用<code>opkg</code>安装即可:</p><figure class="highlight shell"><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="meta prompt_">$ </span><span class="language-bash">opkg update</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">opkg install iptables-mod-ipopt</span></span><br></pre></td></tr></table></figure><p>保存规则并重启防火墙,在电脑上随便 Ping 一个网站看 TTL 是否为 65(不要在路由器上 Ping,除非你知道你在干什么)。</p><h3 id="统一时间戳"><a href="#统一时间戳" class="headerlink" title="统一时间戳"></a>统一时间戳</h3><p>接下来先启用 OpenWrt 自带的 NTP 服务器,然后劫持所有局域网内的 NTP 请求到路由器,以达到我们统一时间戳的目的。</p><p>这种方法并不完美,因为手机连接基站时会同步到别的 NTP 服务器,最好的办法是直接去除 TCP 包的时间戳,但这种方法暂无成熟的实现,只能先采用劫持 NTP 请求的办法。</p><p>只需要在管理页面中修改几个设置就可以了。</p><ul><li>点击 System -> System(系统)</li><li>勾选 Enable NTP client(启用 NTP 客户端)和 Provide NTP server(作为 NTP 服务器提供服务)。</li><li>NTP server candidates(候选 NTP 服务器)按需设置,可以使用阿里云的 NTP 服务器:<code>ntp.aliyun.com</code></li><li>点击 Save & Apply 按钮。</li></ul><p>向防火墙添加以下规则:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">iptables -t nat -N ntp_force_local</span><br><span class="line">iptables -t nat -I PREROUTING -p udp --dport 123 -j ntp_force_local</span><br><span class="line">iptables -t nat -A ntp_force_local -d 0.0.0.0/8 -j RETURN</span><br><span class="line">iptables -t nat -A ntp_force_local -d 127.0.0.0/8 -j RETURN</span><br><span class="line">iptables -t nat -A ntp_force_local -d 192.168.0.0/16 -j RETURN</span><br><span class="line">iptables -t nat -A ntp_force_local -s 192.168.0.0/16 -j DNAT --to-destination 192.168.1.1</span><br></pre></td></tr></table></figure><p>其中<code>192.168.1.1</code>需要更改成路由器的地址,视固件而定。</p><p>若你的路由器地址不在<code>192.168.0.0/16</code>内,最后两行都要跟着改,一般的家用路由器都在这个范围内。</p><p>Windows 下确认效果:</p><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">w32tm /stripchart /computer:baidu.com /dataonly /samples:<span class="number">5</span></span><br></pre></td></tr></table></figure><p>如果能正常同步就证明配置成功了。</p><h3 id="统一-UA"><a href="#统一-UA" class="headerlink" title="统一 UA"></a>统一 UA</h3><p>网上的解决方案大部分基于代理,比如 Privoxy,甚至 Clash。还有不少是通过<a href="https://github.com/CHN-beta/xmurp-ua">XMURP-UA</a>直接在内核层面处理 UA,这几年又有新的插件出来,比如<a href="https://github.com/Zxilly/UA2F">UA2F</a>。</p><p>我嫌编译固件麻烦(校园网不太行编译老是报错),加上 R2S 性能也足够强,就直接采用 Privoxy,除非是软路由(性能足够强),否则不推荐这个方案。如果在普通的路由器上使用这个方案,会导致会导致 HTTP 协议的内容传输缓慢(比如 QQ 发送图片会特别慢,有的下载也会特别慢,Bilibili 手机客户端看不了视频等),这时候别无他法,只得自行编译固件以采用 XMURP-UA 或 UA2F 等。</p><p>安装好 Privoxy 并正确配置,然后将所有 HTTP 流量转发给 Privoxy 代理,并在 Privoxy 中替换 UA。</p><h5 id="安装-Privoxy"><a href="#安装-Privoxy" class="headerlink" title="安装 Privoxy"></a>安装 Privoxy</h5><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">opkg update</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">opkg install luci-app-privoxy</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">opkg install luci-app-privoxy-zh-cn</span></span><br></pre></td></tr></table></figure><h5 id="配置-Privoxy"><a href="#配置-Privoxy" class="headerlink" title="配置 Privoxy"></a>配置 Privoxy</h5><p>点击 Services -> Privoxy WEB proxy。</p><ul><li>Files and Directories(文件和目录):Action Files 删除到只剩一个框,填入 <code>match-all.action</code>。Filter files 和 Trust files 均留空。</li><li>Access Control(访问控制):Listen addresses 填写 <code>0.0.0.0:8118</code>,Permit access 填写 <code>192.168.0.0/16</code>。Enable action file editor 勾选。</li><li>Miscellaneous(杂项):Accept intercepted requests 勾选。</li><li>Logging(日志):全部取消勾选。</li></ul><p>点击 Save & Apply。</p><h5 id="配置防火墙转发"><a href="#配置防火墙转发" class="headerlink" title="配置防火墙转发"></a>配置防火墙转发</h5><p>向路由器防火墙添加以下规则:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">iptables -t nat -N http_ua_drop</span><br><span class="line">iptables -t nat -I PREROUTING -p tcp --dport 80 -j http_ua_drop</span><br><span class="line">iptables -t nat -A http_ua_drop -d 0.0.0.0/8 -j RETURN</span><br><span class="line">iptables -t nat -A http_ua_drop -d 127.0.0.0/8 -j RETURN</span><br><span class="line">iptables -t nat -A http_ua_drop -d 192.168.0.0/16 -j RETURN</span><br><span class="line">iptables -t nat -A http_ua_drop -p tcp -j REDIRECT --to-port 8118</span><br></pre></td></tr></table></figure><p>在路由器的局域网中打开 <code>http://config.privoxy.org/edit-actions-list?f=0</code>,点击 Edit 按钮。Action 那一列中,hide-user-agent 改选为 Enable(绿色),在右侧 User Agent string to send 框中填写 <code>Privoxy/1.0</code>或任意 UA;其它全部选择为 No Change (紫色)。点击 Submit 按钮。</p><p>如果打不开这个页面,说明之前某个地方配置有误。</p><h5 id="确认效果"><a href="#确认效果" class="headerlink" title="确认效果"></a>确认效果</h5><p>本地浏览器调试是看不到效果的,因为经过路由器之前 UA 会保持原样。</p><p>访问 ua.chn.moe 以查看 UA 是否修改成功。</p><h3 id="防止通过-IPID-检测"><a href="#防止通过-IPID-检测" class="headerlink" title="防止通过 IPID 检测"></a>防止通过 IPID 检测</h3><p>各设备的 IPID 起始值不同,并随着包数量的上升而上升,接近一条直线,若有多个设备长时间使用后会呈现出多条上升序列。</p><p>因需要的检测时间较长,通常为数天,所以定时重新拨号即可打断检测过程。</p><p>也可以修改 IPID 为随机值,但网上的现有方法似乎过于古老,无法使用。</p><p>设置如下 crontab 即可在每天凌晨三点重新拨号以打断检测过程:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">0 3 * * * ( ifdown wan; sleep 5; ifup wan )</span><br></pre></td></tr></table></figure><h3 id="侵入式流量屏蔽"><a href="#侵入式流量屏蔽" class="headerlink" title="侵入式流量屏蔽"></a>侵入式流量屏蔽</h3><p>向路由器防火墙添加以下规则:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">iptables -I FORWARD -p tcp -m tcp –sport 80 -m u32 –u32 “5&0xFF=0x7F” -j DROP</span><br><span class="line">iptables -I FORWARD -p tcp -m tcp –sport 8000 -m u32 –u32 “5&0xFF=0x7F” -j DROP</span><br><span class="line">iptables -I FORWARD -p tcp -m tcp –sport 8080 -m u32 –u32 “5&0xFF=0x7F” -j DROP</span><br><span class="line">iptables -I FORWARD -p tcp -m tcp –sport 80 -m u32 –u32 “5&0xFF=0x80” -j DROP</span><br><span class="line">iptables -I FORWARD -p tcp -m tcp –sport 8000 -m u32 –u32 “5&0xFF=0x80” -j DROP</span><br><span class="line">iptables -I FORWARD -p tcp -m tcp –sport 8080 -m u32 –u32 “5&0xFF=0x80” -j DROP</span><br></pre></td></tr></table></figure><p>以屏蔽侵入式流量,以上规则来自 V2EX 网友。</p><p>这些规则用到了<code>iptables</code>的<code>u32</code>模块,大多数固件都不会默认安装,亦需要通过<code>opkg</code>安装:</p><figure class="highlight shell"><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="meta prompt_">$ </span><span class="language-bash">opkg update</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">opkg install iptables-mod-u32</span></span><br></pre></td></tr></table></figure><p>随后屏蔽学校的「共享提示」页面:</p><figure class="highlight shell"><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">iptables -I FORWARD -p tcp --sport 80 --tcp-flags ACK ACK -m string --algo bm --string "src=\"http://1.1.1." -j DROP</span><br><span class="line">iptables -I FORWARD -p tcp --sport 80 --tcp-flags ACK ACK -m string --algo bm --string "value=\"http://18.20.18." -j DROP</span><br></pre></td></tr></table></figure><p>在Openwrt防火墙的流量规则设置如下规则:</p><ul><li><p>源区域WAN,源地址1.1.1.3,目标区域设备,动作拒绝</p></li><li><p>源区域WAN,源地址1.1.1.1,目标区域设备,动作拒绝</p></li></ul><p>这些规则来源于校友的博客(找不到来源,可能已经关闭了)</p><h2 id="意外封锁处理"><a href="#意外封锁处理" class="headerlink" title="意外封锁处理"></a>意外封锁处理</h2><p>前面提到学校会封一段时间的 MAC,想要重新上线就需要更换 MAC 地址重新上线。为此我写了一个 Shell 脚本:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">!/bin/sh</span></span><br><span class="line">DATE=$(date +%Y-%m-%d-%H:%M:%S)</span><br><span class="line">interface=eth0</span><br><span class="line">current_mac=$(ifconfig ${interface} | grep "HWaddr" | awk '{print$5}')</span><br><span class="line">new_mac=$(dd if=/dev/random bs=1 count=3 2>/dev/null | hexdump -C | head -1 | cut -d' ' -f2- | awk '{ print "34:36:3b:"$1":"$2":"$3 }')</span><br><span class="line">tries=0</span><br><span class="line">while [[ $tries -lt 3 ]]; do</span><br><span class="line"> if /bin/ping -c 1 223.5.5.5 >/dev/null; then</span><br><span class="line"> echo --- exit ---</span><br><span class="line"> exit 0</span><br><span class="line"> fi</span><br><span class="line"> tries=$((tries + 1))</span><br><span class="line">done</span><br><span class="line">echo $DATE block detected, replacing mac address >>watchdog.log</span><br><span class="line">ifdown wan</span><br><span class="line">sleep 3</span><br><span class="line">ifconfig ${interface} hw ether $new_mac</span><br><span class="line">sleep 2</span><br><span class="line">ifup wan</span><br><span class="line">echo $DATE old address $current_mac has been replaced with $new_mac >>watchdog.log</span><br><span class="line"></span><br></pre></td></tr></table></figure><p>将这个脚本保存到路由器的 home 目录下(用<code>vim</code>粘贴保存以下就可以了),设置如下 Crontab 每分钟执行一次:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">* * * * * sh /root/net_watchdog.sh</span><br></pre></td></tr></table></figure><p>路由器就会自每隔一分钟检测是否在线,如果掉线,则随机更换 MAC 地址并重新上线,日志将会记录在同目录下的<code>watchdog.log</code>中。</p><h2 id="DNS-内网解析处理"><a href="#DNS-内网解析处理" class="headerlink" title="DNS 内网解析处理"></a>DNS 内网解析处理</h2><p>接上路由器之后,校外资源可以正常访问,反倒是校内资源全都无法访问了。经排查发现是路由器下的设备无法解析出正确的 IP 地址,但路由器本身又没有问题。</p><p>暂时不清楚是什么原因导致的,但解决起来很简单,可以直接把已知的内网地址 dnsmasq,但我推荐安装 SmartDNS 来解决。</p><p>SmartDNS 的安装可以参考<a href="https://pymumu.github.io/smartdns/install/openwrt/">官方教程</a>。</p><ul><li>开启 SmartDNS 并让其接管路由器的主 DNS</li><li>设置 SmartDNS 上游为学校内网提供的 DNS,我校是<code>10.255.255.25</code>和<code>10.255.255.26</code></li><li>设置别的上游,可以参考<a href="https://blog.skk.moe/post/i-have-my-unique-dns-setup/">这篇博客</a></li></ul><p>这样设置下来,内网资源就可以正常访问了。</p><h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><ul><li><a href="https://www.mr-cn.net/2021/06/15/Share-your-network-in-CSUST/">https://www.mr-cn.net/2021/06/15/Share-your-network-in-CSUST/</a></li><li><a href="https://catalog.chn.moe/%E6%8A%80%E6%9C%AF/OpenWrt/%E5%9C%A8%E5%8E%A6%E5%A4%A7%E5%AE%BF%E8%88%8D%E5%AE%89%E8%A3%85%E8%B7%AF%E7%94%B1%E5%99%A8/">https://catalog.chn.moe/%E6%8A%80%E6%9C%AF/OpenWrt/%E5%9C%A8%E5%8E%A6%E5%A4%A7%E5%AE%BF%E8%88%8D%E5%AE%89%E8%A3%85%E8%B7%AF%E7%94%B1%E5%99%A8/</a></li><li><a href="https://catalog.chn.moe/%E6%8A%80%E6%9C%AF/OpenWrt/%E4%B8%BA%E5%95%A5%E6%88%91%E7%9A%84%E8%B7%AF%E7%94%B1%E5%99%A8%E4%BC%9A%E8%A2%AB%E6%A3%80%E6%B5%8B%E5%88%B0/">https://catalog.chn.moe/%E6%8A%80%E6%9C%AF/OpenWrt/%E4%B8%BA%E5%95%A5%E6%88%91%E7%9A%84%E8%B7%AF%E7%94%B1%E5%99%A8%E4%BC%9A%E8%A2%AB%E6%A3%80%E6%B5%8B%E5%88%B0/</a></li><li><a href="https://superuser.com/questions/451018/how-can-i-query-an-ntp-server-under-windows">https://superuser.com/questions/451018/how-can-i-query-an-ntp-server-under-windows</a></li><li><a href="https://github.com/krabelize/openwrt-random-mac-changer/tree/master">https://github.com/krabelize/openwrt-random-mac-changer/tree/master</a></li></ul>]]></content>
<categories>
<category> 技术 </category>
</categories>
</entry>
<entry>
<title>Is Changsha a bike friendly city?</title>
<link href="/2023/09/is-changsha-bike-friendly/"/>
<url>/2023/09/is-changsha-bike-friendly/</url>
<content type="html"><![CDATA[<p>Recently I took a 28 km trip, on bike.</p><p>I’m usually willing to take my bike for a short trip. I know for some of you, the distance I took may sound like nothing. However, it is more than enough to give everyone an impression of how friendly Changsha is to biking.</p><p>So let’s get straight into the topic.</p><h2 id="Overall-impressions"><a href="#Overall-impressions" class="headerlink" title="Overall impressions"></a>Overall impressions</h2><p>Changsha is not designed for bikes.</p><p>I’m sure that the government wants the city to be “car-centric”, and the city is sort of “car-centric” not too long ago. I mean, the city was designed to be “car-centric”, but people at that time were too poor to own a car, so they used bikes instead, which made the city look “bike-centric”. Then, when people get rich, they begin to own cars, which has caused a lot of problems, so the city is now balancing its developing strategy, including building public transport, and making the city more bike-friendly.</p><p>So you get a basic idea of Changsha’s original design ideology. Today Changsha looks like a fusion of American “car-centric” cities and Western European “human-centric” cities: it has wide, straight, and noisy roads originally designed for cars and little space for bikes, newly built roads is likely to have biking lane, but you won’t find them on old roads in city center.</p><h2 id="Some-aspects"><a href="#Some-aspects" class="headerlink" title="Some aspects"></a>Some aspects</h2><h3 id="Infrastructure"><a href="#Infrastructure" class="headerlink" title="Infrastructure"></a>Infrastructure</h3><p>Average road quality is good, but since the city is building its public transport, many roads are currently under construction, these roads are dangerous and badly maintained, traffic on them is also chaotic.</p><p>Most roads don’t have a biking lane, so you need to share your route with the car flow. Now on many roads, you can see these blue arrows, which stand for biking lanes. These are not actual biking lanes, however, it’s better than nothing.</p><p><img src="https://imgcdn.nightcity.pub/202309202149802.webp" alt="Biking lane in Changsha"></p><p>In most situations, the roads are okay and fit for biking. You can take the sidewalk if it’s too dangerous to share the road with cars.</p><p>Parking a bike here is not that easy, be careful of thieves, so make sure your lock is effective and durable enough to prevent it from being stolen.</p><h3 id="Drivers"><a href="#Drivers" class="headerlink" title="Drivers"></a>Drivers</h3><p>Most drivers will pay attention to you if you’re riding a bike, however, you still need to keep an eye on the traffic to make sure you won’t be hurt by a stupid driver.</p><p>It always happens that there are a bunch of cars parking on the side of the road which blocks the path for bikes. Sometimes it’s the road designer’s fault, but in most situations, the driver is to blame, pretty annoying.</p><h3 id="Climate"><a href="#Climate" class="headerlink" title="Climate"></a>Climate</h3><p>Changsha’s climate is terrible, most time in the year it’s just anything but comfortable. Summer here is wet and drastically hot, which makes people sweaty, sometimes even causing heatstroke. Winter is kind of mild, but still too cold for biking. There’s a joke among local people that says there are only two seasons in Changsha, Summer and Winter. Comfy weather in spring and autumn has become increasingly uncommon in recent years, probably due to climate change.</p><p>So the weather is not likely comfortable here in Changsha.</p><h2 id="Conclusion"><a href="#Conclusion" class="headerlink" title="Conclusion"></a>Conclusion</h2><p>I don’t think Changsha is currently bike-friendly. The infrastructure here is not quite ideal, some drivers are not so friendly, and the climate here is also terrible. The city is making its effort to improve itself, wanting to be bike-friendly, and ultimately, human-friendly. But what has been done is just not enough. </p><p>Despite these “not enough” works, I am happy to see Chinese cities changing for the better throughout all these years, and I hope our city to be even better, even happier.</p>]]></content>
</entry>
<entry>
<title>江城武汉圣地巡礼:《三色绘恋》《恋爱绮谭》《高考恋爱100天》</title>
<link href="/2023/08/wuhan-trip/"/>
<url>/2023/08/wuhan-trip/</url>
<content type="html"><![CDATA[<p>江城武汉,国 gal 最高城也。</p><p>这次去武汉,巡礼三个国产 Galgame:《三色绘恋》《恋爱绮谭》和《高考恋爱100天》。</p><p>于是乎挑了一个早上开车一路从长沙狂奔到武汉,到取水楼那订好的酒店住下了。</p><p>当时三伏天还没过去,看了下天气,最高35℃,其实已经很热了。但对于在长沙这种天气极度抽象的地方熬了这么多年的我来说,武汉的天气反倒是可以接受的。(再次证明了长沙的气候就是依托答辩)</p><p>不浪费时间,随便找了家店吃午饭就往中山公园里怼,圣地巡礼正式开始!</p><h2 id="三色绘恋"><a href="#三色绘恋" class="headerlink" title="三色绘恋"></a>三色绘恋</h2><p>应该是2021年接触到的这部 Gal,剧情是真的胃疼,每次推一小段就会因为不忍心看后面的剧情而关掉这个游戏,加之这游戏在 Steam 里叫 Tricolor Lovestory,自然的就按照字母顺序排到了后面,也相应的减少了我打开它的次数。于是直到最近我才把这个游戏给推完。</p><p>游戏本体非常优秀,<strong>百万</strong>字的剧情文本,加上几百张高质量的CG和全程配音,定价却只要11块,还时不时的打折。后面制作组搞事情弄出来的 Trash End 就毁了这么好的一个 IP,实在是可惜了。</p><h3 id="师贰高级中学"><a href="#师贰高级中学" class="headerlink" title="师贰高级中学"></a>师贰高级中学</h3><p><img src="https://imgcdn.nightcity.pub/202308211235352.webp" alt="IMG_6790"></p><p><img src="https://imgcdn.nightcity.pub/202308211245628.webp" alt="Shierzhong"></p><p><img src="https://imgcdn.nightcity.pub/202308211240947.webp" alt="IMG_6794"></p><p><img src="https://imgcdn.nightcity.pub/202308211240386.webp" alt="IMG_6793"></p><p>这是主催的母校,在游戏里竟然是媲美华师一附中的存在,然而现实里就是一所很普通的高中,特色就是这个很夸张但没卵用的拱门。顺带一提,这所学校正在改建,看宣传图似乎是要改的面目全非了,再晚几年可能就完全无法辨认。</p><h3 id="邱诚和墨小菊的上学路"><a href="#邱诚和墨小菊的上学路" class="headerlink" title="邱诚和墨小菊的上学路"></a>邱诚和墨小菊的上学路</h3><p>现实中的航天路,由于店面已经面目全非,而且一侧的店铺已经完全拆除了,已经几乎无法辨认。找了一圈这里大概是比较像的地方。</p><p><img src="https://imgcdn.nightcity.pub/202308211251626.JPG" alt="IMG_6785"></p><h3 id="据说是文芷家原型"><a href="#据说是文芷家原型" class="headerlink" title="据说是文芷家原型"></a>据说是文芷家原型</h3><p>现实中是电业新村,门的造型和游戏里非常相似。</p><p><img src="https://imgcdn.nightcity.pub/202308211253489.JPG" alt="IMG_6778"></p><p><img src="https://imgcdn.nightcity.pub/202308241804675.webp" alt="image-20230824180417043"></p><h3 id="邱诚和墨小菊所在的小区"><a href="#邱诚和墨小菊所在的小区" class="headerlink" title="邱诚和墨小菊所在的小区"></a>邱诚和墨小菊所在的小区</h3><p>现实中是地质家属小区:</p><p><img src="https://imgcdn.nightcity.pub/202308211255581.JPG" alt="IMG_6770"></p><p>顺便在旁边那家副食店买瓶水,证明我来过(</p><p><img src="https://imgcdn.nightcity.pub/202308211256833.JPG" alt="IMG_6771"></p><h3 id="中山公园"><a href="#中山公园" class="headerlink" title="中山公园"></a>中山公园</h3><p>经常出现在场景里的桥,旁边的小卖部是没有的,倒是有一个自助图书馆。中山公园我拍的都是视频,为了加载体验,只好截几张图放上来。</p><p><img src="https://imgcdn.nightcity.pub/202308211300209.png" alt="IMG_2023"></p><p>邱诚被牛头人的地方:</p><p><img src="https://imgcdn.nightcity.pub/202308211302146.png" alt="公园"></p><p>没碰上喷泉表演真可惜了。</p><p>墨小菊的夺命碰碰车:</p><p><img src="https://imgcdn.nightcity.pub/202308211304617.png" alt="image-20230821130442464"></p><h3 id="利北社区"><a href="#利北社区" class="headerlink" title="利北社区"></a>利北社区</h3><p>以下是三色绘恋S里出现的场景。</p><p>迟菓住的小区,u1s1确实比较老旧了,名字的由来应该是利济北路。但在这么市中心的位置,价格也真不便宜啊。顺带一提,只要从这个社区出来过一条马路就是邱诚和墨小菊住的地方,真有够近的。</p><p><img src="https://imgcdn.nightcity.pub/202308212209938.JPG" alt="IMG_6980"></p><p>游戏里完全是1:1还原了这个小区。</p><p><img src="https://imgcdn.nightcity.pub/202308241451156.png" alt="屏幕截图 2023-08-23 001315"></p><h3 id="江城市第六十八初"><a href="#江城市第六十八初" class="headerlink" title="江城市第六十八初"></a>江城市第六十八初</h3><p>迟菓读的初中,游戏里也是1:1的还原,甚至连旁边的刘记腰花面都没有落下。</p><p><img src="https://imgcdn.nightcity.pub/202308212213909.JPG" alt="IMG_6765"></p><p><img src="https://imgcdn.nightcity.pub/202308241452468.png" alt="屏幕截图 2023-08-23 001030"></p><h3 id="汉街上的「稻当劳」"><a href="#汉街上的「稻当劳」" class="headerlink" title="汉街上的「稻当劳」"></a>汉街上的「稻当劳」</h3><p><img src="https://imgcdn.nightcity.pub/202308212227459.JPG" alt="IMG_6959"></p><p><img src="https://imgcdn.nightcity.pub/202308241756363.png" alt="image-20230824175657846"></p><p>别问了,我没有在这里买草莓新地。</p><h3 id="轻轨「循礼门」站"><a href="#轻轨「循礼门」站" class="headerlink" title="轻轨「循礼门」站"></a>轻轨「循礼门」站</h3><p><img src="https://imgcdn.nightcity.pub/202308241806200.webp" alt="image-20230824180625937"></p><p><img src="https://imgcdn.nightcity.pub/202308241859851.webp" alt="屏幕截图 2023-08-24 175957"></p><p>实际上是二号线的一个地铁站,轻轨不应该是一号线吗,武汉怎么2005年就有地铁了?</p><h3 id="江城市风景"><a href="#江城市风景" class="headerlink" title="江城市风景"></a>江城市风景</h3><p><img src="https://imgcdn.nightcity.pub/202308252356970.JPG" alt="DJI_0199"></p><p>那张CG我找不到了,并且这个还是夜景不过武汉的这个风景应该还挺 iconic 的吧?</p><p>和武汉官方的宣传视频不太一样的是,很多建筑的灯光是关着的,导致现在拍出来画面没有官方拍的时候灯光拉满来的好看。</p><h2 id="恋爱绮谭"><a href="#恋爱绮谭" class="headerlink" title="恋爱绮谭"></a>恋爱绮谭</h2><p>恋爱绮谭是我在暑假前才接触到的游戏系列,当时玩过以后,实感相见恨晚,也很高兴能看见国 Gal 在铺天盖地的压力和江河日下的大环境下,仍能保持自己的那一份相对崇高的追求和社会责任感。</p><p>恋爱绮谭的场景设定其实都和现实差距很大,没有像三色绘恋「利北社区」那种1:1还原的场景。但现场的氛围依然给得很足,巡礼是值得的。</p><h3 id="苹果湖中学总校"><a href="#苹果湖中学总校" class="headerlink" title="苹果湖中学总校"></a>苹果湖中学总校</h3><p><img src="https://imgcdn.nightcity.pub/202308212218631.JPG" alt="IMG_6955"></p><p><img src="https://imgcdn.nightcity.pub/202308260027302.png" alt="image-20230826002750808"></p><p>恋爱绮谭主要场景之一——苹果湖高级中学,原型是水果湖高级中学。这所学校就在湖北省委旁边,所以是禁飞区,我甚至没法飞无人机进去航拍一下。</p><p>既然在湖北省委旁边,自然少不了那些官二代、红二代,这所学校在网上可谓是流言四起,显得非常神秘。</p><p><img src="https://imgcdn.nightcity.pub/202308212239657.JPG" alt="IMG_6957"></p><p>感觉这是最像原游戏里校门的地方了。</p><h3 id="充能国安路"><a href="#充能国安路" class="headerlink" title="充能国安路"></a>充能国安路</h3><p><img src="https://imgcdn.nightcity.pub/202308212241976.JPG" alt="IMG_6962"></p><p><img src="https://imgcdn.nightcity.pub/202308212250739.JPG" alt="IMG_6963"></p><p><img src="https://imgcdn.nightcity.pub/202308260011216.png" alt="image-20230826001131728"></p><p>官方设定集里的原型是鸣笛1988商业街,在现实里是一条非常冷清的商业街,入驻的商户没有几家,也看不到任何一个顾客,当然也没有游戏里「充能国安路(CNGal)」那样的二次元周边店。我想知道制作组是怎么找到这么小众的商业街的。而且这条商业街特别小,附上航拍图:</p><p><img src="https://imgcdn.nightcity.pub/202308251233335.webp" alt="DJI_0202"></p><p>就是那个不规则的四边形。而且从游戏里的图来看,制作组还混合了日本某个商店街(也不知道是哪一个)的样式进行了二创,简直是一点都不像。</p><p>关于在游戏第二部里出事的奶茶店,在这个位置倒是有一家茶颜,我进去点了杯筝筝纸鸢,证明我来过,顺便点亮「武汉」徽章:</p><p><img src="https://imgcdn.nightcity.pub/202308212249948.PNG" alt="IMG_6965"></p><p><img src="https://imgcdn.nightcity.pub/202308212251401.JPG" alt="IMG_6967"></p><h3 id="苹果湖中学分校"><a href="#苹果湖中学分校" class="headerlink" title="苹果湖中学分校"></a>苹果湖中学分校</h3><p>设定集里的位置在现实中是菱角湖公园,完全就不是一个东西嘛……</p><p><img src="https://imgcdn.nightcity.pub/202308212259811.JPG" alt="VFHL0144"></p><p>苏半夏(用怪异)就读的学校,位置就在鸣笛1988的旁边,符合苏半夏和顾伟从分校出来就能到充能国安路的设定。</p><h3 id="孱陵路"><a href="#孱陵路" class="headerlink" title="孱陵路"></a>孱陵路</h3><p>现实里是公安街,这条街道是一个典型的「老破小」街区,很脏,很乱,但也很有气氛。但地段其实特别好,生活也很方便。</p><p>我到公安街的时候已经十点半了,在武汉跑了一天,拖着疲惫的身子从大智路地铁站出来,走了一阵,一进到公安街,一股阴森的感觉扑面而来。辅以游戏中的故事,代入感极强。这里一定要晚上来,白天来,这种感觉就会尽数失去。</p><p><img src="https://imgcdn.nightcity.pub/202308212304303.JPG" alt="IMG_6861"></p><p>个人觉得最像游戏里的一处是这里:</p><p><img src="https://imgcdn.nightcity.pub/202308220004301.JPG" alt="IMG_6880"></p><p><img src="https://imgcdn.nightcity.pub/202308260014544.png" alt="image-20230826001446046"></p><p>简直就是游戏里潺陵路33号的入口,可惜旁边没有卖鱼头汤的店,要不然代入感还能更强。走进这种地方,我其实觉得特别亲切,我小时候,也天天要经过这样的街区,也曾住过一段时间像潺陵路33号这样的房子,比起那些光鲜亮丽的高楼大厦,这样的地方,才是人间真实。这样的小区里,可能住着在这里生活了一辈子的老武汉人,可能住着节省开支的人……总觉得繁华的街区皆是幻境,在幻境中呆久了,便会愈发的分不清幻境与现实。而这种地方,却可以让我感到无比踏实。</p><p><img src="https://imgcdn.nightcity.pub/202308220015220.JPG" alt="IMG_6877"></p><p><img src="https://imgcdn.nightcity.pub/202308220016278.JPG" alt="IMG_6868"></p><h3 id="江城大桥"><a href="#江城大桥" class="headerlink" title="江城大桥"></a>江城大桥</h3><p>原型是武汉长江二桥,据制作组称,选择武汉长江二桥是因为一桥画出来太平平无奇了。当时是中午,拍的时候光线实在是太差,凑合着看看吧。</p><p><img src="https://imgcdn.nightcity.pub/202308260034319.png" alt="image-20230826003446859"></p><p><img src="https://imgcdn.nightcity.pub/202308241447490.JPG" alt="FCTF9938"></p><p>也不知道钟齐北救起顾唯的地方是武昌江滩还是汉口江滩,但好像只有汉口江滩这边有芦苇丛,所以姑且算作是汉口江滩。那么下面就是顾唯被救起的地方:</p><p><img src="https://imgcdn.nightcity.pub/202308241445269.JPG" alt="IMG_7008"></p><h2 id="高考恋爱100天"><a href="#高考恋爱100天" class="headerlink" title="高考恋爱100天"></a>高考恋爱100天</h2><p>这游戏一共有61个结局,我只解锁了其中5个,这次来巡礼很大程度上只是顺便。</p><p>不过说回游戏,这确实是个很优秀的作品,既有游戏性剧情也很丰富,国 Gal 最大的优势便是题材和场景对于本土玩家的「亲切」感,这部就把这两个优势发挥得淋漓尽致。有点像是「中国式家长」剧情更丰富、CG 更多的微操版。</p><p>唉,我高考的时候怎么就没有「木馨的护身符」和「1977年的回忆」这种神仙道具呢。</p><h3 id="武汉长江大桥"><a href="#武汉长江大桥" class="headerlink" title="武汉长江大桥"></a>武汉长江大桥</h3><p><img src="https://imgcdn.nightcity.pub/202308220018803.JPG" alt="IMG_6833"></p><p>这个场景其实还挺iconic的,尤其是对面的电视塔,游戏里经常出现。</p><h3 id="华懿高级中学"><a href="#华懿高级中学" class="headerlink" title="华懿高级中学"></a>华懿高级中学</h3><p>原型是华中师范大学第一附属中学,由于戒备实在森严,只好飞个无人机进去拍一圈走人了,属实有点遗憾了。</p><p><img src="https://imgcdn.nightcity.pub/202308251239863.JPG" alt="DJI_0225"></p><p><del>要是他们真有老宿舍那我翻围栏都要翻进去找一本「1977的回忆」</del></p><h2 id="最后……"><a href="#最后……" class="headerlink" title="最后……"></a>最后……</h2><p>在武汉的三天过得非常扎实,基本上去了所有我想要看到的地方。但无奈时间的问题,像是「雨娘传说」的公交站,江景别墅的原型……还是有些地方没能去成,时间紧的时候,做些取舍终究还是很无奈的。</p><p>国 Gal 因「亲切」深得我心,这种题材的亲切、生活环境的亲切,是其他 Gal 无法提供的。正如前面提到,我很高兴看到国 Gal 能够在重重压力下依然保持自己的追求,为我们带来优秀的作品。说来也怪,在如此差的环境下,我们依然在一些方面有所建树。人们总是去歌颂这些建树,默认苦难的合理性,却从来无人过问,是什么造就了如此差的环境。</p><p>希望未来能看到更多优秀作品,也希望我们能早日看到我民族真正解放之日。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 旅行 </tag>
<tag> Galgame </tag>
<tag> 圣地巡礼 </tag>
</tags>
</entry>
<entry>
<title>逃离 1Password:Bitwarden 部署及一个月使用体验</title>
<link href="/2023/08/1password-to-bitwarden/"/>
<url>/2023/08/1password-to-bitwarden/</url>
<content type="html"><![CDATA[<p>之前我的密码管理在用 1Password,体验其实只能算是不差,由于没有针对中国市场做专门的本土化,所以其实这个产品和中国用户是有比较大的脱节的,体现在实际使用上就会发现,国内 APP 无论用户群体大小,几乎没有被适配的例子。加上其服务器不在国内,而且线路没有针对中国大陆做专门的优化,同步速度也是非常一般的。整体用下来,这两个原因让 1Password 的实际使用体验非常一般。</p><p>驱动我迁移的最大因素是价格,1Password 在国区 Appstore 的订阅价格是 238¥/年。其实不是很贵,但作为对比,我手上有两台相对廉价的 VPS,一台是 Racknerd 位于 LA 的 2C2.5G,25.88$ 一年;一台是位于上海的 2C4G 腾讯云轻量,600¥/三年。前面提到的两者订阅价格都比 1Password 便宜,既然同样的价格能用来干更多的事情,只用来开一个 1Password 订阅显然不划算。</p><p>说是「逃离」,逃离的是 1Password 的价格和使用体验的不对称而且 1Password 的数据也并非不能导出,从这方面想,说是「迁移」也许更加合适。在此之前我用过一次 Bitwarden,当时它给我的感受是虽然界面丑了点,但该有功能都有,足以满足我的需求。最重要的是,它开源免费并且可以自托管。于是在我 1Password 订阅到期后,我换到了 Bitwarden。</p><h2 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h2><p>起初我想部署 Bitwarden 官方 Docker 镜像,毕竟这不同于一般服务,这里保存的是重要的登录信息,比起节省服务器资源,保障其稳定性和安全性显然更加重要。直到看了 Bitwarden 官方 Docker 部署教程,不光资源消耗量大,某些功能还需要付费。相比之下,Vault Warden 部署就十分简单,而且功能支持也日趋完善,稳定性也足够用在生产环境。遂最终选择 Vault Warden。</p><p><a href="https://github.com/dani-garcia/vaultwarden">https://github.com/dani-garcia/vaultwarden</a></p><h3 id="基本配置"><a href="#基本配置" class="headerlink" title="基本配置"></a>基本配置</h3><p>新建目录和<code>docker-compose.yml</code>:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash"><span class="built_in">mkdir</span> vault-warden</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash"><span class="built_in">cd</span> vault-warden</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">vim docker-compose.yml</span></span><br></pre></td></tr></table></figure><p>如果你不熟悉<code>vim</code>等命令行编辑器,也可以用其他编辑器编辑<code>docker-compose.yml</code>。</p><p>编辑<code>docker-compose.yml</code>:</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">'3'</span></span><br><span class="line"></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line"> <span class="attr">vaultwarden:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">vaultwarden/server:latest</span></span><br><span class="line"> <span class="attr">container_name:</span> <span class="string">vaultwarden</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">always</span></span><br><span class="line"> <span class="attr">environment:</span></span><br><span class="line"> <span class="attr">DOMAIN:</span> <span class="string">"https://vaultwarden.example.com"</span> <span class="comment"># 您的域名;Vaultwarden 需要知道它是 https 才能正确处理附件</span></span><br><span class="line"> </span><br><span class="line"> <span class="attr">ports:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="number">12345</span><span class="string">:80</span><span class="comment"># 将 12345 换成需要的端口</span></span><br><span class="line"> <span class="attr">volumes:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">./vw-data:/data</span></span><br></pre></td></tr></table></figure><p>启动编排:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">docker compose up</span></span><br></pre></td></tr></table></figure><p>如果你使用的是老的 Docker Compose,则应使用这个写法:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">docker-compose up</span></span><br></pre></td></tr></table></figure><p>随后反代前面设置的端口,部署 SSL 证书即可。</p><h3 id="进阶配置"><a href="#进阶配置" class="headerlink" title="进阶配置"></a>进阶配置</h3><h4 id="禁止新用户注册"><a href="#禁止新用户注册" class="headerlink" title="禁止新用户注册"></a>禁止新用户注册</h4><p>访问新部署的 Vault Warden 并注册账号,随后向<code>docker-compose.yml</code>添加以下环境变量:</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">SIGNUPS_ALLOWED:</span> <span class="string">"false"</span></span><br></pre></td></tr></table></figure><p>以禁止新用户注册。</p><h4 id="启用推送更新"><a href="#启用推送更新" class="headerlink" title="启用推送更新"></a>启用推送更新</h4><p>推送更新分网页端的 WebSocket 和手机应用的推送更新,尤其是 iOS 的推送更新直到不久之前才被 Vault Warden 实现(<a href="https://github.com/dani-garcia/vaultwarden/pull/3304%EF%BC%89%E3%80%82">https://github.com/dani-garcia/vaultwarden/pull/3304)。</a></p><p>最终的<code>docker-compose.yml</code></p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">"3"</span></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line"> <span class="attr">vault-warden:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">vaultwarden/server:latest</span></span><br><span class="line"> <span class="attr">container_name:</span> <span class="string">vault-warden</span></span><br><span class="line"> <span class="attr">ports:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">"25635:80"</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">"25636:3012"</span></span><br><span class="line"> <span class="attr">volumes:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">"/vaultwarden/data/:/data/"</span></span><br><span class="line"> <span class="attr">environment:</span></span><br><span class="line"> <span class="attr">SIGNUPS_ALLOWED:</span> <span class="string">"false"</span></span><br><span class="line"> <span class="attr">WEBSOCKET_ENABLED:</span> <span class="string">"true"</span></span><br><span class="line"> <span class="attr">PUSH_ENABLED:</span> <span class="string">"true"</span></span><br><span class="line"> <span class="attr">PUSH_INSTALLATION_ID:</span> <span class="string">"ce5e2106-f69d-4f9d-9ddf-b04400a192bd"</span></span><br><span class="line"> <span class="attr">PUSH_INSTALLATION_KEY:</span> <span class="string">"fgxipZubZrm48yxWhsnM"</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">"always"</span></span><br></pre></td></tr></table></figure>]]></content>
<categories>
<category> 技术 </category>
</categories>
<tags>
<tag> Docker </tag>
</tags>
</entry>
<entry>
<title>重新捡起 RSS:RSSHub + FreshRSS 建立我的信息流</title>
<link href="/2023/07/rss-information-flow/"/>
<url>/2023/07/rss-information-flow/</url>
<content type="html"><![CDATA[<p>不知从什么时候开始,我的生活就慢慢的被推荐算法淹没,推荐视频、猜你喜欢……,几乎每天,我都或多或少的被他们所影响。我曾半开玩笑:「网速越快,其传递的信息就越少」,甚至有些一语成谶。这并不是互联网能传递的信息变少了,而是越来越快的网速、越来越准的推荐算法养废了我们,夺走了我们从网上获取信息的能力与主动权。</p><p>RSS 已是信息获取手段中的老古董了,但它的体验真的一点都不老古董:相反,用它来获取信息,体验极佳——不光无广告,还能让那些分散在一个一个网页上的信息自动跑到你面前,岂不美哉?我没有经历过那个时代,但听闻当年的大家,人人都拿着 Google Reader(Google 打造的 RSS 阅读器)读他们想读的内容,倒也真想回到那个年代体验一番。</p><p>可惜 Google Reader 这一产品早就关停了,曾经大多数网站都提供的 RSS 订阅源也悉数消失,想要重新拾起 RSS,就需要一点折腾了。</p><h2 id="RSSHub:万物皆可-RSS"><a href="#RSSHub:万物皆可-RSS" class="headerlink" title="RSSHub:万物皆可 RSS"></a>RSSHub:万物皆可 RSS</h2><p><a href="https://github.com/DIYgod/RSSHub">https://github.com/DIYgod/RSSHub</a></p><p>这是 <del>DIYDog</del>DIYGod 大佬发起的项目,就和它的标语一样,万物皆可 RSS,这个项目能通过爬取网页内容的方式生成 RSS 信息流,从而通过 RSS 订阅本不支持 RSS 的网站。</p><p>由于是爬取,难免会受到目标网页反爬取策略的影响,而有的目标网页(比如大陆的政府网站)会屏蔽他国 IP 的访问,亦或者屏蔽掉风险 IP。这些因素就比较考验机房了,但只要不是被特别「照顾」的 IP,一般问题不大。出于这些原因,我在分别在洛杉矶和上海部署了 RSSHub。</p><p>Docker 部署 RSSHub 非常简单,首先拉取已经写好的<code>docker-compose.yml</code>:</p><figure class="highlight shell"><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="meta prompt_">$ </span><span class="language-bash"><span class="built_in">mkdir</span> rsshub && <span class="built_in">cd</span> rsshub</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">wget https://raw.githubusercontent.com/DIYgod/RSSHub/master/docker-compose.yml</span></span><br></pre></td></tr></table></figure><p>然后检查有无需要修改的配置:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">vim docker-compose.yml</span></span><br></pre></td></tr></table></figure><p>我最终修改完成后,配置如下:</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">'3'</span></span><br><span class="line"></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line"> <span class="attr">rsshub:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">diygod/rsshub:chromium-bundled</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">always</span></span><br><span class="line"> <span class="attr">ports:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">'1200:1200'</span></span><br><span class="line"> <span class="attr">environment:</span></span><br><span class="line"> <span class="attr">NODE_ENV:</span> <span class="string">production</span></span><br><span class="line"> <span class="attr">CACHE_TYPE:</span> <span class="string">redis</span></span><br><span class="line"> <span class="attr">REDIS_URL:</span> <span class="string">'redis://redis:6379/'</span></span><br><span class="line"> <span class="attr">depends_on:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">redis</span></span><br><span class="line"> </span><br><span class="line"> <span class="attr">redis:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">redis:alpine</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">always</span></span><br><span class="line"> <span class="attr">volumes:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">redis-data:/data</span></span><br><span class="line"></span><br><span class="line"><span class="attr">volumes:</span></span><br><span class="line"> <span class="attr">redis-data:</span></span><br></pre></td></tr></table></figure><p>为什么要新建一个 Redis 镜像?主要是懒得配置容器互联,而 RSSHub 用 Redis 占不了多少资源,遂直接写进一个<code>docker-compose.yml</code>里,省去容器互联的麻烦。</p><p>启动编排:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">docker compose up<span class="comment"># 老的写法是 docker-compose up</span></span></span><br></pre></td></tr></table></figure><p>随后使用 Nginx 反代<code>localhost:1200</code>至域名,部署 SSL 证书,RSSHub 就全部搭建完成了。</p><h2 id="RSS-阅读器推荐"><a href="#RSS-阅读器推荐" class="headerlink" title="RSS 阅读器推荐"></a>RSS 阅读器推荐</h2><p>RSSHub 可以解决掉大多数订阅源的问题,接下来推荐几个 RSS 阅读器,解决的是最后一步如何呈现到设备上的问题。</p><h3 id="Windows"><a href="#Windows" class="headerlink" title="Windows"></a>Windows</h3><h4 id="Fluent-Reader"><a href="#Fluent-Reader" class="headerlink" title="Fluent Reader"></a>Fluent Reader</h4><p>我目前在用的 RSS 阅读器,开源小巧,遵循 Fluent Design,如果需要 Windows 上的免费 RSS 阅读器,那么大概率就是它了。需要注意的是,这是开源软件,但在应用商店里需要付费才能下载,不想付费则可以直接在 GitHub 上下载其安装包安装,当然,如果喜欢,鼓励大家支持这个项目。</p><p>Github仓库:<a href="https://github.com/yang991178/fluent-reader">https://github.com/yang991178/fluent-reader</a></p><h4 id="ThunderBird"><a href="#ThunderBird" class="headerlink" title="ThunderBird"></a>ThunderBird</h4><p>这个不是 RSS 阅读器,但也提供了 RSS 功能,比较适合打造邮件 RSS All in one。</p><p>ThunderBird 是由 Mozilla 基金会开发的一款开源邮件和新闻聚合客户端,已经有快 20 年的历史。</p><p>官网:<a href="https://www.thunderbird.net/zh-CN/">https://www.thunderbird.net/zh-CN/</a></p><h3 id="MacOS-和-iOS"><a href="#MacOS-和-iOS" class="headerlink" title="MacOS 和 iOS"></a>MacOS 和 iOS</h3><h4 id="NetNewsWire"><a href="#NetNewsWire" class="headerlink" title="NetNewsWire"></a>NetNewsWire</h4><p>开源,Swift UI 原生编写,几乎完美的 RSS 阅读器,说实话我很惊讶这位作者维护这个项目的时间跨度。</p><p>NetNewsWire 是由 Brent Simmon 出于爱好和支持 RSS 发展开发的 RSS 阅读器,遗憾的是,由于是 Swift UI 编写,只支持 Mac OS 和 iOS。</p><p>官网:<a href="https://netnewswire.com/">https://netnewswire.com/</a></p><p>Github仓库:<a href="https://github.com/Ranchero-Software/NetNewsWire">https://github.com/Ranchero-Software/NetNewsWire</a></p><h4 id="Reeder"><a href="#Reeder" class="headerlink" title="Reeder"></a>Reeder</h4><p>这个就是收费 App 了,但功能做的很不错。作为「骨灰级」应用,Reeder 一度被人称为 iOS 与 macOS 上最好用的 RSS 阅读器。不光设计精致,还支持如桌面小组件等各种 Mac OS 和 iOS 上原生的功能,如果你的预算充足,可以考虑。</p><p>官网:<a href="https://reederapp.com/">https://reederapp.com/</a></p><h4 id="Fluent-Reader-1"><a href="#Fluent-Reader-1" class="headerlink" title="Fluent Reader"></a>Fluent Reader</h4><p>又是之前提到的 Fluent Reader 也提供了 Mac 版本,实测在 Mac OS 上体验也还不错,在 iOS 上虽然看起来是原生 UI,但实际上是 React 写的跨平台版本,而且还需要收费,如果想要支持这个项目,可以考虑购买。</p><p>Github仓库:<a href="https://github.com/yang991178/fluent-reader">https://github.com/yang991178/fluent-reader</a></p><p>Github仓库(Fluent Reader Lite):<a href="https://github.com/yang991178/fluent-reader-lite">https://github.com/yang991178/fluent-reader-lite</a></p><h3 id="安卓"><a href="#安卓" class="headerlink" title="安卓"></a>安卓</h3><h4 id="Fluent-Reader-2"><a href="#Fluent-Reader-2" class="headerlink" title="Fluent Reader"></a>Fluent Reader</h4><p>又双叒是 Fluent Reader,在安卓上,Fluent Reader 依然是贴合 iOS 的 UI,用起来有点牛头人的感觉,若不在意这一点,体验倒还不错。</p><p>除了 Fluent Reader 外,我似乎没有找到什么还在维护且支持 Fever API 或者 Google Reader API 的 APP,如果有欢迎在评论区留言。</p><p>Github仓库:<a href="https://github.com/yang991178/fluent-reader-lite">https://github.com/yang991178/fluent-reader-lite</a></p><h2 id="总感觉还缺点什么?"><a href="#总感觉还缺点什么?" class="headerlink" title="总感觉还缺点什么?"></a>总感觉还缺点什么?</h2><p>理论上来说,解决了订阅源的问题,还解决了呈现在设备上的问题,我们已经还原出 Google Reader 的体验了,但我在实际使用中,总是觉得缺少了一些特性,体验并不完整。</p><p>这个特性就是「同步」。我所希望的,是我在 A 设备上阅读,阅读进度可以同步到 B 设备上,在 A 设备上收藏的文章,打开 B 设备,能原封不动的呈现在我眼前。</p><p>同时,还有一个体验上的要求:我希望我在拉取 Feed 时更加快速,不需要等待 RSSHub 抓取网页。</p><p>于是,一个自托管的 RSS 聚合服务就很有必要了。</p><h2 id="以-FreshRSS-完善体验"><a href="#以-FreshRSS-完善体验" class="headerlink" title="以 FreshRSS 完善体验"></a>以 FreshRSS 完善体验</h2><p>FreshRSS 是一个免费,自托管的 RSS 聚合器,相似的项目还有 Tiny Tiny RSS(TTRSS),选择 FreshRSS 是因为它提供两种 API,和各个 RSS 客户端配合的更好。</p><p>Github仓库:<a href="https://github.com/FreshRSS/FreshRSS">https://github.com/FreshRSS/FreshRSS</a></p><h3 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h3><p>部署 FreshRSS 的过程也很轻松。</p><p>创建目录:</p><figure class="highlight shell"><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="meta prompt_">$ </span><span class="language-bash"><span class="built_in">mkdir</span> freshrss</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash"><span class="built_in">cd</span> freshrss</span></span><br></pre></td></tr></table></figure><p>创建<code>docker-compose.yml</code>:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">vim docker-compose.yml<span class="comment"># 或者任意编辑器编辑</span></span></span><br></pre></td></tr></table></figure><p><code>docker-compose.yml</code>如下:</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">"3"</span></span><br><span class="line"></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line"> <span class="attr">freshrss:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">freshrss/freshrss:latest</span></span><br><span class="line"> <span class="attr">container_name:</span> <span class="string">freshrss</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">unless-stopped</span></span><br><span class="line"> <span class="attr">ports:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">"9999:80"</span><span class="comment"># 将9999更改成需要的端口</span></span><br><span class="line"> <span class="attr">volumes:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">./data:/var/www/FreshRSS/data</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">./extensions:/var/www/FreshRSS/extensions</span></span><br><span class="line"> <span class="attr">environment:</span></span><br><span class="line"> <span class="attr">PUID:</span> <span class="number">0</span></span><br><span class="line"> <span class="attr">PGID:</span> <span class="number">0</span></span><br><span class="line"> <span class="attr">CRON_MIN:</span> <span class="string">"1,31"</span></span><br><span class="line"> <span class="attr">TZ:</span> <span class="string">"Asia/Shanghai"</span></span><br></pre></td></tr></table></figure><p>最后执行:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">docker compose up<span class="comment"># 老的写法是 docker-compose up</span></span></span><br></pre></td></tr></table></figure><p>随后反代端口,部署 SSL 证书。初始设置时,数据库选现有的数据库类型,如果没有部署数据库,直接选 SQLite 即可。至此,FreshRSS 部署完成。</p><p>如果之前有订阅源,将其以 OPML 格式导出,然后导入 FreshRSS 就可以获得几乎无缝的体验。</p><p><img src="https://imgcdn.nightcity.pub/%E6%88%AA%E5%B1%8F2023-07-18%2015.17.39.png" alt="FreshRSS"></p><p>如果有现成的 PHP 环境而不想用 Docker 部署,还可以像安装 Wordpress 一样安装好 FreshRSS。</p><h3 id="设置-FreshRSS"><a href="#设置-FreshRSS" class="headerlink" title="设置 FreshRSS"></a>设置 FreshRSS</h3><p>RssHub 充当的是提供订阅源的中心,而 FreshRSS 充当的是一个阅读订阅源的「Hub」,帮助我们集中管理订阅源,同步各设备间的阅读进度。现在订阅源已经集中管理起来,同步个设备间的阅读进度就需要 FreshRSS 提供的 API 了。</p><p>FreshRSS 提供 GReader 和 Fever 两种 API,具体的启用方法如下:</p><ol><li>登入 FreshRSS 进入「设置」->「认证」开启「允许API 访问」</li><li>进入「账户」在页面底部设置一个 API 密钥</li><li>编辑<code>./freshrss/data/config.php</code>中的<code>base_url</code>,改为你的域名根目录地址,比如我的就需要改成<code>https://rss.nightcity.pub/</code></li><li>转到<code>https://example.com/api/</code>查看检测是否通过</li></ol><p><img src="https://imgcdn.nightcity.pub/202307191728380.webp" alt="修改FreshRSS的配置示例1"></p><p><img src="https://imgcdn.nightcity.pub/202307191730452.webp" alt="FreshRSS config.php 文件"></p><p><img src="https://imgcdn.nightcity.pub/202307191731432.webp" alt="FreshRSS API 测试全部通过"></p><h3 id="设置各设备上的客户端"><a href="#设置各设备上的客户端" class="headerlink" title="设置各设备上的客户端"></a>设置各设备上的客户端</h3><h4 id="NetNewsWire-1"><a href="#NetNewsWire-1" class="headerlink" title="NetNewsWire"></a>NetNewsWire</h4><p>部署完成后,在手机上和电脑上支持的应用里使用设置好的用户名和 API 密钥登陆,就可以享受到全程丝滑的 RSS 体验了,下面以 NetNewsWire 为例:</p><p><img src="https://imgcdn.nightcity.pub/image-20230718154700897.png" alt="NetNewsWire集成FreshRSS"></p><p>打开NetNewsWire添加账号的选项卡,NetNewsWire贴心的集成了FreshRSS,可以很方便的添加账号:</p><p><img src="https://imgcdn.nightcity.pub/image-20230718155048961.png" alt="登陆信息"></p><p>NetNewsWire 要求 Greader 的 API,直接在 /api 上复制就可以了。</p><p><img src="https://imgcdn.nightcity.pub/image-20230718155246945.png" alt="NetNewsWire效果"></p><h4 id="FluentReader"><a href="#FluentReader" class="headerlink" title="FluentReader"></a>FluentReader</h4><p>在设置中选择 Google Reader API:</p><p><img src="https://imgcdn.nightcity.pub/202307191734756.webp" alt="FluentReader设置"></p><p>然后填入相关信息:</p><ul><li>API端点直接从<code>/api</code>网页上复制 Google Reader API 的 API 端点即可</li><li>用户名填写安装 FreshRSS 时设置的用户名</li><li>密码是前文设置的 API 秘钥</li></ul><p>即可设置完成。</p><p>其他的客户端设置大同小异,无外乎上面两大类,可以参考上面的方法进行设置。</p><h2 id="RSS-订阅什么呢"><a href="#RSS-订阅什么呢" class="headerlink" title="RSS 订阅什么呢"></a>RSS 订阅什么呢</h2><p>我们已经装好了 RSSHub,这极大的方便了我们的订阅以及丰富了我们的订阅源。RSSHub 的官方文档中维护着一份详细的支持列表,支持的项目不可谓不繁多:媒体、博客……甚至大学通知,Twitter 更新都能覆盖。</p><p>以订阅「湖南省政府采购网」的「采购公告」为例,首先需要在 RSSHub 的文档中找到「湖南省政府采购网」以获取其订阅的「路由」:</p><p><img src="https://imgcdn.nightcity.pub/image-20230720180435763.png" alt="湖南省政府采购网的RSSHub文档"></p><p>查询文档可知我们所需要的路由是<code>/gov/hunan/notice/:type</code>,其中<code>:type</code>是一个必选参数,我们需要获取的是「采购公告」所以<code>:type</code>应该是<code>cg</code>,最终需要的路由就是<code>/gov/hunan/notice/cg</code>。将这个路由附加在我们部署(反代)RSSHub 的网址后,即可得到完整的订阅地址,例如:部署rsshub的网址是<code>https://rsshub.app</code>,则最终的订阅地址为:<code>https://rsshub.app/gov/hunan/notice/cg</code>,将其加入 FreshRSS 的订阅即可。</p><p>需要注意的是,FreshRSS 似乎不支持自动转换订阅链接里的非 ASCII 字符,如果你的订阅链接里含有这些字符,如<code>https://rsshub.app/sspai/tag/派早报</code>,则建议在浏览器内先访问一下,再将转换后的链接粘贴进 FreshRSS 以转换链接中的非 ASCII 字符。</p><p>对于原本就有 RSS 的网站,推荐使用 RSSHub Radar,这是一款浏览器插件,可以实现 RSS 订阅源的自动嗅探,而不必在网站上四处寻找。推荐它是因为,它不光可以嗅探 RSS 链接,如果目标网站可以用 RSSHub 订阅,这个插件可以自动匹配支持的 RSSHub 路由。</p><p>Github 仓库:<a href="https://github.com/DIYgod/RSSHub-Radar">https://github.com/DIYgod/RSSHub-Radar</a></p><h2 id="最后……"><a href="#最后……" class="headerlink" title="最后……"></a>最后……</h2><p>经过了这一番折腾,基本体验到了当时人人都用着 Google Reader 的乐趣。即便如此,属于 Google Reader 的时代终究还是过去了,那个人人都可以从网上收获纯粹的知识与快乐的时代,也已然一去不复返。这些年来网速越来越快,但给我的上网体验却越来越差。大多数人都开始上网的时候,内容农场,推荐算法……只要有利可图,互联网精神,那个曾经作为互联网基石的精神,就全被这些追逐利益的资本和官商勾结的政府抛在脑后。我甚至可以说:至少在中国,那个曾经「互联网」的理想已死。</p><p>RSS 的没落只是大环境的缩影,「技术」固然需要进步,但没有与之相匹配的「人文」,这种进步就会成为一场灾难。以我们现在的状态来看,赛博朋克真的离我们不远——技术进步,不但不能消除不平等,反而会加剧压迫与控制。</p><p>即使大环境再怎么黑暗,我们依然能看到一线生机,依然会有人去发扬几乎被大环境抛在脑后但弥足珍贵的互联网精神,散发光和热,通过自己的方式捍卫互联网的开放与自由。</p><p>感谢所有这些开源项目的贡献者,也向所有热爱分享的同路人致敬。</p><h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><ul><li><p><a href="https://sspai.com/post/63202">https://sspai.com/post/63202</a></p></li><li><p><a href="https://docs.rsshub.app/">https://docs.rsshub.app/</a></p></li><li><p><a href="https://typecho.l3zc.com/archives/20/">https://typecho.l3zc.com/archives/20/</a></p></li></ul><p>以及这篇文章里所有提到的链接。</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
<tags>
<tag> Docker </tag>
<tag> RSS </tag>
<tag> Linux </tag>
</tags>
</entry>
<entry>
<title>真的「喜欢」这首歌吗</title>
<link href="/2023/07/really-a-loved-song/"/>
<url>/2023/07/really-a-loved-song/</url>
<content type="html"><![CDATA[<p>音乐是我生活中不可缺少的一部分,每次听自己想听的音乐,心情都会变得无比舒畅。</p><p>我喜欢随机播放音乐,给自己寻找一些新鲜感。为了听到自己「想听」的音乐,随机到我不喜欢的音乐时,我自然会选择性的跳过,直达契合自己先下想听的那首曲子。</p><p>时间一长,我发现:有些曲子,似乎不是什么想不想听的问题——几乎每次听歌遇到这些曲子,我都会选择跳过,很多都是第一次收藏以后就再也没有听过了。即使如此,我也不忍心将他们移出我的歌单,因为,那至少是我曾经「喜欢」过的曲子。思来想去,我依旧还是遇到他们就选择性的跳过,即使这样更加麻烦。</p><p>这些所谓「喜欢」的音乐也影响到了推荐算法,很快,我的「每日推荐」「每周新发现」等歌单,被那些「似乎喜欢」的音乐充斥。每次听算法推荐的歌单,都有一种在逛 CSDN 的感觉,可以算作是「屎里刨金」吧。面对这种情况,我常常对推荐算法失望透顶,却又不得不承认,那些「似乎喜欢」的音乐,影响了推荐算法的成果。</p><p>是我对「喜欢」这首歌的概念定义错了。对于那些听了一次就不再听的歌,我终于明白了,终究还是我「不喜欢」他们啊。给那些根本就「不喜欢」的歌按上红心,收藏起来,越积越多,甚至越发影响自己听那些真正「喜欢」的歌。这不是敝帚自珍,本末倒置吗?</p><p>是时候清理那些「似乎喜欢」的歌了。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 音乐 </tag>
<tag> 感想 </tag>
</tags>
</entry>
<entry>
<title>转载:感悟经典</title>
<link href="/2023/07/repost-gan-wu-jing-dian/"/>
<url>/2023/07/repost-gan-wu-jing-dian/</url>
<content type="html"><![CDATA[<p>中国向有斗士和隐士两类散文家,其最大的区别在于斗士把散文当利剑,隐士拿散文当雕刀。斗士惯有特立独行,宁为玉碎的血性,也许他的剑术并不高明,却一定刺中要害。「特殊的时代一定会产生特殊的文体」,鲁迅式与茅盾式的散文的现实性和战斗性,实在是他们当时所处大时代的造物。要在他们的散文里寻觅矫情自饰的小情调,「小摆设」,则不免徒费无益。他们是把散文当「投枪」与「匕首」的,才不会把它变成高逸人士手里的小玩意,去「专论苍蝇之微」。正如阿英所说:「在中国的小品文活动中,为了社会巨大目标而探索的作家,在努力的探索着这条路的,除了茅盾、鲁迅以外,似乎还没有第三个人。」</p><p>因而,正当大时代而一味的「品赏」「幽默」与「闲适」,就显得十分不合时宜了。不是吗?曾几何时,「幽默」的老舍就遇到过难堪的尴尬,他怎么会想到「幽默」竟会给他带来「危险」!他那篇《「幽默」的危险》既是一次辩白,也是在为一己的幽默正名。这自然起因于鲁迅对林语堂所办《论语》半月刊的批评,而老舍当时常给《论语》写稿。当国家身处内忧外患之际,林语堂倡导「幽默」、「性灵」,「以自我为中心,以闲适为格调」,自然便有了专事玩弄之嫌。眼里从不糅沙子的鲁迅,批评林语堂将幽默导向「将屠户的凶残,使大家化为一笑,收场大吉。」也就顺理成章。可要是单从鲁迅 1934 年 6 月 18 日写给台静农的那封信来看,他当时对老舍的幽默是更看不上眼的。他说:「文坛,则刊物杂出,大都属于 ‘小品’。此为林公语堂所提倡,盖骤见宋人语录,明人小品,所未前闻,遂以为宝,而其作品,则已远不如前矣。如此下去,恐将与老舍半农,归于一丘。其实,则真所谓‘是亦不可以已乎’者也。」这实在有点冤枉了老舍,因为即便当时来说,老舍与林语堂的幽默路数也毕竟是有区别的,「林语堂的文章是幽默而带滑稽,老舍则幽默而带严肃。」</p><p>与鲁迅比,郁达夫要豁达许多,他认为,「清谈,闲适,与幽默,何尝也不可以追随时代而进步呢?」可见,在他眼里,一个作家是否追随时代而进步,并不在乎他的「文调」是「性灵」、「闲适」、「幽默」的,还是道文壮行、挥戈反日的。其实,鲁迅也并不像有些人出于逆反心理想象的那样,是只会「横眉冷对」的「铁板」一块。在散文写作理念上,他还是蛮「前卫」的。他认为散文只要达到了真情实感的流露,写作上「是大可以随便的,有破绽也不妨。」同时,鲁迅的深刻犀利却也是旁人所望尘莫及的,他一针见血地指出,散文的幻灭在于「模样装得真。」换言之,在鲁迅看来,散文最贵在「真」,尤忌「瞒」和「骗」的装腔作势。</p><p>散文写作又实在是多元的,远非「斗士」「隐士」两类可以囊括。恰如梁实秋所说,「有一个人就有一种散文。」以鲁迅、周作人虽为血缘兄弟,却「文调」迥异,即可见事实也是如此。一个人的散文写成什么样,或他会如何来写,跟他的散文观,其实也就是性格,是血脉相连的。所以,梁实秋强调,散文的「文调就是那个人。」「文调的美纯粹是作者性格的流露。」他以为「散文是没有一定格式的,是最自由的。」要「美在适当」。周作人则率先提出,现代散文是「记述的,是艺术性的,又称作美文,」且「须用自己的文句与思想。」朱自清主张「意在表现自己」,崇尚写「独得的秘密」。</p><p>再比如,沈从文一味要在散文里「写我自己的心和梦的历史。」并特别强调,「把文学附庸于一个政治目的下,或一种道德名义下,不会有好文学。用文学说教,根本已失去了文学的意义了。」坚持文学的纯艺术性,像他的同道何其芳、李广田、萧乾,直至他的弟子汪曾祺,均如是;章依萍则代表「海派」作家直言不讳地表示,「所谓文人的著作,在高雅之士看来,诚为不朽之大业,而在愚拙之我看来,在资本主义之下,一切的著作,无非皆是商品而已。」坚持文学的商品性。像与之归于一派的张爱玲、苏青等,也都明确地说,他们是为生活、为钱而写作。在今天看来,即便是为稻粮谋,却写得一手好文章,已无可厚非,不太再会轻易指摘为思想格调不高或人品低下了。</p><p>正是从这个角度也说明,诚如梁遇春所说,「自从有小品文以来,就有许多小品文的定义,当然没有一个是完全对的。」可我还是最心仪他以 26 岁年轻生命留下的那份洒脱与率真,以及只能是天赋的灵性与悟感。他以为,散文就是「用轻松的文笔,随随便便地来谈人生。」而且,比起诗来,散文「更是洒脱,更胡闹些罢!」我颇以为然。</p><p>其实,追踪 20 世纪中国现代散文的脚迹,无论是早期的「语丝派」,「论语派」,赞美母爱的「冰心体」,「跑野马」的徐志摩散文,还是被一度奉为新经典的杨朔、秦牧、刘白羽三家散文,直至海峡对岸立志要「剪掉散文的辫子」的余光中,甚或近来的「大文化散文」也好,「小女人散文」也罢,至少在一点上是一致的,即「我手写我口」。不管何种「文调」,无论向杂文倾斜的硬邦邦抨击时政的,还是抒情感怀到软绵绵无病呻吟的,或触景生情得悲歌哀怨、如泣如诉的,散文在某种程度上,是可以作为灵魂的避难所或精神的栖息地而存在的。艺术是独立的,散文须是个性的。</p><p style="text-align: right">2005 年 5 月 23 日于中国现代文学馆</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 转载 </tag>
</tags>
</entry>
<entry>
<title>一些关于「Threads」的看法</title>
<link href="/2023/07/opinions-on-metas-thread/"/>
<url>/2023/07/opinions-on-metas-thread/</url>
<content type="html"><![CDATA[<p>由于马一龙最近的吐血操作,Twitter 用户又一次大量出逃,我愿称之为「Twitter Exodus」。见此情景,隔壁的小扎坐不住了,连夜提前自家的竞品的发布日期,7月6日10点我们就能看到它了。</p><p>Meta 家的竞品名叫「Threads」,乍一看介绍就是个文字版的 Instagram,继承所有 Ins 上的 Followers 和 Followings。「又是一个平平无奇的产品,全靠同行衬托……」——这是我当时粗看介绍给它的评价。</p><p>可是 Threads 没这么简单。</p><blockquote><p>The new standalone app will be based on Instagram and integrate with ActivityPub, the decentralized social media protocol. That will theoretically allow users of the new app to take their accounts and followers with them to other apps that support ActivityPub, including Mastodon.</p></blockquote><p>据<a href="https://www.theverge.com/2023/6/8/23754304/instagram-meta-twitter-competitor-threads-activitypub">报导</a>,Threads 将会在未来以接入 ActivityPub 的方式接入 Fediverse,消息一出,许多(ActivityPub)实例的站长都表达了不满,或直接声称将会在自己的实例上屏蔽 Threads,或在站内发起投票以决定是否屏蔽之。</p><h2 id="什么是-Fediverse?"><a href="#什么是-Fediverse?" class="headerlink" title="什么是 Fediverse?"></a>什么是 Fediverse?</h2><p>Fediverse 即 Federation 和 Universe 的组合,中文译名叫「联邦宇宙」。顾名思义,「联邦宇宙」就是由多个相对独立的实例组合而成,这些实例的互通方式和电子邮件比较相似,实例加入或者离开这个网络对其余的实例以及整个网络都没有影响,你还是可以和这个网络上其他所有人互通。基于这个特性,与其叫做「联邦」,叫「邦联」更合适。</p><p>只要在一个联邦宇宙的实例上注册账号,比如一个 Mastodon 账号,理论上你就可以和联邦宇宙内其它任何实例上的任何账户通信(包括那些非 Mastodon 实例,GNU Social, Friendica, Hubzilla, Diaspora, etc.)</p><h2 id="为什么要集体抵制-Threads?"><a href="#为什么要集体抵制-Threads?" class="headerlink" title="为什么要集体抵制 Threads?"></a>为什么要集体抵制 Threads?</h2><blockquote><p>Masto zealots: We’re open, federate with us!</p><p>Instagram: Great, we’re building a new thing to join you.</p><p>Masto zealots: Not that kind of open!</p></blockquote><p>各实例之所以集体抵制 Threads,最主要的理由便是担心 Threads 会「夺舍」:先是倚仗大公司的资源优势,提供比其它实例更好的早期体验,等到垄断了内容创作者,再断开与 Activity Pub 的连接。Threads 本身就有 Instagram 的用户群打底,想要这么做,是很容易的。</p><p>即使上述的想象没有发生,下面的问题,就涉及到了联邦宇宙本身:</p><blockquote><p>Admins who are planning on federating with Threads, what is your plan when Libs of Tik Tok sends thousands of far right users to harrass one of your users?</p><p>——@<a href="mailto:siege@octodon.social">siege@octodon.social</a></p><p><a href="https://m.cmx.im/@StarKiller">@StarKiller</a> 你好!目前,Threads与Fediverse尚未连接,长毛象中文站不会立即屏蔽Threads的域名。然而,一旦开始联邦,如果发现Threads对用户体验造成了不可接受的影响(例如无法控制攻击性言论和滥用、向外部站点投放广告、不遵循远程嘟文删除请求、大幅增加服务器负载等),我们将考虑立即在实例级别隐藏或封禁Threads。</p><p>对于Mastodon用户数据流向Threads的担忧,请参考以下嘟文中的第2条。<br><a href="https://m.cmx.im/@strawberry/109437505449349542">https://m.cmx.im/@strawberry/109437505</a></p><p>——@<a href="mailto:strawberry@m.cmx.im">strawberry@m.cmx.im</a></p></blockquote><p>联邦宇宙设计的理念之一就是赋予大家平等的社交权力,为了实现这一点,在设计之初,甚至牺牲自己的体验,刻意弱化了自己的一些功能,现在 Meta 进军联邦宇宙,带来大量的名人和社交媒体影响者,与联邦宇宙连接,Meta 完全可能执意自己的商业价值,破坏这种平等,补全联邦宇宙缺失的体验,仗着这种优势给予那些「Far right users」随意攻击联邦宇宙上他人的途径。</p><p>对于实例的管理员们,<a href="https://m.cmx.im/">草莓县</a>的管理员几乎已经阐述清楚了他们的担忧,和一般的恶意实例一样:向外部站点投放广告、不遵循远程嘟文删除请求、大幅增加服务器负载……,Meta 毕竟是一家商业公司,如果这有利于他们利润最大化,那么这些情景完全可能发生。</p><p>最后就是大家都要担心的隐私和数据流向 Meta 的问题。在隐私方面,Meta 并不是一家声誉很好的公司。相反,Meta 就是因为隐私问题才沦落到今天这个地步,至于我们能看到的隐私有多糟糕,这两张图就可以形成鲜明的对比:</p><p><img src="https://imgcdn.nightcity.pub/202307052239419.webp" alt="Threads 的隐私"></p><p><img src="https://imgcdn.nightcity.pub/202307052241409.webp" alt="Mastodon的隐私"></p><p>2018 年美国总统大选时,当时还叫 Facebook 的 Meta 协助特朗普团队秘密存储了 5000 万 Facebook 用户的数据并用其左右选举,商业公司之所以能提供免费的服务,就是因为我们的数据所能创造的价值(比如干预总统选举)远超开发维护产品的成本。现在 Meta 接入联邦宇宙,不就相当于把我们的数据(帖子,用户名这些虽然公开但还是很有价值的数据)让 Meta 不费吹灰之力免费拿走吗?而 Meta 甚至不需要征得我们的同意。</p><h2 id="抵制可能带来的副作用"><a href="#抵制可能带来的副作用" class="headerlink" title="抵制可能带来的副作用"></a>抵制可能带来的副作用</h2><p>对人们的去留起决定性作用的,不是花里胡哨的功能,不是大部分人不会细看的隐私政策,而是这个平台所创造的社区,更本质的说,就是这个平台上的<strong>人</strong>。</p><blockquote><p>I have to keep posting on twitter because that’s where my audiences are.</p></blockquote><p>为什么马斯克如此胡作非为却仍能让人们留在 Twitter 上?就是因为 Twitter 的王牌——十几年的用户和内容积累。Threads 同理——成千上万的,有趣的人都在使用这个服务,因为 Meta 的问题把这些人拒之门外,对于他们来说是极为不公平的。</p><h2 id="Threads-的潜在好处"><a href="#Threads-的潜在好处" class="headerlink" title="Threads 的潜在好处"></a>Threads 的潜在好处</h2><p>Threads 掀起了一股很大的热度。这对普通用户接触到联邦宇宙显然是一大利好,想想新人大量涌入联邦宇宙实例时的困惑,或许 Threads 真的可以 Make their life easier。</p><p>Activity Pub 的初衷,是像电子邮件一样,把社交媒体去中心化。电子邮件就可以作为 Threads 的参照,如果经营得法,Threads 完全可以成为 Gmail 一般的服务,而 Gmail 即使发展到现在,电子邮件这一协议既没有消亡也没有变成 Gmail 内部专属的协议,而 Gmail 的出现也让普通人更容易的接触到电子邮件,某种意义上降低了电子邮件的使用门槛。</p><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>Threads 尚未正式上线,对于其功过不可过早的盖棺论定。目前来看,Gmail 大概是最能窥见 Threads 未来的产品,Threads 也大概率会走上类似 Gmail 的发展路线。无论现在如何分析,都只是对 Threads 的预测,我很期待 Threads 将来会怎么发展,那么现在,就等它上线了。</p><h2 id="延伸阅读"><a href="#延伸阅读" class="headerlink" title="延伸阅读"></a>延伸阅读</h2><p><a href="https://daringfireball.net/linked/2023/06/19/not-that-kind-of-open">Not that kind of “Open”</a>:本文的一个参考。</p><p><a href="https://tutanota.com/blog/posts/gmail-independent-email">Is Gmail killing independent email?</a>:讲到 Gmail 扼杀独立电子邮件的现状,可以一窥 Threads 的未来。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>独裁者的下限</title>
<link href="/2023/07/dictators-are-bad/"/>
<url>/2023/07/dictators-are-bad/</url>
<content type="html"><![CDATA[<p>Twitter 自被马斯克收购以来闹剧不断——大裁员、付费蓝勾、越来越多的黄推机器人……,收购 Twitter 前马斯克曾信誓旦旦的承诺「这次收购将会让 Twitter 变得更好」,但收购以后的每一次闹剧都是对 Twitter 声望的重大打击,这次的限制免费用户的浏览量也真的离谱,用粗俗一点的话说:脑子被驴踢了,自然是被骂的该死。</p><p>连续的闹剧,给我们淋漓尽致的展现了一个独裁者的下限能有多低,也算是让我认识到了马斯克的自大和独断。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>遣词造句</title>
<link href="/2023/06/qian-ci-zao-ju/"/>
<url>/2023/06/qian-ci-zao-ju/</url>
<content type="html"><![CDATA[<p>今天在图书馆借了一本沈从文的《湘行散记》,其中的一段很有意思:</p><blockquote><p>在那旅馆中住下,一面听他詈骂佣人,一面使我就想起在北京城圈里编《国语大辞典》的诸先生,为一句话一个字的用处,把《水浒》、《金瓶梅》、《红楼梦》以及其他所有元明清杂剧小说翻来翻去,剪破了多少书籍!若果他们能够来到这旅馆里,故意在天井中撒一泡尿,或装作无心的样子,把些瓜果皮壳脏东西从窗口随意抛出去,或索性当着这旅馆老板面前,作点不守规矩缺少理性的行为。好,等着你就听听那作老板的骂出稀奇古怪的字眼儿,你会觉得原来这里还搁下了一本活生生的大辞典!</p></blockquote><p>连学者都不曾听过老板骂出的古怪字眼,肯定也没能放在今天的汉语词典里,更不用说当时湘西的客栈老板,没有受过良好的教育,之所以能骂出这些稀奇古怪的字眼,除了当地的口口相传,归根结底,还是中国人从无到有,造词和遣词造句的智慧。</p><p>前些天我做过一个<a href="https://www.arealme.com/chinese-vocabulary-size-test/cn/">中文词汇量测试</a>和一个<a href="https://www.arealme.com/how-many-chinese-characters-do-i-know/cn/">中文识字量测试</a>,识字量的结果可能还行,词汇量测试的结果实在不是非常好:</p><p><img src="https://imgcdn.nightcity.pub/202306291810268.webp" alt="识字量"></p><p><img src="https://imgcdn.nightcity.pub/202306291801223.webp" alt="词汇量测试"></p><p>(By the way,这俩加起来可能还没我英语词汇量大)</p><p>(这玩意不准啊,刚又去测了两遍结果都是8000个词汇量)</p><p><img src="https://imgcdn.nightcity.pub/202307022207340.webp" alt="img"></p><p>之前我一直很好奇,为什么一些文字功底深厚的作家,总能给出让我眼前一亮的遣词造句的手法呢?现在我算是理解了——和英语一样,只要词汇量和识字量达到一定程度,碰到自己需要的场景就能够融会贯通,从而彻底的从单纯的使用这门语言升华为「Master」这门语言。</p><p>在我的回忆里,从幼儿园到高中,给我们用来打好汉语基础的时间并不多,学生们总是疲于奔命,几乎没有什么机会能够启发学生们体味汉语的魅力。或许,给予学生们足够的时间与适当的引导,让学生们自己热爱上语言的魅力,让兴趣成为学生们最好的语言老师,就是语文课最理想的解决方案吧。又想到我高中的语文学习状态,所剩下的,只有哀叹矣。要是我回到语言最本真的地方,尽情感受这语言的魅力,提升自己的文字功底,该有多好!到头来,我高中三年学的语文,大多是一些我从未擅长过的应试技巧,只剩下一点点可怜的语文素养提升罢了。</p><p>我试着去写,然这篇文章所传达出的意思,始终和我想要表达的意思有所出入,也许这正是我对中文「Master」的不够深吧。可惜那终究是过去,我能做的,也只能从现在开始,是时候好好的重新审视这一门语言,提升自己的词汇量和遣词造句的能力了。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 感想 </tag>
</tags>
</entry>
<entry>
<title>玩一下 Stable diffusion 生成二维码</title>
<link href="/2023/06/fancy-qr-code-with-stable-diffusion/"/>
<url>/2023/06/fancy-qr-code-with-stable-diffusion/</url>
<content type="html"><![CDATA[<p>前些日子在网上看到一组十分惊艳的二维码:</p><p><img src="https://imgcdn.nightcity.pub/IMG_6361.webp" alt="一个不寻常的二维码,乍一看是一个少女"></p><p>最惊艳的是,这些不只是借二维码形式的艺术品,而都是真的可以扫出来的。具体的思路就是先生成一张原始的二维码,然后丢给 Stable Diffusion + ControlNet,控制二维码信息损失在可以接受的范围内,然后尽可能的让 Stable Diffusion 自由发挥。</p><p>只可惜这套东西刚出来的那几天我在忙别的,但这东西毕竟也挺好玩的,现在终于有时间了,那么我们现在来好好玩玩这东西。</p><h2 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h2><p>像往常一样随便找一个生成二维码的工具,生成一张平凡的二维码,注意这个二维码不能包含太多信息。</p><p>安装 Stable Diffusion 的部分可以参考我之前的文章“<a href="https://l3zc.com/2023/04/play-around-with-stable-diffusion/">玩了几天Stable Diffusion</a>”。</p><p>在 Stable Diffusion 的插件页面安装 ControlNet 插件,前期的准备工作就完成了。</p><h2 id="参数调整"><a href="#参数调整" class="headerlink" title="参数调整"></a>参数调整</h2>]]></content>
<categories>
<category> 技术 </category>
</categories>
<tags>
<tag> Stable Diffusion </tag>
</tags>
</entry>
<entry>
<title>Clash for Windows 不是开源软件</title>
<link href="/2023/06/clash-for-windows-is-not-opensourced/"/>
<url>/2023/06/clash-for-windows-is-not-opensourced/</url>
<content type="html"><![CDATA[<p>Clash 内核是开源的,我在搜索 Clash for Windows 时,遇到托管在 Github 上的<a href="https://github.com/Fndroid/clash_for_windows_pkg">项目</a>,自然也会认为其是开源的,并且我还用它用了相当长的一段时间。</p><p>虽然托管在 Github 上,但没有开源版权申明,也没有源代码。这种做法十分具有误导性,很容易让人误以为这是一个开源项目而放心的下载使用,直到看到空空如也的仓库才会猛然醒悟。</p><p>这个项目拥有超过 55k 的 Stars,不知里面有多少是和我一样,被托管在 Github 上这一做法误导的呢?我想数量绝对不会小。</p><p><img src="https://imgcdn.nightcity.pub/202306101516262.webp" alt="空空如也的仓库"></p><p>为了节省成本和提高知名度,托管在 Github 上无可厚非。但对于上网代理这种敏感的工具,我会选择多留一个心眼,这种不开源的软件,我是不敢用了。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>Docker Minecraft 开服记</title>
<link href="/2023/06/build-a-mc-server-with-docker/"/>
<url>/2023/06/build-a-mc-server-with-docker/</url>
<content type="html"><![CDATA[<p>我大概从2013年开始接触到了 Minecraft ,算下来,今年正好是我接触 Minecraft 的第十个年头。</p><p>熟悉 Docker 以后,我着手开始把我现在跑的服务容器化,从某种意义上,这非常「优雅」——可以很方便的管理各个服务,还不用担心各种环境不兼容的问题。</p><p>暑假将至,为了方便和朋友们联机玩 MC,遂自行搭建一个服务器,顺便进一步熟悉 Docker 和 Docker Compose。</p><h2 id="服务器选择"><a href="#服务器选择" class="headerlink" title="服务器选择"></a>服务器选择</h2><p>服务器有两个要求,一是性能要足够强,二是距离要足够近,目前我手头有三台机器,分别位于香港和洛杉矶,不是性能不够就是距离太远,延迟太高。所以,都无法满足需求。</p><p>最近恰逢618,各大云主机厂商都有活动,遂购入一台某大厂轻量服务器,位于上海,2C4G5M,对于一个入门 MC 服务器来说完全足够。当然,买了这一个服务器不可能只是跑跑 MC,别的一些对带宽要求不高的服务我肯定也会放在上面。</p><p>那么直接 Deploy,似乎用的还是 AMD 的新 EPYC,还行。</p><h2 id="安装-Docker"><a href="#安装-Docker" class="headerlink" title="安装 Docker"></a>安装 Docker</h2><p>相比于一键脚本,我个人还是偏好手动安装 Docker。个人为了方便直接用了 Root,这不是最佳实践,尽可能用普通用户并在必要的时候用<code>sudo</code>。</p><p>添加 PGP 密钥:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg</span></span><br></pre></td></tr></table></figure><p>向<code>source.list</code>添加软件源:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash"><span class="built_in">echo</span> \</span></span><br><span class="line"><span class="language-bash"> <span class="string">"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \</span></span></span><br><span class="line"><span class="string"><span class="language-bash"> <span class="subst">$(lsb_release -cs)</span> stable"</span> | sudo <span class="built_in">tee</span> /etc/apt/sources.list.d/docker.list > /dev/null</span></span><br></pre></td></tr></table></figure><p>更新软件包缓存并安装 Docker:</p><figure class="highlight shell"><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="meta prompt_">$ </span><span class="language-bash">apt update</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin</span></span><br></pre></td></tr></table></figure><p>启动 Docker:</p><figure class="highlight shell"><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="meta prompt_">$ </span><span class="language-bash">systemctl <span class="built_in">enable</span> docker</span></span><br><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">systemctl start docker</span></span><br></pre></td></tr></table></figure><p>至此 Docker 已经安装完成,顺遍装好了 Docker Compose。</p><h2 id="Docker-换源"><a href="#Docker-换源" class="headerlink" title="Docker 换源"></a>Docker 换源</h2><p>国内服务器这点非常蛋疼。</p><p>换源还要有一个命令行的文本编辑器,于是我决定先装个 Vim:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">apt install vim</span></span><br></pre></td></tr></table></figure><p>编辑/创建<code>/etc/docker/daemon.json</code>:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">vim /etc/docker/daemon.json</span></span><br></pre></td></tr></table></figure><p>编辑成如下内容:</p><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">{</span></span><br><span class="line"> <span class="attr">"registry-mirrors"</span><span class="punctuation">:</span> <span class="punctuation">[</span></span><br><span class="line"> <span class="string">"https://mirror.ccs.tencentyun.com"</span></span><br><span class="line"> <span class="punctuation">]</span></span><br><span class="line"><span class="punctuation">}</span></span><br></pre></td></tr></table></figure><p><code>https://mirror.ccs.tencentyun.com</code>是某大厂的内网镜像,内网拉取速度极快,还不计流量,不在内网里的服务器无法使用,应当换成下列镜像:</p><ul><li><code>https://hub-mirror.c.163.com</code></li><li><code>https://ustc-edu-cn.mirror.aliyuncs.com</code></li><li><code>https://mirror.baidubce.com</code></li></ul><p>随后重启 Docker 服务即可完成换源:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">systemctl restart docker</span></span><br></pre></td></tr></table></figure><h2 id="粗略部署"><a href="#粗略部署" class="headerlink" title="粗略部署"></a>粗略部署</h2><p>我部署服务的原则是先 Get it to work,再 Polish。</p><p>对于 MC 这种 community driven 的游戏来说,社区的力量是强大的,基本上什么样的需求都能在社区里找到对应的解决方案。我直接采用了 <a href="https://github.com/itzg/docker-minecraft-server">itzg/docker-minecraft-server</a>。</p><p>不得不吐槽的是,这个项目的文档写得实在是没有那么友好,摸索了一下,总算是把这个服务基本的跑起来了。这时我的<code>docker-compose.yml</code>如下:</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">"3"</span></span><br><span class="line"></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line"> <span class="attr">mc:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">itzg/minecraft-server</span></span><br><span class="line"> <span class="attr">ports:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="number">25565</span><span class="string">:25565</span></span><br><span class="line"> <span class="attr">environment:</span></span><br><span class="line"> <span class="attr">EULA:</span> <span class="string">"TRUE"</span></span><br><span class="line"> <span class="attr">tty:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">stdin_open:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">unless-stopped</span></span><br><span class="line"> <span class="attr">volumes:</span></span><br><span class="line"> <span class="comment"># attach a directory relative to the directory containing this compose file</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">./minecraft-data:/data</span></span><br></pre></td></tr></table></figure><p>这样的 Docker Compose 配置能以最新的版本把一个基础的 Vanilla Server 跑起来,只能勉强满足几个人的联机需求,肯定也没几个人会将这样的配置用到生产环境。</p><h2 id="进一步调整"><a href="#进一步调整" class="headerlink" title="进一步调整"></a>进一步调整</h2><p>要进一步调整,要先确认调整的方向,否则就是无头苍蝇,误打误撞,没有目标,十分痛苦。实际感受一番后,我大致整理出了此时配置的问题,有些是 Vanilla 客户端的问题:</p><ul><li>版本不固定</li><li>缺少基本的性能数据</li><li>图标和 MOTD 需要调整</li><li>没有白名单</li><li>不能装插件</li><li>有正版验证(无所谓,我有正版)</li></ul><p>有了这个方向,我就可以有目标的去调整这个 Server 的配置。接下来要做的,就是查阅这个项目的<a href="https://docker-minecraft-server.readthedocs.io/en/latest/">文档</a>,做出自己需要的修改。</p><h3 id="固定版本"><a href="#固定版本" class="headerlink" title="固定版本"></a>固定版本</h3><p>说实话 MC 的版本更新还挺频繁的,前一个版本尚未体验下一个版本就会出现。我暂时先固定这服务器的 MC 版本为<code>1.19.4</code>,日后充分游玩再慢慢升级。</p><p>同时 Vanilla Server 实在是太垃圾,顺便将其换成 PAPER 岂不美哉?分别设置<code>VERSION</code>和<code>TYPE</code>两个环境变量即可。藉由 Paper 的优点,这样也同时解决了服务器插件和性能数据的问题。</p><h3 id="白名单"><a href="#白名单" class="headerlink" title="白名单"></a>白名单</h3><p>设置<code>ENABLE_WHITELIST</code>和<code>ENFORCE_WHITELIST</code>两个环境变量,即可强制服务器核查白名单。同时,不要忘记将自己加入白名单,由于服务器的 OP 会被自动加入白名单,只需要将自己提前设置为 OP 即可,设置<code>OPS</code>即可做到这一点。</p><h3 id="图标和-MOTD"><a href="#图标和-MOTD" class="headerlink" title="图标和 MOTD"></a>图标和 MOTD</h3><p>设置<code>ICON</code>和<code>MOTD</code>两个环境变量即可自定义服务器的图标和标语。</p><h3 id="正版验证"><a href="#正版验证" class="headerlink" title="正版验证"></a>正版验证</h3><p>设置<code>ONLINE_MODE</code>变量即可控制正版验证的开关。</p><p>需要注意的是,关闭<code>ONLINE_MODE</code>后,服务器会根据玩家的离线 UUID 判断身份,离线 UUID 和在线 UUID 不同,此时添加 OP 和黑白名单都需要改用离线 UUID 进行。</p><h3 id="最终的-docker-compose-yml"><a href="#最终的-docker-compose-yml" class="headerlink" title="最终的 docker-compose.yml"></a>最终的 docker-compose.yml</h3><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">"3"</span></span><br><span class="line"></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line"> <span class="attr">mc:</span></span><br><span class="line"> <span class="attr">image:</span> <span class="string">itzg/minecraft-server</span></span><br><span class="line"> <span class="attr">ports:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="number">25565</span><span class="string">:25565</span></span><br><span class="line"> <span class="attr">environment:</span></span><br><span class="line"> <span class="attr">EULA:</span> <span class="string">"TRUE"</span></span><br><span class="line"> <span class="attr">TYPE:</span> <span class="string">"PAPER"</span></span><br><span class="line"> <span class="attr">VERSION:</span> <span class="string">"1.19.4"</span></span><br><span class="line"> <span class="attr">VIEW_DISTANCE:</span> <span class="number">8</span></span><br><span class="line"> <span class="attr">ENABLE_WHITELIST:</span> <span class="string">"TRUE"</span></span><br><span class="line"> <span class="attr">ENFORCE_WHITELIST:</span> <span class="string">"TRUE"</span></span><br><span class="line"> <span class="attr">OPS:</span> <span class="string">""</span></span><br><span class="line"> <span class="attr">ONLINE_MODE:</span> <span class="string">"TRUE"</span></span><br><span class="line"> <span class="attr">SERVER_NAME:</span> <span class="string">"Pub of NightCity"</span></span><br><span class="line"> <span class="attr">MOTD:</span> <span class="string">"Want to have a drink?"</span></span><br><span class="line"> <span class="attr">ICON:</span> <span class="string">""</span></span><br><span class="line"> <span class="attr">OVERRIDE_SERVER_PROPERTIES:</span> <span class="string">"TRUE"</span></span><br><span class="line"> <span class="attr">tty:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">stdin_open:</span> <span class="literal">true</span></span><br><span class="line"> <span class="attr">restart:</span> <span class="string">unless-stopped</span></span><br><span class="line"> <span class="attr">volumes:</span></span><br><span class="line"> <span class="comment"># attach a directory relative to the directory containing this compose file</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">./minecraft-data:/data</span></span><br></pre></td></tr></table></figure><h2 id="一些杂七杂八的事情"><a href="#一些杂七杂八的事情" class="headerlink" title="一些杂七杂八的事情"></a>一些杂七杂八的事情</h2><h3 id="RCON-的连接"><a href="#RCON-的连接" class="headerlink" title="RCON 的连接"></a>RCON 的连接</h3><p>服务器运行后,若要在不进入游戏的情况下管理服务器,就需要用到 RCON。方法很简单,使用这个项目绑定的 rcon-cli 即可:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">$ </span><span class="language-bash">docker <span class="built_in">exec</span> -i <name_of_container> rcon-cli</span></span><br></pre></td></tr></table></figure><p>注意将<code><name_of_container></code>换成自己的容器名。</p><p>作者还推荐了一个叫做<code>rcon-web-admin</code>的项目,打算过一阵子尝试。</p><h3 id="安装插件"><a href="#安装插件" class="headerlink" title="安装插件"></a>安装插件</h3><p>Paper 支持 Bukkit 的插件,还有自己的插件,插件数量上完全无需担心。</p><p>我们在配置<code>docker-compose.yml</code>时,已经做了 bind 操作,会在<code>docker-compose.yml</code>所在目录的相对路径下创建一个叫做<code>minecraft-data</code>的文件夹,并绑定到容器的<code>data</code>目录,将下载好的插件<code>.jar</code>文件丢进<code>./minecraft-data/plugins</code>目录就完成了插件的安装。</p><p>我选用了 World Edit,Grief Prevention 和 Dead Chest 三个插件,保证原汁原味的生存体验。</p><h2 id="最后"><a href="#最后" class="headerlink" title="最后"></a>最后</h2><p>如果你有开服经验并且偏向手动修改<code>server.properties</code>,将<code>OVERRIDE_SERVER_PROPERTIES</code>设置为<code>FALSE</code>即可将<code>server.properties</code>的控制权交还到我们手中,这也是一种配置的手段。</p><p>Docker 开服还是相对容易的,社区已经造好了轮子,免去了很多不必要的麻烦。稍后我会继续 play around with the server,继续探索这个游戏无限的可能性。</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
</entry>
<entry>
<title>郁达夫的博客</title>
<link href="/2023/06/yudafus-blog/"/>
<url>/2023/06/yudafus-blog/</url>
<content type="html"><![CDATA[<p>何为博客?</p><p>广义上的博客,便是当人们将自己原本留在心里,写在日记本,取自书上的东西加以整理加工,写成一篇文章时,就自然而然的形成了博客。一开始还不叫博客,甚至还没有公开发表,公开发表了,便是博客的雏形。</p><p>自互联网出现,这套过程被搬到了网上,就成了标准意义上的「Weblog」。</p><p>再回头看看我写的这个标题,连我自己都忍俊不禁,为自己不假思索起的标题感到些可笑——没有上网,怎么能叫 BLOG 呢?十分荒唐,但也不全无道理。之所以把标题起的不假思索,大抵是因为郁达夫的行文风格令我不由自主的将其与博客联系起来。在我看来,郁达夫发表的这些文章,无论怎么看,都太像是一个博客。</p><p>以下节选自郁达夫的《记风雨茅庐》:</p><blockquote><p>自家想有一所房子的心愿,已经起了好几年了;明明知道创造欲是好,所有欲是坏的事情,但一轮到了自己的头上,总觉得衣食住行四件大事之中的最低限度的享有,是不可以不保住的。</p><p>……</p><p>自搬到杭州来住后,于不意之中,承友人之情,居然弄到了一块地,从此葬的问题总算解决了;但是住呢,占据的还是别人家的房子。去年春季,写了一篇短短的应景而不希望有什么结果的文章,说自己只想有一所小小的住宅;可是发表了不久,就来了一个回响。一位做建筑事业的朋友先来说:“你若要造房子,我们可以完全效劳。”。</p><p>……</p><p>四面一凑,于是起造一个风雨茅庐的计划即便成熟到了百分之八十,不知我者谓我有了钱,深知我者谓我冒了险,但是有钱也罢,冒险也罢,入秋以后,总之把这笑话勉强弄成了事实,在现在的寓所之旁,也竟丁丁笃笃地动起了工,造起了房子。</p><p>……</p><p>却也涂上了朱漆,嵌上了水泥,有点像是外国乡镇里的五六等贫民住宅的样子了;自己虽则不懂阳宅的地理,但在光线不甚明亮的清早或薄暮看起来,倒也觉得郭先生的设计,并没有弄什么玄虚,和科学的方法,仍旧还是对的。</p></blockquote><p>看到郁达夫「从发表文章到找到“知音”」的过程,不禁觉得倍感亲切,换而言之,博客的初衷,不就是如此吗?不得不感叹:原来我们今天在做的事情,至少一百多年以前,甚至更早,人们就已经在做了。倘若郁达夫能上网,这篇文章肯定会出现在他的博客上吧。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>Max Viable</title>
<link href="/2023/05/max-viable/"/>
<url>/2023/05/max-viable/</url>
<content type="html"><![CDATA[]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>Apple Watch Series8 初体验</title>
<link href="/2023/05/apple-watch-series8-chutiyan/"/>
<url>/2023/05/apple-watch-series8-chutiyan/</url>
<content type="html"><![CDATA[<p>从某一天开始我的睡眠质量忽然急转直下,正好一直想要 Apple Watch,遂直接下单一块来监测睡眠。</p><p>这是我的第一块 Apple Watch,在此之前,小米手环、卡西欧、AmazeFit以及小米手表都在我的手腕上戴过一阵。但这块手表不一样,买了它我就相当于被苹果生态绑架,唉(bushi)。</p><h2 id="下单"><a href="#下单" class="headerlink" title="下单"></a>下单</h2><p>5月11号在苹果官网下的单,选的银色铝金属表壳,耐克雪峰白配黑表带,显然不是标准配置,于是订单被送到上海保税区的工厂组装。</p><p>一天用来组装,一天用来清关,清关后终于到了 EMS 特快专递,而且还是航空件。「这下应该马上到了」,果然,邮政的效率从来没让我失望过——南京飞到长沙用了 11 个小时,怕不是用车拖着飞机在地上走?</p><p>总算,四天,我的快递,经过「特快专递」「空运」到了我的手上。</p><h2 id="开箱"><a href="#开箱" class="headerlink" title="开箱"></a>开箱</h2><p>当天是一个温和的天气,邮政送到校内驿站,正好我的另一个快递也到了,于是就屁颠屁颠的跑过去取快递。</p><p><img src="https://imgcdn.nightcity.pub/202305192057557.webp" alt="Apple Watch的快递盒子"></p><p>当了一下久违的爱撕机膜人,开箱撕膜真的有一种特殊的喜悦和魅力,让人上瘾。不管怎样,简单设置一下以后 Apple Watch 就这么戴上了。</p><p>Apple Watch 的整个设置真的简单,掏出 iPhone 扫一扫手表上的图案,剩下的全都交给设备完成就好。头一次见到手表设置的时候会把手机里所有的 App 对应的手表版装上去的,难怪用了这么久才把设置圆环跑完。Anyway that‘s good。</p><p><img src="https://imgcdn.nightcity.pub/202305241511883.webp" alt="戴在手腕上的 Apple Watch"></p><p>在苹果官网上买,最大的原因是为了定制这只表的外观。官网上看不觉得,直到线下才发现不锈钢和铝金属的质感完全不是一个量级,难怪要把不锈钢边框的版本买贵这么多,真有你的,厨子。话说回来,铝金属边框也有好处,划伤没有不锈钢那么明显,要说质感的话,也勉强能算是别具一格吧,搭配某些表带可能会更好看。第一次带这种表,铝金属依然是最佳选择,只是以后有机会再买 Apple Watch,我肯定会买成 Ultra 或者不锈钢的版本。</p><h2 id="这几天的体验"><a href="#这几天的体验" class="headerlink" title="这几天的体验"></a>这几天的体验</h2><p>先说结论,Apple Watch 是唯一能比小米手环还让我满意的可穿戴设备。我对穿戴设备的要求无非就是这些:穿起来舒服是刚需,这是让我愿意将之长期佩戴的基础。外观漂亮不是那么重要,但也是一个长期佩戴的加分项。功能上最基本的是健康监测与和手机的互联,不那么重要的就是系统流畅度和应用的丰富程度了。</p><h3 id="穿戴体感-amp-外观"><a href="#穿戴体感-amp-外观" class="headerlink" title="穿戴体感 & 外观"></a>穿戴体感 & 外观</h3><p>不论是智能手表还是别的手表,戴在手上或多或少都有一种「存在感」。我之前戴在手上的东西里,除了一个很轻的装饰品,唯一令人满意的是小米手环。Apple Watch 在这点上令人满意,虽然表盘很大,但戴在手上几乎感觉不到什么异样的感觉,让我愿意长期将其戴在手上。这点上它和我之前戴过的小米手表形成的对比非常强,明显感觉到 Apple Watch 在这点上下了功夫。</p><p>外观上就不赘述了,毕竟是 Apple Watch,带出去至少不会丢人,小米手环我尚觉得不错,Apple Watch 更无需多言。</p><h3 id="健康监测-amp-与手机互联"><a href="#健康监测-amp-与手机互联" class="headerlink" title="健康监测 & 与手机互联"></a>健康监测 & 与手机互联</h3><p>健康监测是 Apple Watch 最大的卖点,也算是我买它最大的理由事实上 Apple Watch 默认状态下监测的数据就是全天候无感的,非常舒服。但我也不得不吐槽其中一个数据——睡眠检测,不光睡前要先按睡眠专注模式不说,起来掐掉闹钟继续睡还直接不记录闹钟之后的数据,这样的体验真就是依托答辩。</p><p>与手机互联上 Apple Watch 是所有设备里做的最好的,没有之一。所有数据全程无感同步,应用会自动唤起相应的手表版,可以和手机互相解锁,进入手机的连接范围内就从来没有连接失败过……,这些都是只有 Apple Watch 上才有的体验。</p><h3 id="系统流畅度-amp-应用的丰富程度"><a href="#系统流畅度-amp-应用的丰富程度" class="headerlink" title="系统流畅度 & 应用的丰富程度"></a>系统流畅度 & 应用的丰富程度</h3><p>毕竟是 S8 芯片,系统是真的流畅,怎么用都感觉不到卡顿,况且苹果的优化也很让人放心,也无需多言(iPhone 除外,要吐槽这咖喱味拉满的 iOS 我能专门写一篇文章)。</p><p>关于应用的丰富程度,我其实不怎么用第三方应用,苹果就是这样,你在它自己的生态里,保证你用得很舒服,一旦你想跳出他那个生态,那可能就会「生不如死」。本着这个理解,我只是装了少量的第三方应用,本身也用不着这些应用,何必要去装上呢?而我装的第三方应用里,甚至大部分都是手机里应用的 Watch 版。</p><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>这可以算作我的可穿戴设备的一次升级,这种升级当然是喜闻乐见的——从一两百的小米手环到三四千的 Apple Watch,这就是迄今为止我戴过最满意的可穿戴只能设备,无可争议。</p><p>这次买 Apple Watch 也涉及到了一个问题,到底是买更便宜的东西还是更贵但更好的东西?对于这个具体的问题,小米手环和 Apple Watch 就是一对对立面。我是从小米手环一路换到 Apple Watch 的,花费的钱,加起来都够买一个 Apple Watch Ultra 了,既然如此,即使当时没有 Ultra,买一个好一点的 Apple Watch 不是更好的选择吗?为什么要委屈自己,大部分时间戴着更便宜的设备?</p><p>It is unwise to pick top gear equipments just to start a new hobby,如果你不知道自己是否需要某一类产品,那么早期挑选入门级的产品就是一个更明智的选择。一开始用更便宜的平替本质上是一种保险,因为你不知道你自己需要多好的设备,这就像是理财,你可以花总体上更少的钱一步到位,亦可一步步升级以求保险,有时候前者从长远上来看是更明智的选择,但更多时候都要一步一步探索自己究竟需要什么,至于风险和保险如何平衡,就要看自己对自己的把握和取舍了。</p><p>而需要和想要就是两回事,如果想要(真正的想要,不是冲动消费)而没有显著的反对理由,那顺从自己就对了。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>新时代的“知识越多越反动”</title>
<link href="/2023/05/%E6%B0%91%E4%B8%BB%E8%B6%8A%E5%A4%9A%E8%B6%8A%E5%8F%8D%E5%8A%A8/"/>
<url>/2023/05/%E6%B0%91%E4%B8%BB%E8%B6%8A%E5%A4%9A%E8%B6%8A%E5%8F%8D%E5%8A%A8/</url>
<content type="html"><![CDATA[<p>文革时期有一口号曰「知识越多越反动」,从根本上否定「知识」,限制,打击知识分子,挑起人民内部的争斗,而这个政权则坐收渔利,极大地确保了政权的稳定。然中国却被折腾成了当时世界上最穷的国家之一,造成社会、文化上的遗毒,及其产生的后果,更是难以估量。</p><p>只要知识分子说真话,那你就是反动学术权威,哪怕是客观事实也不行,因此闹出许多笑话,其中一例:</p><blockquote><p>众:毛主席是红太阳!万物生长靠太阳!</p><p>某人:豆芽不要。</p><p>旋即某人被打成反革命。</p></blockquote><p>如此简单的客观事实尚不能自由的表达,学术上的知识若是不符合红卫兵的意思,更别提生存的空间。</p><p>对比一下今天,只要喊出民主自由之口号,就会在微博上被限流,被小粉红们和官方水军爆破。甚至于被开盒,社会性死亡。文革传下来的遗毒依然在,只是换了一种形式而已。</p><p>文化遗毒未能止于民间,这些年来,官媒关于民主问题上的论调开始由原来的避而不谈转为所谓的「批判」民主,颇有「知识越多越反动」的势头。它们将民主、自由与所谓的「乱、弱、差」联系起来,从根本上否定民主这个本世纪以来为全世界所接受的价值观,以期确保政权稳定,巩固权贵们的利益。从 1953 年的第一部宪法第一条「我国是人民民主的社会主义国家」,到今天所谓社会主义核心价值观国家层面的「富强民主文明和谐」,「民主」这个东西,实际上是自 1949 年建国以来,这个政权自始至终都在立的牌坊。一边将这套牌坊砸的体无完肤,一边又毫无违和感的立着这套牌坊,十分讽刺。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>开站一周年</title>
<link href="/2023/05/1st-anniversary/"/>
<url>/2023/05/1st-anniversary/</url>
<content type="html"><![CDATA[<p>一年前,网上多了一个给自己写字的地方。过了一年,也算是写了不少字了。回想起从当时还是初中生的我懵懵懂懂的开设自己的第一个博客,到现在我真实的在博客上记录内容的第一年,不由得感叹,时间过得真快。</p><h2 id="为什么开站?"><a href="#为什么开站?" class="headerlink" title="为什么开站?"></a>为什么开站?</h2><blockquote><p>旅程总有个开始的理由,但也不排除说走就走。</p></blockquote><p>这得问问当初在 Github Pages 上笨手笨脚尝试部署我的第一个静态博客的我:没有什么理由,Because that’s cool.</p><p>于是我学了点 HTML、JS 和 CSS 。然后花了点时间搞清楚 Hexo 的主题到底是怎么运作的,跌跌撞撞拿着一个 Hexo 主题修改,竟然也勉强改出了我想要的版本。当初不知 Webpack 为何物的我竟然对着一堆 .min.css 和 .min.js 一个一个改了半天,回想起来只能一笑了之。</p><p>做一件事情不需要理由,只要没有显著的反对理由,那就放手去做吧。</p><h2 id="这一年发生的一些事"><a href="#这一年发生的一些事" class="headerlink" title="这一年发生的一些事"></a>这一年发生的一些事</h2><p>2022.04:</p><ul><li>开站,在 Github Pages 上发出一声 Hello World。</li><li>19岁</li><li><del>(跟别人)</del>参加一些竞赛:挑战杯,创青春,创新创业</li></ul><p>2022.06:</p><ul><li>六级出分,虽然成绩不太漂亮,但大一下就能过也算不错了</li><li>参加了个<del>形式主义的</del>院学代会</li></ul><p>2022.07:</p><ul><li>拿到 Azure 学生服务器,博客框架换成 Wordpress</li><li>早上五点起床搬到新校区,<del>累死我了</del></li></ul><p>2022.08:</p><ul><li>拿到驾照</li><li>开学,<del>看新兵蛋子军训咯</del></li></ul><p>2022.09:</p><ul><li><p>接手学长祖传的一个团队<del>收拾烂摊子</del></p></li><li><p>院学生会里当了个副部长</p></li></ul><p>2022.10:</p><ul><li>给<del>新兵蛋子</del>新同学们办开学典礼</li><li>核酸、核酸,天天核酸</li><li>校运会<del>被抓壮丁</del></li></ul><p>2022.11:</p><ul><li>弄了台新电脑,原来的 1715 暂时可以休息了</li><li>11.24,逝者安息,不要沉默,不要麻木</li></ul><p>2022.12:</p><ul><li>为了防止出现更大规模的抗议,政府把我们请回家了</li><li>阳了一次</li></ul><p>2022.01:</p><ul><li>长途旅行,徒步虎跳峡,玩丽江……</li><li>过年部门微信群里沙雕红包接力</li></ul><p>2022.02:</p><ul><li>买了个新的显示器和手柄,这下电竞寝室了</li></ul><h2 id="统计数据"><a href="#统计数据" class="headerlink" title="统计数据"></a>统计数据</h2><p>我一共更换了三次统计平台,所以没有连续的统计数据,只能凑合着看看了</p><p><img src="https://imgcdn.nightcity.pub/202305031208255.webp" alt="image-20230503120812038"></p><p><img src="https://imgcdn.nightcity.pub/202305031210165.webp" alt="image-20230503121051020"></p><p>由于Google Analytics很容易被屏蔽,所以只能大致的估计一下数据,先借由 Umami一个月的访问量,再大致估算一下自己的访问量,大概能得出过去一年,自己大概收获了 8000 个左右的访客,以及大约 10000 的 PV。</p><p>对于一个刚开设一年,没有备案且没有被百度收录的网站,这已经算是不错了。</p><p>这一年,我一共写了 27 篇文章,新增评论 18 条,平均下来,每个月写了 2.25 篇文章。</p><h2 id="我经历的转变"><a href="#我经历的转变" class="headerlink" title="我经历的转变"></a>我经历的转变</h2><p>开站早期,我为了博客的 SEO 和规避敏感话题,发表的全都是些半吊子的技术博客。而现在看来,真是有些委屈了自己。</p><p>关于自我审查,我写过<a href="https://l3zc.com/2023/03/no-longer-prosper/">一篇文章</a>,从此之后,我不再自我审查,这下,这个博客终于发挥了它原本的用意——不是为写而写,而是有感而发,若是连自己有感而发的冲动都要被自我审查磨灭,那就更别提写别的了。</p><p>私以为,语言的意义,在于用最精炼的话,传递最准确的信息。写文章是一场修行,写得详略得当,条理清晰,语言儒雅,是这场修行的终点。从前我写博客一定要写出字数的执念,在写了很多的啰嗦话以后,终于也放下了。</p><p>……</p><h2 id="其他一些话"><a href="#其他一些话" class="headerlink" title="其他一些话"></a>其他一些话</h2><p>这一年我的博客从 Hexo 换到 Wordpress,最近又想换到 Hugo 了,但苦于已经运行了这么久,SEO 业已做了一年,再换一套博客系统实在是太过于折腾,也就 Stick with Wordpress 了。</p><p>博客托管的地方也尝试换了很多,香港 Azure,Cloudflare,Racknerd,BandWagon。兜兜转转一圈,踩了不少坑,又回到了香港 Azure,果然平平淡淡才是真吗。</p><p>我很后悔我没有在一开始尝试更多的技术栈,这也是我今年要做的事情。为了改出好看的主题和需要的功能我去学了怎么写 PHP,为了部署 Umami 我去学了怎么用 Docker Compose……搭建博客本就是一个学习的过程,学的越多,写的越多;写的越多,学的越多。</p><h2 id="最后"><a href="#最后" class="headerlink" title="最后"></a>最后</h2><p>回顾这一年,总有一种“我怎么才做了这么点事”的感觉。</p><p>我真的把太多的时间耗费在了公事上,于自己提升之事却做的太少。我已经对于学生会这个东西越发失去兴趣。刚刚进入大学一心想服务同学、提升自己的激情也在一次次毫无意义的形式主义活动下被磨灭,回想起来,也许当时的我真的太天真了……即使我很想在学生会有所作为,这个大学处处充斥的形式主义、官僚主义却会把每一个激情四射的人变得忧郁而只想混吃等死的行尸走肉,用现在的话来说,叫“躺平”了。</p><p>穷则独善其身,达则兼济天下。以我现在所处的境地,我真的应该好好的考虑独善其身的问题。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>体验Google Bard</title>
<link href="/2023/04/test-google-bard/"/>
<url>/2023/04/test-google-bard/</url>
<content type="html"><![CDATA[<p>Google Bard是当时谷歌和微软同时宣布将类似 ChatGPT 的 AI 融合到搜索引擎,Google 给出的产物。然而当时的 Bard 在 Pichai 演示的时候就翻车了。Pichai 还因为这个被 Google 员工在内部论坛炮轰。既然连 Google 员工都认为这个产品是“仓促,盲目,以及Ungooglely”,甚至连预览版本都一推再推,现在拿到手了,还能好用吗?</p><p>在<code>bard.google.com</code>上点击 Join Waitlist 你就在等候清单里了。说是什么 Bard 准备好让我使用以后会给我发邮件,但我第一天申请,第二天打开 Bard 的网页就能用了,也没收到任何邮件。我:?</p><p>不管怎样,Bard 在申请上比隔壁 New Bing 的体验好太多,于是我就直接开始用了。</p>]]></content>
<categories>
<category> 未分类 </category>
</categories>
<tags>
<tag> AI </tag>
<tag> Google </tag>
<tag> ChatGPT </tag>
</tags>
</entry>
<entry>
<title>玩了几天 Stable Diffusion</title>
<link href="/2023/04/play-around-with-stable-diffusion/"/>
<url>/2023/04/play-around-with-stable-diffusion/</url>
<content type="html"><![CDATA[<p>Stable Diffusion 是去年就出来的东西了,我没有去早点玩这个东西是因为当时我的电脑算力真的不够,我直接用 Mid Journey 的 Discord 群组凑合体验了一下,换了新电脑自然要玩玩这个东西。</p><h2 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h2><p>我直接部署<a href="">stable-diffusion-web-ui</a>,毕竟这已经是一个成熟的方案了。</p><p>Clone 仓库</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git</span><br></pre></td></tr></table></figure><p>修改<code>webui-user.bat</code>:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">@echo off</span><br><span class="line"></span><br><span class="line">set PYTHON=</span><br><span class="line">set GIT=</span><br><span class="line">set VENV_DIR=</span><br><span class="line">set COMMANDLINE_ARGS= --xformers --medvram</span><br><span class="line"></span><br><span class="line">call webui.bat</span><br></pre></td></tr></table></figure><p>我用的 RTX 3060 Laptop 有6G显存,所以选用<code>--medvram</code>参数。</p><p>执行用户,注意这套脚本要使用普通用户(非管理员)执行。</p><figure class="highlight shell"><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">cd stable-diffusion-webui</span><br><span class="line">webui-user.bat</span><br></pre></td></tr></table></figure><p>这套东西只在 Python 3.10.6 上测试过,当时用 Python 3.11 时安装过程出现了报错,如果现在用的是 Python 3.11 记得换成 Python 3.10.6,修改环境变量,然后重启电脑。</p><h3 id="DiffusionWrapper-has-859-52M-params"><a href="#DiffusionWrapper-has-859-52M-params" class="headerlink" title="DiffusionWrapper has 859.52M params"></a>DiffusionWrapper has 859.52M params</h3><p>正常情况下,这套脚本会自动下载所需要的依赖。记得我当时在部署的时候是半夜,挂着终端代理,这个脚本跑了半天。第二天起来,依然卡在昨天晚上的地方,也就是<code>DiffusionWrapper has 859.52M params</code>。</p><p>上课回来,在网上一搜索,才发现遇到这个问题的人还真不少,Github 上也有人在<code>stable-diffusion-webui</code>的官方库里提了 issue,看起来是<code>hugging-face</code>的<code>file-download.py</code>出现了bug,而非<code>stable-diffusion-webui</code>本身的问题。这是解决方案:<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7901#issuecomment-1498002872">Github上的解决方案</a>。</p><p><img src="https://imgcdn.nightcity.pub/202304182154737.webp" alt="修改hugging_face"></p><p>定位到<code><INSTALL_FOLDER>\stable-diffusion-webui\venv\Lib\site-packages\huggingface_hub\file_download.py</code>的 1262 行,将其修改为:</p><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">blob_path = os.path.join(storage_folder, <span class="string">"blobs"</span>, etag[<span class="number">3</span>:])</span><br></pre></td></tr></table></figure><p>重新运行<code>webui-user.bat</code>,这次 webui 顺利启动了。</p><p><code>stable-diffusion-webui</code>跑在本地默认的端口号是7860,访问<code>http://localhost:7860</code>就可以看到这套 Web UI 了。</p><p><img src="https://imgcdn.nightcity.pub/202304182205790.webp" alt="stable-diffusion启动"></p><p><img src="https://imgcdn.nightcity.pub/202304182206103.webp" alt="stable-diffusion-webui界面"></p><h2 id="找模型"><a href="#找模型" class="headerlink" title="找模型"></a>找模型</h2><p>部署工作至此已告一段落,但<code>stable-diffusion-webui</code>部署下来自带的模型生成的图片并不符合我的需求和口味,我相信大部分人也不会只用这个默认的模型,那么随后的一件事就是找模型。</p><h3 id="去哪找?"><a href="#去哪找?" class="headerlink" title="去哪找?"></a>去哪找?</h3><p>起初我也不知道去哪找,于是就傻乎乎的 Google 了一下:stable diffusion anime model。别说,还真奏效了。搜出来的结果里立刻就出现了<a href="https://huggingface.co/">Hugging face</a>和<a href="https://civitai.com/">Civit-AI</a>。Civit-AI还能直观的看到每个模型的预览图。</p><p>除此之外,Reddit 等论坛上,像我一样的个人博客上,都可以看到网友们的模型推荐,用这种方式找模型也很不错。</p><p>Problem solved.</p><h3 id="找到的模型"><a href="#找到的模型" class="headerlink" title="找到的模型"></a>找到的模型</h3><p>就这么去了 Civit-AI 的首页,第一眼就被<code>counterfeit</code>模型吸引了。</p><p><img src="https://imgcdn.nightcity.pub/202304182217584.webp" alt="counterfeit模型"></p><p>除此之外,<code>Anything</code>也是非常流行的模型,也被我收入囊中。</p><h3 id="可以自己训练模型吗?"><a href="#可以自己训练模型吗?" class="headerlink" title="可以自己训练模型吗?"></a>可以自己训练模型吗?</h3><p>先说结论:理论上来说,可以。但我这个 3060 Laptop……还是算了吧。</p><p>Stable diffusion 有几种主要的训练方法,Textual Inversion, Hyper Network, Dream booth, Lora。即使是配置要求最低的 Lora,也要求至少 8G 的显存,而 3060 Laptop 只有 6G 显存。既然如此,就不折磨自己了,还是直接用训练好的现成模型吧,感谢社区。</p><h2 id="开始用"><a href="#开始用" class="headerlink" title="开始用"></a>开始用</h2><p>一开始我在 CivitAI 上下载下来<code>Counterfeit-V2.5</code>模型,CivitAI 上只有一个 4.1G 的<code>CounterfeitV25_25.safetensors</code>文件。我将其下载下来丢进了<code><INSTALL DIR>\stable-diffusion-webui\models\Stable-diffusion</code>文件夹,刷新一下Web UI的模型列表就看到了这个模型,于是我就很顺利的加载了这个模型开始用了。</p><h3 id="这……不对啊"><a href="#这……不对啊" class="headerlink" title="这……不对啊"></a>这……不对啊</h3><p>先来看看这个时候的生成效果:</p><p><img src="https://imgcdn.nightcity.pub/202304192355517.webp" alt="00000-2669052925"></p><p><img src="https://imgcdn.nightcity.pub/202304192355527.webp" alt="00012-2065576542"></p><p><img src="https://imgcdn.nightcity.pub/202304192356328.webp" alt="00035-3723924490"></p><p>这……不对啊。怎么感觉我被这个模型的样图给骗了?</p><p>来看看作者生成的样图:</p><p><img src="https://imgcdn.nightcity.pub/002.webp" alt="002"></p><p><img src="https://imgcdn.nightcity.pub/007.webp" alt="007"></p><p>我们用的真的是同一个模型吗?可以看到我和作者生成了一张大体十分相似的图片,那是我用和作者相同的 Prompt 和种子生成的,作者生成的图片,不论是画面细节,还是色彩,都和我一开始用这个模型的时候生成的几乎完全不是一个东西,难道我是下错模型了?</p><h3 id="找问题"><a href="#找问题" class="headerlink" title="找问题"></a>找问题</h3><p>我在论坛里翻找遇到相同问题的帖子,发现其实遇到同样问题的人还真不少,大多数人都抱怨生成的图片细节不够,色彩不够鲜艳。根据我的经验,肯定是少装了些什么东西。</p><h4 id="EasyNegative"><a href="#EasyNegative" class="headerlink" title="EasyNegative"></a>EasyNegative</h4><p>EasyNegative 可以被看做一个 Super Prompt,用于改善模型生成图片的质量。</p><p><img src="https://imgcdn.nightcity.pub/202304202328404.webp" alt="EasyNegative效果"></p><p>谷歌 EasyNegative 第一个出来的就是为<code>counterfeit-v2.5</code>模型设计,于是我便下载下来使用了。链接附上:<a href="https://huggingface.co/datasets/gsdf/EasyNegative">gsdf EasyNegative</a></p><blockquote><p>This is a Negative Embedding trained with Counterfeit. Please use it in the “\stable-diffusion-webui\embeddings” folder.<br>It can be used with other models, but the effectiveness is not certain.</p></blockquote><p>这套 EasyNegative 同样适用于 <code>AbyssOrangeMix2</code>,<code>anything</code>等模型,我愿称之为必备。</p><p>到了这一步,我总算是知道为什么所有人的 Prompt 里总要有个<code>EasyNegative</code>了,原来是个 Super Prompt。</p><p>装好 Easy Negative,生成的图片就正常多了。</p><p><img src="https://imgcdn.nightcity.pub/202304202338251.webp" alt="00004-3723924490"></p><p>但总感觉色彩还是不好看啊……是不是还缺了什么?</p><h4 id="VAE"><a href="#VAE" class="headerlink" title="VAE"></a>VAE</h4><p>我在 Hugging Face 上看了一下,这里模型作者提供了远远不止一个的文件。</p><p>VAE 的全程是 Variational Autoencoder。旨在帮助用户更好的渲染图像,其中也包括了色彩的部分。而不知出于什么原因,作者只在 Hugging Face 上提供了他的 VAE。</p><p>装好 VAE,再次生成图像,这下的图像终于完全正常了。</p><p><img src="https://imgcdn.nightcity.pub/202304202346271.webp" alt="00008-3723924490"></p><h2 id="这几天生成的图片"><a href="#这几天生成的图片" class="headerlink" title="这几天生成的图片"></a>这几天生成的图片</h2><p>这是我挑选的一些图片</p><p><img src="https://imgcdn.nightcity.pub/202304202348504.webp" alt="00009-3723924490"></p><p><img src="https://imgcdn.nightcity.pub/202304202348703.webp" alt="00019-3798999894"></p><p><img src="https://imgcdn.nightcity.pub/202304202349523.webp" alt="00025-20447565"></p><p><img src="https://imgcdn.nightcity.pub/202304202349442.webp" alt="00006-323134003"></p><h2 id="阴间的图片"><a href="#阴间的图片" class="headerlink" title="阴间的图片"></a>阴间的图片</h2><p>其实上面最后一张图的手指已经是有生成问题的,而生成的图片里还有更阴间的图片。</p><p><img src="https://imgcdn.nightcity.pub/202304212308772.webp" alt="00022-805092293"></p><p><img src="https://imgcdn.nightcity.pub/202304212309704.webp" alt="00020-2866285131"></p><p><img src="https://imgcdn.nightcity.pub/202304212310638.webp" alt="00021-2462655427"></p><h2 id="玩玩插件"><a href="#玩玩插件" class="headerlink" title="玩玩插件"></a>玩玩插件</h2><p>这套 WebUI 还有插件可玩,这几天又心血来潮玩玩比较出名的插件。</p><p>至于怎么安装插件,都是在这套 Web UI 的 Extensions 里。一是从官方仓库里拉取插件列表,二是自己找到插件的仓库链接拉库下载即可。</p><p>我们来玩玩插件。</p><h3 id="controlnet"><a href="#controlnet" class="headerlink" title="controlnet"></a>controlnet</h3><p>controlnet 可以通过草图控制画中人物的姿势,理论上可以解决上面生成的人物阴间的问题。</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
<tags>
<tag> Stable Diffusion </tag>
<tag> AI绘图 </tag>
</tags>
</entry>
<entry>
<title>散步小记</title>
<link href="/2023/03/disappearing-public-memories/"/>
<url>/2023/03/disappearing-public-memories/</url>
<content type="html"><![CDATA[<p><img src="https://imgcdn.nightcity.pub/202303301549608.webp" alt="曾经用于防疫的围栏残片"></p><p>我有出门散步的习惯,每当累了,我就出门到处转悠。</p><p>说到散步,这也算是一种冥想吧,慢慢走在路上,不需要考虑任何事情,感受时光流逝,四季更迭,感受这个世界真实存在的东西。</p><p>这三年来,我身边曾习以为常的很多东西,大多是防疫相关的各个东西都慢慢消失。一开始是自然的,再到后来,就是被强行抹去了。为了防疫,这套围栏存在了三年。三年来,我们对不能从这里出去习以为常,当最近一次散步经过,我却发现,这些围栏已经化为时代的眼泪——被拆除了。</p><p><img src="https://imgcdn.nightcity.pub/IMG_6140.webp" alt="免费核酸检测点的残留"></p><p>我自高中以来就挤时间在学校散步,到了大学,这种校园内的漫步就成了常态。</p><p>在学校里待的时间长了,总有出校门的冲动,新校区远离市中心,自然不如老校区周围繁华,但也有在市中心见不到的东西,显得更加的真实。</p><p>这个核酸检测点,自我搬到新校区来就一直存在。它在新校区旁边不远的一个繁华的商业广场边上,只要我们要去那个商业广场,就必然要经过这里。现在这个核酸点早已不再做核酸,这个过去我们司空见惯的条幅,竟也成为了这不堪回首之时代的仅存的记忆。</p><p><img src="https://imgcdn.nightcity.pub/202304291636385.webp" alt="IMG_6068"></p><p>阴天适合骑车,从新校区出来沿着车少的路一路骑行,铁栏后的厂房,路边停满的卡车,新鲜的红土地,从小到大熟视无睹的苏联式住屋——离市中心这么远,自然就是工业区了。看到这番景象,想起我小时候住的地方,登时感到怀念不已。这些学习苏联建起的建筑,见证了中国的工业化。</p><p>再往前走到了一条大路上,车并不算多,这也算是我专挑车少的路走的回报。一直往前骑,在一个小区后拐弯,就能碰到一条长长的断头路——在六车道的公路上,没有一台车的干扰,可以在路中间自由驰骋。路边零星能看到为公交预留的停靠港,只是站台并没有建好。或许是当时经济发展势头好,城市做了自己的扩张规划以后兴建了这条路吧。只可惜,现在想要城市发展到用上这条路,恐怕要比计划的晚上10年了。</p><p>路边上有一个小村,没有被周边的宽阔马路分割成几个部分,还保持了相当不错的森林覆盖率。村口农家乐院里有一颗树,长势很好,以树干的粗壮程度来看,至少也有两百岁了吧。这么看来,这颗树逃过了大大小小的战火和政治运动,还躲过了旁边的公路和两条高铁的建设。要是城市真的发展到这里而砍掉这棵树,也得比计划的晚上十年吧。而十年过去以后又会是一副什么样的光景,这棵树能否活下去一事,突然就变得充满希望了。这么看来,这棵树竟也有不少福气。</p><p>星期二的下午是学校的公休,用于给教师做“统战”,是工作日难得的休息时间。这难得的休息时间,领导却还开会搞形式主义,我当然嗤之以鼻。</p><p>从这种会议上逃走,类似于旷课做自己喜欢的事。平日里整日的在学校里忙得头昏脑涨,即使放假也舍不得抽上半天时间出去玩,哪有这么好的机会能让我心安理得的出去玩?就像从喧嚣的凡尘里逃走——若是不逃出学校,恐怕我就得被迫去参加这次会议了吧。</p><p>一路乘地铁“出逃”,原本心情的喜悦被难受取代——人太多了,多到我喘不过气来,经过侯家塘,我实在支撑不住出站,终于看到了与此前不同的景象,相对较老的摩天大楼,六七十年的老社区……我终于没有被禁锢在那个牢笼里。</p><p>从侯家塘站一路走到白沙古井,再走到天心阁——长沙几乎没有百年社区,为了抵抗日寇的侵袭,文夕大火焚毁了这里的一切。无厘头的走着,但我并不觉得空虚,甚至一路走到了黄兴路步行街,方才打道回府。</p><p>之所以如此钟爱散步,是为了寻回“自我”。在经历了军事化的中学教育,好不容易来到大学,却没有发现期待中知识的殿堂。疫情之后,大学把自己围了起来,昔日校园里随处可见的社会人士全无踪影。这不是一种保护,而是一种囚禁。现在的大学,像中学一样,通过围墙轻而易举的扼杀了大学本应有的无限的可能性,扼杀了“希望”。之所以如此喜爱散步,之所以会有逃出校园的欲望,就是想要在散步中,寻找无限的可能性,寻找“希望”,让自己知道“原来,除了按部就班的上课、开会,还有无限的可能性,无限的希望等着我去探索,去发现。”</p><p>大学教育中学化,中学教育军事化,我几乎不能再找到比这更适合的形容现在教育的句子。每一次散步回来,我都感到欣慰和一种发自内心的平静,让我能更有力,更积极的去应对各种困难,即使深处这江河日下的社会,在中学化的大学校园里,我已经感受到了自己的存在和对自己的掌控。在这日渐干涸的土地上,我仍能坚守最后一片绿洲。</p><p>久旱的甘霖,何时才能降临?</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>不能被书写的时代</title>
<link href="/2023/03/the-ridiculous-era/"/>
<url>/2023/03/the-ridiculous-era/</url>
<content type="html"><![CDATA[<p>这些天出门散心,边散心边拍照片,三年间发生的闹剧的踪迹,在所谓“新十条”开始时慢慢淡去,过了几个月,竟然开始慢慢消失了。</p><h2 id="不得使用“疫情”相关表述"><a href="#不得使用“疫情”相关表述" class="headerlink" title="不得使用“疫情”相关表述"></a>不得使用“疫情”相关表述</h2>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>早稻亩产三万六千九百多斤</title>
<link href="/2023/03/new-great-leap-forward/"/>
<url>/2023/03/new-great-leap-forward/</url>
<content type="html"><![CDATA[<blockquote><p>《广西大叔一招把酸果变香甜 一年赚百万》</p><p>《广西夫妇做片状腐竹 一天收入七八百》</p><p>《山东大哥全年供应鲜嫩韭菜 年销售额3个亿!》</p><p>…</p></blockquote><p><img src="https://imgcdn.nightcity.pub/202303252226279.webp" alt="卖土豆日入9000"></p><p>这些是央视新闻最近的标题,明显可以看出来央视是在针对最近严重的失业问题以及“孔乙己文学”做宣传。</p><p>关于这则买土豆的新闻,它的真实性是存疑的,1天赚9000?你真的卖过土豆吗?我本想看看网友们有才的评论,打开评论区却发现评论早已被精选,并不意外。</p><p>且不论这则新闻的真实性,忽然如此高强度的输出这些所谓的“励志”新闻,明显就是政府面临如此严重的失业问题不作为而借官媒开脱的产物:你们失业都是你们自己不努力,关我屁事?</p><p><img src="https://imgcdn.nightcity.pub/202303252239571.webp" alt="人民日报1958年8月13日"></p><p>当时我看到这些新闻的标题,总觉得似曾相识,我初中时做过一些历史题目,其中有两个给我留下的印象特别深刻:第一个题目引用了上面这张人民日报在 1958 年 8 月 13 日的头版头条;第二个题目则是引用了这个时期的新闻,单凭印象的话,大概是“广西农民成功将苹果树与小麦嫁接”之类,并令我们反思为什么会出现这种新闻。当初不觉得有什么,才几年过去,现在想起来,这种题目竟是无比的开放、大胆,不经感慨道:这种题目是否还能出现在今天学生们的试卷上呢?</p><p>关于为什么这两个时期的新闻如此相似,主要便是如下几点:</p><ul><li>都是有目的的政治宣传</li><li>都非常浮夸而不切实际</li></ul><p>所谓有目的的政治宣传,前者是为了转移政府制造了失业问题而解决失业问题不力的矛盾,后者则是营造“革命形势一片大好”的氛围;所谓非常浮夸而不切实际,前者相比后者倒是有了一些进步,听起来至少比 1958 年的新闻真实多了。当然,这也至少证明公众的总体认知水平相比六十多年前还是提升了。但这依然不影响他们是同一个东西的事实。</p><p>“在社会主义制度无比优越!只要努力,早稻就能亩产三万六千九百多斤!不能亩产三万六千九百多斤?那是因为你反革命!”;“社会主义制度无比优越!只要努力,每个人都能年入过亿!不能年入过亿?那是因为你反革命!”。社会主义制度怎么会出问题呢?出了问题那也是你的问题。取得了一些成就?那是因为社会主义制度无比优越!跟你有什么关系?</p><p>为什么一则 2023 年的新闻,和 1958 年的新闻竟然如此相似?</p><p>若不容忍不同的意见存在,那么这个唯一存在的意见必然错误。而这个错误若持续得不到修正,造成的后果将是灾难性的。大跃进的后果我已无需多言,而今天,我们不论是宣传机器的作为、舆论环境的高压,还是其折射出的社会本质,都越来越接近于 1958 年的状态。今天的中国,不论是人口数量还是经济体量,与 1958 年的中国相比都高出好几个量级,若是对现状持续视而不见,一旦导火索被引燃,造成的后果与 1958 年相比绝对有增无减。</p><p>兜兜转转六十多年,本以为是新时代,殊不知新时代的外衣下,还是那个荒唐的败絮。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>十天补考三门后我学到了什么</title>
<link href="/2023/03/what-i-learned-after-3-tests/"/>
<url>/2023/03/what-i-learned-after-3-tests/</url>
<content type="html"><![CDATA[<h2 id="在嘈杂的环境中学习"><a href="#在嘈杂的环境中学习" class="headerlink" title="在嘈杂的环境中学习"></a>在嘈杂的环境中学习</h2><p>寝室环境通常不会安静,打游戏、开黑,这是室友的常态。但作为补考者,我必须要学会在嘈杂的寝室里学习。就在上学期,在嘈杂的寝室里,我还会喝住室友,让其安静。但这非但没能让我安心学习,还破坏了寝室和谐的氛围。</p><p>是否 Productive 和所处的环境并没有直接的联系,从前,我总是觉得我所处的环境不够好,我需要一个更好的环境才能变得 Productive。</p><blockquote><p>春天不是读书天,夏日炎炎正好眠;秋有蚊虫冬有雪,收拾书本好过年。</p></blockquote><p>事实上我错了,真正重要的因素其实是你是否想要 be Productive。停止寻找最佳 Productive 时间,Be productive at morning? Be productive at night?这些都随你便。真正 Productive 的人会说出这句话:Be productive now!——如果追逐最佳状态,那么很抱歉,达到最佳状态的时间终究是少数。追逐最佳状态其实是一种完美主义情结,而现实中并没有那么多完美,更好的解决方案实际上是接受现实——接受一个不完美但是更有用的解决方案。</p><h2 id="放下我执"><a href="#放下我执" class="headerlink" title="放下我执"></a>放下我执</h2><p>这实际上和第一点有很大的联系,什么是我执:</p><blockquote><p>我执(梵语:आत्म ग्राह ātma-grāha),佛教术语,又名人执,即妄执人有一实在的我(补特伽罗)。为二执之一,对应的为“法执”。 我执按三界境界相可分为:</p><p>执取见闻嗅尝触知等自性,于欲界所触之境界,以如是知觉性为不坏之我。<br>执取见闻触知等自性,于色界所触之境界,以如是知觉性为不坏之我。<br>执取了知定境之自性,于无色界所住之定境相或执取恒审思量心为常住不坏之我。</p></blockquote><p>简单的来说,“我执”是一种对事物应当如何的执念。这种执念,不但不能帮助人认清现实、解决问题,还徒增烦恼和压力。</p><p>从前,我总是认为,“室友一定要安静,只有室友安静,我才能专心搞学习”。但这并非现实,并且,这种执念让我为寝室的嘈杂而懊恼,愤怒和焦虑。然而,寝室并不会因为我的懊恼,愤怒和焦虑而做出任何改变。</p><p>在漫长的“我执”后,我发现,这些“我执”白白劳累我的心智,而这些白白劳累的心智,到后来都变成我心智不成熟的表现罢了。</p><p>懊悔不已。</p><h2 id="道德只能约束自己"><a href="#道德只能约束自己" class="headerlink" title="道德只能约束自己"></a>道德只能约束自己</h2><p>寝室里,即使你不断的去吵别人,这是公共空间,我也只能骂你没有素质,在道德上谴责你,但在没有力量来强行干预的情况下,能做的只限于这些——没辙。</p><p>怕的不是你卑鄙,怕的是你根本就想不到卑鄙的手段,怕的是你不会卑鄙。</p><p>为了目的不择手段是不可取的,我们向来被这么教育,鲜有人怀疑这个命题的真实性。事实上,道德是奢侈品,就像战火连连,粮食短缺时的黄金,一文不值。当帝国面临危难,珠宝和香水形同废品。当连基本存亡都成问题的时候,仁义道德都是虚无缥缈之物。</p><p>在被卑鄙的手段战胜以后,我们常常会觉得“这手段太卑鄙了,这赢得太恶毒了,真的是个小人!”,然而失败者能做的也只能是骂上类似的几句。当帝国面临危难,珠宝和香水能救国吗?看上去这些失败者建立了舆论优势,在道德上这种失败者也当之无愧的冤,可这毫无用处,即是你到处骂胜者卑鄙,也不影响他胜利的事实。这么做,无异于鸵鸟把头埋进土里,以为能够躲避沙尘暴,却还是被之吞噬。</p><p>我当然主张高尚,但高尚需要建立在自己足够强大的基础上。因为道德不能拿来要求别人,而只能用来约束自己。当一个实体还不够强大的时候,违背道德的成本就显得微不足道了。</p><p>我也要学习卑鄙的做事,要去学习,把自己培养成一个卑鄙的人:先卑鄙,再自发高尚,才是真高尚,被灌输的高尚,那叫蠢到家了。</p><h2 id="和室友相处"><a href="#和室友相处" class="headerlink" title="和室友相处"></a>和室友相处</h2><p>由于这个寒假的特殊性,我的室友也难免的出现了挂科的现象。大家压力都很大,甚至于精神都出现了不正常。压力一大,人就表现出了攻击性,经常出现很多莫名其妙的情绪波动。</p><p>所有人都有 Depress 的时候,有的人在这种时候不想和他人聊天,有的人会表现的富有攻击性。这些都很正常,理解万岁。不去理会那些人便可。</p><h2 id="忍受自卑以及其引来和放大的冷眼"><a href="#忍受自卑以及其引来和放大的冷眼" class="headerlink" title="忍受自卑以及其引来和放大的冷眼"></a>忍受自卑以及其引来和放大的冷眼</h2><p>当一个人自卑时,任何一个稍有不当的举动对他来说都是冷眼。</p><p>熬过去很难,成长本就是一种修行。对于减轻痛苦的办法,只能说,出去散个步,听听音乐。不忍受痛苦的成长是不可能的,这也是一种 Growing pain。</p><h2 id="放下包袱"><a href="#放下包袱" class="headerlink" title="放下包袱"></a>放下包袱</h2><p>得知我要补考三门以后,我产生一种想法:我已经不再是好学生了。</p><p>自进入大学以来,我一直背着一个要当好学生的包袱。现在看来,我真是自己给自己徒增压力。即使不论现在的内卷有多严重,所谓“好学生”的包袱,也严重影响了我的行为:即使老师很烂,我也会因为“好学生”的包袱逼着自己去听课,即使不去,我也会因此产生很大的负罪感。大一的时候要上的晚自习,教室里没有设备,网络也因为人多而卡顿,还要浪费不少时间在路上,而晚自习并没有对进入学习状态提供多大的帮助。现在回想起来,真是浪费了大量时间精力。</p><p>我们的班主任是一个话痨,关于这个话题,班上大多数同学大概是有共识的。平常,我们从不见他做任何裨益班级之事,一到开学期末,就不知从哪里冒出来,满嘴努力学习、仁义道德。每次他那冗长重复的讲话里,不时的蹦出的字眼,总有贬低学生之嫌。我那所谓争做“好学生”的心态,就会备受折磨。</p><p>我很高兴,我已经不再是好学生了。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>我为什么迁移到了Cloudflare</title>
<link href="/2023/03/why-i-moved-to-cloudflare/"/>
<url>/2023/03/why-i-moved-to-cloudflare/</url>
<content type="html"><![CDATA[<p>这一阵子,我将我的服务器迁移到了美国,然后给我的网站套上了Cloudflare。</p><p>我的网站原本假设在香港微软云的服务器上,在 Azure最近一次网络架构调整之前,电信直连的延迟仅需27毫秒。即使现在,也是可以接受的三网100毫秒。而迁移到美国套上Cloudflare之后,延迟骤增到了170毫秒。到了晚上,还会有很高的丢包率。</p><p>我当然不傻,知道继续在香港架设这个博客访问速度会比套在Cloudflare上快上不少,还能顺手利用学生身份白嫖服务器。然而,Cloudflare和美国服务器的组合却可以提供一些Azure学生机无法提供的东西。</p><p>现在我的博客架设在 Racknerd 的洛杉矶机房,趁着新年打折,2C2G的服务器一年的价格只需 25 美刀,即使在美西的服务器普遍很便宜的背景下也是十分突出的性价比。</p><p>之所以放弃使用Azure学生机,我需要援引一句话:</p><blockquote><p>免费的就是最贵的</p></blockquote><p>大部分看似免费的东西都需要我们在非金钱的方面付出更多成本:学生机虽然免费,但性能孱弱,1C1G,只能是勉强够用的水准。维护过自托管博客的站长肯定遇到过后台被爆破的问题,我的 WordPress 博客运行半年多,后台被爆破的情况几乎天天都有。学生机的性能弱到什么地步呢,只要有人用一秒一次的频率爆破后台,在不缓存的情况下,博客就会立马因为性能不足以处理这些请求而接近瘫痪。即使不瘫痪,TTFB 也会比正常情况下多1秒以上。因为学生机的性能,我没少花功夫去优化我的网站,比如前面提到的缓存,这些都十分消耗精力。</p><p>微软不是慈善机构,能为学生免费提供给服务器已经很不错了,更何况还在香港这种热门地点。我可以继续使用这一免费的解决方案,但问题是,人不可能永远呆在校园里,总有一天,我会失去高校学生的身份。我们不妨假设这样一段对话:</p><blockquote><p>Q:清华大学的学生算是高校学生吗?</p><p>A:算。</p><p>Q:那中南大学的学生算吗?</p><p>A:嗯,算的。</p><p>Q:那某个野鸡大学的学生算是高校学生吗?</p><p>A:呃,这得看情况。</p></blockquote><p>发现了吗?一家公司提供的免费的产品为谁提供的决定权和解释权并不在用户的手上,只要这家公司想,它就可以立刻收回白嫖的产品。这和免费域名的逻辑一样,你有使用权,但并无所有权。</p><p>为了停止使用 Azure 学生订阅,我一度想要放弃 Wordpress,改用静态化博客框架并托管在现成的静态网站托管服务上,却又不忍放弃我逐渐做好的 SEO。我也去找过国内的服务器,却发现价格太贵,套路太深。不想忍受大陆的“互联网狗牌”——ICP牌照制度,却又希望博客在大陆加载速度更快——没有完美的解决方案,我的博客想要面向大陆用户的访问速度,就需要钱和 ICP 牌照。</p><p>我开始问自己:我真的需要对大陆直连的访问速度吗?</p><p>我的访客,大部分都有挂代理的能力,即使是搜索引擎流量也大部分来自 Google。挂代理的能力还是一种过滤过滤低质量访客的手段,只有积极的绕过政府的封锁者才是真正的高质量访客。</p><p>牺牲大陆直连的速度,加速挂代理访问的速度,却又不完全被大陆封锁,同时不需要带着狗牌自我审查,这不正是我想要的吗?</p><p>只要牺牲大陆直连的速度,事情就变得简单起来,廉价的服务器已经有了,Cloudflare 提供了免费的全球(除了中国)CDN,有着强大的防御能力,而没有被中国完全封锁,更好的是,只要挂上代理,在中国大陆以外访问这个博客速度都会很快。不由得感叹中国大陆网络的孤立性。</p><h2 id="Version-B"><a href="#Version-B" class="headerlink" title="Version B"></a>Version B</h2><p>这一阵子,我将我的博客服务器迁移到了美国,然后采用了 Cloudflare 作为我的全球(除了中国)CDN。</p><p>我的博客原本架设在香港微软云上,而且服务器是我以学生身份免费领取的,可最近,这台服务器的表现越来越不尽如人意。香港地理位置非常好,网络也发达,理论上把博客架设在这里,可以给中国大陆的访客非常良好的体验,事实上,在我的博客开设初期,中国大陆的访客体验确实很好。</p><p>之所以说体验良好,主要是因为这三个方面:性能够用,大陆直连,免费。</p><p>所谓性能够用,但仅仅是勉强够用的水平。微软云针对学生免费的 B1S 实例,1C1G,硬盘 IO 经过实测只有几十mb/s,不说是金刚盘,也可以算是石头盘了。就这个性能,跑个 Wordpress 都费劲,我将博客缓存后方才勉强应付了架设初期的访问量。</p><p>所谓大陆直连,其实这仅适用于电信。在我刚拿到这个服务器的时候,实测 Traceroute 全程 59.xx 开头的 IP,妥妥的 CN2 线路。至于其他两个运营商就没那么好了,全都走东京 NTT 线路。</p><p>这么看下来,免费反而是最货真价实的优点了。微软云免费的学生额度有 100 刀一年,据官网介绍,这 100 刀用完,并且你还是学生,那么第二年可以再次申请。相当于是免费承包了学生时代的服务器。</p><p>当时刚拿到服务器的时候,微软云的这三个优点让我没有不选择它的理由,但随着我的博客运行半年多,这台服务器的问题就慢慢开始突出了。</p><p>首先就是让人非常难受的性能问题:如果说1C1G还能勉强说得过去的话,那么这个石头盘就真的太难受了。随着我的博客访问量逐渐增加,也就自然而然的引来了各路 Bot 的骚扰。这台服务器的综合性能甚至弱到了,只要有人用 1 秒一次的频率爆破我的后台,我的网站就会接近瘫痪。即使不瘫痪,TTFB 也会比正常情况下多1秒以上。</p><p>性能问题甚至已经影响到了我的 SEO :我已经多次收到邮件,提示我网页的打开速度太慢,需要优化,与此同时,我博客上来自谷歌的流量也显著降低,大概是因为搜索权重因为打开速度降低了不少。</p><p><img src="https://imgcdn.nightcity.pub/202303231923422.webp" alt="SEO 问题"></p><p>即使性能如此糟糕,在相当长的一段时间里,我也还是通过缓存等办法勉强维持了网页体验的整体质量。但微软云随后进行了一波令人吐血的操作:换线路。原本电信直连的香港直接并入了东京 NTT(刚去看了一下竟然变成绕新加坡了?),Traceroute 一下全都变成了 AS4134,CN2 直接变成 163。真有你的,微软云。这下,Azure 的网络优势也几乎尽数失去。</p><p>就算不好用,但是它免费啊,要什么自行车?</p><p>免费真的那么好吗?微软也不是慈善机构,能在香港这种热门的地方提供免费的服务器属实已经非常良心了。我还能要求什么呢?<strong>我还能要求什么呢?</strong>通过前面的换线路事件,我大概也见识到了,对于免费的产品,我们真的无法要求什么,甚至连最基本的要求都不行。不光如此,只要微软政策一换,我就立马无法继续白嫖。</p><p>在我的博客上线半年多以后,我发现,我已经没有理由再选择白嫖微软云学生机了。</p><p>那么,物色一个新的机器,成为了必要的选择:</p><p>起初我想寻找一个香港 CN2 直连的 VPS,但看了看价格,还是算了吧。最经典的搬瓦工,香港 CN2 要 899 刀一年,这显然不是我这个小破站能承受得起的。即使是更便宜的美国 CN2,仅仅 1C1G 的配置,也需要 49刀一年。换算成人民币需要 350 元一年。</p><p>更要命的是,CN2 网络因为承载量小,防御能力几乎没有,这就意味着我的博客要是遭到 DDOS 攻击,几乎完全无法防御。要是硬是想要防御,就得上 Cloudflare 这一类 CDN,但这样,CN2 线路的优点就不复存在。</p><p>实现快速似乎需要投入太多成本。这时我开始问自己,我真的需要很快的速度吗?我的访客,大部分都有挂代理的能力,即使是搜索引擎流量也大部分来自 Google。这样一来,Cloudflare 带来的直连速度的劣势得到了很大的缓解,而且,我还可以借助这一点过滤一些低质量的访客。</p><p>牺牲大陆直连的速度,加速挂代理访问的速度,却又不完全被大陆封锁,同时不需要带着狗牌自我审查,这不正是我想要的吗?</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>江河日下</title>
<link href="/2023/03/no-longer-prosper/"/>
<url>/2023/03/no-longer-prosper/</url>
<content type="html"><![CDATA[<p>前些天看到了阮一峰老师的<a href="https://www.ruanyifeng.com/blog/2007/11/what_is_the_people_s_democratic_dictatorship.html">旧文章</a>,不由得感叹江河日下。</p><p>当时阮老师的评论尤为犀利,再看看今天的阮老师,博客变成了《科技爱好者周刊》的发布地,再也不见这些犀利的评论。我并不觉得科技爱好者周刊有什么问题,相反,我个人也是阮老师博客的订阅者,我也很喜欢阮老师的博客。只是,阮老师从写真正的博客变成专注《科技爱好者周刊》,几乎意味着其不再发布令人眼前一亮的、富有创造力的个人观点与感想,而只是按照一个模板,半机械性的堆砌内容。</p><p>从这个意义上来说,阮老师的博客已死。</p><p>回头一想,我自己进行自我审查也已经有了相当长的一段时间,小到上网评论,大到高考作文,只要涉及敏感问题,我的第一反应是避而不谈,如果不得不谈,我也会尽力炮制一个“安全的”观点,替代我的真实观点。这种做法在我读高中时最为常用,我将其理解为“明哲保身”。</p><p>可怕的是,在经历了多年的自我审查后,我为时间如此长的自我审查付出了沉重的代价:我似乎失去了对社会事实评论的勇气,甚至能力——高中时的我很少在写作文时发表自己独到的见解,因为那些见解涉及敏感问题;微博上,我从不为任何时事发声,因为我担心这会为我带来不必要的麻烦;即使在不受审查的平台上,我也需要在发表自己的观点时鼓足勇气,因为我担心被大陆的警察“开盒”。</p><p>久而久之,我的高中作文变成了死板的套式,再也不见任何亮点。无论在何处,我不再抛出独到的见解。</p><p>这不是因为我不想,而是时间足够长的自我审查后,我对于这些事情评论的能力已经丧失。即使我已经放弃自我审查,短时间内我依然无法写出一针见血的评论。这种“失能”甚至如癌细胞一般,不受控制地扩散到了我更多的领域,这些领域涉及的方面非常广,从学习到生活,几乎无孔不入。</p><p>审查是一件非常可怕的事情。</p><p>有的人认为,审查只是确保社会稳定,防止“有害”内容产生的必要手段。而真相是,当人们进行了足够多的自我审查,人们就失去了没有被审查时的创造力和勇气。</p><p>当戴了一生镣铐的人忽然被释放,他看似自由的步伐也不会超过昔日镣铐的束缚。</p><p>这并不利于人的发展,更不利于社会。</p><p>别再自我审查。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 自我审查 </tag>
</tags>
</entry>
<entry>
<title>如何快速在CSUST图书馆找到你想要的书籍</title>
<link href="/2023/03/find-books-csust/"/>
<url>/2023/03/find-books-csust/</url>
<content type="html"><![CDATA[<p>要去图书馆找书,建议首先在图书馆的系统里搜索一下你需要的书籍,即使是模糊搜索也比什么都不做好。需要注意的是图书馆的系统<code>opac.csust.edu.cn</code>只能在内网打开。</p><p>找到书以后,可以截一张图,将带有索书号的页面发到你手机上,就可以动身去找书了。不要使用系统的书单导出功能,那并不会导出相关的索书号。而索书号是快速找书的关键。</p><p><img src="https://imgcdn.nightcity.pub/image-20230305163827833.png" alt="索书号"></p><p>拿着索书号到达图书馆后不要急着去找书,先确定你所需要的书在哪一个图书室,以及是否借出,以免扑空。上述这些信息都确认无误之后就可以去图书馆找书了。</p><h2 id="索书号怎么用?"><a href="#索书号怎么用?" class="headerlink" title="索书号怎么用?"></a>索书号怎么用?</h2><p>索书号是快速找书的关键,遵循一定结构编制,书籍都按照索书号的顺序存放。</p><p>以书籍《MATLAB programming》 为例,它的索书号是<code>TP312MA/C466/E.4</code>:其中,TP是书籍的分类,T是“Technical”的缩写,P则是T下的一个子类“Programming”;“312”则是“TP”分类下的一个细分;“MA”是“Matlab”的缩写,与之对应的还有 Java 的 “JA”等。</p><p>索书号在<code>TP312MA</code>之后的部分都是用以确定书在书架上的具体位置所用,在CSUST图书馆,这些书籍按照编号递增自上而下,从左到右依次排列。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> CSUST </tag>
<tag> 图书馆 </tag>
</tags>
</entry>
<entry>
<title>为Azure服务器上运行的网站启用IPv6支持</title>
<link href="/2023/02/enable-ipv6/"/>
<url>/2023/02/enable-ipv6/</url>
<content type="html"><![CDATA[<p>众所周知,Azure 的服务器在部署的时候只会分配一个动态的 IPv4 地址,在其上架设的网站自然也不会支持 IPv6。为什么花这么大的劲折腾网站的 IPv6 支持?这是一种必然趋势,当然,也是为自己的网站 Future Ready。</p><h2 id="为服务器申请一个公网-IPv6-地址"><a href="#为服务器申请一个公网-IPv6-地址" class="headerlink" title="为服务器申请一个公网 IPv6 地址"></a>为服务器申请一个公网 IPv6 地址</h2><p>于是我们首先要为服务器申请到一个公网 IPv6。</p><p>微软对 IPv6 的重视程度似乎没有那么高,在不久前,为服务器添加 IPv6 还需要动用 Powershell 部署 Load Balancer 实现,具体有多复杂可以看看<a href="https://learn.microsoft.com/zh-cn/azure/load-balancer/ipv6-add-to-existing-vnet-cli">这篇文档</a>,属实是非常劝退。</p><p>好在现在微软已经为 Azure 引入了原生 IPv6 支持,但部署起来依然相对繁琐,而且相当的不友好,之前甚至连文档都没有,不过现在终于把<a href="https://learn.microsoft.com/zh-cn/azure/virtual-network/ip-services/add-dual-stack-ipv6-vm-portal">文档</a>给补上了。</p><h3 id="添加-IPv6-地址空间和子网"><a href="#添加-IPv6-地址空间和子网" class="headerlink" title="添加 IPv6 地址空间和子网"></a>添加 IPv6 地址空间和子网</h3><p>根据文档,首先为现有的虚拟网络分配一个子网空间:</p><ol><li>登录到 <a href="https://portal.azure.com/">Azure 门户</a>。</li><li>在门户顶部的搜索框中,输入「虚拟网络」。 在搜索结果中,选择「虚拟网络」。</li><li>在「虚拟网络」中,选择你自己的虚拟网络。</li><li>在「设置」中选择「地址空间」。</li><li>选中「添加其他地址范围」框。 <strong>输入「2404:f800:8000:122::/63」</strong>。</li><li>选择「保存」。</li><li>在「设置」中选择「子网」。</li><li>在「子网」中,从列表中选择子网名称。 </li><li>在子网配置中,选择「添加 IPv6 地址空间」框。</li><li>在「IPv6 地址空间」中,<strong>输入「2404:f800:8000:122::/64」</strong>。</li><li>选择「保存」。</li></ol><p><img src="https://imgcdn.nightcity.pub/image-20230202195348596.png" alt="虚拟网络上添加IPv6地址空间"></p><p><img src="https://imgcdn.nightcity.pub/image-20230202195456103.png" alt="给子网添加IPv6"></p><h3 id="申请一个公共-IPv6-地址"><a href="#申请一个公共-IPv6-地址" class="headerlink" title="申请一个公共 IPv6 地址"></a>申请一个公共 IPv6 地址</h3><p>在搜索栏里搜索「公共 IP 地址」,然后按以下配置新建一个 IP:</p><table><thead><tr><th align="left">设置</th><th align="left">值</th></tr></thead><tbody><tr><td align="left">IP 版本</td><td align="left">选择「IPv6」。</td></tr><tr><td align="left">SKU</td><td align="left">选择「标准」。</td></tr><tr><td align="left">IPv6 IP 地址配置</td><td align="left"></td></tr><tr><td align="left">名称</td><td align="left">随意</td></tr><tr><td align="left">空闲超时(分钟)</td><td align="left">保留默认值「4」</td></tr><tr><td align="left">订阅</td><td align="left">选择你自己的订阅</td></tr><tr><td align="left">资源组</td><td align="left">选择你的资源组。 在本示例中,资源组的名称为 myResourceGroup</td></tr><tr><td align="left">位置</td><td align="left">选择你服务器所在的位置,例如我的 East Asia</td></tr><tr><td align="left">可用性区域</td><td align="left">选择「区域冗余」</td></tr></tbody></table><h3 id="将-IPv6-添加到机器上"><a href="#将-IPv6-添加到机器上" class="headerlink" title="将 IPv6 添加到机器上"></a>将 IPv6 添加到机器上</h3><p>打开机器的管理面板,停止服务器。转到网络选项卡,在「网络接口」边上打开你的网络接口。</p><p><img src="https://imgcdn.nightcity.pub/image-20230202215137930.png" alt="网络接口的位置"></p><p>然后,在网络接口的设置里选择「IP配置」选项卡,选择添加一个 IP 配置。并在弹出的选项里填入以下内容:</p><table><thead><tr><th align="left">设置</th><th align="left">值</th></tr></thead><tbody><tr><td align="left">名称</td><td align="left">随意</td></tr><tr><td align="left">IP 版本</td><td align="left">IPv6</td></tr><tr><td align="left"><strong>专用 IP 地址设置</strong></td><td align="left"></td></tr><tr><td align="left">分配</td><td align="left">保留默认值「动态」</td></tr><tr><td align="left">公共 IP 地址</td><td align="left">选择「关联」</td></tr><tr><td align="left">公共 IP 地址</td><td align="left">选择你新建好的 IPv6地址</td></tr></tbody></table><p>完成后确定保存就可以启动服务器了,这时你的服务器已经拥有并可以使用 IPv6 地址。</p><h2 id="修改-Nginx-配置"><a href="#修改-Nginx-配置" class="headerlink" title="修改 Nginx 配置"></a>修改 Nginx 配置</h2><p>如果这时使用纯 IPv6 网络环境访问部署在这台服务器上的网站,发现还是无法访问,就需要修改 Nginx 配置。</p><p>将以下两行插入到 Nginx 配置的 Server 块中实现监听 IPv6 的功能。</p><figure class="highlight nginx"><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="attribute">listen</span> [::]:<span class="number">80</span>;</span><br><span class="line"><span class="attribute">listen</span> [::]:<span class="number">443</span> ssl http2;</span><br></pre></td></tr></table></figure><p>插入正确的Nginx配置文件看起来应该类似这样:</p><figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">server</span></span><br><span class="line">{</span><br><span class="line"> <span class="attribute">listen</span> <span class="number">80</span> default_server;</span><br><span class="line"> <span class="attribute">listen</span> [::]:<span class="number">80</span> default_server;</span><br><span class="line"> <span class="attribute">listen</span> <span class="number">443</span> ssl http2 default_server;</span><br><span class="line"> <span class="attribute">listen</span> [::]:<span class="number">443</span> ssl http2 default_server;</span><br><span class="line"> <span class="attribute">server_name</span> wordpress.l3zc.com www.l3zc.com l3zc.com;</span><br><span class="line"> <span class="attribute">index</span> index.php index.html index.htm default.php default.htm default.html;</span><br><span class="line"> <span class="attribute">root</span> /www/wwwroot/wordpress.l3zc.com;</span><br><span class="line"> </span><br><span class="line"> <span class="attribute">if</span> (<span class="variable">$server_port</span> !<span class="regexp">~ 443)</span>{</span><br><span class="line"> <span class="attribute">rewrite</span><span class="regexp"> ^(/.*)$</span> https://<span class="variable">$host</span><span class="variable">$1</span> <span class="literal">permanent</span>;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="attribute">ssl_stapling</span> <span class="literal">on</span>; </span><br><span class="line"> <span class="attribute">ssl_stapling_verify</span> <span class="literal">on</span>;</span><br><span class="line"> </span><br><span class="line"> <span class="comment">#省略以下部分</span></span><br><span class="line"> ......</span><br><span class="line"> ......</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h2 id="修改网页内容"><a href="#修改网页内容" class="headerlink" title="修改网页内容"></a>修改网页内容</h2><p>此时托管在这台服务器上的网站已经可以通过 IPv6 访问了,但此时使用纯 IPv6 打开这个网站很有可能会得到一个不完整的页面。这是因为你的网站上还有外挂在 CDN 上的资源:例如图片和一些前端文件,而 CDN 不支持 IPv6 访问。这时就要根据具体情况替换网页内容上的外挂资源。</p><p>我这里的实际情况是:</p><ul><li>CDN 前端资源库支持 IPv6 访问,无需作任何修改。</li><li>大部分图片托管在腾讯云对象存储并外挂在网页上,经测试这项服务默认并不支持 IPv6。</li><li>其它资源均通过服务器本身加载。</li></ul><p>搜索得知腾讯云对象存储有一个双栈域名,使用这个域名即可达到目的。于是就开始了批量替换:登进 WP 后台,每个文章打开代码编辑器,把图片的链接批量替换,更新文章。一气呵成。再次打开文章测试,所有的资源都正常加载。</p><p><img src="https://imgcdn.nightcity.pub/%E6%9B%BF%E6%8D%A2COS%E5%8F%8C%E6%A0%88%E5%9F%9F%E5%90%8D.jpg" alt="替换COS双栈域名"></p><h2 id="更简单直接的方法?"><a href="#更简单直接的方法?" class="headerlink" title="更简单直接的方法?"></a>更简单直接的方法?</h2><p>如果你的网站在大陆已经备案,那么添加 IPv6 支持的最简单办法就是全站 CDN,上述内容全都不用考虑。</p><p>不过这种办法还需要想到其它的问题,例如,怎么设置缓存刷新周期,不过这就不是这篇文章考虑的问题了(才不是因为我没有备案用不了大陆的 CDN)。</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
<tags>
<tag> 网站 </tag>
<tag> Nginx </tag>
<tag> IPv6 </tag>
<tag> Azure </tag>
<tag> 服务器 </tag>
</tags>
</entry>
<entry>
<title>长沙到丽江,2023年的第一次旅行</title>
<link href="/2023/01/2023-new-year-trip-archive/"/>
<url>/2023/01/2023-new-year-trip-archive/</url>
<content type="html"><![CDATA[<p>这是我 2023 年第一次旅行,准确的说,是这三年闹剧过去以后的第一次真正意义上的旅行。</p><p>这次旅行从长沙出发,最远到达丽江,来回实际行驶的里程超过 4600 公里。什么概念呢?作为对比,从哈尔滨到海口的总里程是3800公里。</p><h2 id="规划"><a href="#规划" class="headerlink" title="规划"></a>规划</h2><p>这么长的行程,自然要仔细规划。</p><p>关于国内的地图不好用这件事我几乎无力吐槽。2010 年时,我曾踏上一次长途旅程——从海南到三亚,当时我们使用还在大陆运作的谷歌地图规划路线。而今天使用百度地图规划路线,规划的体验却和十几年前的谷歌地图相差甚远。谷歌地图因为失去在大陆采集数据的资质停止更新,甚至想用都用不了。无奈只能使用勉强用手机规划一条路线。</p><p>一开始我对这条路线应该怎么走并无头绪。于是我请出了 ChatGPT 为我献上旅行计划一则:</p><p><img src="https://imgcdn.nightcity.pub/image-20230208131140947.png" alt="ChatGPT制定旅行计划"></p><p>ChatGPT 还真就给我制定了一个看起来像模像样的旅行计划:</p><p><img src="https://imgcdn.nightcity.pub/image-20230208155304102.png" alt="ChatGPT制定的旅行计划全文"></p><p>看起来是不是非常靠谱?要真靠谱我早就把这一部分一笔带过了。</p><p>第二天直接从凤凰开车开到大理?然后在云南和各市之间反复横跳?我严重怀疑 ChatGPT 对中国地理的了解程度。不管怎样,这份旅行规划过于离谱,肯定是不能用的。不过,其中列出的景点倒是算有参考价值。</p><p>用 ChatGPT 规划行程的计划泡汤,无奈只好自己慢慢摸索。本次旅行的主要目标是去云南度假,避开长沙的寒冷。所以,赶在下一轮寒潮之前到达云南是很有必要的。驾车从长沙到昆明有两种大体方案:大体上贴着沪昆高速,以及先走一段杭瑞高速。由于杭瑞高速正好经过凤凰,一个不错的歇脚点,并且后面的行程更好安排,选择这条线路作为大体上的行程显得更加合适。</p><p><img src="https://imgcdn.nightcity.pub/image-20230208154013682.png" alt="大体上行进的路线"></p><p>于是根据这条路线,我大致规划出了这次到达云南之前的行程。</p><h2 id="出发前"><a href="#出发前" class="headerlink" title="出发前"></a>出发前</h2><p>2022 年的夏天,我顶着酷暑拿到了驾照。</p><p>考完驾照以后一直在开车,但开过的路况却仅限于市内路况。无可奈何于学业和这三年来疫情防控的闹剧,我们一直在忍受。</p><p>当时还处在感染大潮轰轰烈烈的时期,各种新闻与小道消息与社交媒体,无一不在反映一件事:那就是很多人都染病了,多到能够让街上的人甚至比所谓的“放开”之前都少上不少。人们都在家里养病,谁有心情出去旅游?</p><p>不过那时我和我的家人都已慢慢从感染中恢复过来,我们感到的已经不再是肉体上的疲倦,更多疲倦来自精神上。趁着这一轮感染潮消退之前,也就是三年以来最大的一波旅游潮到来之前,我们应当尽快将计划付诸实践。</p><p>后来的事实证明,这是一个正确的选择。</p><h3 id="买点东西随后出发"><a href="#买点东西随后出发" class="headerlink" title="买点东西随后出发"></a>买点东西随后出发</h3><p>出发前的物资补给很简单:</p><ul><li>3桶泡面</li><li>3盒自热米饭</li><li>一箱矿泉水</li><li>6瓶红牛</li><li>其他一些零散的零食</li></ul><p>以及最后的把油加满,直接走人。</p><h2 id="出发"><a href="#出发" class="headerlink" title="出发"></a>出发</h2><h3 id="凤凰古城"><a href="#凤凰古城" class="headerlink" title="凤凰古城"></a>凤凰古城</h3><p>这是我第一次开上高速,当然,实习期内只能在经过实习期的老司机陪同下上高速,好在高速上并不是很堵。第一次上高速很容易累,于是乎在开了一个小时的时候进服务区换人了,在换人以后边聊天边开的时候。高速上忽然堵车,还好雷达起了作用踩了一脚急刹。在吃完午饭简餐后一口气到达凤凰古城,很累,住在一家还不错的店子里,只可惜这家店位置不是很好,离景区有15分钟路程,只能在晚上去吃晚饭以后顺便看看夜景。尽管之前来过一次,夜景没有让我失望,虽然凤凰的店在3年时间里倒闭了不少,但很多不以盈利为目的,底子扎实的小店还是保留了下来。文艺气息很浓,很多有趣的店藏在深深的角落,文静,安宁。我很后悔,我没能抓住机会,去其中之一喝几杯杯咖啡或酒,坐在一个角落里慢慢休息,慢慢去感受这座古城。</p><p><img src="https://imgcdn.nightcity.pub/1673438042_uBwGZpuf_10a2cd162e43112fcf22236caa4e44fe.jpg" alt="喝了点拍的"></p><p>吃饭的时候喝了点,晚上在古城里散步,繁华的 Tourist Attraction 旁,喧闹的古城商业,安静的小巷里,时不时可以发现店铺转让的公告。上一次来凤凰古城是在2015年,当时正值劳动节,城内人山人海,一眼所及的店铺无不生意红火。现在同是旅游高峰期,人流却不到2015年时的一半。</p><p><img src="https://imgcdn.nightcity.pub/13076726_270955786580059_3738862630595491747_n.jpg" alt="2015年来凤凰时的照片"></p><p>凤凰古城在2015年前后经历了两次较大的挫折:第一次是2013年时臭名昭著的古城收费事件,在2016年结束。第二次便是这一次的三年疫情了。</p><p>两次事件都对凤凰古城的客流量造成了毁灭性的打击,其中以2013年古城收费事件为甚,这次人祸造成的客流骤减甚至直接导致凤凰古城内爆发示威游行。这是当时的一篇报导:</p><p><img src="https://imgcdn.nightcity.pub/image-20230211180032002.png" alt="收费的凤凰不如鸡"></p><p>当时的报导还真是正常且真实得多,不过这都是另一个话题了。</p><p>好在现在生活正在慢慢恢复正常,凤凰的客流量也得以恢复的机会。总让我想起一句来自 Cytus 2 背景图的一句话:</p><blockquote><p>Keep moving on.</p></blockquote><p>即使天塌下来,生活也还要继续。生活无论如何都要恢复正常,人们努力的将塌下来的天支撑起来,在第二天早上,大家起床,喝到了早晨的第一杯咖啡。</p><h3 id="镇远古城"><a href="#镇远古城" class="headerlink" title="镇远古城"></a>镇远古城</h3><p>从凤凰出发,不久便进入了贵州铜仁,转眼间所有的车牌都变成了“贵C”开头,这对我们来说还有些不习惯。虽然自我们从长沙出发以来海拔一直在缓慢上升,但因幅度不大,我们并没有明显感受到。不过,自进入贵州以来,由于北风被山脉挡住,天气逐渐放晴,这才让我们意识到,我们已经穿越了省界。</p><p>凤凰到铜仁的路程比较顺畅,到了中午饭点时,我们赶到了铜仁。</p><p><img src="https://imgcdn.nightcity.pub/26DD79C45EEDED533AC493233BF48482.png" alt="随手拍的一张铜仁照片"></p><p>这是铜仁解放路上的一个步行街,只要在中国生活过,都知道一个城市的解放路是这个城市最繁华的地带,然而导航依然无视堵车的风险,将我们带到了这里,正值中午,我们也决定在此歇脚吃饭。</p><p>铜仁的车牌以“贵C”开头,其在贵州省内的地位与桂林于广西、湘潭于湖南的地位类似,在城市建设方面,铜仁自然不会差。铜仁原名“铜人”,相传元朝时有渔人在铜岩处潜入江底,得铜人三尊。《大明一统名胜志·贵州名胜志》卷四铜仁府:“元置铜人大小江等处蛮夷军民长官司。盖境西南有大江,西北有小江,当其合流之处,崖高数十仞,挺然立于中流,相传有渔者没其底,见三足如鼎,得铜范儒、道、释三像,故以铜人名崖。及置长官司,始易‘人’为‘仁’。” 张澍《续黔书》卷三:“元始置铜人大小江等处,其曰铜仁者,则明洪武初改之之误也。”</p><p>铜仁有相对悠久的历史,顺理成章成为了一座旅游城市。其周边的梵净山,思南石林都是值得一看的景点。奈何梵净山乃避暑胜地,而这次来的时间是冬天,并非一个好的参观时间点,遂放弃参观。</p><p>如果你想在铜仁解放路上找到一家具有当地特色的餐馆,可能会有些失望。和许多城市一样,解放路上大多是商业店铺,老字号饭店由于承担不起高昂的房租,已陆续搬至租金更便宜的地方。这条路上唯一醒目的饭店居然是麦当劳,无奈之下,我只好进去买了点东西填肚子。</p><p>在铜仁短暂停留后我们再次出发了,然而,这一次的行程可就没有那么顺利了。在我看来,从铜仁到镇远,才算真正的进入贵州。这一段路十分颠簸,像是原本想要提质改造成宽阔的公路,但因资金链断裂而停工,最终被过路的大车压得坑坑洼洼。在这段路上,我们的平均车速不超过每小时10公里,其难走的程度可想而知。</p><p><img src="https://imgcdn.nightcity.pub/2F3A832DB063475A56D49F3562A34CFE.png" alt="难走的公路"></p><p>只要最终看到的风景足够好,再难走的路都不虚此行。然而,镇远并没有给我惊喜。我可以明显感觉到这里原来只是一个普通到不能再普通的小镇,将苏联式的房子加上马头墙,刷上白漆,贴上“青砖”,就包装成了一个古镇。镇上的人文气息少之又少,完全不能给人一种沉浸感,没有大城市的繁华,却依然非常浮躁和喧嚣。这不禁让我想要以这一句话评论这个古镇:取了大城市糟粕,却未能学到大城市的精华。</p><p>唯一值得看的,是环绕在这个“古镇”周围的山水。</p><p><img src="https://imgcdn.nightcity.pub/EF85A67D-856C-428A-A2C8-EC5C22A8F897_1_105_c.jpeg" alt="镇远古城"></p><p><img src="https://imgcdn.nightcity.pub/6D171B6E-D57D-4F1D-AEBE-A35BF4B3E03D_1_105_c.jpeg" alt="镇远山水2"></p><p>镇远毕竟地处偏远的贵州,其景色、文化底蕴、旅游氛围完全不能与湖南凤凰相比,奇怪的是,镇远古城竟然被评为5A景区,而凤凰古城仅仅被评为 4A 景区,难道是因为凤凰古城的收费事件?</p><blockquote><p>镇远县位于贵州东部,属黔东南苗族侗族自治州。从地图上看,东邻的湖南湘西中部有一凸出部分,恰像一个楔子,插入贵州东部凹处。镇远县就处在这个凸凹结合部上。不知哪朝哪代哪位先生称镇远为湘黔门户,这一点上,与湖南凤凰无二。据史书记载,镇远古称“竖眼大田溪洞”,属“鬼方”。从夏到商,世居着荆、梁二州的西南,泛称“荆蛮”。追本溯源,古代的镇远,地处历史上“五溪蛮”和“百越人”聚居的结合部。宋绍定元年,公元1226年,赐名镇远州,“镇远”这一名称从此沿用至今。镇远有被誉为有“长江三峡之雄伟,桂林山水之秀丽”的国家风景名胜区舞阳河三峡景区,也有可同四川九寨沟媲美而被古人惊叹为“或不得游则有为恨者矣”的铁溪风景区,有广为历代名人盛赞的镇远二十奇景,还有野趣神韵堪与湖北神农架相比的高过河幽地。除此,镇远还有众多千奇面怪、千姿百态的溶洞兀峰、奇石奇景荟萃。</p></blockquote><p>看到这一段话,我自然的联想到我的出生地永州。永州拥有丰富的文化底蕴,柳宗元被贬永州时,永州的美景待他不薄,“千山鸟飞绝,万径人踪灭。孤舟蓑笠翁,独钓寒江雪。”。欧阳修游览零陵时,亦曾写下“画图曾识零陵郡,今日方知画不如。”的吟咏。不仅如此,永州的自然美景也毫不逊色,九嶷山乃属国家森林公园,而其中的炎帝陵更是极富竞争力的景点,加之永州毗邻桂林,有世界级的顶级旅游目的地为伴,发展旅游业不说不费吹灰之力,也绝非难事。</p><p>小城永州自有小城的格调,泛舟潇湘,每天下午在河边悠闲钓鱼的人不计其数。富有文艺气息的小店散落在此,藏在永州的各个小巷。这是一个生活节奏缓慢的慵懒城市,活脱脱一个逃避凡尘的绝佳地点。</p><p>奈何,永州并未能抓住这些绝好的发展机遇,错过多次发展旅游的风口,在毫无区位优势的前提下,发展的重心竟然落在工业上,沦为一个不伦不类的城市。</p><p>镇远与永州相比,并不是什么好地方,既没有永州古时零陵郡的建制,也没有永州湖广要道的区位。甚至不久前还仅仅只是一个普普通通的小县城,在相对短的时间内却成为5A级景区。相比之下,永州的旅游体验比镇远有过之而无不及。</p><p>这趟旅途让我充分的体会到一点:冲着5A景点去旅行,还不如抽签决定去哪个景点,旅游体验决不比5A景点差。</p><h3 id="贵阳"><a href="#贵阳" class="headerlink" title="贵阳"></a>贵阳</h3><p>一大早离开镇远古城后我们赶往贵阳。铜仁到镇远的烂路令人印象深刻,在走国道还是高速的问题上算是让我们坚定的选择了全程后者。</p><p>于是我们很顺利来到了贵阳。</p><p><img src="https://imgcdn.nightcity.pub/DA4ED0B69826A7089A5551B97F858307.png" alt="黔灵山上的贵阳"></p><p>作为省城,贵阳自有光鲜亮丽的一面。但也免不了“千城一面”的单调。这是我在贵阳黔灵山顶的景观亭拍下的贵阳城景,其实,在岳麓山上鸟瞰长沙,你也会看到大同小异的景色:光污染的摩天大楼,大道平整宽阔,小道穿城而过。无非如此。</p><p>从酒店到黔灵山的路上遇到几个施工地点。这也是在别的城市能够看到的:不统一的城市规划导致每三五年,城市道路挖了又填,填了又挖。不光阻塞交通,切断人行道,还有噪声和烟尘污染。总让我感觉回到了前几年长沙地铁还在兴建时,我家周边的环境。</p><p>贵阳在网上给我留下的另一个深刻印象是花果园,号称是全亚洲最大的住宅区。于是,即使在贵阳只能停留一天,即使开车一上午累的只想趴在酒店休息,我还是在从黔灵山返回酒店后不久搭公交车前往了花果园。</p><p><img src="https://imgcdn.nightcity.pub/CEE7857BC56AB9737FD3005746ECE853.png" alt="黄昏时的花果园"></p><p>花果园亚洲最大住宅区的名号名不虚传,可以说简直就是黑压压一片。</p><p><img src="https://imgcdn.nightcity.pub/202303101538190.png" alt="花果园的住宅区"></p><p>摩天大楼实际上是反人类的,它并不宜居,同时会造成非常多的额外问题。然而在贵州花果园,这样黑压压的摩天大楼数以百计。堪称世界上最大的“人造灾难”。</p><p>以色列 Isaac Meir 教授曾经写过<a href="https://www.israel21c.org/skyscrapers-are-huge-mistakes-warns-engineering-expert/">一篇文章</a>,系统地总结摩天大楼的各种缺点,简单的总结下来有如下几点:</p><ul><li>能耗巨大,摩天大楼是天然的温室,加之内部人员与器件所散发的热量,致使其必须依赖大型空调散热</li><li>成本太高,建造摩天大楼所需要的成本比一般高楼多得多。</li><li>安全问题,如果发生紧急情况,电梯无法使用,高层的人员如何撤离到地面?</li><li>社会问题,摩天大楼会对基础设施造成巨大的挑战,下楼的麻烦也减少了人们出门的频次。</li></ul><p>既然明知摩天大楼有如此多的缺点,为什么人们还是热衷于摩天大楼?为什么一栋栋摩天大楼总能得到足够多的资源拔地而起?显然不是因为中国和沙特阿拉伯一样钱多到没处花。</p><p>不只是在贵阳,而是全国各地,尤其是近几年经济不景气,烂尾楼从来是不缺的。上面图中出现的花果园双子塔,虽然看上去光鲜亮丽,实际上已经沦为一个烂尾花瓶。</p><p><img src="https://imgcdn.nightcity.pub/202303111040252.png" alt="image-20230311104057208"></p><p>2015年封顶的建筑,下面的商业层却是完全的废弃状态,充斥居无定所的游民,场面一度让我认为我在赛博朋克的烂尾楼下。而旁边供开发商高层享乐的花果园白宫,则是外表上就恢弘大气,内部据透露亦极尽奢华。</p><p><img src="https://imgcdn.nightcity.pub/202303111544963.webp" alt="花果园白宫"></p><p>倒是大楼的另一边,开着一家类似酒店的场所,让我还能找到这栋大楼的一点实际用途。</p><p><img src="https://imgcdn.nightcity.pub/202303111538358.webp" alt="双子塔唯一的实际用途"></p><p>远看一栋大楼,近看败絮其中。</p><p>政府支持求政绩,开发商们饱私囊。</p><p>银行放贷有恃无恐,来日崩盘有人来救。</p><p>那么究竟是谁来救?只有政府的巨额税收。</p><p>建设摩天大楼需要耗费的大量资源,一切都因为腐败而被腐蚀成一个空壳。只有那些开发商们赚足了钱,政府也因此获得了政绩,银行也收获了利息。只有我们,要为这一切荒谬的投入买单,却享受不到实际的好处。</p><h3 id="黄果树瀑布"><a href="#黄果树瀑布" class="headerlink" title="黄果树瀑布"></a>黄果树瀑布</h3><p>从花果园回来以后,一夜无话。</p><p>第四天是赶路的一天,这一天的赶路还算顺利。由于冷空气加速南下,我们决定赶在冷空气之前加速前往下一站。这样一来,这一天就需要直接从贵阳赶到昆明。</p><p>贵州大部分是山区,旅游资源实际上非常丰富,自然风景有前面提到的梵净山,黄果树瀑布等,人文资源一样也不缺,西江千户苗寨等地在来贵州之前我就已经耳熟能详。如果只是在贵阳住一晚上,相当于直接略过了贵州的旅游资源,即使时间很赶,我们还是决定去黄果树瀑布看看。</p><p>一大早从酒店出发,边开车边啃面包,一路无事到达了黄果树瀑布景区。碰巧赶上为了恢复旅游,贵州全境景区门票免票。花了三个小时在黄果树景区游玩。</p><p>从景区出来时碰到了一位景区工作人员,他给我介绍了黄果树景区极盛时的状况:黄果树景区本身就有完善的接待设施,接待能力很强。旅游高峰期时,一天的接待量可达到六万游客。此时,景区内观光巴士车来车往,栈道上人山人海,水泄不通。黄果树景区内著名的景点水帘洞,甚至需要排队1小时才可游览。我在参观时,发现去往水帘洞的路上,出现了一个标示牌,上书“因最大安全承载量问题,水帘洞景区需要排队进入,预计需等待一小时”。而今天的黄果树景区,游客稀少,进入水帘洞完全无需排队。据称,即使免门票,目前的游客接待量也只有每日三千。</p><p>从黄果树景区出来时会经过一段有意设计的路线,引导你经过景区的纪念品商店区。这个商店区非常庞大,从其使用的痕迹依稀可见往日的繁荣,如今到处都是关门歇业、门面转让的告示,只有寥寥数家商户苦苦支撑,盼望政策放宽后的人潮,只可惜,折腾了这么久,大家口袋里真的还有钱来消费吗?</p><p>之后便是与寒潮赛跑快马加鞭赶往云南。贵州与云南交界的山区本身就对寒潮起到了很好的阻隔作用,又因为焚风效应,实际上几乎完全抵消了寒潮的影响。</p><p><img src="https://imgcdn.nightcity.pub/202303311325583.webp" alt="C95C760B452AA4A8836A388C1BCB2DD0"></p><p>所谓云南有所谓“彩云之南”的称呼,进入云南,真的就如换了一片天。天空很蓝,而且是以周计算的,连续的蓝。</p><p>云南的日照时间很长,可以算作是“中国的阳光地带”,从长沙到昆明,感知相当强烈。在长沙生活的人盼着出太阳的时候,昆明人大抵在盼着下雨。</p><p><img src="https://imgcdn.nightcity.pub/202303311334696.webp" alt="bg2022122010"></p><p><img src="https://imgcdn.nightcity.pub/202303311334439.webp" alt="bg2022122009"></p><p>下午五点,我们还在路上,太阳依然很高,实际上我们不光在和寒潮赛跑,也在和太阳赛跑。</p><p>我们几乎全程在向西开,跨越的纬度几乎足以制造一个小时的时差。地球是倾斜转动,北半球正值冬季,越往南走,白昼就越长。昆明的下午5点,几乎是长沙的下午三点。</p><h3 id="抚仙湖"><a href="#抚仙湖" class="headerlink" title="抚仙湖"></a>抚仙湖</h3><p>抚仙湖是云南第三大湖,和省会昆明只有一山之隔,水质非常清澈,是昆明人的度假胜地。</p><p>《地理·中国》曾拍过一期节目讲解抚仙湖,链接附上:<a href="https://tv.cctv.com/2015/05/30/VIDE1432970526664662.shtml">https://tv.cctv.com/2015/05/30/VIDE1432970526664662.shtml</a></p><p>抚仙湖周围不乏开设小吃摊的本地人,藉由抚仙湖连续的好天气,以及周围宁静的氛围,小吃和音乐总能让我忘却很多生活中的琐事。若是要我给这种氛围一个评价,我将回答:还会再来的。</p><p><img src="https://imgcdn.nightcity.pub/202303311955216.webp" alt="B773687871ED5191AEEA4EA1737E57DF"></p><p><img src="https://imgcdn.nightcity.pub/202303311956171.webp" alt="8766469318BE66B2DA80B87719AF406B"></p><p><img src="https://imgcdn.nightcity.pub/202303311958318.webp" alt="CF7A5769E888D0F7D41BCAF42A8475DC"></p><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=2013921197&auto=0&height=66"></iframe><p>这是拿不拿在当天发布的新歌,氛围真的是可以影响心情的魔法,而心情是能让歌变得无限好听的魔法。</p><h3 id="虎跳峡"><a href="#虎跳峡" class="headerlink" title="虎跳峡"></a>虎跳峡</h3><p>虎跳峡是世界上最深最大的峡谷之一。</p><p>网上能找到的关于虎跳峡的评价里,很大一部分人自述来的动机是因为国家地理的安利,然而我在网上搜了一圈,并没有找到国家地理相关的文章,也许是某期节目吧。</p><p>虎跳峡的高路徒步线路是世界级的徒步线路——强度不大,风景很好。</p><p><img src="https://imgcdn.nightcity.pub/202304011104723.webp" alt="9415543D1494BDE3ED9431407B7D1686"></p><p><img src="https://imgcdn.nightcity.pub/202304011110271.webp" alt="5F7F9E055DC9E65CE4487E296DBDFF08"></p><p><img src="https://imgcdn.nightcity.pub/202304011112552.webp" alt="22432F1A298E56B622F6C7E81E224CC4"></p><p>这条徒步路线相当成熟,几乎是每逢岔路,必有路牌。路牌通常是客栈老板所设,其上也是他们客栈的名字,简单来说,就是广告。当好几个客栈,乃至十几,几十个客栈在同一个地方打广告时,这些广告竟然也像是被施了魔法,变得有趣了起来。</p><p><img src="https://imgcdn.nightcity.pub/202304011108373.webp" alt="2334A23CD4CB12954A6FD1A41F6BE6C7"></p><p>虎跳峡中途有一客栈,名曰 Halfway。疫情之前诸多国际友人来到这里,欣赏其观景平台的“日照金山”,久而久之,这里就变成了世界著名的观景平台。而因其位置非常好,在这里蹲厕可以看到雄伟的虎跳峡绝壁山峦,于是大家都给它一个笑称,曰“天下第一厕”。</p><p>在湖南生活了这么久,几乎不知道干冷是什么感觉。每逢湖南降温,其必然是又湿又冷,气温还没降到零度,湿冷所带来的“魔法攻击”就能让人赶到寒冷无比。直到这次徒步,路已结冰,一看天气,才察觉温度已到零下,我方才体会到干冷的感觉——原来,干冷是只需要穿点衣服就能挡住的。</p><p><img src="https://imgcdn.nightcity.pub/202304011123454.webp" alt="BE26730289212E060FF456DA5A642949"></p><h3 id="丽江"><a href="#丽江" class="headerlink" title="丽江"></a>丽江</h3><p>Fun fact:虎跳峡在香格里拉,不是丽江!</p><p>丽江是全国旅游发展很早的城市,毕竟是江泽民时代就已开始发展。</p><p><img src="https://imgcdn.nightcity.pub/202304021241588.webp" alt="Jiang_Zemin’s_calligraphy_in_Lijiang"></p><p>丽江本身的城市建设,我是觉得没什么问题的。本身没有高楼大厦,规划也还算整齐,活脱脱一个宜居的城市。而丽江古城,商业化气息就非常严重了,甚至有肯德基和麦当劳。</p><p>此地气候非常好,我们在此游玩的时间里,天气非常适宜:在高原上,天空都矮了下来,蔚蓝无暇。空气适宜,因为污染被高山阻挡——作为一个旅游城市,丽江几乎没有什么高污染产业了。</p><p>丽江古城内有一些自古城成为景点就一直开下来的老店,味道和环境都属于上乘。不知怎么的,高原的食材就是比平原上产量少,质量却比平原上的视频高不少。在丽江古城,沐浴在阳光下,享用高原醇美的食材。抑或在夜晚到来,在古城熙熙攘攘的氛围里慢慢用餐,都是不错的选择。</p><p><img src="https://imgcdn.nightcity.pub/202304021352732.webp" alt="IMG_5617"></p><p>古城总是有一种魅力,看见古城的繁华,总能让人忘却一切现代社会的糟粕,令人回到过去,享受当年美好的繁华。</p><blockquote><p>在这里,你会发现,时间并非总是线性发展。</p></blockquote><p>城内之精华是木府,顾名思义,即木家府邸。木府是当年木氏土司修建的府邸,崇祯十二年(1639年),徐霞客游至丽江时,曾在其游记中描述木氏土司府“宫室之丽,拟于王者”,足见其规模壮大。</p><p>木府的规模壮大,得益于当年中原王室的支持。处处都是“敕造”,足可见到木氏土司和中原王室的关系良好。</p><p><img src="https://imgcdn.nightcity.pub/202304021401952.webp" alt="FE370150F960FC83AF665135A5BBC951"></p><p>土司的地位约等于藩王,皇帝坐的是龙椅,藩王就坐一把“虎椅”</p><p><img src="https://imgcdn.nightcity.pub/202304021404560.webp" alt="07B94FDE1A6D22FD78A7AD6674C13052"></p><p>1996 年,木府在主要来自世界银行的贷款下被修复。能够在当时的经济水平下修复成如此水平,已经非常不容易。</p><p>登上高处,可以欣赏到几乎半个丽江古城。</p><p><img src="https://imgcdn.nightcity.pub/202304021408390.webp" alt="2219FA77C808C160BEEAE698B475CFAB"></p><p>在丽江古城,能明显感觉到来自国外的客流正在慢慢恢复,起码,你能在街上看到前来参观游览的外国人了,虽然肯定不如三年前的水平,但至少正在慢慢恢复。</p><p>听本地人说,丽江古城相当于丽江的市中心,是夜生活的好地方。我特别留意了这一点:夜晚来到丽江古城,只见夜店、酒吧到处开张,十分损害古城的氛围。虽说酒楼瓦肆和迪厅夜店本质上并无区别,但我相信来到这里的外地人,都是受够了大城市的喧嚣,想来感受古色古香的氛围的吧。可惜,晚上经过迪厅密集的古城街区时,人们便会感受到这种格格不入,大失所望。</p><h3 id="大理"><a href="#大理" class="headerlink" title="大理"></a>大理</h3><p>云南曾经有过一段政权叫做“大理国”,在两宋时期存在。疆域落在今天,遍及中国、老挝、缅甸、越南,当然,大部分在中国。大理即是大理国的首都。</p><p><img src="https://imgcdn.nightcity.pub/202304021735203.webp" alt="800px-Dali_Kingdom"></p><p>(图片来自维基百科)</p><p>首都的建制自然豪华,而我们到达大理时,过年的人流已经将大理挤得水泄不通,在大理歇脚的计划只好作罢。</p><p>古城周围停车总是非常紧张,就拿我们在大理短暂停留的时间来说,吃了个中饭,花了大概半个小时,却被迫在每小时10元的停车场停车。这个价格,已经比肩闹市中心的紧俏停车场了。也许是我们赶到大理时已经接近新年吧。</p><p>大理三塔,佛教建筑也。就在214国道旁边,还是非常著名的景点。这里在大理国时期扩展为890间屋子、11400尊佛像、三阁、七楼、九殿及百厦,被称为“佛都”。大理国22代国王中,就先后有9位到崇圣寺出家为僧。</p><p>你大概也在网上听过“虽不信佛,但敬佛”的人,我大概也算其中之一吧。此次参观,也算让我更加敬佛了。</p><p><img src="https://imgcdn.nightcity.pub/202304062301287.webp" alt="2433FE707E60DE6BF2CEB89D46805E26"></p><h2 id="回程"><a href="#回程" class="headerlink" title="回程"></a>回程</h2><h3 id="在昆明过年"><a href="#在昆明过年" class="headerlink" title="在昆明过年"></a>在昆明过年</h3><p>赶到昆明的那一天正好大年三十,于是我们顺理成章的在昆明过年了。</p><p>省城的接待能力普遍不会很差,昆明也不例外,加上非常多的人在春节时实际上会离开省城回到自己的家乡过年,省城的接待压力反而会有所减少。于是我们便可以一个相对便宜的价格住下来。</p><p>前面提到过昆明是全国全年日照时数最多的城市之一,现在看来,名不虚传。我们在此过年,很大一部分原因是这里的气候——夏无酷暑、冬无严寒、气候宜人,具有典型的温带气候特点。现在,这个春城的名号,是我们留在这里的最大理由。</p><p>昆明是中国的战略大后方,抗日时期,即使日寇再凶猛,也未能攻下昆明城。当时,中国最好的大学——北大,清华,南开,在此共组国立西南联合大学,昆明一城,就荟萃了全国最精华的教育资源,如果昆明有意识,也一定会受宠若惊吧。</p><p>大年初一在官渡古镇,人潮涌动,完全觉察不到是大年初一——几乎所有的店铺都照常营业,人们也享受这里的生活。这里刚好在举行什么“美食文化交流节”,看到老长沙臭豆腐的摊位前人满为患,我甚至有些想笑:这东西真有这么好吃吗。</p><h3 id="百色"><a href="#百色" class="headerlink" title="百色"></a>百色</h3><p>花了两天时间到百色,中间曾经去过一个叫做普者黑的破地方。我的评价是,吸引的来人,但留不住人。反倒是百色,打破了我对其之前的印象。</p><p>从昆明一路向西下高原,就会到达广西,到了广西,第一站便是百色。</p><p><img src="https://imgcdn.nightcity.pub/202304091735298.webp" alt="250px-Location_of_Baise_Prefecture_within_Guangxi_(China)"></p><p>进入百色,市容整齐,气候宜人,倘若是抛弃那些热门的“养生”城市,百色倒是一个非常不错的住家的地方。毕竟靠近海洋,纬度也低,气候终年不会太冷,湿度也是无需担心的。</p><p>翻看百色建制的历史,就会发现百色的建制几乎是一路绿灯——从直隶厅到县,从县到市,不断升级。百色是革命老区,除开城市自然发展的因素,这大概也是革命老区的专属待遇吧。</p><h3 id="在黎平待上最后一晚"><a href="#在黎平待上最后一晚" class="headerlink" title="在黎平待上最后一晚"></a>在黎平待上最后一晚</h3><p>黎平是我们此行的最后一个驻留的地方,为什么要在这里再停一个晚上?其实没有什么特殊的原因,若是打开地图,规划百色到长沙的路线,你就会发现黎平刚好就在这两个地点的中点。黎平地处湘、贵、桂的交界,看上去也像一个很好的中转站。</p><p><img src="https://imgcdn.nightcity.pub/image-20230411203938734.png" alt="image-20230411203938734"></p><p>至于风景,我们无暇观看。尽管黎平有各种侗族大寨等,我等也只能在酒店附近转转。于是我们看到的人文景观便只有翘街了。</p><p><img src="https://imgcdn.nightcity.pub/image-20230411205348897.png" alt="image-20230411205348897"></p><p><img src="https://imgcdn.nightcity.pub/image-20230411205512707.png" alt="image-20230411205512707"></p><p><img src="https://imgcdn.nightcity.pub/image-20230411205845243.webp" alt="image-20230411205845243"></p><p>黔东南人有一特色菜名曰牛瘪,具体就是将牛宰杀后,把牛胃及小肠里未完全消化的内容物拿出来,挤出其中的液体,加入牛胆汁及佐料放入锅内文火慢熬,煮沸后将液体表面的泡沫过滤后食用。至少,我这个外地人是觉得难以接受的。</p><p>近期香港流行起“两送饭”,黎平人其实也有自己类似的两送饭——炒好的牛瘪以食品袋装好直接带回家,就是一道现成的菜,价格和同样份量的食材差不多,还不用洗碗,何乐而不为?我体验了下,其实味道很不错,只是不论是烧菜店面的卫生环境,还是什么措施都不采取,直接用普通的塑料食品袋盛装这一做法,实在是让人担心,第二天自己会不会拉肚子呢(苦笑)。</p><h3 id="沪昆高速上的大堵车"><a href="#沪昆高速上的大堵车" class="headerlink" title="沪昆高速上的大堵车"></a>沪昆高速上的大堵车</h3><p>第二天早上出发,本以为只要6个小时我们就能赶到长沙,没成想,这成了我们这次旅途中最难熬的一段。</p><p>每逢新年,像是沪昆高速这种全国高速的大动脉就会拥堵不堪,从前觉得没什么,直到自己体验过一遍,才知道拥堵有多严重。从前有一错觉——高速堵车再怎么也没城市堵车严重。上到高速才发现,过年高速上那种水泄不通的堵车,显然不是一般人可以接受的。具体有多堵呢?看看就知道了。</p><p><img src="https://imgcdn.nightcity.pub/IMG_5750.webp" alt="IMG_5750"></p><p><img src="https://imgcdn.nightcity.pub/IMG_5751.webp" alt="IMG_5751"></p><p>从早上10点出发,一直到凌晨两点,一直被卡在高速上,我看,几乎是没有什么别的情况能让我们(轮换)开这么久的车了。回来之后我才发现我的脚已经淤青——踩刹车踩的。</p><h2 id="旅行总觉得学之甚少"><a href="#旅行总觉得学之甚少" class="headerlink" title="旅行总觉得学之甚少"></a>旅行总觉得学之甚少</h2><p>都说读万卷书,行万里路,这一趟行程满打满算也接近空间距离上的“万里”了。但每次行程下来,我总觉得,我学到的甚少。每个自然、人文景观,对我来说,似乎更多意义上是一个过眼云烟,甚至连放松身心的作用都没有起到很多。现在想想,为什么行万里路之后,收获如此之少呢?也许就是因为读书没有破万卷吧。</p><p>在虎跳峡,壮观景色之外,其中蕴含的地理知识也许更能让人迷醉。在丽江古城,除了古时的繁华,历史近在眼前的感觉或许更让人心生满足。行万里路之前需要读万卷书,或许这句话也有这样的意义吧:当从万卷书内汲获的知识在现实中找到参照和实践,心中生现的满足感和安然是让人赶到自己和世界真实存在的最好慰藉。</p><p>这篇游记从1月开始撰写,一直到4月中旬才接近完成。回看我最初写下的文字,总是对我那近乎流水账的文笔感到羞愧。这3个月的时间里发生了不少事,有一段时间我也经受巨大的压力,压力却也不总是带来坏处,它没有击垮我,反而让我更加成熟。</p><p>这不是一篇完美的游记,也永远不会是一篇完美的游记,在撰写它的过程中,我学会了精炼文字,学会了更加成熟的语风,学会了在不那么理想的环境下写作……。这篇游记对于我来说,已经超越了一篇游记的意义——它一直在见证我的成长,即使这并非我原本的目的。</p><p>为什么要旅行?也许我已经有了答案。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 旅行 </tag>
</tags>
</entry>
<entry>
<title>Traceroute俳句</title>
<link href="/2023/01/traceroute-haiku/"/>
<url>/2023/01/traceroute-haiku/</url>
<content type="html"><![CDATA[<p>Traceroute 是一个很常用的网络 debug 工具,它(应该)会列出你的数据包在到达最终目的地的路上经过的所有路由节点,如果你 traceroute 我的网站,你会得到看起来像这样的内容:</p><p><img src="https://imgcdn.nightcity.pub/image-20230110161809741.png" alt="image-20230110161809741"></p><p>traceroute通过 <code>Time To Live</code>或者 IPV6 下的 <code>Hop Limit</code>实现追踪的效果</p><p><img src="https://imgcdn.nightcity.pub/n6nzkD1NN0" alt="IPv6 packet diagram"></p><p>这个数值的用意是通过限制数据包能通过的最长「逻辑距离」(最多能通过几个节点),防止数据包在网络故障的情况下在网络上被无限循环广播。每当数据包经过一个节点,这个数值就会减少,这个值减小到0时,路由节点就会丢弃这个数据包:举个例子,网络故障的情况下,一个 IPV4 数据包的 TTL 为65,经过64个节点时,其TTL会等于65-64=1,经过第65个节点时,TTL 会降为0,那么,第66个节点在发现这个数据包的 TTL 为0时就会将其直接丢弃。</p><p>但做到这一步并没有解决所有问题:出于礼貌原因,当一个数据包丢失了,我们还要想办法通知发送这个数据包的人——既然一个数据包能够从发送者到达丢弃它的服务器,那么丢弃它的服务器和发送者之间一定是可以通信的。</p><p><img src="https://imgcdn.nightcity.pub/BPMu8w53FU" alt="IPv6 ICMP packet in wireshark"></p><p>那么 traceroute 的设计思想是:首先设置一个极低的 TTL,并向目标服务器发包,小幅增加这个 TTL,再次向服务器发包,重复这个步骤,直到可以到达目标服务器为止,通过这个做法,traceroute就可以通过前面提到的,数据包被丢弃后的「回执」向我们展示我们与目标服务器之间的「路径」。</p><p><img src="https://imgcdn.nightcity.pub/nZMBkDESh7" alt="how a traceroute works gif"></p><p>traceroute 工具通常还会贴心的帮你查询好对应 IP 的反向 DNS,便于我们查看途径节点的相关信息。尽管设置 IP 的反向 DNS 并非必须,大多数运营商都会设置反向 DNS 以方便用户或者他们自己 Debug。</p><p>重要的是,如果买下一个 IP 区段,你便可以将这个区段内的 IP 的反向 DNS 改成 Whatever you want。于是乎,一位仁兄突发奇想,买下了一个 IP 区段,于是就有了下面的 TraceRoute 民谣:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line">PS C:\Users\l3zc> tracert -h 100 bad.horse</span><br><span class="line"></span><br><span class="line">通过最多 100 个跃点跟踪</span><br><span class="line">到 bad.horse [162.252.205.157] 的路由:</span><br><span class="line"></span><br><span class="line"> 1 <1 毫秒 <1 毫秒 <1 毫秒 192.168.0.1</span><br><span class="line"> 2 2 ms 1 ms 1 ms 192.168.1.1</span><br><span class="line"> 3 5 ms 4 ms 4 ms 100.66.128.1</span><br><span class="line"> 4 4 ms 4 ms 4 ms 58.20.125.137</span><br><span class="line"> 5 5 ms 4 ms 4 ms 119.39.126.117</span><br><span class="line"> 6 * 27 ms 27 ms 219.158.98.69</span><br><span class="line"> 7 32 ms 30 ms 30 ms 219.158.5.158</span><br><span class="line"> 8 29 ms 30 ms 31 ms 219.158.16.66</span><br><span class="line"> 9 172 ms 175 ms 174 ms 219.158.98.10</span><br><span class="line"> 10 179 ms 175 ms 174 ms ix-xe-8-2-5-0.tcore1.sqn-sanjose.as6453.net [63.243.205.93]</span><br><span class="line"> 11 226 ms 225 ms 236 ms if-ae-1-2.tcore2.sqn-sanjose.as6453.net [63.243.205.2]</span><br><span class="line"> 12 222 ms 222 ms * if-ae-51-2.tcore2.ct8-chicago.as6453.net [64.86.79.14]</span><br><span class="line"> 13 224 ms 225 ms 225 ms if-ae-22-2.tcore1.ct8-chicago.as6453.net [64.86.79.2]</span><br><span class="line"> 14 223 ms 223 ms 223 ms if-ae-8-2.tcore2.tnk-toronto.as6453.net [66.110.48.1]</span><br><span class="line"> 15 223 ms 223 ms 223 ms if-ae-2-2.tcore1.tnk-toronto.as6453.net [64.86.33.89]</span><br><span class="line"> 16 225 ms 224 ms 225 ms 64.86.33.58</span><br><span class="line"> 17 223 ms 223 ms 223 ms 67.223.96.90 [67.223.96.90]</span><br><span class="line"> 18 225 ms 224 ms 224 ms bad.horse [162.252.205.130]</span><br><span class="line"> 19 228 ms 228 ms 229 ms bad.horse [162.252.205.131]</span><br><span class="line"> 20 239 ms 237 ms 235 ms bad.horse [162.252.205.132]</span><br><span class="line"> 21 244 ms 245 ms 248 ms bad.horse [162.252.205.133]</span><br><span class="line"> 22 243 ms 243 ms 243 ms he.rides.across.the.nation [162.252.205.134]</span><br><span class="line"> 23 248 ms 249 ms 249 ms the.thoroughbred.of.sin [162.252.205.135]</span><br><span class="line"> 24 263 ms 259 ms 261 ms he.got.the.application [162.252.205.136]</span><br><span class="line"> 25 267 ms 268 ms 267 ms that.you.just.sent.in [162.252.205.137]</span><br><span class="line"> 26 266 ms 266 ms 266 ms it.needs.evaluation [162.252.205.138]</span><br><span class="line"> 27 267 ms 266 ms 267 ms so.let.the.games.begin [162.252.205.139]</span><br><span class="line"> 28 275 ms 274 ms 274 ms a.heinous.crime [162.252.205.140]</span><br><span class="line"> 29 280 ms 280 ms 280 ms a.show.of.force [162.252.205.141]</span><br><span class="line"> 30 292 ms 293 ms 292 ms a.murder.would.be.nice.of.course [162.252.205.142]</span><br><span class="line"> 31 293 ms 290 ms 290 ms bad.horse [162.252.205.143]</span><br><span class="line"> 32 301 ms 302 ms 302 ms bad.horse [162.252.205.144]</span><br><span class="line"> 33 297 ms 296 ms 297 ms bad.horse [162.252.205.145]</span><br><span class="line"> 34 308 ms 307 ms 307 ms he-s.bad [162.252.205.146]</span><br><span class="line"> 35 309 ms 309 ms 308 ms the.evil.league.of.evil [162.252.205.147]</span><br><span class="line"> 36 314 ms 314 ms 313 ms is.watching.so.beware [162.252.205.148]</span><br><span class="line"> 37 322 ms 323 ms 322 ms the.grade.that.you.receive [162.252.205.149]</span><br><span class="line"> 38 327 ms 326 ms 326 ms will.be.your.last.we.swear [162.252.205.150]</span><br><span class="line"> 39 327 ms 329 ms 330 ms so.make.the.bad.horse.gleeful [162.252.205.151]</span><br><span class="line"> 40 331 ms 331 ms 331 ms or.he-ll.make.you.his.mare [162.252.205.152]</span><br><span class="line"> 41 339 ms 339 ms 339 ms o_o [162.252.205.153]</span><br><span class="line"> 42 345 ms 346 ms 346 ms you-re.saddled.up [162.252.205.154]</span><br><span class="line"> 43 348 ms 348 ms 348 ms there-s.no.recourse [162.252.205.155]</span><br><span class="line"> 44 351 ms 350 ms 350 ms it-s.hi-ho.silver [162.252.205.156]</span><br><span class="line"> 45 363 ms 363 ms 361 ms signed.bad.horse [162.252.205.157]</span><br><span class="line"></span><br><span class="line">跟踪完成。</span><br><span class="line">PS C:\Users\l3zc></span><br></pre></td></tr></table></figure><p>这是这首民谣的原曲:</p><iframe src="//player.bilibili.com/player.html?aid=265008545&bvid=BV1sY4112714&cid=959455567&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe><p>某位仁兄甚至用这个做了一份他的简历:</p><p><img src="https://imgcdn.nightcity.pub/image-20230110161519369.png" alt="image-20230110161519369"></p><h2 id="如何实现?"><a href="#如何实现?" class="headerlink" title="如何实现?"></a>如何实现?</h2><p>看起来很美好,但是这如何实现?</p><p>我们可以轻松的更改 Reverse DNS 的设置。最大的问题是,如何让数据包按照我们希望的路线穿行。</p><p>在物理上将节点按顺序连接显然不现实,现在能被想到的有两种办法:要么在单个节点上将很多虚拟的接口按顺序分配 IP 并串联起来并将他们用作「节点」,要么在用户网络层上做手脚,生成假的「超限」消息,凭空生成一条不存在的路由线路。</p><p><a href="https://github.com/benjojo/traceroute-haiku">https://github.com/benjojo/traceroute-haiku</a></p><p>这个仓库是 benjojo 进行实验的项目,利用了第二种方法,用GO语言写一个TUN/TAP,接管所有的网络流量,并生成假的「超限」消息。</p><h2 id="自己动手"><a href="#自己动手" class="headerlink" title="自己动手"></a>自己动手</h2><p>我们来写一个程序,彻底理解这个项目。</p><p>我之前没有使用过 Go 语言。已知的 Go 项目里我最熟悉的是 Clash 的 Mac 版本。Clash 有强大的分流功能,以及为了兼容性,编写了一套 TUN 模式。用来作为切入点学习非常合适。</p><h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><p><a href="https://blog.benjojo.co.uk/post/traceroute-haikus">https://blog.benjojo.co.uk/post/traceroute-haikus</a></p>]]></content>
<categories>
<category> 技术 </category>
</categories>
</entry>
<entry>
<title>没有完美的Todo List</title>
<link href="/2023/01/%E6%B2%A1%E6%9C%89%E5%AE%8C%E7%BE%8E%E7%9A%84todolist/"/>
<url>/2023/01/%E6%B2%A1%E6%9C%89%E5%AE%8C%E7%BE%8E%E7%9A%84todolist/</url>
<content type="html"><![CDATA[<p>也许你曾经尝试过使用诸如滴答清单、Notion 的软件来构建一套 Todo List 系统,但实际操作起来却发现:心血来潮时,就往清单里丢几个任务,过了一会,心情不好了,就对这份自己构建的 Todo List 束之高阁。</p><p>是的,清单软件很棒,但若是你真正的去使用他时,会发现清单软件总有一些缺点让你感到不适——每个人的使用习惯不一样,商业化的产品不可能去专门配合每个人的使用习惯。</p><p>不幸的是,即使你从0开始,自己开发一套属于自己的工作流系统,完美的Todo List也是无法实现的。如果你遇到了上面所提到的问题,那么这是一个不争的事实:这些应用程序都要求远高于你期望的,持续的投入。<strong>没有一个Todo List能够减少对某种程度的自律的需要。</strong></p><p>我很抱歉,非常抱歉。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>天灾最痛的部分,是人祸——新冠记事</title>
<link href="/2023/01/%E6%96%B0%E5%86%A0%E8%AE%B0%E4%BA%8B/"/>
<url>/2023/01/%E6%96%B0%E5%86%A0%E8%AE%B0%E4%BA%8B/</url>
<content type="html"><![CDATA[<p>发生在2022年末因新冠引起的一系列或荒谬,或痛苦的事件:</p><p>12月21日,开始出现类似感冒的症状,此时我并不知道自己得了新冠。腿部肌肉酸痛,畏寒,吃布洛芬缓解了不少症状,此时的寒冷非比寻常,即使处在平日里觉得很热的环境里,我依然很冷,身体根本就没有在产生热量,可以说,只要处在比体温低的环境下,我就会感到寒冷。</p><p>服用布洛芬后,我躺在床上,寒风从窗外吹来,刺激着我因为病痛更加敏感的神经。鼻边传来了二氧化硫的刺鼻味道,嘈杂粗放的音乐让我无法好好休息,此时正是晚上7点,街上亮起的灯光宣示着人们的夜生活之开始,可惜,我没有夜生活,也需要顾及这病痛。</p><p>12月23日,感冒症状消退,可以稍稍活动,但并不感到舒服。病毒严重影响了我的精神状态:大脑昏昏沉沉,无论睡多久都睡不醒,头发凌乱,这是我睡眠不足的信号,可事实上,我每天都睡了超过10个小时。病痛时,即使平时令我愉悦的事物,此刻也失去了原本的色彩。什么都是灰色的,我仿佛在无尽的虚无中沉沦,跌入万劫不复的深渊。</p><p>12月28日,我的嗅觉消失,我依旧惶惶不可终日,但已经好上不少。头发越来越凌乱,甚至开始掉发,睡眠质量依旧欠佳,此时的我只希望,自己能够好好睡上一觉。此时家尊已经感染,家慈却将此怪罪于我。</p><p>新冠本身并不可怕,可怕的是人们对待新冠的态度。动态清零切断了家人们之间的联系,人们失去了彼此互助的纽带。只剩下自己的孤独无助。你可以摧毁我的肉体,但无法摧毁我的精神。而现在这项政策宣告失败,不成想,家人却陷入了因新冠而互相指责的地步——何其荒谬。</p><p>家慈这人,一生气,就会不择手段的说出难听的话,当做她的武器,却死活不肯承认这一点。新冠本身不为我所害怕,因为新冠互相攻击,家人反目。到了这般地步,和文革有什么区别!愚昧的民众,为宣传口的宣传所洗脑,从来不去动脑思考,却总认为自己是对的。若是惧怕奥密克戎的死亡率,从而将自我与社会隔离起来,和因噎废食何异?若真是如此,你大可因为惧怕车祸而不再出行。</p><p>12月31日,症状基本消退,睡眠也变得好了起来,这是一场闹剧,以家慈的思想和认知,这种闹剧迟早会发生。新冠让我的身受到折磨,荒谬的争吵让我的心受到折磨。非要排个名,我倒是认为心受到的折磨远比身受到的折磨更加难受。一个小小的病毒带给人最大的痛苦却是由人本身造成的,怪哉怪哉!</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>中国真的有10亿网民吗?恐怕连1亿都不到</title>
<link href="/2022/10/%E4%B8%AD%E5%9B%BD%E7%9C%9F%E7%9A%84%E6%9C%8910%E4%BA%BF%E7%BD%91%E6%B0%91%E5%90%97/"/>
<url>/2022/10/%E4%B8%AD%E5%9B%BD%E7%9C%9F%E7%9A%84%E6%9C%8910%E4%BA%BF%E7%BD%91%E6%B0%91%E5%90%97/</url>
<content type="html"><![CDATA[<p>1960年,谁也不会想到美苏冷战时期军用的 ARPANET 会发展成为现在世界上最重要的基础设施之一。互联网从少数人手里的玩具变成了每日生活中必不可少的工具。<a href="http://www.gov.cn/xinwen/2022-08/31/content_5707605.htm">中国政府的数据</a>显示,截至2022年8月31日,中国网民数量达到10.51亿,是世界上最大的互联网用户群体。</p><h2 id="这是网民?"><a href="#这是网民?" class="headerlink" title="这是网民?"></a>这是网民?</h2><p>是的,没错,这些人是中国网民。</p><p>是……吗?</p><p><img src="https://imgcdn.nightcity.pub/IMG_D715CEC2FE3A-1.webp" alt="中国“网民”"></p><blockquote><p>我们只不过是一群用上了 iPhone 的秦朝人罢了</p><p>——网友</p></blockquote><p>90%的中国“网民”,只不过是一位用上了网络的大清子民而已。而淘宝,用一种直截了当的说法,地位堪比——赛博供销社。</p><p>互联网技术成功的普及到了全世界,与之相应的价值观——互联网精神,却不得不向传统价值观妥协。我们前脚迈入了乌托邦,后脚却还停留在那个混沌而蒙昧的旧世界。</p><h2 id="互联网精神?"><a href="#互联网精神?" class="headerlink" title="互联网精神?"></a>互联网精神?</h2><p>互联网精神,来自互联网的最初设计:对等、开放、容错、共享、去中心、自组织、非商业,等等。</p><p>我很怀念十年前的互联网,那时候包容共享开放还是主流,Censorship 并没有现在这么极端,大家在各大论坛、贴吧以及当时欣欣向荣、并未被禁止的个人博客上分享自己高质量的经验见解,和谐共处的讨论。流氓软件、内容农场、假冒网站没有充斥在搜索引擎上。那时候上网,不说受益匪浅,也至少能发现有价值的信息,以及在讨论中收获纯粹的快乐。</p><p>看看现在,垃圾内容和审查制度大行其道。制造各种狗屁不通全靠编文章的自媒体与内容农场,低俗降智的直播短视频平台,脱胎于电视购物洗脑污染的直播带货,充斥着内容农场、沙雕小编生产的文字垃圾的搜索引擎,各路巨头打造自己的 All in One Apps,开展新时代的“圈地运动”,将曾经自由的网民们看作价值的载体,大肆圈定自己的势力范围,恨不得挤占用户所有的上网时间。</p><p>人们上网的时间越来越多,但从网上获得的却越来越少。再难看到到有趣的故事让人灵魂共鸣,再难听到独到的见解让人醍醐灌顶,再难学到有用的经验帮你解决各种各样的问题。互联网越是发展,发展到仿佛每个人都在当下充沛的信息流冲击下大量获取信息,但你所获得的只是所谓“获取信息”的快感,只是在缓解互联网奶头乐毒瘾而被迫做出的举动。推荐算法的出现甚至让你所看到的、所想到的,只是权力想要让你看到、想到的。</p><p>互联网早已经不是一个让所有人平等、自由、快捷的提升自己获取知识收获快乐的渠道,只是一个更加黑暗的现实世界,披着互联网的外衣,收割更多人的韭菜。</p><h2 id="技术?人文?"><a href="#技术?人文?" class="headerlink" title="技术?人文?"></a>技术?人文?</h2><p>技术终究只是技术,他就摆在那里,没有人文属性。20世纪,人们惊呼电视会毁了下一代,可这并没有发生。21世纪,人们惊呼电脑会毁了下一代,可这也未曾发生。现在,人们惊呼手机会毁了下一代,可以预见到,这也绝不会发生。技术从不会毁掉任何一个人,真正会毁了一个人乃至全人类的,乃是属于人文因素的,人们自甘堕落的,颓废。</p><blockquote><p>为什么要限制未成年人只能在周末每天玩手机游戏一个小时?是为了让那些家长认清就算没有游戏你的孩子照样是个废物。</p></blockquote><p><strong>互联网并不要求每个人具有互联网精神,但,互联网精神才是让互联网能够被称为互联网的核心所在。</strong></p><h2 id="这样的网络,只配被称为“赛博”"><a href="#这样的网络,只配被称为“赛博”" class="headerlink" title="这样的网络,只配被称为“赛博”"></a>这样的网络,只配被称为“赛博”</h2><p>没有互联网精神的互联网不能被称作互联网,而只是现有内容的另一种表达形式。把原本放在橱窗和货架上的商品搬上屏幕,再做一个配送服务?把原来大家在线下讨论问题搬到线上,现在拉一个群?把原本衣锦还乡的典故旧貌换新颜,变成衣锦发微博微信小红书?</p><p>我们只不过是一群用上了iPhone的秦朝人而已。技术进化了,推动社会进步的关键人文因素却没有进化,每每找一本描写古代社会生活之著作,看看古代的社会生活,其与现在之相似无不让我有一种恍若离世之感,在中国几千年的历史里,尽管技术更新迭代,社会生活从没有改变,我们的社会也从未允许过这样的改变。中国虽然引进了互联网的技术,却一如既往的顽固,从未让这种技术改变社会生活。<strong>这样的网络,只能被称为“赛博”</strong>,而不能被称作“互联网”。这样的网民,只能被称作“赛博原始人”。</p><h2 id="真正的网民?恐怕1亿都是乐观估计"><a href="#真正的网民?恐怕1亿都是乐观估计" class="headerlink" title="真正的网民?恐怕1亿都是乐观估计"></a>真正的网民?恐怕1亿都是乐观估计</h2><blockquote><p>苹果官网在哪看</p><p>淘宝吗</p><p>……</p></blockquote><p>在中国,真正的网民又有几何?政府和巨型企业联合,个人网站和私人论坛了无生存之地,ICP牌照制度挤压个人网站的生存空间,只有大公司的网站能够生存。近期传出的中国大陆互联网白名单的试点,虽然令人担忧,可悲的是,人们已经不再在乎了。</p><p>平时上网的时间基本都花在了 BAT 三大巨头的APP上,即使开启了白名单制度,也没什么吧。</p><p>这是一种悲哀。1994年,中国正式接入互联网。2022年,中国却在打造自己的网络,与互联网精神背道而驰,离互联网越来越远。中国的网民们呆在与局域网没有差别的小圈子里,浏览着几家大公司与政府的网站,使用他们的服务,过着高级版的朝鲜局域网生活。</p><p>这更是一种无尽的黑暗,我们看似接入了互联网,更多的人在实质上却只接入了赛博,我们何尝不像是赛博朋克2077的世界,将自己孤立成一个个与世隔绝的封闭子网。</p><p>按照互联网的定义,真正遵循互联网精神的民众可能具有如下的行为:</p><ul><li>运营自组织的网站</li><li>使用真正遵循 P2P 精神的下载器</li><li>经常在网上分享自己的见解与想法,抑或是git commit等</li><li>…</li></ul><p>这样的网民,在如今的中国,可谓是少之又少。即使有,也很难在简体中文圈子里抱团——这样的人太少了,与其这样,我们不如使用通用的英语与全世界的同路人交流,享受互联网的乐趣。</p><h2 id="赛博朋克真的离我们很远吗?"><a href="#赛博朋克真的离我们很远吗?" class="headerlink" title="赛博朋克真的离我们很远吗?"></a>赛博朋克真的离我们很远吗?</h2><p>这就是赛博朋克,巨型企业和政府通过技术监控着人们的一举一动,更好的技术没能用于造福众人,而成为了金字塔顶端一小撮人的敛财工具。权贵们运用技术巩固他们的地位,玩弄他们的权力。而普通的人民却只能在这种绝望的阴影下怀揣着希望努力生活,人们无法反抗,无法打破铺天盖地的绝望。</p><h2 id="变革?"><a href="#变革?" class="headerlink" title="变革?"></a>变革?</h2>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>为什么学习一门外语这么难?</title>
<link href="/2022/09/why-it-takes-so-long-to-learn-a-foreign-language/"/>
<url>/2022/09/why-it-takes-so-long-to-learn-a-foreign-language/</url>
<content type="html"><![CDATA[<p>1949年,哈佛语言学家齐夫(George Kingsley Zipf)做了长篇小说《尤利西斯》的词频统计。该书的长度是260,430字,总共用到了29,899个单词。它是单词量最大的文学作品之一。</p><p><img src="https://imgcdn.nightcity.pub/bg2022090111.webp" alt="尤利西斯"></p><p>他发现,单词的出现频率有规律地下降。词频第二名的单词的出现频率,是第一名的二分之一,第三名的出现频率是第一名的三分之一,第四名是四分之一,第十名是十分之一,第1,000名是千分之一,以此类推。</p><p>这被称为 Zipf 定律,即任何单词的词频,与该单词在词频表中的排名保持一个固定比例。</p><p><img src="https://imgcdn.nightcity.pub/bg2022090112.webp" alt="Zipf定律"></p><p>这个定律有两个重要推论。</p><ol><li>一种语言的常用词汇只包含少数单词。例如,在英语中,单词 the 占所有文本的7%,最常见的10个英语单词占到了所有文本的23%。</li></ol><p>对于当今世界的大多数语言来说,仅仅100到150个常用单词,就占所有文本的一半左右。在希腊语的《圣经新约》中,319个单词占全书近80%的内容。</p><ol start="2"><li>当你掌握了这些高频常用词以后,遇到的所有词汇几乎都是低频词。</li></ol><p>还是以希腊语的《圣经新约》为例,319个单词占文本的近80%,但剩下的20%包含了5118个不常用的单词,其中大部分单词只使用了一次。</p><p>推论二注定了精通一种外语是一件麻烦事。学习者入门以后,就不得不花大量时间,记住那些出现频率很低的词汇。以布朗大学语料库为例,该语料库一共包含了53,076个单词,其中36,135个单词在语料库的所有文献中出现次数不超过三次,它们占了词汇量的68%,但是仅仅在5%的场合使用。</p><p>更麻烦的是,这些不常见的词往往很重要,能够提供句子的关键信息。越少见的词对于了解句子含义越重要。</p><p>学习者遇到不认识的单词,可以通过上下文去猜测含义。但是,一项研究表明,如果要从上下文中正确猜中单词含义,阅读者必须能够理解文本中至少95%的内容。</p><p>对于布朗语料库来说,15,851个单词可以覆盖语料库97.8%的内容。这差不多就是英美大学生掌握的单词数量。这意味着,如果你记住了15000个单词,再遇到不认识的单词,就可以较有把握得猜出它的含义。</p><p>但是,对于外国人来说,想要通过几年学习,掌握15000个左右的英语单词,绝非易事。</p><p>即使按照每天记忆30个单词,全年无休的速度计算,从零开始记忆15000个单词也需要500天也就是比一年半还要多的时间。事实上,在实际操作中,能达到这个速度的学习者非常罕见,以我为例,进入高中时,我的词汇量在3000到4000,读高中的时间里,由于我的词汇量对我的英语成绩并不构成瓶颈,我在任何时候都没有刻意去记单词。高中毕业时,我的词汇量仅6000到7000,这意味着高中三年里,在不刻意记单词的情况下,平均下来我每天新增的词汇量不足三个。按照这个速度从零开始记忆15000个单词需要花费15年时间。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>Cytus2剧情解析</title>
<link href="/2022/08/cytus2%E5%89%A7%E6%83%85%E8%A7%A3%E6%9E%90/"/>
<url>/2022/08/cytus2%E5%89%A7%E6%83%85%E8%A7%A3%E6%9E%90/</url>
<content type="html"><![CDATA[<p>Cytus 2 的剧情是音游剧情的天花板。丰富的人物关系,赛博朋克的叙事风格,Keep Moving On,Used to be。<del>这种游戏竟然只卖8软妹币,值!什么,扩展包?那没事了。</del></p><span id="more"></span><p>初玩 Cytus 2,你大概率会发觉自己无法梳理剧情,只有当故事线推进到一定程度,故事的脉络才会越来越明了。其实要看懂 Cytus 2 的剧情只需要看两个部分:OS 和 iM,前者类似于角色日志,后者则是一个类似于 Twitter 的社交平台。由于 Cytus 2 的剧情是非线性的,即随着关卡的推进,剧情不会按照时间先后的顺序出现。事实上,由于<del>雷亚拖更</del>剧本是随着版本更新制作,剧情事按照版本更新发布的顺序出现,而版本更新的剧情往往包含对前版本剧情的补充,这意味着你不能随着游戏进度的推进逐级构建出剧情框架,而是一个阶段一个阶段的“梳理”。</p><h2 id="Cytus-2-剧情中的概念"><a href="#Cytus-2-剧情中的概念" class="headerlink" title="Cytus 2 剧情中的概念"></a>Cytus 2 剧情中的概念</h2><h3 id="Cytus-网络"><a href="#Cytus-网络" class="headerlink" title="Cytus 网络"></a>Cytus 网络</h3><p>也就是游戏中俗称的精神网路(精神网络),拥有极高的带宽(高到可以供千万人实时与 PAFF 的虚拟舞台宛如身临其境的互动)和0延迟的特性,是 Cytus 2 世界观里最重要的基础设施。iM 和 OS 系统,PAFF 的演出的舞台,NEKO 和 Robo_Head 的直播都依托 Cytus 网络进行。由于直连神经,Cytus 系统可以给使用者提供大量快感,这也无可避免的带来了上瘾的问题。</p><h3 id="A-R-C"><a href="#A-R-C" class="headerlink" title="A.R.C"></a>A.R.C</h3><p>可以看到,Cytus 网络对社会产生了颠覆性的影响,A.R.C 是掌握 Cytus 技术的公司,一家巨型企业。已经掌握这么重要的技术设施,A.R.C 在相当程度上取代了政府的位置,可以说,Cytus 2 世界观下 A.R.C 就是一家企业政府。</p><h3 id="Node-03-和-Node-08"><a href="#Node-03-和-Node-08" class="headerlink" title="Node 03 和 Node 08"></a>Node 03 和 Node 08</h3><p>类比通常的赛博朋克世界观, Node 03 是赛博朋克的阴暗面,传统政府无力控制这里,企业政府也不希望投入过高的成本整治此地。这也就导致了 Node 03 黑社会、帮派林立,互相斗争的局面,人们想要过上想对安稳的生活就必须向控制他们居住地所在范围的帮派缴纳「保护费」。Node 08 则是通常赛博朋克世界观下的大都会市中心,看上去光鲜亮丽,秩序井然,人们的生活丰富多彩,实际上每个人都生活在公司的阴影下。</p><h3 id="象限"><a href="#象限" class="headerlink" title="象限"></a>象限</h3><p>这个概念很好理解,每个 Node 分为四象限,和坐标系上的象限没什么区别。</p><h3 id="JOEZ-Cafe"><a href="#JOEZ-Cafe" class="headerlink" title="JOEZ Cafe"></a>JOEZ Cafe</h3><p>名义上是 Cafe,扮演的角色是一个各方势力都无法控制的中立地带,类似于公海——没有法律约束,任何见不得光的交易、商谈都可以在此进行。</p><h2 id="PAFF-和-NEKO-的童年"><a href="#PAFF-和-NEKO-的童年" class="headerlink" title="PAFF 和 NEKO 的童年"></a>PAFF 和 NEKO 的童年</h2><h3 id="PAFF"><a href="#PAFF" class="headerlink" title="PAFF"></a>PAFF</h3><p>PAFF 的剧情卡住了很多人,最简洁的说法:PAFF 是被灌入了 Aroma 记忆的 Kaori(南宫薰)。PAFF 在 16岁之前是 Aroma,Aroma 出生在 Node 08 一个家庭,天资聪颖,歌声优美,长相可爱,从小怀揣着在舞台上歌唱的梦想。15 岁时,PAFF 第一次参加选秀,虽然紧张到麦克风都掉在地上,却还是凭借动听的歌声和可爱的长相夺得第二名。尽管如此,Aroma 还是与主办方的唱片公司无缘,而是被另一家名叫单声(Mono)的唱片公司相中签约。意外发生在 Aroma 与单声签约后的第一次演唱会的路上,一场车祸突然发生,Aroma 因此身负重伤,在医院的 ICU 里,尽管医生们尝试了各种办法,但 Aroma 回天乏术,最多只能在昏迷状态下存活一个月的时间。</p><p>Kaori 出生在 Node 03,和 Hayato 一样由芳奶奶从孤儿院领养。Kaori 个性开朗大方,和 Hayato 是自幼一起长大的青梅竹马,Kaori 热爱歌唱,和 Aroma 一样拥有动听的歌喉,Kaori 则擅长演奏,在成长的过程中,Kaori 和 Hayato 经常一起演奏,Kaori 动听的歌声配上 Hayato 的演奏,一度可以吸引很多观众驻足,在一次变故发生之前,两人(你没猜错,他们成了一对恋人)一直过着虽不富裕却幸福的日子。</p><p>Aroma 和 Kaori 的故事线发展到这里开始重合,在得知 Aroma 最多只能存活一个月的噩耗,Aroma 的姐姐 Helena 和姐夫 Noah 只剩下一个选择:利用 Noah 在 A.R.C. 工作所掌握的技术将 Aroma 的记忆转移到一个合适的受体上。</p><blockquote><p>我比你,更想救她啊…</p><p>——Noah</p></blockquote><p>Noah 两人在 JOEZ Cafe 委托黑社会提供合适的受体,Kaori 本就因为在 Node 03 的表演而小有名气,自然被黑社会锁定为目标,在一天 Kaori 和 Hayato 演奏完毕,Kaori 独自一人行走到无人的小巷时,被从背后突然袭击绑架,卖到 Node 08 成为了复活 Aroma 不幸的牺牲品。</p><h3 id="NEKO"><a href="#NEKO" class="headerlink" title="NEKO"></a>NEKO</h3><p>NEKO 的本名是 Asakura Neko,出生在 Node 03 一个并不富裕的家庭,Asakura 先生是 Neko 的父亲。Neko的家庭并不富裕,Node 03 帮派斗争每月的「保护费」更是将这个状况雪上加霜,但好在 Neko 幼年家庭基本和睦,因此还算快乐。出于种种经济和家庭原因,Asakura 先生和 Neko 的妈妈离婚并打算孤身一人前往 Node 08 工作。此时的 Neko 正处于 Sophomore 时期,认为爸爸孤零零一人非常可怜,于是决定与爸爸一同前往 Node 08 生活。在 Neko 进入青春期后,Asakura 先生和 ? 开始了一段新的感情。此时的 Neko 开始萌生对父亲这一段新感情的不满,这种不满在她的内心慢慢积蓄。</p><blockquote><p>不在沉默中爆发,就在沉默中灭亡</p></blockquote><p>Neko 在 Node 08 结识了新的朋友,其中玩的要好的是 Linda。Neko 经常前往电玩城玩游戏,并且是常常霸榜的高手存在。</p><p>Neko 的不满情绪终于爆发了,在一天,Neko 的「继母」做了一道炖肉而使用了 Neko 妈妈独有的食谱,Neko 绝望了,这是她「最后一种纪念妈妈的方式」却仍然被无情的「剥夺」。</p><p>绝望的 Neko 第一次逃出了这个让她辛酸不满的家。她接受不了自己继母的所作所为,她接受不了自己父亲的不义(尽管后来证明这是一场「误会」)。气愤的 Neko 来到了她常来的游戏厅,想要通过游戏发泄她所有的不满。福无双至,祸不单行,Neko 等待了半个小时,却发现她想要玩的游戏被一对争吵不休的路人霸占,忍无可忍的 Neko 发起了脾气,却遭到了这对流氓路人的威胁,Xenon 此时登场相救。</p><p>Neko 是 Xenon 的粉丝,平日里,凡 Xenon 举办的演唱会 Neko 与其好友 Linda 都会前往观看。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>为什么中国大陆访问全球其他地方都这么慢?</title>
<link href="/2022/08/%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%86%E8%AE%BF%E9%97%AE%E5%85%A8%E7%90%83%E7%BD%91%E7%BB%9C%E5%A6%82%E6%AD%A4%E6%85%A2/"/>
<url>/2022/08/%E4%B8%BA%E4%BB%80%E4%B9%88%E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%86%E8%AE%BF%E9%97%AE%E5%85%A8%E7%90%83%E7%BD%91%E7%BB%9C%E5%A6%82%E6%AD%A4%E6%85%A2/</url>
<content type="html"><![CDATA[<p>身处中国大陆,想要访问中国大陆以外的资源是件不那么容易的事情。即使没有被墙的资源也是如此,缓慢的连接速度和动辄 10% 以上的丢包率使中国大陆成了互联网孤岛,可以看到,想要到达却很难。</p><h2 id="凌乱复杂的网络架构"><a href="#凌乱复杂的网络架构" class="headerlink" title="凌乱复杂的网络架构"></a>凌乱复杂的网络架构</h2><p>中国大陆的网络架构有别于世界其他地区,三大运营商控制网络并且相对独立的建设自己的一套网络。于是今天你看到的网络局面就是 China Mobile, China Unicom 和 China Telecom 三足鼎立又相对独立的网络。</p><blockquote><p>We observe the provincial capital cities are not only government centers but are also hubs in the ISPs’ networks, and interISP connections are concentrated to a few routers across China.^[1]</p></blockquote><p>三大运营商网络之间的互通性并不高——数据跨网往往集中在几个数据中心进行而非随时随地的互联互通,例如,很多西部地区的数据包在重庆跨网。</p><h2 id="少得可怜的总出口带宽"><a href="#少得可怜的总出口带宽" class="headerlink" title="少得可怜的总出口带宽"></a>少得可怜的总出口带宽</h2><p>根据一些非官方但可信度比较高的数据,中国大陆总出口带宽大约是20Tbps,作为对比,十年前的香港,总出口带宽就已经达到了40Tbps,这么少的人均出口带宽简直就是用一个吸管为长江引流,不炸才怪。</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
</entry>
<entry>
<title>浅谈 OCSP Stapling</title>
<link href="/2022/08/something-about-ocsp-stapling/"/>
<url>/2022/08/something-about-ocsp-stapling/</url>
<content type="html"><![CDATA[<p>自从把博客系统换成 Wordpress 以后,又是缓存,又是精简,又是各种替换,为了优化网站的速度不可不谓花了一番心思,然而在 iPhone 上,我的网站的打开速度却依然时快时慢。在之前两个月里,我一直认为是服务器的性能问题所致。直到有一天我看到并且为网站部署了 OCSP Stapling。</p><span id="more"></span><h2 id="为什么偏偏在-iPhone-上就打开慢?"><a href="#为什么偏偏在-iPhone-上就打开慢?" class="headerlink" title="为什么偏偏在 iPhone 上就打开慢?"></a>为什么偏偏在 iPhone 上就打开慢?</h2><p>你可能已经注意到我使用了「打开」而非「加载」,如果你调用 iPhone 上 Safari 的开发者模式查看一个网页的 Handshake 时间,你就会发现一个不容忽视的 1 秒,至于这一秒都花在了哪里,我们先来看看 OCSP 究竟是什么。</p><h3 id="OCSP-的概念"><a href="#OCSP-的概念" class="headerlink" title="OCSP 的概念"></a>OCSP 的概念</h3><h4 id="先从-SSL-证书的有效期说起"><a href="#先从-SSL-证书的有效期说起" class="headerlink" title="先从 SSL 证书的有效期说起"></a>先从 SSL 证书的有效期说起</h4><p>曾经我有一个困惑,为什么没有永久有效的 SSL 证书?难道是单纯因为商业原因?其实并不是,主要原因是为了安全。每次签发机构(CA)签发 SSL 证书时,CA 都会为这个 SSL 证书生成一个私钥。就像家里任何一把钥匙一样,HTTPS 证书的私钥有丢失、泄露的风险,当网站的私钥丢失时,网站应该向证书 CA 申请将他们的证书加入到证书吊销列表(CRL)里。当用户访问 https 站点时,浏览器会自动向 CA 请求吊销列表,如果用户访问的站点提供的证书在 CRL 里,浏览器就不信任这个证书,因为私钥泄漏后,攻击者可能拥有同样的证书。</p><p>所以,如果证书永久有效,随着越来越多的私钥丢失,吊销列表也越来越大(因为只有加进去的,没有剔出去的),这既给 CA 的服务器增加流量压力,也会增加浏览器需要下载的数据量。而一旦有效期只有一年或几年,那么CA就可以将那些已经过期了的证书从 CRL 里剔除,因为反正浏览器也不信任过期证书。这种问题也就随之消失,于是,今天看到的证书,有效期都随着安全等级的提高而加长,但除非自签,没有永久有效的证书。</p><h4 id="这和-OCSP-有什么关系?"><a href="#这和-OCSP-有什么关系?" class="headerlink" title="这和 OCSP 有什么关系?"></a>这和 OCSP 有什么关系?</h4><p>OCSP 即 Oline Certificate Status Protocol,是用于替代 CRL 的协议,解决了一些 CRL 协议存在的问题,以下信息来译自 Wikipedia:</p><blockquote><p>OCSP 响应通常比典型的 CRL 响应更小,这意味着对于客户端和服务器更小的网络负担。</p><p>OCSP 响应中需要解析的数据更少,因此客户端需要的运行库比解析典型的 CRL 响应更少更简单</p><p>OCSP 中,服务器可以记录主机在何时验证过特定的证书,由于请求不强制加密,相关信息可能被第三方获取。</p></blockquote><p>简单来说,OCSP 做的就是 CRL 的事——验证这个网站的 https 证书是否处于被吊销的状态。</p><h3 id="所以为什么打开慢?"><a href="#所以为什么打开慢?" class="headerlink" title="所以为什么打开慢?"></a>所以为什么打开慢?</h3><p>我们搭建个人网站时大都没有很高的预算,例如我的网站原本托管在免费的 Github Pages 上,预算能省则省,更别提动辄几千一年的 SSL 证书了。于是你看到的非商业性质的个人网站大都采用了免费的 Let’s Encrypt 证书。而 Let’s Encrypt 的 OCSP 服务器 <code>ocsp.int-x3.letsencrypt.org</code> 线路非常垃圾,实测中部地区联通 traceroute 以供参考:</p><p><img src="https://imgcdn.nightcity.pub/image-20220816165046969.webp" alt="Let's Encrypt OCSP服务器的拉胯线路"></p><p>可以看到服务器在香港,线路却绕美国。这导致 一个很简单的 OCSP 查询请求需要 1 秒的时间来返回结果。这意味着无论你的服务器性能有多强,网络延迟有多低,只要部署的证书是 Let’s Encrypt,网站在 iPhone 上的加载时间就绝对不会快过一秒。这还不是最坏的情况,因为各种莫名其妙的原因,Let’s Encrypt 的 OCSP 服务器域名会时不时的被 GFW 通过 DNS 污染等方式阻断,这就导致客户端在一部分时间里根本无法查询 OCSP。</p><h3 id="但为什么只有-iPhone-会加载慢呢?"><a href="#但为什么只有-iPhone-会加载慢呢?" class="headerlink" title="但为什么只有 iPhone 会加载慢呢?"></a>但为什么只有 iPhone 会加载慢呢?</h3><p>OCSP 协议有一个很要命的问题:用 https 的人越来越多,验证证书有效性的需求自然会越来越大,OCSP 服务器难道硬扛访问量?当然不是,不同浏览器都会有不同的 OCSP 验证超时时间,超时就先默认证书有效继续进行访问。但是有些”「注重用户体验」 的浏览器,比如 Chrome,自己在浏览器内部做了个本地列表,通过每次浏览器更新实现列表更新。直接查本地的列表速度就非常快了,当然也不存在什么 CA 的 OCSP 服务器被屏蔽的问题。缺点是并非实时更新。但并非所有浏览器都是所谓「注重用户体验」的浏览器,比如 Safari 就默认开启 OCSP 验证。自然无法避免这种中国特色的问题。Chrome 在全球有超过 70% 的市占率,而受 Chromium 开源项目的影响,国内一众「安全」「极速」浏览器都不存在这种问题,这几乎覆盖了国内桌面端所有用户群体。而苹果要求包括 Chrome 在内的所有 iOS 应用都要使用 Webkit 内核,这直接干死了所有的 iPhone 用户。</p><h2 id="怎么解决?"><a href="#怎么解决?" class="headerlink" title="怎么解决?"></a>怎么解决?</h2><p>总不可能要求所有 iPhone 用户都自己关掉 OCSP 吧?那么解决方法就是——<del>换证书</del>。怎么可能,要是我真换了证书你也就看不到这篇文章了。虽然换证书,比如 Trust Asia 证书的确可以解决问题。但我不想因为换一个证书而告别 Let’s Encrypt 自动续期和支持泛域名的特性。</p><p>终于可以谈到 OCSP Stapling 了,即 OCSP 封装,想要开启 OCSP Stapling 非常简单:首先到亚洲诚信提供的 <a href="https://myssl.com/">https 检测服务</a>检测自己的证书链是否完整,若是不完整则<a href="https://myssl.com/chain_download.html">修复证书链</a>后将修复好的证书重新部署,完成操作后在 Nginx 配置里加上如下两行:</p><figure class="highlight nginx"><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="attribute">ssl_stapling</span> <span class="literal">on</span>; </span><br><span class="line"><span class="attribute">ssl_stapling_verify</span> <span class="literal">on</span>;</span><br></pre></td></tr></table></figure><p>然后重启 Nginx 服务,大功告成。由于我自己使用的是 Nginx,Apache 请自行搜索相关方法。</p><p>然后,iPhone 用户也能愉快的访问你的网站而无需忍受恼人的 GFW 干扰 Let’s Encrypt 的 OCSP 服务器。</p><p>那么效果如何呢?</p><p><img src="https://imgcdn.nightcity.pub/ocsp-stapling-not-enabled.webp" alt="开启OCSP Stapling前排队时间超过1秒"></p><p><img src="https://imgcdn.nightcity.pub/ocsp-stapling-enabled.webp" alt="开启OCSP Stapling后排队时间仅200毫秒"></p><p>可以看到,开启 OCSP Stapling 后,查询验证结果所需要的时间大幅缩短,反映到网站打开速度上是非常明显的感知。</p><h2 id="什么东西这么牛逼?"><a href="#什么东西这么牛逼?" class="headerlink" title="什么东西这么牛逼?"></a>什么东西这么牛逼?</h2><p>OCSP 封装,顾名思义,即服务器缓存 OCSP 服务器的验证结果,并且在与客户端 SSL 握手时直接发送缓存结果。</p><blockquote><p>OCSP装订,是TLS证书状态查询扩展,作为在线证书状态协议的替代方法对X.509证书状态进行查询,服务器在TLS握手时发送事先缓存的OCSP响应,用户只要验证该响应的时效性而不用再向数字证书认证机构(CA)发送请求,可以加快握手速度。</p></blockquote><p>我的服务器线路虽然亦非很好,但比 Let’s Encrypt 的弟中弟线路好到不知道哪里去了。开启 OCSP Stapling 后,客户端只需要验证服务器事先缓存的 OCSP 查询结果的有效性,免去了向“神优化”的服务器发请求的痛苦,速度自然会快上一大截,在有 OCSP 强制验证的浏览器上初次打开网页的效果尤为明显,统计数据显示,在开启 OCSP Stapling 后,新访客量明显有所提高,大概是拜 OCSP Stapling 节省的大量握手时间所赐。</p><h2 id="为什么不默认开启-OCSP-Stapling?"><a href="#为什么不默认开启-OCSP-Stapling?" class="headerlink" title="为什么不默认开启 OCSP Stapling?"></a>为什么不默认开启 OCSP Stapling?</h2><p>听上去 OCSP Stapling 简直就是完美的万金油优化——每个网站都开启 OCSP Stapling,既提升用户的访问体验,也为 OCSP 服务器减轻负担。那为什么新的 Nginx 配置文件不默认开启 OCSP Stapling 呢?其实这是一个很简单的问题。</p><ul><li>不是所有网站都有 SSL 证书</li><li>OCSP Stapling 并非在所有情况下都能提供更好的访问体验</li><li>现存方案中 OCSP 并不是唯一的证书验证方案</li><li>引入新功能时通常是需要谨慎的,Nginx 用户群体非常复杂,不同用户不同需求</li></ul><h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><ol><li><a href="https://www.zhihu.com/question/20803288">为什么https证书要设有有效期?</a></li><li>找不到了</li><li>Wikipedia</li><li><a href="https://wangejiba.com/4725.html">玩个机吧</a></li></ol>]]></content>
<categories>
<category> 技术 </category>
</categories>
</entry>
<entry>
<title>Nano Pi R2S 上手,小小升级一下家庭网络环境</title>
<link href="/2022/08/nano-pi-r2s-hands-on/"/>
<url>/2022/08/nano-pi-r2s-hands-on/</url>
<content type="html"><![CDATA[<p>最近想要解放设备们的 CPU,让科学上网的体验变好一点点,顺手实现一些杂七杂八的功能满足折腾欲。在学校里我有一台 OpenWRT 的普通路由器,用起来非常不错,OpenWRT 基本可以实现所有我想要的功能,但毕竟是普通路由器,CPU 性能太弱,所以我的需求就定在了一款 CPU 性能更强的,能运行 OpenWRT 的 ARM 软路由,于是 Nano Pi R2S 进入了我的视野。</p><p>要是软路由有排名,那 R2S 绝对是经典中的经典。小到无论如何都可以塞进弱电箱的体积,足够强大的性能和上手的容易程度都是软路由里数一数二的。虽然价格可能是49入国军,就不放出来了,但是只要我对这玩意有需求,那也不是不能接受。</p><h2 id="上手"><a href="#上手" class="headerlink" title="上手"></a>上手</h2><p>好了,现在我们搞到了这 R2S,简单来上个手:</p><p><img src="https://imgcdn.nightcity.pub/image-20220811160337177.webp" alt="R2S本体"></p><p><img src="https://imgcdn.nightcity.pub/image-20220811160419690.webp" alt="R2S网口侧"></p><p><img src="https://imgcdn.nightcity.pub/image-20220811160519105.webp" alt="R2S的USB2.0接口和Reset插口"></p><p>R2S 外观非常简洁,没有多余的 IO,虽然原本不是作为软路由设计,但在设计上却给人一种天生为软路由而生之感:一个 WAN 一个 LAN 两个 RJ45 网口,一个 Micro SD 卡插槽,一个 USB 2.0 接口,完美覆盖软路由几乎所有使用场景。</p><blockquote><p>R2S 原本是作为边缘服务器设计,被我们硬生生的玩成了软路由。</p></blockquote><p>一体成型的金属外壳,非常有高级感,很有工业风,手感不错。由于 R2S 挑卡,挑电源(看到后面你就知道了)在购买机器时我直接买了已经经过测试的 Micro SD 卡和电源组合套餐,理论上来说,我不会遇到 SD 卡、电源与机器不兼容的问题。</p><h2 id="刷个-OpenWRT-跑起来!"><a href="#刷个-OpenWRT-跑起来!" class="headerlink" title="刷个 OpenWRT 跑起来!"></a>刷个 OpenWRT 跑起来!</h2><p>先来看看这玩意儿的硬件规格:</p><ul><li>CPU: Rockchip RK3328, Quad-core Cortex-A53</li><li>DDR4 RAM: 1GB</li><li>Network:<ul><li>10/100/1000M以太网口 x 1</li><li>USB3.0转10/100/1000M以太网口 x 1</li></ul></li><li>USB2.0 Host: Type-A x1</li><li>MicroSD Slot x 1</li><li>MicroUSB: 供电和Slave功能</li><li>Debug Serial Port: 3.3V TTL电平,3Pin 2.54mm间距排针</li><li>PC Size: 55.6 x 52mm</li><li>Power Supply: DC 5V/2A</li><li>Temperature measuring range: 0℃ to 80℃</li><li>OS/Software: U-boot,Ubuntu-Core,OpenWrt</li></ul><p>这个硬件规格,装 Ubuntu 当服务器还是免了,但是跑个 OpenWRT 当路由器使绰绰有余。</p><p>由于使用 Micro SD 卡作为启动介质,R2S 的刷机非常容易:取出 SD 卡,用读卡器接上电脑,把镜像烧写进 SD 卡,再把 SD 卡装回 R2S,完成。对于用 Ultra ISO 刻过 Windows 系统盘的老油条来说全都是熟悉的操作,完全没有任何难度可言,即使是新手也能很轻易的学会。让我们快进到登入 OpenWRT 的后台:</p><p><img src="https://imgcdn.nightcity.pub/image-20220811173625242.webp" alt="R2S刷入OpenWRT后的后台界面"></p><p>(此处应有Nice)</p><p>狗都不用 R2S 官方编译的 OpenWRT,不仅没有中文翻译,没有好看的主题,各种插件还需要自行安装。懒得在官方固件上瞎折腾则可以直接选择别人打包好的固件。我使用了 BigDongDong 打包的带 Docker 固件,能满足我的所有需求。</p><h2 id="让这玩意加入我的家庭网络"><a href="#让这玩意加入我的家庭网络" class="headerlink" title="让这玩意加入我的家庭网络"></a>让这玩意加入我的家庭网络</h2><p>要想让 R2S 加入我的家庭网络,有两种大致的方案:第一种,也是最直截了当的办法,即直接拿 R2S 当主路由使用;第二种方法稍微复杂,用 R2S 当旁路由,将原来主路由的网关指向旁路由。这两种方案各有优缺点,将 R2S 当主路由配置简单,只要你想,只需要将 R2S 接入光猫和原来的路由器之间,然后启动路由器,什么都不需要配置,直接开始上网。代价是这会让网络架构多一重出故障的概率,虽然这个概率很小。将 R2S 用作旁路由配置稍微复杂,但能实现某些设备直接走主路由,其余设备走旁路由的效果,缺点就是某些只有作为主路由才能实现的功能(比如你要建站而你原来的主路由不支持端口转发)无法实现。</p><p>我无法接受让 R2S 作为旁路由的行为,想到数据包在两个路由由之间来回窜个两次才能被发出去情景,我还是选择了第一种方案——我不需要那么稳定的网络,大不了多重启几次。于是这就是新的网络拓补图:</p><p><img src="https://imgcdn.nightcity.pub/image-20220812170317043.webp" alt="加入R2S后的网络拓补"></p><p>图片<del>懒得自己画所以</del>来源于网络,无线路由器那里那个 WAN 请自行脑补成 LAN。</p><p>为了让 R2S 能尽可能的与我的设备交互(比如控制某个设备是否启用科学上网),以及尽可能的减少 NAT 和网段的套娃,我们需要对原来的路由器进行一些设置,首先查看路由器是否有类似 AP模式(无线接入点模式)的功能,如果有那么直接启用这个模式就行。如果我的路由器有这个选项那我就不需要写下面这个部分了,只可惜,这 TP-LINK 电子垃圾并没有。</p><h3 id="手动把原来的路由器设置成交换机"><a href="#手动把原来的路由器设置成交换机" class="headerlink" title="手动把原来的路由器设置成交换机"></a>手动把原来的路由器设置成交换机</h3><p>我不得不手动设置这个路由器,不过还好这并不是一件难事:首先把原本接在路由器 WAN 口的网线插到 LAN 口里,你没看错,<strong>LAN 口</strong>。然后登入原路由器的后台,关掉原路由器的 DHCP 服务器,打开原路由器的 LAN 口设置把原路由器的 LAN 口 IP 设置成与 R2S同一网段下的一个IP,例如:我的 R2S 的 IP 是 <code>192.168.2.1</code> ,所以我将原路由器的 LAN 口 IP 设置成 <code>192.168.2.2</code> 。设置好以后重启路由器,所有设备就和 R2S 同一个网段了,在 R2S 的后台也可以看到这些设备。这些操作的本质是把路由器变成一个带无线功能的交换机。</p><p><img src="https://imgcdn.nightcity.pub/image-20220812172849779.webp" alt="在TP-LINK路由器的后台关闭路由器的DHCP服务器"></p><p><img src="https://imgcdn.nightcity.pub/image-20220812172531650.webp" alt="将路由器变成交换机后OpenWRT的后台可以看到所有设备"></p><p>至此,基础的网络配置已经全部完成了,<del>本来就很乱的弱电箱更乱了</del>。</p><h2 id="终于可以正式开始折腾了"><a href="#终于可以正式开始折腾了" class="headerlink" title="终于可以正式开始折腾了"></a>终于可以正式开始折腾了</h2><p>现在折腾的基础已经有了,那就开始折腾吧。</p><h3 id="Passwall-科学上网"><a href="#Passwall-科学上网" class="headerlink" title="Passwall 科学上网"></a>Passwall 科学上网</h3><p>其实原本想用 Clash,不过 Clash 有多吃资源上网一搜就知道。</p><p>关于 Passwall 怎么使用网上一搜一大把,这里我直接写我的用法:</p><ul><li>导入机场的订阅开启自动更新订阅,每天一更新</li><li>选择一个位于香港的节点作为主节点</li><li>开启自动切换,设置新加坡和美国的节点为 Fallback 节点(故障转移)</li><li>开启 <code>ChinaDns-NG</code> 过滤被污染的 DNS 结果</li></ul><p>最后把之前所有设备上设置的 DoH 和 DoT 取消,让他们的 DNS 服务器直接指向 R2S,万事大吉,所有设备都可以科学上网了。<del>出于强迫症</del>我将家用摄像头排除在代理列表外,搞定。</p><h3 id="青龙面板"><a href="#青龙面板" class="headerlink" title="青龙面板"></a>青龙面板</h3><p>既然这固件自带 Docker,那总得用起来吧?Docker 能干嘛?青龙面板安排。操作其实也很简单:把青龙面板的镜像拉取到 SD 卡上,然后部署启动容器启动就行。</p><p>另外需要额外安装一些依赖,例如 Python 的 requests 库,Node.js 的 base64 库等,这里我随意贴一份依赖列表,可以自行取用:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Node.js 下的依赖</span></span><br><span class="line">crypto-js</span><br><span class="line">prettytable</span><br><span class="line">dotenv</span><br><span class="line">jsdom</span><br><span class="line">date-fns</span><br><span class="line">tough-cookie</span><br><span class="line">tslib</span><br><span class="line">[email protected]</span><br><span class="line">ts-md5</span><br><span class="line">jsdom -g</span><br><span class="line">jieba</span><br><span class="line">fs</span><br><span class="line">form-data</span><br><span class="line">json5</span><br><span class="line">global-agent</span><br><span class="line">png-js</span><br><span class="line">@types/node</span><br><span class="line">require</span><br><span class="line">typescript</span><br><span class="line">js-base64</span><br><span class="line">axios</span><br><span class="line">moment</span><br><span class="line"><span class="comment"># Python3 下的依赖</span></span><br><span class="line">requests</span><br><span class="line">canvas</span><br><span class="line">ping3</span><br><span class="line">jieba</span><br><span class="line">PyExecJS</span><br><span class="line">aiohttp</span><br></pre></td></tr></table></figure><p>至于其他依赖基本可以看脚本运行的错误日志对症下药地安装,这里就不贴出来了。</p><p>那么现在青龙面板有了,拿他干什么呢?</p><p><img src="https://imgcdn.nightcity.pub/image-20220813181819566.webp" alt="充满任务的青龙面板定时任务界面"></p><p><img src="https://imgcdn.nightcity.pub/image-20220813162626204.webp" alt="青龙面板刷京豆"></p><p>目前只是拿它跑跑脚本拿京豆,佛系看到什么功能就加上,虽然用的是家用 IP,被风控的概率比较低,但我还是尽量不多开脚本,且不说会不会被风控,毕竟这东西还是主路由,总不能一天到晚太占性能导致我的上网体验变差吧?如果真是这样那就舍本逐末了。</p><p>至于脚本从哪里来,可以自行在 Github 上搜索依赖库拉库安装,说不定以后还要去 Gitee 上再找找,只能说,但愿 Github 不要被完全阻断导致一部分大佬往 Gitee 上跑。这里贴一个我用的库</p><p><a href="https://github.com/okyyds/yydspure/tree/master">https://github.com/okyyds/yydspure/tree/master</a></p><p>直接用定时任务拉库就行。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ql repo https://github.com/okyyds/yydspure.git <span class="string">"jd_|jx_|gua_|jddj_|jdCookie"</span> <span class="string">"activity|backUp"</span> <span class="string">"^jd[^_]|USER|function|utils|sendNotify|ZooFaker_Necklace.js|JDJRValidator_|sign_graphics_validate|ql|JDSignValidator"</span> <span class="string">"master"</span></span><br></pre></td></tr></table></figure><h2 id="稳定性、效果和问题"><a href="#稳定性、效果和问题" class="headerlink" title="稳定性、效果和问题"></a>稳定性、效果和问题</h2><p>为了稳定,暂时就折腾这么多了。</p><p>那么稳定性怎么样?目前来看很好,没有遇到网上的各种烧坏,重启之类的问题,设置 Crontab 每周重启一次,非常稳定,这里有一个坑点: R2S 使用 Type-C 接口供电,却不支持 PD 协议。并且,虽然官方的技术规格里只需要 5V2A 的电源,但实际上需要尽量选择高于这个规格的电源,比如我的电源是 5V3A 的非 PD 协议电源,这就导致 R2S 的配套电源选择范围很窄,尽量选择店家 R2S 套餐里配好的电源。以下是一些网友的情况:</p><p><img src="https://imgcdn.nightcity.pub/image-20220813182030465.webp" alt="什么值得买里烧坏的R2S和不稳定的R2S"></p><p>前面也提到了 R2S 挑卡的问题,出于一些原因,R2S 与某些SD卡的兼容性欠佳,可以去 R2S 官方 Wiki 上找找兼容的 SD 卡列表。</p><p>效果如何?不需要多说,因为家里的宽带只有 100 兆,任何一个软路由都可以轻松跑满。因为我的机场屏蔽了意义不大的测速,晚高峰(大概是晚高峰,周六下午六点半) Youtube 的话可以轻松跑到 12 万。</p><p><img src="https://imgcdn.nightcity.pub/image-20220813183052529.webp" alt="晚高峰Youtube可以跑到12万"></p><p><img src="https://imgcdn.nightcity.pub/image-20220815225712582.webp" alt="非晚高峰速度可到26万"></p><p>这个速度和机场有比较大的关系,不过,只要5万以上,4k 就能随便拖着看,再往上意义不大。再就是青龙面板的效果,前面大家也都看到了。</p><p>那么问题?其实问题主要集中在 IPV6 上,换上 R2S 后,哪怕我将所有 IPV6 相关的服务全都设成中继模式也没有办法正常使用 IPV6,而原来的路由器只要设置成桥模式即可,这个问题暂时没有找到解决方案。</p><h2 id="最后"><a href="#最后" class="headerlink" title="最后"></a>最后</h2><p>总体上,R2S 达到了我的预期,基本满足了我的需求,是一件我相对满意的产品。折腾乐趣无穷,但切莫上头,软路由这种东西,搞清自己的需求,不要忘记折腾原本的目的,够用就好,否则就是一个痛苦的无底洞。至于这个尚未解决的 IPV6 问题,佛系解决,实在不行看看能不能用 IPV6 NAT。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
</entry>
<entry>
<title>在中国,漫展已经失去了灵魂</title>
<link href="/2022/08/my-thoughts-on-anime-shows-in-china/"/>
<url>/2022/08/my-thoughts-on-anime-shows-in-china/</url>
<content type="html"><![CDATA[<p>我从未去过漫展,并且可能在今后相当长的一段时间里也不打算去了。看到一位推友发送的广州漫展的情况后,我的心情却不比当年 Pixiv 被墙更加简单。</p><p><img src="https://imgcdn.nightcity.pub/653FBD7AF04B464C4EA55DFC39C670E4.webp" alt="653FBD7AF04B464C4EA55DFC39C670E4"></p><h2 id="我们到底需要什么样的漫展?"><a href="#我们到底需要什么样的漫展?" class="headerlink" title="我们到底需要什么样的漫展?"></a>我们到底需要什么样的漫展?</h2><p>在维基百科上搜索“漫展”,你会发现这个词条之中文版是一个年久失修的词条。所以我们来看看英文版:</p><blockquote><p>An <strong>anime convention</strong> is an event or gathering with a primary focus on <a href="https://en.wikipedia.org/wiki/Anime">anime</a>, <a href="https://en.wikipedia.org/wiki/Manga">manga</a> and <a href="https://en.wikipedia.org/wiki/Culture_of_Japan">Japanese culture</a>. Commonly, anime conventions are multi-day events hosted at <a href="https://en.wikipedia.org/wiki/Convention_center">convention centers</a>, <a href="https://en.wikipedia.org/wiki/Hotel">hotels</a> or college campuses. They feature a wide variety of activities and panels, with a larger number of attendees participating in <a href="https://en.wikipedia.org/wiki/Cosplay">cosplay</a> than most other types of fan conventions. Anime conventions are also used as a vehicle for industry, in which studios, distributors, and publishers represent their anime related releases.</p></blockquote><p>最初的漫展在1975年举行,是位于东京举行的 Comiket。上面这段话大致的翻译是:漫展是将焦点放在动漫,漫画以及日本文化上的展览。通常分多日在会议中心、酒店、校园等地举行,分为各种活动。漫展中参加 Cosplay 的人数远比参加其他活动的人更多。漫展也被当作二次元商业活动的载体,签售等各种商业活动都可以通过漫展进行。</p><p>可以看出,漫展在中文和英语环境下都是一个较为冷门的词汇。就连在编辑战频发的维基百科都少人问津。在我的印象里,漫展是一个传播ACG(Anime, Cartoon, Gaming)文化之地。虽然这类文化大抵起源于日本,但像英文维基百科片面的将其归结于日本文化显然非常偏激。</p><blockquote><p>漫展在官僚主义、形式主义、和沙文主义三座大山的夹缝中求生存、图发展,漫展的堕落是中国畸形的文化现象的缩影。</p></blockquote><p>审查并非一定是政府行为,亦可以是民间自发行为,过度的审查让原本正常生长的文化变成了畸形的文化,这已经不是第一次:民国时期的散文诗作者抒情之地,建国后大部分却变成了刻意拍马屁的垃圾;京剧是我国国粹,文革时期极端的审查与文化专制让京剧畸形发展出了面目全非的样板戏;藏传佛教本是至美的纯粹信仰,过分的审查却将其变成了政治意味浓厚的工具。毫不夸张的说,过分的审查本质上是在同化文化,是对多元文化的不容忍,简单来说,这就是在破坏文化。</p><p>我们到底需要什么样的漫展?我们需要的,只不过是未经污染的一片净土,是一片原汁原味的文化,可是在极端的审查下,连对多元文化基本的保留,基本的原汁原味都成了奢望。</p><h2 id="你不是不看漫展吗?"><a href="#你不是不看漫展吗?" class="headerlink" title="你不是不看漫展吗?"></a>你不是不看漫展吗?</h2><p>若是问及这在现实世界中对我的影响,可以说是几乎为零。我虽然喜爱二次元文化,但就我痴迷的程度而言,我甚至不配被称为ACG爱好者。我一苦逼大学生的生活状态,直截了当的说,与那些花天酒地的大学生相比,我过得可能更接近于苦行僧。毕竟从第一句话我就说了:我从未去过漫展,在夏日祭事件后环境每况愈下的情况下更加不打算去。</p><p>在我的意识里,一种声音告诉我:等某一天我喜爱的某个东西,比如最近在玩的 Cytus 2 被拉清单,或者说发生更加难以接受的事国内进一步封闭互联网,我才会站出来发声。现在的事对你没什么影响,事不关己,高高挂起?但我却不得不提到这首著名的墓志铭:</p><blockquote><p>在德国,起初他们追杀共产主义者,我没有说话,因为我不是共产主义者;</p><p>接着,他们追杀犹太人,我没有说话…,因为我不是犹太人;</p><p>后来,他们追杀工会成员,我没有说话…,因为我不是工会成员;</p><p>此后,他们追杀天主教徒,我没有说话…,因为我是新教徒;</p><p>最后,他们奔我而来,却再也没有人站起来为我说话了。</p></blockquote><p>这是一位牧师的墓志铭,相信很多人都看过。对于每况愈下的沉默是可怕的,不在沉默中爆发,就在沉默中灭亡。不如我来仿写一下这首诗墓志铭:</p><blockquote><p>起初他们打压“娘炮”,我保持沉默,因为我不是“娘炮”。</p><p>接着,他们打压明星,我保持沉默,因为我不追星。</p><p>后来,他们审查游戏,要求游戏必须拿到版号,我保持沉默,因为我玩的游戏没有受到影响。</p><p>此后,他们借着莫须有的“夏日祭”事件对漫展施压,我保持沉默,因为我不看漫展。</p><p>最后,他们只允许高唱赞歌,整个民族却不再容忍其他文化了。</p></blockquote><h2 id="别再洗白文化审查"><a href="#别再洗白文化审查" class="headerlink" title="别再洗白文化审查"></a>别再洗白文化审查</h2><blockquote><p>Freedom of speech is that you could say anything you want, but it doesn’t mean I have to listen to it.</p></blockquote><p>言论自由的意思是:你可以发表任何你想要发表的言论,但这并不代表我一定要听。社会文化同理,我们的社会可以有“正能量”的主流文化,但并不代表我们的社会不能有其他文化。畸形的文化审查就是对文化的破坏。在中国,审查并非单纯的一种制度,而是一种现象,中国的审查现象是官僚主义、形式主义和沙文主义互相结合的产物。为什么会有人为这种畸形中的畸形现象洗白?长期只接受单一的文化,人的思想就会愈发偏激,愈发地不能接受其他文化,不能容忍文化多样性的存在。当一个国家,一个民族不能容忍多样性时,势必造成灾难性的后果。想想纳粹德国是如何发动二战以及他们在二战中的各种反人类行为,你就能明白这一点。</p><p>及时行乐。情况虽然不容乐观,但我们依旧可以掌控当下。与其等待文化被阉割,不如尽早的感受多元文化。前面已经反复提到,中国的审查现象是一种十分畸形的现象,与其担惊受怕不断自我审查,不如趁早、趁更加开放的时候感受文化。不得不说,现今社会在倒退,Totally reversing all the progress we’ve made,让人看不到希望,我们能看到的,只有黑暗,一眼望不到头的黑暗。</p><h2 id="历史的车轮滚滚向前?"><a href="#历史的车轮滚滚向前?" class="headerlink" title="历史的车轮滚滚向前?"></a>历史的车轮滚滚向前?</h2><blockquote><p>刚被历史的车轮碾过,好不容易爬起身来,却发现历史在开倒车。</p></blockquote><p>我们本应在上世纪80年代迎来一个更加开放的社会,可我们没有。我们本应在20世纪初加入WTO后逐渐转型,我们亦在20世纪初呈现了短暂的繁荣,没有畸形的政治正确,没有过分的审查,青年一代朝气蓬勃,踌躇满志,整个社会呈现出变革的态势。现在回想起童年时的社会生活,虽然亦有审查,但绝无现在的压抑之感。我们能明显的感觉到,当时的社会正在进步,理论上来说,十几年过去,我们应当迎来一个更为进步、开放的社会。十几年后的今天,社会却事与愿违,正加剧着偏激与极端。</p><h2 id="最黑暗的时候…"><a href="#最黑暗的时候…" class="headerlink" title="最黑暗的时候…"></a>最黑暗的时候…</h2><p>虽然正在陷入无尽的黑暗,但人们还是努力生活,努力在生活中寻找幸福感。在1940年,也就是第二次世界大战最激烈,法西斯看上去就要征服世界的时候,人们依然会憧憬战后的生活。即使生活在绝望里,人们还是会以这句话安慰自己:</p><blockquote><p>The darkest hour is before the dawn.</p></blockquote><p>最黑暗的时候往往是清晨第一丝曙光前。即使黑暗看上去无尽,但总有一天,它会到头,即使生活在绝望中,也切莫放弃对生活的信心。在每况愈下,充满无力感时,这是我们能做且唯一能做到的。</p><h2 id="最后…"><a href="#最后…" class="headerlink" title="最后…"></a>最后…</h2><p>我想看到我们的社会是包容的,而不是越来越偏激,越来越有攻击性。当然,这也没那么容易。社会变革是痛苦的,山雨欲来风满楼,这是变革前的阵痛吗?我们究竟何处去?是更加光明,还是更加黑暗?也许现在我不该考虑这个问题,要下雨了,赶紧收衣服去。</p>]]></content>
<categories>
<category> 生活 </category>
</categories>
<tags>
<tag> 牢骚 </tag>
</tags>
</entry>
<entry>
<title>为什么上下行不对等的宽带在中国大陆大行其道?</title>
<link href="/2022/08/why-upload-speed-is-typically-slower-than-download-speed-in-china/"/>
<url>/2022/08/why-upload-speed-is-typically-slower-than-download-speed-in-china/</url>
<content type="html"><![CDATA[<p>几个月前从学校回家,发现家里的下载速度似乎变快了一些。于是跑了一通测速,是的,下行的确变快了1/5,但是上行竟然变成了原来的1/5,恶心程度堪比下行突然降速一半。虽然家庭宽带的上行需求并不大,但在下行提速后,这仍然是一个值得思考的问题:都2202年了,为什么上下行不对等的宽带在中国大陆仍然大行其道?</p><span id="more"></span><h2 id="先从历史上的-ADSL-说起"><a href="#先从历史上的-ADSL-说起" class="headerlink" title="先从历史上的 ADSL 说起"></a>先从历史上的 ADSL 说起</h2><p>只在十几年前,电信的 ADSL 是一代人的童年回忆,8兆的宽带在当时已经算快速,每逢游戏的大更新都需要花一个下午乃至好几天的时间下载。迅雷还在它最辉煌的年代,盗版依旧大行其道,谷歌还在中国提供审查后的搜索服务……大家依靠着ADSL提供网络访问。</p><p><img src="https://imgcdn.nightcity.pub/format,f_auto.webp" alt="ADSL示意"></p><p>ADSL,全称 Asymmetric Digital Subscriber Line,为电话线上网时代的人们量身定制,不同于SDSL的上下行对等,ADSL能够在同样适用电话线的情况下能够以牺牲上行速度为代价实现更高的下行速度。这对于当时上网的人们来说无疑是天大的好消息——在Web 1.0时代,用户并不生产内容。即使有,也是数据量极小的文字和图片信息。</p><p><img src="https://imgcdn.nightcity.pub/image-20220802202917411.webp" alt="ADSL标准图"></p><p>由于ADSL使用电话铜线上网,如此细的一根铜线并且通过电信号传输数据,瓶颈不可避免,我的印象里,国内ADSL的介入速度最高到过8兆,之后ADSL就被扔进了历史的垃圾堆。一直到近七八年光纤上网开始出现之前,中国大陆的平均互联网接入速度仅3.7Mbps,基本上是非洲国家的水平。</p><blockquote><p>我国互联网平均接入速度仅为3.7Mbps,远低于发达国家的平均水平</p><p>——马化腾于很久以前</p></blockquote><h2 id="再说说现在的光纤到户"><a href="#再说说现在的光纤到户" class="headerlink" title="再说说现在的光纤到户"></a>再说说现在的光纤到户</h2><p>2010年,光纤上网开始在国内出现,取代了ADSL。光纤通过光信号传播信息,由于光的频率很高,光纤通信的速率上限也可以做的非常高。一开始可以做到是10兆,再后来,辅以国务院在2015年颁布的<a href="http://www.gov.cn/zhengce/content/2015-05/20/content_9789.htm">提速降费</a>政策,20兆、50兆、100兆、200兆……网速开始起飞,一直持续到今天。按理来说,光纤上网原理上不存在电话线ADSL的技术瓶颈,在技术上完全可以做到上下行对等。对上行有着极高要求的数据中心亦采用光纤通信也在一定程度上佐证了这一点。为什么上下行不对等依旧在家庭宽带里大行其道?</p><p><img src="https://imgcdn.nightcity.pub/image-20220803135431082.webp" alt="上下行不对等的家庭宽带"></p><h2 id="来看看通信设施的部署和维护成本"><a href="#来看看通信设施的部署和维护成本" class="headerlink" title="来看看通信设施的部署和维护成本"></a>来看看通信设施的部署和维护成本</h2><p>(暂时搜不到相关文献,我也不是这方面专业)</p><p><del>我暂时未能找到具体的文献估算这个成本,可能这个成本本身也比较复杂。</del>最后,我不得不考虑放弃这一部分。</p><p>我们回到问题的本源:明明不存在技术瓶颈,为什么运营商宁可冒着口碑变差的风险,也要缩水我们的上行带宽?是因为历史遗留问题?还是垄断寡头造成的高价?抑或是纯粹利用大部分消费者不在乎上传速度的特点?……我们可以轻易的得知,第三点的可能性相对较小,在网盘和短视频盛行的今天,上传的需求比以往更大,除非运营商希望自己口碑扫地,没人会顶着投诉的风险去缩水上行带宽。</p><h2 id="历史遗留问题?"><a href="#历史遗留问题?" class="headerlink" title="历史遗留问题?"></a>历史遗留问题?</h2><p>那么这是不是历史遗留问题?</p><p>自1994年中国正式接入互联网,中国的网络架构就注定有别于世界其他地区。三大运营商垄断经营网络,同时又相互独立的铺设自己的骨干网。假如某一个网通用户想要访问架设在电信骨干网上的网站,他的数据包需要跨网传输,网通就需要向电信支付跨网流量费用。</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
</entry>
<entry>
<title>为什么你的线路总是绕道美国阿什本?</title>
<link href="/2022/07/why-ashburn/"/>
<url>/2022/07/why-ashburn/</url>
<content type="html"><![CDATA[<p>阿什本,也就是 Ashburn,一个临近华盛顿的不起眼小城,全球 70% 的网络流量流经这里,这显然非常的 Ridiculous。</p><span id="more"></span>]]></content>
<categories>
<category> 未分类 </category>
</categories>
</entry>
<entry>
<title>替换Wordpress和Typecho的Gravatar源为国内源实现国内加载Gravatar</title>
<link href="/2022/07/replace-gravatar-source-on-my-blog/"/>
<url>/2022/07/replace-gravatar-source-on-my-blog/</url>
<content type="html"><![CDATA[<p>出于种种原因,Gravatar 在国内的访问极其不稳定,而 Wordpress 和 Typecho 都使用 Gravatar 作为头像源,这导致网站的上文章出现评论时,页面会因为几个 Gravatar 头像而一直处于加载状态。为了解决这个问题,我尝试自行搭建 Gravatar 镜像并将其更换到 Wordpress 和 Typecho,彻底而完美的解决了问题,<del>并且水出了一篇文章。</del></p><span id="more"></span><p>为什么不直接关了 Gravatar?一句话:没有灵魂。Gravatar可能是世界上使用范围最广的通用头像,若是直接关了 Gravatar,评论里的人就失去了“灵魂”,只剩下一个冷冰冰的人物模具。</p><p>回到正题,想要替换 Gravatar 源,首先你得有一个 Gravatar 源。在一开始的时候,我在网上找了一圈 Gravatar 源,并对它们进行了逐一测试。结果就是发现他们不是太慢就是早已失效,例如网上满天飞的 V2EX 源 <a href="https://cdn.v2ex.com/gravatar/">https://cdn.v2ex.com/gravatar/</a> 在国内就已经被封锁。于是我决定自行搭建一个 Gravatar 镜像。</p><h2 id="更新:使用-Cravatar"><a href="#更新:使用-Cravatar" class="headerlink" title="更新:使用 Cravatar"></a>更新:使用 Cravatar</h2><p>实际上,Gravatar 有一个完美的本土化方案——Cravatar,Cravatar 的 API 将会按照 Cravatar 头像 –> Gravatar 头像 –> QQ头像的顺序为用户匹配头像。并且,Cravatar 的 API 调用方式与 Gravatar 完全兼容。</p><p>并且,Cravatar 官方也给出了一份简明的指导:</p><blockquote><p>你可以很方便的为 WordPress 集成 Cravatar 头像服务,只需要将以下代码加入你的插件或主题的 functions.php 里即可。</p></blockquote><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> ( ! <span class="title function_ invoke__">function_exists</span>( <span class="string">'get_cravatar_url'</span> ) ) {</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 替换 Gravatar 头像为 Cravatar 头像</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * Cravatar 是 Gravatar 在中国的完美替代方案,你可以在 https://cravatar.cn 更新你的头像</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> <span class="function"><span class="keyword">function</span> <span class="title">get_cravatar_url</span>(<span class="params"> <span class="variable">$url</span> </span>) </span>{</span><br><span class="line"> <span class="variable">$sources</span> = <span class="keyword">array</span>(</span><br><span class="line"> <span class="string">'www.gravatar.com'</span>,</span><br><span class="line"> <span class="string">'0.gravatar.com'</span>,</span><br><span class="line"> <span class="string">'1.gravatar.com'</span>,</span><br><span class="line"> <span class="string">'2.gravatar.com'</span>,</span><br><span class="line"> <span class="string">'secure.gravatar.com'</span>,</span><br><span class="line"> <span class="string">'cn.gravatar.com'</span>,</span><br><span class="line"> <span class="string">'gravatar.com'</span>,</span><br><span class="line"> );</span><br><span class="line"> <span class="keyword">return</span> <span class="title function_ invoke__">str_replace</span>( <span class="variable">$sources</span>, <span class="string">'cravatar.cn'</span>, <span class="variable">$url</span> );</span><br><span class="line"> }</span><br><span class="line"> <span class="title function_ invoke__">add_filter</span>( <span class="string">'um_user_avatar_url_filter'</span>, <span class="string">'get_cravatar_url'</span>, <span class="number">1</span> );</span><br><span class="line"> <span class="title function_ invoke__">add_filter</span>( <span class="string">'bp_gravatar_url'</span>, <span class="string">'get_cravatar_url'</span>, <span class="number">1</span> );</span><br><span class="line"> <span class="title function_ invoke__">add_filter</span>( <span class="string">'get_avatar_url'</span>, <span class="string">'get_cravatar_url'</span>, <span class="number">1</span> );</span><br><span class="line">}</span><br><span class="line"><span class="keyword">if</span> ( ! <span class="title function_ invoke__">function_exists</span>( <span class="string">'set_defaults_for_cravatar'</span> ) ) {</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 替换 WordPress 讨论设置中的默认头像</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> <span class="function"><span class="keyword">function</span> <span class="title">set_defaults_for_cravatar</span>(<span class="params"> <span class="variable">$avatar_defaults</span> </span>) </span>{</span><br><span class="line"> <span class="variable">$avatar_defaults</span>[<span class="string">'gravatar_default'</span>] = <span class="string">'Cravatar 标志'</span>;</span><br><span class="line"> <span class="keyword">return</span> <span class="variable">$avatar_defaults</span>;</span><br><span class="line"> }</span><br><span class="line"> <span class="title function_ invoke__">add_filter</span>( <span class="string">'avatar_defaults'</span>, <span class="string">'set_defaults_for_cravatar'</span>, <span class="number">1</span> );</span><br><span class="line">}</span><br><span class="line"><span class="keyword">if</span> ( ! <span class="title function_ invoke__">function_exists</span>( <span class="string">'set_user_profile_picture_for_cravatar'</span> ) ) {</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 替换个人资料卡中的头像上传地址</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> <span class="function"><span class="keyword">function</span> <span class="title">set_user_profile_picture_for_cravatar</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="keyword">return</span> <span class="string">'<a href="https://cravatar.cn" target="_blank">您可以在 Cravatar 修改您的资料图片</a>'</span>;</span><br><span class="line"> }</span><br><span class="line"> <span class="title function_ invoke__">add_filter</span>( <span class="string">'user_profile_picture_description'</span>, <span class="string">'set_user_profile_picture_for_cravatar'</span>, <span class="number">1</span> );</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h2 id="自建Gravatar镜像:Nginx-反代-Gravatar-官方源"><a href="#自建Gravatar镜像:Nginx-反代-Gravatar-官方源" class="headerlink" title="自建Gravatar镜像:Nginx 反代 Gravatar 官方源"></a>自建Gravatar镜像:Nginx 反代 Gravatar 官方源</h2><p><strong>注意:这一部分仅适用于服务器在海外的同学,如果服务器在国内请直接绕道去看后面的部分</strong></p><p>首先声明,为了方便管理网站,我使用了宝塔面板。在宝塔面板里使用你想要的域名新建一个网站,纯静态,数据库和FTP都不需要。完成后,转到这个网站的设置,找到反向代理选项,新建一个新的反向代理,填入目标 URL 为 <code>https://secure.gravatar.com</code>提交保存即可。到了这一步,尝试访问指派给网站的域名,别忘了加上/avatar,如果出现了默认 Gravatar 头像即代表配置成功。</p><p><img src="https://imgcdn.nightcity.pub/image-20220724223648262.webp" alt="在宝塔面板里新建一个网站"></p><p><img src="https://imgcdn.nightcity.pub/image-20220724224045361.webp" alt="反向代理Gravatar官方源"></p><p><img src="https://imgcdn.nightcity.pub/image-20220724224804758.webp" alt="出现默认Gravatar头像即配置成功"></p><p>配置成功后,除非你想看到 Chrome “不安全”的提示,否则别忘了给刚刚搭建好的镜像申请一个 SSL 证书。通常情况下直接使用 Let’s Encrypt 即可,打开网站的 SSL 选项,用 DNS 验证的方式申请一个 SSL 证书后开启强制 HTTPS 即可。到这一步,我们自己的 Gravatar 镜像就搭建完成了。</p><h2 id="更换博客上的-Gravatar-源为国内可访问源"><a href="#更换博客上的-Gravatar-源为国内可访问源" class="headerlink" title="更换博客上的 Gravatar 源为国内可访问源"></a>更换博客上的 Gravatar 源为国内可访问源</h2><h3 id="Wordpress"><a href="#Wordpress" class="headerlink" title="Wordpress"></a>Wordpress</h3><p>对于 Wordpress,Google 上搜索到的相关文章大部分都通过修改主题的<code>functions.php</code>文件,加入如下的函数来实现。</p><figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">getV2exAvatar</span>(<span class="params"><span class="variable">$avatar</span></span>) </span>{</span><br><span class="line"> <span class="variable">$avatar</span> = <span class="title function_ invoke__">str_replace</span>(<span class="keyword">array</span>(<span class="string">"www.gravatar.com/avatar"</span>,<span class="string">"0.gravatar.com/avatar"</span>,<span class="string">"1.gravatar.com/avatar"</span>,<span class="string">"2.gravatar.com/avatar"</span>),<span class="string">"cdn.v2ex.com/gravatar"</span>,<span class="variable">$avatar</span>);</span><br><span class="line"> <span class="keyword">return</span> <span class="variable">$avatar</span>;</span><br><span class="line">}</span><br><span class="line"><span class="title function_ invoke__">add_filter</span>(<span class="string">'get_avatar'</span>, <span class="string">'getV2exAvatar'</span>);</span><br></pre></td></tr></table></figure><p>实测在 MDx 主题上这种方法无效,故使用了另一种方法:打开网站目录,找到<code>/wp-includes</code>里的<code>link-templates.php</code>,在这个文件中搜索“gravatar”,大约在这个文件4378行的位置就可以发现 Gravatar 的链接,替换链接为国内可访问的镜像源即可。</p><p><img src="https://imgcdn.nightcity.pub/image-20220724231147789.webp" alt="替换链接为国内的镜像源"></p><p>至于插件,暂时没有找到还在更新且能完美实现这个功能的插件,如果有欢迎评论。</p><h2 id="Typecho"><a href="#Typecho" class="headerlink" title="Typecho"></a>Typecho</h2><p>对于 Typecho,方法与 Wordpress 大同小异,找到网站根目录,打开<code>/var/Typecho/</code>目录下的<code>Common.php</code>文件。大约在 836 行左右的地方可以找到 Gravatar 官方源的地址,替换为国内可访问源即可。</p><p><img src="https://imgcdn.nightcity.pub/image-20220725104210264.webp" alt="Typecho替换Gravatar官方源后的效果"></p><p>不过,某些 Typecho 主题可能不会调用 Typecho 的模板函数,而是使用主题内的函数,这时需要对主题文件作额外的修改。回到网站根目录,打开<code>/usr/themes/</code>下你的主题根目录,主题获取 Gravatar 的相关代码一般在<code>comments.php</code>里,打开<code>comments.php</code>搜索”avatar” 找到 Gravatar 官方源的地址替换为国内可访问源即可。</p><p><img src="https://imgcdn.nightcity.pub/image-20220725105114445.webp" alt="某些Typecho主题会自写模板函数"></p><h2 id="推荐的Gravatar源"><a href="#推荐的Gravatar源" class="headerlink" title="推荐的Gravatar源"></a>推荐的Gravatar源</h2><p>目前只推荐自建源和七牛云源,后续可能会寻找新源,如果有欢迎评论。</p><figure class="highlight plaintext"><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">https://gravatar.l3zc.com#自建源,已停用</span><br><span class="line">https://dn-qiniu-avatar.qbox.me/avatar/#七牛云源,很快,推荐</span><br></pre></td></tr></table></figure><h2 id="需要注意的是"><a href="#需要注意的是" class="headerlink" title="需要注意的是"></a>需要注意的是</h2><p>你可能已经注意到,在 Typecho 自带的模版函数里,调用 Gravatar 源时不需要加<code>/avatar</code>,这是因为 Typecho 自带的函数里已经自动为之加上。同理,有的源调用avatar的路径可能是<code>/gravatar</code>,应用到网站上时需要做出相应的修改。</p>]]></content>
<categories>
<category> 未分类 </category>
</categories>
</entry>
<entry>
<title>家人真的值得信赖吗?</title>
<link href="/2022/07/are-parents-really-trustable/"/>
<url>/2022/07/are-parents-really-trustable/</url>
<content type="html"><![CDATA[<p>翻一翻以前的日记,总觉得大脑里神经错乱难以持继。</p><blockquote><p>那些试图控制你的所谓家人,不配叫做家人,他们只不过是一群为一时肉体快感,为满足自身控制欲将你可怜的灵魂带到世上,让你饱受痛苦的孽障。他们只不过是一群借所谓的忠孝仁义控制别人而为自己带来好处的流氓。他们只不过是一群虚有其表在你面前狂吼乱叫的贱狗。</p><p>——2020年2月12日</p></blockquote><blockquote><p>都说家人将帮助你,某些情况下,家人却会成为你的枷锁,你真的需要家人吗?目前来看,确实需要,但是,家人的存在是否是你后续人生的威胁?道德,什么是道德?什么是仁义?都是狗屁,家人利用仁义时,道德上的弱者将会被无情的压榨殆尽。</p><p>——2021年3月20日</p></blockquote><p>这里所谓的“家人”,给我带来了什么,为什么要给我带来这些,我失去了什么,我又得到了什么?很久以来我一直在问自己这样一些问题。严格来说,这个道理不值得我长篇大论:显而易见,繁衍是人的本能,繁衍的欲望会随年龄逐渐加强,在这个欲望没有那么强的时候,这会与人的本能互相制衡,达到一个平衡。当欲望愈发强烈,这一套平衡系统就会被崩溃。为了追求快感,后面的事情大家都知道了,一个大冤种就此降世。</p><p>事情就是这么简单,大方向上,人的本能决定了没有第二种情况:最亲的亲人贪图一时的肉体快感,却不想承担与之对应的繁重生育工作——欲火焚身,哪管那么多?这种情形下,亲人的智商为负,但这没能阻止他们开始“权衡”生育子女的利弊:</p><ul><li>夫妻恩爱是必要的啦</li><li>有个孩子很幸福的</li><li>等孩子考上清华北大我们就可以等着享福了</li><li>……</li></ul><p>明眼人都能看出来,这样分析下去,无论如何都会得出“生个孩子血赚”的结论。因为这根本就不是理性分析,这仅仅是为自己纵欲找个理由以便早日缓解欲火焚身的局面。上述是一个情况较为极端的个例,但也不失参考价值。事情在细节上可能有所偏差:有的人过分理性,压倒了欲望,综合分析后决定生育;有的人甚至更加感性,纯粹出于欲望使然;有的人甚是好笑,采取的防护措施不到位发生意外而将错就错。在生育上,“亲人”是大同小异的。</p><p>从内心的最深处,没有人会“为了你好”。即使是一番真心的为你付出,希望你将来有着杰出成就的父母也是如此。最世俗的父母希望下一代比他们好自己跟着沾光,达到一定层次的父母可能把带孩子当作一场游戏,最高尚的父母将孩子作为实现他们自我价值的手段,因为他们以此为人生的乐趣。虽然很残酷,但这就是现实——即使短期利益可能相符,我们与亲人最终的利益却不一定一致,甚至冲突。</p><p>任何人都不值得信赖,尤其是最亲近的人。<del>不要相信任何人说爱你,也不要相信任何人说为你好</del>,这只不过是他们自我的说辞罢了。从某个时刻开始,我开始不信任任何人。计算机为了确保安全,即使会降低效率,0 Trust 也是一个必需品。从前只是计算机专有的名词,现在却不得不用在人身上,对于人来说,何尝不是一种悲哀。我无力改变这种情况,我能做的只是明辨,慎重的选择合作与否。除此之外,我们也没有什么别的办法。</p>]]></content>
<categories>
<category> 未分类 </category>
</categories>
</entry>
<entry>
<title>当我们愈发接近赛博朋克</title>
<link href="/2022/07/when-we-are-closer-to-cyberpunk/"/>
<url>/2022/07/when-we-are-closer-to-cyberpunk/</url>
<content type="html"><![CDATA[<p>我爱城市,但不是我现在所居住的这个片区。冷冰冰的高楼大厦掺入烟火气,若即若离的人情味,这才是我心目中理想的城市该有的样子。我爱这些光鲜亮丽的大楼,更爱这无情与有情的反差——当冷冰冰的技术将 What makes us human 一点一点的剥夺时,那些让人是人的元素显得愈发可贵和美丽。</p><p>是的,我说的就是赛博朋克。高技术,低生活,以及由此衍生的人们之间的联系。现在的我们正生活在赛博朋克的城市里,与未来只不过是程度的高低。当人们需要靠着生活中的“小确幸”来获得一点幸福,众人就已经沦为行尸走肉,在大多数时间,状态与机器并无差别。飙车、泡吧……你可以在大都市活的很痛快,却很难在大都市活的幸福。技术的发展让人们活的更痛快,却在某种程度上剥夺了人们活的幸福的权利。</p><p>城市的核心,是人。我望着我周围的一片光鲜亮丽的钢筋水泥森林,以及钢筋水泥下那些为了蝇头小利而破口大骂的人们,我真的感到呼吸困难。</p><blockquote><p>城市的核心是文化,是人,而非崭新却散发着有害化学味道的钢筋水泥森林。</p><p>高楼林立,光鲜亮丽却鲜有人迹的城市是可怕的。</p></blockquote><p>我所在的这个片区,甚至可以称得上光鲜亮丽,可生活在这里的人们大都疲于奔命。我希望感受城市的美好,却只能在这浮躁里迷失漂流。我们何去何从?</p><p>几天前被星尘 Infinity 的惊人的次时代升级惊讶住了,加上动人的歌词,AI 唱出的情感真挚无比,曲绘对我内心深处的触动。让我有一种宛若隔世之感。当 AI 将人与电脑的界线模糊,我们将何去何从?</p><p>我真的生活在真实的世界吗?还是一直被周围的幻象欺骗?当 AI 能够 24 小时比真人更加卓越的满足你的一切情感需求,真人还有存在的意义吗?当人们完全依赖 AI 提供给我们的便利和情感的满足,当真实不再能带给我们快乐,当我们的一切需求都由别人说了算,由巨头公司,威权政府控制,说断就断?真的到了那时,我们怎么拯救自我?</p><p>在赛博朋克的夜之城,当面对义体全副武装,分不清是人是机的时候,唯有爱情能给这个冷冰冰的城市里孤独无依的内心带来真实的慰藉。可是现在,连爱情都开始变得模糊,我们拿什么为我们带来内心的安慰?我们在科技上越来越强大,富有,在精神上,甚至在物质上都变得越发荒芜。</p>]]></content>
<categories>
<category> 未分类 </category>
</categories>
</entry>
<entry>
<title>多数情况下,我们说话就只是想说说话</title>
<link href="/2022/07/in-most-cases-we-just-need-to-talk/"/>
<url>/2022/07/in-most-cases-we-just-need-to-talk/</url>
<content type="html"><![CDATA[<blockquote><p>“我总感觉我们住的这个地方,没有什么文化底蕴,像是那种土包子盖起来的城市,这不是一个宜居的地方”,“那你就去改变啊”,“……”</p></blockquote><p>以上是我与父亲之间的一段谈论,原本纯粹的一段闲聊调侃活生生的变成了家长味十足的说教。这种情况发生过多次,以至于我早已对此麻木。我知道这肯定不是个例,随意找找钢铁直男与其女友“和睦相处”就能抓出一大把远比这更糟的情况。这次无语后,我出门运动以避免进一步的“说教”,也算是一种无奈之举吧。</p><p>记得以前不知从哪里听来的俗语:会打哈哈的人,官升的快。会打哈哈的人并非舔狗,相反,这类人内心十分自信,很有尊严和主见。他们很清楚的知道自己付出了什么,得到了什么,以及两者之间的比例是否值得。只要他们想,他们会在一个他们自己明知而又可以接受的范围内尽可能的给人们以舒适。回到开头的场景,换作一个正常一些的人,也只会听一听,顶多与我扯上两句。但是家长不一样,他们出于自我的快感和成就感,会找尽一切机会对我们进行说教。</p><p>所以这篇文章其实应该是《家长是不是真的爱我们?(血缘关系是否能够带来爱?)血缘关系真的能够带来爱吗?》?</p>]]></content>
<categories>
<category> 未分类 </category>
</categories>
<tags>
<tag> 家人 </tag>
</tags>
</entry>
<entry>
<title>同时发布三个版本的站点?我的博客工作流及对每个版本的优化方案</title>
<link href="/2022/07/my-blog-workflow/"/>
<url>/2022/07/my-blog-workflow/</url>
<content type="html"><![CDATA[<p><del>众所周知,我闲的蛋疼</del>为了对比不同的博客系统并找出最适合我的那一个,我的博客设立了三个版本,一个是 Hexo、一个 是Typecho、一个是Wordpress。这三个版本的博客各有特点,写作和发布文章的方式是各有千秋,功能的多少和轻重也互不相同。因此,尽可能的减少文章“移植”到不同的博客系统的工作量成为了刚需。</p><span id="more"></span><h2 id="用-Markdown-写作"><a href="#用-Markdown-写作" class="headerlink" title="用 Markdown 写作"></a>用 Markdown 写作</h2><p>自从第一次使用 Hexo 搭建博客而第一次使用 Markdown 写作以来,我的写作变从未离开过 Markdown。不光不需要考虑排版的问题,不需要时不时就操作一下鼠标的感觉体验过了就真的离不开。再者,我还在使用 Hexo 作为我的一套博客框架,必须使用 Markdown 写作,写好的 Markdown 直接发布在 Hexo 博客上,不需要任何的二次修改。因此,肯定是用 Markdown 写作了。在确定了写作的主题后,我会用 Hexo 生成一个 Markdown 文件。</p><p><img src="https://imgcdn.nightcity.pub/hexo_generate.webp" alt="用Hexo生成一个Markdown文件"></p><p>之后,我会使用 Typora 编辑这份 Markdown 文件,写好文章。</p><p><img src="https://imgcdn.nightcity.pub/image-20220712151727345.webp" alt="用Typora编辑Markdown文件"></p><h2 id="发布到-Hexo"><a href="#发布到-Hexo" class="headerlink" title="发布到 Hexo"></a>发布到 Hexo</h2><p>文章写好以后,下面就是刻进骨子里的操作:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> blog</span><br><span class="line">hexo g</span><br><span class="line"><span class="built_in">export</span> https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890</span><br><span class="line">hexo d</span><br></pre></td></tr></table></figure><p>直接将文章发布到 Hexo 博客。为什么在有了 Typecho 以后我还是在使用看上去不那么方便的 Hexo?就像 Markdown,只要配置得当,Hexo 对 Markdown (Github Flavoured Markdown)近乎完美的支持可以让我更专注于写博客本身,不需要考虑任何关于格式方面的问题。</p><h2 id="发布到-Typecho"><a href="#发布到-Typecho" class="headerlink" title="发布到 Typecho"></a>发布到 Typecho</h2><p>现在还是相对简单的部分。Typecho 虽然支持 Markdown,但对于 Github Flavoured Markdown 支持的程度显然没有 Hexo 好,例如<code>- [x]</code>在使用 Hexo 时就可以正确渲染,但 Typecho 就不能识别。这时我们便不得不用 HTML 替换掉原本的 Markdown 代码。</p><ul><li><input checked="" disabled="" type="checkbox"> 这里我使用了 Markdown</li></ul><p>要是你在<a href="https://typecho.l3zc.com/">黑土地</a>看这篇文章,你可能会发现上面的 Checkbox 并没有被正确渲染,如果直接以 HTML 代码替换掉这个 Checkbox,显示的效果如下:</p><ul><li><input checked="" disabled="" type="checkbox"> 这里我使用了 HTML</li></ul><p>替换好以后文章方可正常显示。</p><h2 id="发布到-Wordpress"><a href="#发布到-Wordpress" class="headerlink" title="发布到 Wordpress"></a>发布到 Wordpress</h2><p>Wordpress 的编辑器真的是个大麻烦。不光默认没有代码高亮,也是个连 Markdown 都不支持的东西。不过好在 Wordpress 的编辑器支持插入自定义的 HTML 内容。经过简单的尝试,在将 Markdown 文章转换成 HTML 格式直接粘贴在 Wordpress 的 HTML 内容编辑器后切换回可视化编辑器会直接变为 Wordpress 经典编辑器,这使得我想要进一步编辑文章添加一些 Wordpress 特有的区块时很不方便。所以,在 Typora 里直接复制文章粘贴到 Wordpress 的默认编辑器里,随后更改渲染错误的地方替换为自定义 HTML 代码块。</p><h2 id="对-Typecho-和-Wordpress-的小修小补"><a href="#对-Typecho-和-Wordpress-的小修小补" class="headerlink" title="对 Typecho 和 Wordpress 的小修小补"></a>对 Typecho 和 Wordpress 的小修小补</h2><p>你可能会注意到,我写文章的时候时常需要添加代码块和 Mermaid 流程图,<a href="https://github.com/probberechts/hexo-theme-cactus">hexo-theme-cactus</a>自带代码高亮,而我又通过修改主题加入了<a href="https://github.com/mermaid-js/mermaid">mermaid.js</a>,但 Typecho 和 Wordpress 默认都无上述两个功能。为了尽可能的减少文章“移植”到不同的博客系统的工作量,我对这俩货进行了一些小修小补。</p><h3 id="Wordpress"><a href="#Wordpress" class="headerlink" title="Wordpress"></a>Wordpress</h3><p>我采用的 Wordpress 主题是 <a href="https://github.com/yrccondor/mdx">MDx</a>,并不带有代码高亮功能,因此我使用了 <a href="https://github.com/EnlighterJS/EnlighterJS">enlighter.js</a> 官方提供的 Wordpress 插件。安装这个插件后,Wordpress 编辑器里会多出一种名叫 Enlighter 的区块,使用它作为代码的载体即可实现代码高亮的功能。这款插件提供的自定义样式选项不足,这个区块本身的样式又过于棱角分明,与 MDx 圆润的边角格格不入。好在这款插件的 CSS 文件能够被找到,只要学过 CSS ,修改出一个圆润的边角也不是什么难事。</p><p>打开博客的安装目录,找到<code>/wp-content/plugins/enlighter/resources/enlighterjs</code>里的<code>enlightenjs.min.css</code>文件,编辑这个文件,找到其中的<code>enlighter-default</code>类,修改<code>padding</code>参数为<code>10px</code>,添加<code>border-radius</code>参数为<code>10px</code>后保存,就可以得到一个圆润的高亮代码块。</p><p><img src="https://imgcdn.nightcity.pub/image-20220712230431707.webp" alt="image-20220712230431707"></p><p>说到 Mermaid,虽然 Wordpress 原生不自带 Mermaid,但只要装一个插件就能实现支持 Mermaid 流程图,直接在 Wordpress 的应用商店里搜索 Mermaid 即可。</p><h3 id="Typecho"><a href="#Typecho" class="headerlink" title="Typecho"></a>Typecho</h3><p>我采用的 Typecho 主题是 <a href="https://github.com/txperl/Story-for-Typecho">Story</a>,代码高亮功能是自带的,但很遗憾,Typecho 并不支持 Mermaid,同时我似乎没有找到为Typecho 添加 Mermaid 的插件。这意味着我们只能自己去添加这个功能。</p><p>给我等着,我先去学一会 PHP,这事没完!</p>]]></content>
<categories>
<category> 技术 </category>
</categories>
<tags>
<tag> 博客 </tag>
<tag> 工作流 </tag>
<tag> Markdown </tag>
<tag> CSS </tag>
<tag> HTML </tag>
</tags>
</entry>