netty Reactor 模式

netty Reactor模式 Reactor模式的角色构成(Reactor模式一共有5中角色构成): Handle (句柄或描述符,在Windows下称为句柄,在L

golang MP4文件服务器

golang MP4 文件服务器 https://studygolang.com/articles/11204 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 package main import ( "github.com/gorilla/handlers" "log" "net/http" "os" "time" ) func ServeHTTP(w http.ResponseWriter, r *http.Request) { video, err := os.Open("/tmp/foo.mp4") if err != nil { log.Fatal(err) } defer video.Close() http.ServeContent(w, r, "foo.mp4", time.Now(), video) } func main()

termite

termite vim ~/.config/termite/config font = Source Code Pro 10 Termite是一种基于VTE的最小终端仿真器,它是一个模态应用程序,类似于Vim,具有插入模式和选择模式,其中键绑定具有

go new make

go new make https://sanyuesha.com/2017/07/26/go-make-and-new/ new 和 make 都可以用来分配空间,初始化类型,但是它们确有不同。 new(T) 返回的是 T 的指针 new(T) 为一个 T 类型新值分配空间并将此空间初始化为 T 的零值,返回

Making ipset,iptables persistent

Making ipset,iptables persistent 1 2 3 4 5 ipset save > /etc/ipset.conf systemctl enable ipset.service iptables-save -f /etc/iptables/iptables.rules systemctl enable iptables.service https://wiki.archlinux.org/index.php/Ipset https://wiki.archlinux.org/index.php/Iptables

数据库事务, 锁

数据库事务, 锁 数据库锁 因为数据库要解决并发控制问题。在同一时刻,可能会有多个客户端对同一张表进行操作,比如有的在读取该行数据,其他的尝试去删

0day

0day 0day,中文意思"0日/零日"或"零日漏洞"或"零时差攻击”, 零日这个词历

upgrade和update的区别

upgrade和update的区别 upgrade一般是指比较重要的升级,或者说是主要的,单独版本的升级,其中软件改变很大,比方说从windo

CPU steal time

CPU steal time Steal Time(st),用来衡量被虚拟机监视器(Hypervisor)偷去给其它虚拟机使用的 CPU 时间所占的比例。 https://blog.csdn.net/jessysong/article/details/73571878 Netflix 很关注 CPU 的 Steal Time。他

svn diff

svn diff 转载于: http://blog.sina.com.cn/s/blog_4e5668630100ag2u.html http://www.upsdn.net/html/2004-12/65.html $ svn diff -r 2:3 rules.txt (1)Index: rules.txt (2)=================================================================== (3)- rules.txt (revision 2) (4)+++ rules.txt (revision 3) (5)@@ -1,4 +1,4 @@ (6)Be kind to others (7)-Freedom = Chocolate Ice Cream (8)+Freedom = Responsibility (9)Everything in moderation (10)Chew with your mouth open 第一行,显示文件 第二行,分隔符 第三行,老版

MySQL update in

MySQL update in 1 2 3 4 5 6 7 8 9 10 11 12 EXPLAIN UPDATE table0 w SET w.field0 ='foo' WHERE (w.key0,w.key1,w.) IN ( SELECT a.* FROM ( SELECT w1.key0,w1.key1,w1.key2 FROM table0 w1 WHERE w1.field0 IS NULL AND w1.key2=0 LIMIT 10) AS a ); 1 2 3 4 5 6 EXPLAIN UPDATE table0 w0 JOIN (SELECT *FROM table0 w1 WHERE w1.field0 IS NULL AND w1.

MySQL update 嵌套 select

MySQL update 嵌套 select 当你希望更新一批值,且值是通过select条件查询出来时,下面这个错误应该不陌生 You can’t specify target table ‘x’ for update in FROM clause。 错误示范 1: A B 有

Screeps

Screeps https://screeps-cn.github.io/introduction.html https://github.com/rustyscreeps/screeps-game-api https://twodam.net/Tutorial-for-Screeps-0 https://github.com/aphistic/screeps-deployer https://github.com/rustyscreeps/screeps-starter-rust https://github.com/hinshun/screepsapi

toml

toml https://toml.io/cn/ 1 2 # comments java https://github.com/mwanji/toml4j goland https://github.com/pelletier/go-toml/tree/v2

slf4j 打印java异常堆栈信息

slf4j 打印java异常堆栈信息 SLF4J 1.6.0以前的版本,如果打印异常堆栈信息,必须用 log.error(String msg, Throwable t) log.info等对应方法. 如果msg含有变量,一般用