博客重启
Hexo博客重建为啥还是Hexo博客之前是使用Hexo+Github Page搭建的
使用Github Page肯定是没有问题,因为只有白嫖的东西才能持久运行,国内访问速度不关键,常年你懂的
至于静态内容生成框架,有考虑过Hugo,因为生成速度比Hexo快很多,调试方便,同时安装起来比较方便(npm那堆东西恶心一批)。但是Hexo众多主题还是留住我了哈哈哈(真香警告)
新的主题之前的配置博客已经很久了,很多东西已经忘记了,所以这次打算重新配置下,使用新的主题,新年新气象。
hexo-theme-butterfly功能丰富的Hexo博客主题Features:
卡片式两栏 UI 设计
响应式布局
支持搜索和 TOC 展示
可自定义博客主题色
支持 Disqus、Gitalk、Valine、Waline 等评论系统
丰富的动画效果
内置 Mathjax 和 Katex
Butterfly 主题的开发基于 Melody 主题,在此基础上做了两栏设计,并带来了很多一眼看不出的实用功能。同时,作者也提供了一些文档便于大家安装和使用,涵盖入门至进阶需求。但我认为这些文档不够连贯,有些功能也没 ...
CMU213-CSAPP-Virtual-Memory-Systems
18-Virtual-Memory-SystemsSimple memory system exampleAddress Translation Example #1
PPN实际不存在页表中
MMU做的第一件事是检查TLB,将VA中的VPN的TLBI(0x3)和TLBT(0x03)提取出来。所以会去查set3找到tag为3的line,找到对应的line并且valid为1,TLB将PPN(0D)返回给MMU
MMU使用0D构建物理地址。将VA的VPO复制到PA的PPO,0D作为PA的PPN,由此构成了一个物理地址
将地址发送给cache,提取出CI(0x5)、CT(0x0D),所以会去查set5找到tag为0xD的line,找到并且valid为1,因为CO为0,所以找到B0(36)
cache将该字节通过MMU返回给CPU,并将其存到一个寄存器中。
Address Translation Example #2
VA中的VPN的TLBI=TLBT=0,TLB的set=0&tag=0的line的valid=0,TLB miss
通过VPN=0查找页表,valid=1有效,内存将 ...
CMU213-CSAPP-Virtual-Memory-Concepts
17-Virtual-Memory-ConceptsPhysical and Virtual Addressing
Main memory: an array of M contiguous(连续的) byte-size cells(单元). Each byte has a unique physical address (PA) {0, 1, 2, 3 … }
The most natural way for a CPU to access memory would be to use physical addresses. We call this approach physical addressing.
When the CPU executes the load instruction, it generates an effective physical address and passes it to main memory over the memory bus. The main memory fetches the 4-byte word s ...
玩客云部署beancount-telegram-bot
玩客云捡垃圾,40块钱还行,民间大佬弄出了刷Linux的方法,可惜是32位,不过也凑合用,比斐讯N1折腾了那么一点。
beancountbeancount介绍可以看下面几个文章,整挺好。之前是用ios端的Moze3,感觉还是差了点意思。
Beancount复式记账(一):为什么
复式记账指北(三):如何打造不半途而废的记账方案
使用 Beancount 管理家庭财务 · 构建我的被动收入
使用 Costflow 提高 Beancount 记账效率
bot-docker这里推荐使用kaaass/beancount_bot_costflow_docker,参考上面第二篇文章,里面有详细说明。不过上面的镜像只支持64位,只能自己弄32位的docker镜像。
Dockerfile从beancount_bot_costflow_docker的Dockerfile修改而来
12345678910111213141516171819202122232425262728FROM alpine:3.6WORKDIR /appADD requirements.txt /appENV PYTHONUNBU ...
Golang-GC笔记-GC-Traces
来源:https://www.ardanlabs.com/blog/2019/05/garbage-collection-in-go-part2-gctraces.html
开关GC的对比有一个从不同的新闻提供商下载RSS并搜索的应用程序
在关闭GC的情况下测试并发请求应用程序耗时情况
12345$ go build$ GOGC=off ./project > /dev/null# 10k requests using 100 connectionshey -m POST -c 100 -n 10000 "http://localhost:5000/search?term=topic&cnn=on&bbc=on&nyt=on"
处理10k个请求需要4188ms,每秒处理约2387个请求
在开启GC的情况下呢,
123456$ GODEBUG=gctrace=1 ./project > /dev/nullgc 3 @3.182s 0%: 0.015+0.59+0.096 ms clock, 0.19+0.10/1.3/3.0+1. ...
Golang笔记-Fan-in
来源:https://go.dev/talks/2012/concurrency.slide
The boring function runs, like a boring party guest.
12345678910111213func boring(msg string) { for i := 0; ; i++ { fmt.Println(msg, i) time.Sleep(time.Duration(rand.Intn(1e3)) * time.Millisecond) }}func main() { go boring("boring!") fmt.Println("I'm listening.") time.Sleep(2 * time.Second) fmt.Println("You're boring; I'm leaving.")}
A channel connects the main and boring ...
Golang笔记-Pipelines-and-cancellation
来源:Go Concurrency Patterns: Pipelines and cancellation - The Go Programming Language
What is pipeline
receive values from upstream via inbound channels
perform some function on that data, usually producing new values
send values downstream via outbound channels
Squaring numbers
Generator Pattern converts a list of integers to a channel that emits the integers in the list
12345678910func gen(nums ...int) <-chan int{ out := make(chan int) go func() { for _, n := range nums{ ...
Golang-GC笔记-Semantics
来源:https://www.ardanlabs.com/blog/2018/12/garbage-collection-in-go-part1-semantics.html
Garbage collectors responsibility
tracking heap memory allocations
freeing up allocations that are no longer needed
keeping allocations that are still in-use
As of version 1.12, the Go programming language uses a non-generational concurrent tri-color mark and sweep collector.
非分代并发三色标记和扫描收集器
Collector Behaviorcollection工作会经历三个阶段
Mark Setup - STW(Stop The World)
Marking - Concurrent
Mark Termination - STW
M ...
MIT6.824-LEC11-Cache-Consistency-Frangipani
为什么要阅读这篇论文
cache coherence
distributed transactions
distributed crash recovery
三者的相互作用
整体的设计
a network file system,与现有的应用程序共同工作,类似普通的unix程序。可以将petal想象成一个磁盘,通过网络将数据共享给Frangipani,看起来就像从普通磁盘上读取数据
预期用途
一个文件系统,能保存自己的home目录以及共享的项目文件,在任何的workstation(可以理解是个人PC)能拿到自己的home目录以及所需要的所有文件。
没有涉及到安全问题,彼此电脑之间互相信任,适用于小群体
Frangipani的设计
强一致性
caching in each workstation — write-back
所有对文件的更新最初只是在workstation cache中完成—速度快
包括创建文件、目录、重命名等
比如ws1(workstation user 1)想要创建并读写/grades:Frangipani会从Petal读取/infomation的信息并保存到ca ...
MIT6.824-LEC10-Cloud Replicated-DB-Aurora
为什么要学习Aurora
作为近几年成功的云服务,解决了严重的问题
设计良好,有性能的优势
使用general-purpose storage架构情况下的局限性
许多关于云基础架构中重要的内容
Amazon EC2,cloud computing,针对于web
租用直接运行在Amazon数据中心物理机器上的virtual machines instances
使用的存储是连接在物理磁盘上的virtual local disk
客户在EC2上面运行着stateless www server或者DB
但是EC2不适合DB:扩展功能和容错功能有限(可以通过S3大容量存储服务定期存储数据库的snapshot)
Amazon EBS (Elastic Block Store)
使用的是Chain Replication,基于paxos的configuration manager
如果DB EC2崩溃,只需要在另一个EC2上面重新启动一个DB并挂载同一个EBS volume
EBS不是shared storage,只能由一个EC2挂载
DB-on-EBS缺点
需要通过网络发送大量数据—l ...