Tips about writing a manpage
From des@:
groff -Tlatin1 -mdoc strtonum.3 2>&1 | less
A even better version from ru@:
cd /usr/src/lib/libc
make manlint MAN=strtonum.3 # to check stderr
make all-man MAN=strtonum.3 -DMANBUILDCAT # to format
共 127 篇文章。
From des@:
groff -Tlatin1 -mdoc strtonum.3 2>&1 | less
A even better version from ru@:
cd /usr/src/lib/libc
make manlint MAN=strtonum.3 # to check stderr
make all-man MAN=strtonum.3 -DMANBUILDCAT # to format
将个性化的factory提取出来,改为使用通用的factory生成同一协议的protocol对象,并将业务逻辑对象作为factory的一个参数。这样做使得代码冗余大大降低了。
以前一直以为不行的,今天仔细看了一下manpage:
如欲让sysctl之后能使用tab补齐,则应使用:
complete sysctl ’n/*/`sysctl -Na`/'
试了一下,不错!
算是生活常识吧。记两笔。
今天 renzhen 同学问起为什么很多宏都定义为 do { something… } while(0),我也顺便温习了一下。
简而言之:如果希望宏表现的和函数接近,就需要这样做。
原来是 environ(7),今天看col(1)偶然发现的……
有时,我们会希望扩展一些现有的C代码。这些代码可能经历了相当久的运行考验——它们至少目前工作起来没有问题——然而,它们可能存在各种各样的问题,比如:
要扩展这类代码是一件有挑战的事情。
没啥技术含量,做个笔记而已。
相关日志如下:
Jan 11 22:19:02 tarsier postfix/postfix-script: stopping the Postfix mail system
Jan 11 22:19:02 tarsier postfix/master[92875]: terminating on signal 15
Jan 11 22:19:02 tarsier postfix/postfix-script: starting the Postfix mail system
Jan 11 22:19:02 tarsier postfix/master[70250]: daemon started – version 2.2.8, configuration /usr/local/etc/postfix
学习一种语言最快的方法就是逼自己干什么事情的时候都用它——有一个利用了Python来实现的shell——iPython,可以用来代替默认的shell。
Just for reference for future upgrades.
Today I managed to upgrade from OpenLDAP 2.2.29 to OpenLDAP 2.3.11. This is a large upgrade, so all and foremost thing is to backup. Additionally, to keep downtime as less as possible, build these stuff first!
On FreeBSD, the recommended way of installing third party software is to use ports(7). Note that OpenLDAP is separated into two ports, openldap2X-server and openldap2X-client, and building the server requires the client library, therefore, you can not easily do build on the production server (and this SHOULD be avoided anyway).
A solution is to use a separated box (or jail for smaller deployments), to build packages and use pkg_add to install them.