GIMP 使用
ctrl-a 全选 ctrl-shift-a 取消选区 ctrl-c 复制选区像素 ctrl-x 剪切选区像素 shift-s 自由调整选区像素 shift-alt-drag 拖动选区像素 shift-ctrl-drag 复制并拖动选区像素 Layer / Transparency / Alpha to Selection 选择透明区
2019-03-21   schedule 20 s  
从源代码构建 go
有多种方法从源代码构建 go,其中的关键是准备自举所需的工具链。 gcc 构建 go1.4 并实现自举 go1.4 是最后一个使用 C 语言实现 go 工具链的版本
2019-03-21   schedule 4 min 31 s  
查找 unix socket 所属的进程
~# ss --unix -a -p Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port u_str LISTEN 0 100 private/bounce 19084 * 0 users:(("master",pid=1550,fd=35)) u_str LISTEN 0 5 /var/run/ceph/ceph-osd.0.asok 73473 * 0 users:(("ceph-osd",pid=5441,fd=19)) u_str LISTEN 0 10 /var/run/NetworkManager/private-dhcp 23562 * 0 users:(("NetworkManager",pid=2697,fd=17)) ... ~# fuser ceph-osd.0.asok /run/ceph/ceph-osd.0.asok: 5441
2019-03-20   schedule 12 s  
audit2allow
通常来说,我们会通过手写 fc(file context)、te(type enforcement)定义来生成 SELinux 规则模块,但在
2019-03-19   schedule 2 min 52 s  
yaml 文档 中的 & * << 语法
今天看到如下的一个 yaml 文档: color: neutral: white: &color-white '#ffffff' background: color: primary: *color-white 初次见到确实很难以理解,其实 & 和 * 分别是 yaml 规范中的 anchor 和 reference 语法,另外还有一种 extend
2019-03-19   schedule 1 min 20 s  
hashicorp raft
raft 是 paxos 分布式一致性协议的简化版本,常见的 raft C++ 实现有 baidu 的 braft,golang 实现有 hashicorp 独立的 raft 代码库,也有 etcd 中的 raft pac
2019-03-18   schedule 2 min 53 s  
使用 audit 定位文件访问进程
有时可能会存在需要定位是哪个进程访问了文件的需求,使用 audit 可以实现该需求。 ~# rpm -ql audit ... /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d /etc/audit/rules.d/audit.rules /sbin/audispd /sbin/auditctl /sbin/auditd /sbin/augenrules /sbin/aureport /sbin/ausearch /sbin/autrace /usr/bin/aulast /usr/bin/aulastlog /usr/bin/ausyscall /usr/bin/auvirt /usr/lib/systemd/system/auditd.service ... auditctl 命
2019-03-16   schedule 3 min 8 s  
consul 学习
consul 分 server、client 两种角色,其中 server 可以理解为 rpc server、它也是 raft quroum 中的成员,而 client 可以理解为 rpc client
2019-03-15   schedule 3 min 2 s  
scalar type
a scalar is a fundamental except it cannot be void, but it can be a pointer type, or an enum type. And a fundamental has a keyword in the language. template< class T > struct is_scalar : std::integral_constant<bool, std::is_arithmetic<T>::value || std::is_enum<T>::value || std::is_pointer<T>::value || std::is_member_pointer<T>::value || std::is_null_pointer<T>::value> {}; 参考资料 Type Classification http://howardhinnant.github.io/TypeHiearchy.pdf What is a scalar Object
2019-03-12   schedule 21 s  
LP64
参考资料 64-Bit Programming Models: Why LP64? http://www.unix.org/version2/whatsnew/lp64_wp.html Twice the bits, twice the trouble: vulnerabilities induced by migrating to 64-bit platforms https://blog.acolyer.org/2016/11/17/twice-the-bits-twice-the-trouble-vulnerabilities-induced-by-migrating-to-64-bit-platforms/ Data model https://www.viva64.com/en/t/0012/ Data structure alignment https://en.wikipedia.org/wiki/Data_structure_alignment
2019-03-05   schedule 8 s