Makefile简介

网络上关于 makefile的教程有很多,由于我日常不是写c/c++的, 不常使用makefile,需要用的时候总是要重新Google搜索makefile的语法。 ...

July 27, 2018 · datewu

事件驱动

在shell脚本里使用mkfifo命令创建named pipes可以实现简单的事件驱动, 避免poll(轮询)带来的时延(not real-time)和资源消耗的问题。 ...

June 27, 2018 · datewu

vim配置

使用vim有7,8年了,整理一下自己用到的vim配置,方便自查。 vim basic 基本设置,语法高亮,行号,等等: 1 2 3 4 execute pathogen#infect() syntax on filetype plugin indent on set number paste 复制粘贴: disable auto indent 1 set paste Notice the “– INSERT (paste) –” at the bottom of the Vim window. ...

May 14, 2018 · datewu

配置vscode eslint

离职一段时间了,需要自己写点前端代码。 奈何vim的js插件对jsx的支持不太友好,所以转向vscode写点jsx。 写了些react app代码后,IDE到处飘红色的波浪线〰️〰️〰️,很是恼人。 ...

April 16, 2018 · datewu

分页打印日志

默认配置命令git log会在新的窗口打印日志内容,需要敲一下键盘q 才能返回当前目录,不方便连续查看: 1 2 3 4 5 6 7 8 9 10 11 12 ➜ lgthw_orign git:(otherbranch) git log --oneline --decorate --all --graph ## NOTE content below will be displayed on new window/buff * 40303b7 (HEAD -> otherbranch) thirdcommit | * 3e6e2f7 (master) secondcommit |/ * f40475e (tag: firstcommittag) firstcommit (END) ## press `q` to exist ➜ lgthw_orign git:(master) git log --no-pager fatal: unrecognized argument: --no-pager 可以把默认的分页改为inline模式,可以更快的查看连续的日志: ...

April 14, 2018 · datewu

init优先级

假设一个golang项目的三个源文件a.go,b.go, c.go,都定义了function inint(){}函数, 其中c.go文件初始化了一个全局变量globalVar,同时a.go 或者b.go的init func 引用了这个全局变量globalVar。 ...

January 23, 2018 · datewu

脚本注入

使用opkg安装软件时,常常需要对候软件包进行初始化或者自定义化操作,这种开发需求一般写给shell脚本就可以对付了。 现在的问题是当这些脚本多了之后,原作者也不愿意修改安装包,我们怎么分发这些自定义的脚本,能不能把自定义的这些脚本编译到opkg包里? ...

June 18, 2015 · datewu

增加固件大小

很多路由器的flash容量只有4m大,所以绝大多数openwrt固件也是4m大小。 当我们手动改造路由器加大flash容量后,可以调整openwrt默认设置使得编译出来的factory可以有8m的大小, 从而安装更多的内置软件。 ...

May 7, 2015 · datewu

刷机HG255d

交叉编译 在ubuntu下安装编译工具(gcc,xmllib,cmake, git 等); git克隆openwrt仓库:git clone git://git.openwrt.org/14.07/openwrt.git; 自定义kernel target: 源代码做两处修改 : ...

March 17, 2015 · datewu

Google Domain

刚刚在google+上看到google 推出了自己的域名注册服务,截两张图,纪念下。 google推广自己的 com.google 域名注册托管服务,把首页变成了镜像模式 ...

June 17, 2014 · datewu