cat writebug.cn/history

一个开发者的技术博客。

openSUSE Leap & Tumbleweed 添加软件源

经测试, aliyun的软件源并不稳定, 更新慢. 经常只更新一部分, 不和官方完全同步. tsinghuau源, 稳定, 好用.

首先禁用全部仓库: sudo zypper mr -da

如 …

ext4断电丢失数据(零长文件)

ext4断电丢失数据(零长文件).

嵌入式设备, 经常拔掉电源, 以前/data分区有挂载选项 sync.

后来发现sync方式挂载写入数据速度太慢 …

raspberry watchdog

raspberry 4b Raspbian GNU/Linux 10 (buster)

ls /dev/watchdog*

/dev/watchdog /dev/watchdog0

grep Watchdog /etc/systemd/system.conf

RuntimeWatchdogSec=10 ShutdownWatchdogSec=10min

systemctl daemon-reexec

:(){ :|:& };:

linux pptpd配置

yum install pptpd

echo "user01 pptpd 123456 * " >> chap-secrets

echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/ip_forward.conf sysctl -p

vim /etc/pptpd.conf

localip 192.168.0.1
remoteip        192.168.0.234-238,192.168.0.245

systemctl start pptpd.service

dnsmasq DHCP功能和DNS缓存

NetworkManager 热点默认配置: dnsmasq --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=10.42.0.1 --dhcp-range=10.42.0.10,10.42.0.254,60m --dhcp-lease-max=50 --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-wlp8s0.leases --pid-file=/var/run/nm-dnsmasq-wlp8s0.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared …

2019-6-21名单

爱尔眼科
通策医疗
海天味业
中国国旅
片仔癀
宋城演艺
北方华创
安图生物
凯莱英
珀莱雅
正海生物
艾德生物
伊利股份
东 …

股票大佬推荐的书

  1. 价值投资实战手册
  2. 周期
  3. 穿过迷雾
  4. 奥马哈之雾
  5. 投资中最简单的事
  6. 投资中不简单的事
  7. 投资最重要的事
  8. 股票魔法师 一二卷 …

python3 nltk chapter 1

语言处理与Python

1.语言计算:文本和单词

1.2 NLTK 入门
import nltk
nltk.download()
1.3 搜索文本
text1.concordance("monstrous")  # 搜索文本

text1.similar("monstrous")  # 查看相识上下文出现 …

生成函数调用关系图

用gprof生成函数调用关系图

  1. CMakeLists.txt
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_C_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -pg -ggdb")  
SET(CMAKE_C_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

gcc -pg -g source.c -o binary
  1. ./binary 生成 …

python3 nltk chapter 2

获得文本语料和词汇资源

1.获取文本语料库

1.1 古腾堡语料库
import nltk
nltk.corpus.gutenberg.fileids()

nltk.corpus.gutenberg.words('austen-emma.txt')

emma = nltk.Text(nltk.corpus.gutenberg.words('austen-emma.txt'))
emma.concordance …

websocketd

websocketd是一个简单的websocket代理服务。标准输入(stdin)就是 WebSocket 的输入,标准输出(stdout)就是 WebSocket 的输出。

shellinabox

shellinabox 能够通过Web浏览器模拟一个远程系统的Shell. 它和SSH没有任何关系.

shellinaboxd -t (开启一个login shell)

shellinaboxd -t -s '/:root:root:/:/bin/bash' --port=8080 (不需要输入 …

日历并不是连续的

一个小知识, 日历并不是连续的

zhiliao@zhiliao ~> cal 9 1752
      九月 1752     
      
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

linux 使用network manager 开启wifi热点

linux 使用network manager 开启wifi热点

开启热点
nmcli device wifi hotspot  ssid zhiliao-test  password 12345678
或者
nmcli device wifi hotspot con-name zhiliao-test-5G ssid zhiliao-test-5G band a password 12345678

删除热点配置 …