... no pains, no gains!
2.杂八技术
今天在自己配置的~LAMP~上安装了~phpMyadmin,应该是很简单的,但也花了几十分钟,步骤不难,如下:
#cd /home/www/src/
#wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.10.1-all-languages.tar.gz
#tar xvfz phpMyadmin-2.10.1-all-languages.tar.gz
#mv phpMyadmin-2.10.1-all-languages /home/www/apache2/htdocs/
#cd !$
#ln -sf phpMyadmin-2.10.1-all-languages phpMyadmin
#cd phpMyadmin
#cp config.sample.inc.php config.inc.php
修改~phpMyadmin~目录下面的~config.inc.php~下面几个地方:
$cfg['blowfish_secret'] = 'ZhyFly.Org';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'passwd';
第一行必须填上,随便填写就行,然后最后一行为用户~root~的密码,然后创建~Apache~认证,步骤如下:
#mkdir -p /home/www/apache2/passwd
#/home/www/apache2/bin/htpasswd -c /home/www/apache2/passwd/authpass admin
然后会提示输入用户~admin~的密码,这样访问~phpAdmin~的用户和密码就设定好了,然后还要让~Apache~能知道,因此必须修改~httpd.conf,添加下面一段:
<Directory "/usr/local/apache/htdocs/phpmyadmin">
AuthType Basic
AuthName "myphp"
AuthUserFile /usr/local/apache/passwd/authpass
Require user myphp
</Directory>
最后重启~Apache~就好了:
#/home/www/apache2/bin/apachectl restart
然后通过网址输入:http://ipaddress/phpMyadmin/,输入用户名(admin)及其密码获得网页访问,然后再输入~mysql~的用户名(root)及其密码就可以进入~phpMyadmin~的管理了。
参考(English)
终于读完了~MAXIMA~的一本书了,虽然这本有点过时,但总比读那厚厚的七百多页的~Manual~要容易点,来自~The Maxima Book,Maxima~给出的说明为:
The Maxima Book
This is a very incomplete and in some places out of date user oriented manual. It is a work in progress, but is provided here in the hope it might be useful.
Update: This new version isn't all that different, but it has been updated a bit with regards to plotting and a couple other minor changes. Emaxima and install docs have not been updated yet. Mathematical content is essentially unchanged. Pictures should be of slightly better quality.
看~MAXIMA BOOK,说到了~TeXmacs,于是下来一个~.tgz(源码的编译出现错误)包,装上,试用了下,只能一个字形容了:强!但有的时候还是喜欢~ASCII,呵呵。
恩,竟是碰上错误(还是bug)了,编译~TeXmacs~出现下面的错误:
Guile/Glue/glue.hpp:35: error: new declaration `bool scm_to_bool(scm_unused_struct*)'
/usr/include/libguile/boolean.h:39: error: ambiguates old declaration `int scm_to_bool(scm_unused_struct*)'
make[1]: *** [Objects/evaluate.o] Error 1
make[1]: Leaving directory `/home/flyzhy/Software/Science/TeXmacs/TeXmacs-1.0.6-src/src'
make: *** [TEXMACS] Error 2
找了半天居然没有任何信息,怎么~TeXmacs~里面的这个数据类型和~Guile~库里面的数据类型能定义的不一样呢,我也不知道哪个对,还是到~LinuxPackages~找个现成的版本装上吧。
昨晚看~MAXIMA,提到了画二维图最好用~GnuPlot,而画三维图的时候最好用~Geomview,于是下载其源码,接着编译安装,但在~make~的时候出现下面的错误:
/usr/X11R6/include/GL/glext.h:6952: error: redefinition of typedef 'PFNGLGETUNIFORMUIVEXTPROC'
/usr/X11R6/include/GL/glext.h:6941: error: previous declaration of 'PFNGLGETUNIFORMUIVEXTPROC' was here
到网上搜了下,是~NVIDIA~显卡驱动的一个~bug,于是想下载最新版本,到~NVIDIA~网站下载了最新的~1.0-9755~版本,直接运行~.run~文件,先是提示我的显卡跟这个驱动不匹配,不过是个警告,没太注意,继续,接着后来提示:
ERROR: Unable to load the kernel module 'nvidia.ko'. This is most likely
because the kernel module was built using the wrong kernel source files.
Please make sure you have installed the kernel source files for your
kernel; on Red Hat Linux systems, for example, be sure you have the
'kernel-source' rpm installed. If you know the correct kernel source
files are installed, you may specify the kernel source path with the< br /> '--kernel-source-path' commandline option.
搜索了一下,用下面的命令就好了:
#./NVIDIA-xxx.run -k $(uname -r)
安装后,重启~X,但找不到设备,查看~/var/log/Xorg.0.log,原来的确是开始的警告,这个驱动根本与我的显卡不匹配,我的显卡是:
nVidia Corporation NV11 [GeForce2 MX/MX 400]
提示说只能用~96xx,系列的驱动,然后找个系列的驱动安装,一切顺利!然而再重新编译~Geomview~的时候仍然是那个错误,最后只好手动的修改了那个文件~/usr/X11R6/include/GL/glext.h,把里面的~6941~和~6952~两行注释掉了,然后再编译安装,一切顺利。
据说~NVIDIA~的这个~bug~在最新的~97xx~系列中已经修正,可是我的显卡却只能用~96xx~系列的,可能我的显卡太老了吧 :(。
命令
yes banner ddate cal 9 1752 fortunetac ptx xeyes xev factor vdir shred ctrlaltdel look
Funny Software:
cowsay and cowthink Homepage:
http://www.nog.net/~tony/warez/cowsay.shtml
Description:
Cowsay is the easy way to add speaking and thinking cows (and a few other creatures) to anything. Any message you like, even in large figlet letters, can be rattled off by these ASCII critters. Cowsay comes with over 40 creatures that can be bent to your sick and twisted will. New "cows" can be easily bred by those versed in the appropriate dark arts. Cowsay is more useful than most of the items found in SkyMall catalogues, and a lot less expensive.
#/bin/sh for i in /usr/share/cowsay/cows/* ; do cowsay -f $i `basename $i .cow` done fortune | cowsay -f stimpy
下午去图书馆,爬那睡了几个小时,然后到了自然科学,想看看数学类有什么书,看到一本《从毕达哥拉斯到怀尔斯》(《From Pythagoras To Wiles》),介绍了困扰了数学界~350~年之久的费马最后定理的完结,整个定理的证明过程我搞不太明白,但其中每个关键人物的介绍倒是给了我很大的兴趣,没有吃晚饭,一口气读完了前半部分,从毕达哥拉斯,费马,欧拉,库默尔,高斯,然后几位著名女数学家(吉尔曼,柯娃列夫斯卡娅,诺特),接着现代的法尔廷斯,布朗,谷山和志村,宫冈洋,最后是怀尔斯,无一不是大家风范,从中有几点给我比较深刻的印象。
1,很多虽都是天赋之举,但后天努力和意志力不可忽视,而且个个精力旺盛,比较起来我天天感觉很累的确有些惭愧阿,相比起大师们的那些重举,自己又做了点什么?相比起大师们的严谨的治学态度和对自己苛刻的要求,自己又是如何做的?相比起大师们的旺盛的精神和深入的钻研精神,自己又拥有什么?
2,大师们大都非常爱国,不拘小节,事事显露大家风范,相比起来,为什么中国的留学生却无一返乡救国者?在这里该书的作者对日本的数学以及物理等科学领域的突起做了很深刻的阐述,日本本是较我们差很多,可到19世纪,我们已经开始频繁派遣留学生到日本学习,可知我国的落后程度,而且,对费马最后定理做出重要贡献的几位现代的日本数学家起到了关键的作用,怀尔斯最后就是证明了谷山-志村猜想才得以证明费马最后定理,而当时的日本留学生在到国外的名校留学后一般都是报有回国发展本国的思想而去,而且也的确付诸实施,象东京大学的几位著名数学家应该都是当时受过希尔伯特等数学大家的教导,而令人忧心的是一位数学大家来中国访问时说到中国一名留学生做的不错,后来经查居然回国后到了京汉铁路工作,因跟以色列人发生冲突而被枪杀,多么大的悲哀!
3,在历史上女性真是遭受了多年的不平等待遇,几位著名的女科学家虽有爱国之心,却无报国之路,但她们却始终报有对科学的追求,最后为自己的国家挣得很大的荣誉!
看这样的传记就象通过不同的镜子看我们自己,看我们的社会,看我们的国家,看我们周围的每一个人,希望我们学到知识本身的同时,更学到其中更深邃的东西。
实验室代理服务器的~Squid~过一段时间后总是莫名其妙的不能启动,不知道具体什么原因,但每次把~/usr/local/squid/var/logs/~下的日志文件重建(保留原来相同的文件属性),然后把~/usr/local/squid/var/cache/~目录里的东西全部删除,然后重新启动电脑或者~squid,便可以重新工作,具体原因还不清楚,但如果启动不了的时候,我手动启动时有时会出现类似下面的错误:
2007/05/04 16:03:56| Creating Swap Directories
FATAL: Failed to make swap directory /cache/00: (13) Permission denied
Squid Cache (Version 2.5.STABLE4): Terminated abnormally.
CPU Usage: 0.001 seconds = 0.000 user + 0.001 sys
Maximum Resident Size: 0 KB Page faults with physical i/o: 0
貌似没有权限写~/cache/00~的意思,但用~root~启动~squid~后好像是没有这个错误了,可~squid~还是没有启动起来,到底为什么呢?
昨天在用 Emacs 编辑一个文本时遇到了 矩形区域 操作的问题,一行一行的改真是太麻烦了,于是想这个功能好像以前见过,只是当时没觉得有多大用处,现在想起来有的时候还是很有用的,就像一次注释多行的功能一样,只不过这个是在一个矩形区域了,今天稍微整理了下,找到了 rect-mark.el,看了下该文件开头部分的说明,然后把这个文件放到 Emacs 能找到的地方,添加如下代码到 ~/.emacs 文件:
;;; rect-mark.el
;; ~/Emacs/Extensions/rect-mark.el
(require 'rect-mark)
;
;; Use this section in your "~/.emacs" when rect-mark isn't included
;; as an integral part of Emacs. Don't forget to remove the first
;; three columns.
;; Support for marking a rectangle of text with highlighting.
(define-key ctl-x-map "r\C-@" 'rm-set-mark)
(define-key ctl-x-map [?r ?\C-\ ] 'rm-set-mark)
(define-key ctl-x-map "r\C-x" 'rm-exchange-point-and-mark)
(define-key ctl-x-map "r\C-w" 'rm-kill-region)
(define-key ctl-x-map "r\M-w" 'rm-kill-ring-save)
(define-key global-map [S-down-mouse-1] 'rm-mouse-drag-region)
(autoload 'rm-set-mark "rect-mark"
"Set mark for rectangle." t)
(autoload 'rm-exchange-point-and-mark "rect-mark"
"Exchange point and mark for rectangle." t)
(autoload 'rm-kill-region "rect-mark"
"Kill a rectangular region and save it in the kill ring." t)
(autoload 'rm-kill-ring-save "rect-mark"
"Copy a rectangular region to the kill ring." t)
(autoload 'rm-mouse-drag-region "rect-mark"
"Drag out a rectangular region with the mouse." t)
;; Use this section in your "~/.emacs" to modify picture mode so that
;; it automatically uses the rect-mark equivalents of many commands.
;; One vision of a better picture mode.
(add-hook 'picture-mode-hook 'rm-example-picture-mode-bindings)
(autoload 'rm-example-picture-mode-bindings "rect-mark"
"Example rect-mark key and mouse bindings for picture mode.")
其操作就是在普通区域操作的前面加上
C-x r
比如:
标记: C-x r C-S-@
复制: C-x r M-w
剪切: C-x r C-w
当你习惯了 Emacs,你不需要再用别的任何编辑工具了!
现在想用 Subversion 来管理 MIT OCW 的翻译项目,下面是 HTML 和 WordPDF 的整体布局:
/svn/ocw_mit/
HTML/
trunk/
branches/
tags/
WordPDF/
trunk/
branches/
tags/
创建过程如下:
#mkdir -p /svn/ocw_mit
#mkdir ~/tmpdir
#cd ~/tmpdir
#mkdir -p HTML/trunk
#mkdir -p HTML/branches
#mkdir -p HTML/tags
#mkdir -p WordPDF/trunk
#mkdir -p WordPDF/branches
#mkdir -p WordPDF/tags
然后把需要翻译的 HTML 文件和 PDF 文件分别放到 ~/tmpdir/HTML/trunk/ 和 ~/tmpdir/WordPDF/trunk/ 里面,再执行:
#svnadmin create /svn/ocw_mit
#cd ~/tmpdir
#svn import . file:///svn/ocw_mit --message "Initial MIT OCW Project repository."
... ...
#cd ..
#rm -rf tmpdir
#svn list --verbose file:///svn/ocw_mit
... ...
其他很多东西需要以后边用边体会了。