argus.py 可以仍是昔日素心悠游的少年

argus.py 可以仍是昔日素心悠游的少年有的时候, 会扫一眼来信的签名。有的是纯工作单位和联系电话, 如偶像的; 有的啥也没有, 连"这个人很懒,
什么也没有留下"也没有; 有的是莫名其妙的名字, 也不知道啥意思, 如果来
信是讨教问题的, 就感觉像是蒙个猪头的家伙闯入你家门, 问"你说我这病咋治
", 你说我要把下脉, 对面的先生大摇其头, 说可不能让你见了我的真面目。签名各种各样, 没创意的居多。而建一每次的签名总能让我目光停留。 所以,
私底下以为, 这个工程师的心底里是个文学青年。建一的某个签名是: 我已不是昔日素心悠游的少年。其实, 你可以是的, 永远都可以。We carry our laptop computer to different places, such as workshop,
office, home, etc., where we connect it with different monitors. We
click the mouse to setup the resolution, position, ratation for every
monitor repeatly.With Arugus, the untility for saving your current setting of
display/monitor, you can collect automaticlly for all the
display/monitor connected to your computer into a shell code, which
later you can run to restore the setting.What you need is just remember the name of the shell code, which
brings you all the information of your favorate working environment as
soon as you run it.An simple example is as the follow.I have a Dell display in 23 inch, which can rotate vertically for
programmer easilly browsing a large scale of code with out pagedown
or pageup, as well as rotate horizantally for watching movie without
black edge.I turn the monitor left, before setting up the layout (position and
mode and rotation) for it with System->Monitors in Ubuntu. Then, I run: ~ $ arugus.py -s programming.shto cteate a file named programming.sh excutable.: ~ $ cat programming.sh
: #!/bin/bash
: xrandr --output VGA1 --pos 0x0 --mode 1920x1080 --rotate left
: xrandr --output LVDS1 --pos 0x1920 --mode 1280x800 --rotate normalI turn the monitor horizatally, then also set up the current layout
manually with GUI System->Monitors. I save the current setting as movie.sh.
: ~ $ arugus.py -s movie.sh
: ~ $ cat movie.sh
: #!/bin/bash
: xrandr --output VGA1 --pos 0x0 --mode 1920x1080 --rotate normal
: xrandr --output LVDS1 --pos 248x1080 --mode 1280x800 --rotate normalOnce completed the steps above, we can switch the working condition
with running the corresponding shell code.When I watch movie,: ~$ ./movie.shwhen I input code,: ~$ ./programming.shIn my office, in my classroom with projector, or in my workshop, I can
switch my laptop to the suitable state.We can return whatever we have been, if we remember. Yesterday once
more.Dependency:xrandr, you usually have.python, you usually have.bash, you usually have.

有事要吱声

有事要吱声计算机输入输出的时候,传统上有三种方法。一种是轮询,类似于每隔一会就上人人上瞧一眼,哪个好友又抽疯更新状态了;一种是中断,类似于有同学在人人网给你留言,你不用总花CPU时间去看,而是人
人网主动的发封邮件给你,而你有邮件通知工具,一收到邮件你机器就叫唤。于
是你脱离工作状态,上人人。另一种是DMA通道,类似于你后台下载一大推VERYCD的东西,前台不耽误看碟。如果不是批量的话,很多场合,我们希望是中断方式,不幸的是,很多时间恰恰
要轮询。是不是有人强迫症到半夜起来上厕所还要收下邮件看看QQ的?工程上也一样。俺们使用git做版本控制,长时间以来,我每天pull一次。然后看看同学们有啥
进度。SVN很久以前就提供一个好功能,有人更新代码的话,会给大家发封邮件。为啥
不是QQ消息呢?因为电子邮件是因特网中三个核心技术之一,QQ不是的。其实git也可以提供类似的功能。一年左右以前,我试把了一次,失败了。前一段时间跟李记者和典典烤肉,又提起这个。话说,我们仨谈不完的话题恰恰
是技术本身。本次会面,就先友好地把ipad和kindel等东西拿出来,大家显摆一
翻。还有口头上提到的8G内存啥的。典典说,他们公司也用git管理版本,有邮件通知功能。我又活了心,回家歇了
几天,整些俗务,然后又回过头投入到美好的git geek生活中。其实邮件通知说起来也容易调。有个hooks目录,往里面拷一个post-receive-email,然后配置一下。事情就成
了。不过这只是说起来。我发现一个规律,越是简单的,越是有N多人写了或抄了相同
的教程的,我调起来总是失败的次数越多。直接读文档,反倒好一些。其实上面的描述里,有好几个陷阱, 或者太过简单, 写教程的人不太提。1. 那个hooks目录是服务端(比如安装gitosis的那个)的,不是客户端的.更严格的说,是大家一起向它
push的那个git,而且大家相互之间不会push.这是手册上说的.2. post-receive-email一般已经跟git一起安装了,不用到处找,在你硬盘上.通
常在
: /var/git/repositories/gittest.git/hooks/post-receive
或者这样查到
: ~/git/gittest $ dpkg -L git | grep post-receive-email
: /usr/share/doc/git/contrib/hooks/post-receive-email3. post-receive必须是可执行4. sendmail 必须启动我上次可能就栽在这上面了.不清楚为什么在我的Ubuntu下,不启动sendmail,也能发出邮件。: sendmail -t < mailbody.txt服务端CentOS,需要启动sendmail: /etc/rc.d/init.d/sendmail start
以上.此外,push的时候发现,使用git也有文件系统编码的问题.原来的git都是gbk的,而今我投奔了utf8.于是,git自动把N多文件名都复制一
份,改成了UTF8的.唉,跟SVN的做法没啥区别.网上大家都建议所有成员一起用linux.暂时估计还不行.刘同学正试windows下的
utf8 git,等消息中.一个收获.sendmail -v
查看详细信息, 包括发送邮件的过程, 用于确定问题的原因.要想知道问题的原因,当然,不仅要知道如何看,如上,还要知道那些信息到底
是什么意思.这就得看理论书了.
配完了以上这些东西,git终于能在有事的时候就发邮件了.有事吱声,不用成天去看了.尤其是成天看,却不见更新.顺便说一嘴,春晚的"喜欢你就抱抱我亲亲我爱爱我",把我恶心够呛.你事怎么就
这么多呢.知道为什么把WINDOWS下的杀毒软件一个个都杀了么?因为它们太事多,打扰人工
作.干点活就成天叫唤"我又给你杀了个病毒".杀了就杀了,你以为我留着你干嘛
的,打呼噜翻跟斗的?"你的计算机打败了全国XX台计算机",我同意你测了么?
测量是占用启用时间的,显示这条没用的消息是占用我的显示器的.有事你就吱声.但是,前提是有事.如果你成天让我轮询,我就让你闭嘴.