参考:http://bobpeers.com/linux/vnc.php 1:安装 vnc vnc-server b9f76f102e3fe8751f55c5da6b5b733e000 2:添加用户 /etc/sysconfig/vncservers 配置文件的最后两行去掉注释: VNCSERVERS=”1:bobpeers” VNCSERVERARGS[1]=”-geometry… Read the rest of this entry
Archive for the ‘Linux’ Category
[Shell编程] Shell 笔记
1:保存命令的结果 $(ls -l /) 或者 `ls -l /` 2:判断 [[]] 与 [] [ -z $(ls -l /)] 或者 test 一个目录是否为空: [[ -z $(ls /a)]]||&&echo empty|| echo “not empty” 3:$(()) 算数运算 VAR=1 VAR=$(($VAR+1)) echo $VAR 4:while 循… Read the rest of this entry
[AMP] mysql 字符编码
现在mysql又遇到乱码的问题了! 现在整理如下: 1:查看mysql的字符编码 登陆mysql,用status查看: b9f76f102e3fe8751f55c5da6b5b733e004 或:show variables like ‘collation_%’; show variables like ‘character_set_%’; 2:修改mysql的字符编码 /et Read the rest of this entry
[Shell编程] 字符编码转换的脚本
程序中遇到汉字真是麻烦,弄的程序原本是gbk或者是gb2312的。现在服务器上都是utf-8,汉字全是乱码。只好写个shell,来自动转换。 b9f76f102e3fe8751f55c5da6b5b733e005 有两个难点,就是在判断是不是文本文件还有原来的编码的问题。先 Read the rest of this entry
[Linux] Linux同步时间
Linux服务器的时间不是太准,就同步下时间: 0 0 * * * /usr/sbin/ntpdate time.nist.gov&& /usr/sbin/hwclock -w 太简单了,只用两个命令就搞定了。!^_^ 或者是 ntpdate -u pool.ntp.org 上面的服务器好像是不管用了。 ps: 我好不容易写的那么多 Read the rest of this entry
[AMP] htmlentities函数导致中文乱码
再用 PHP Navigator 的时候,发现不能正常浏览中文字符。 它的代码很简单,因为我也能看懂了。最后定位到filestatus这个函数,它用来显示文件的一些属性。然后再找到显示文件名的地方,其实是个变量$filename: b9f76f102e3fe8751f55c5da Read the rest of this entry
[Shell编程] shell 参数替换
今天在分析一个shell脚本的时候遇到了一个变量 ${2:15}。经我查阅shell经典参考书ABS后,得到如下解释: ${var:pos} 变量从位置pos开始扩展。 说得很抽象,我就自己弄了个例子: b9f76f102e3fe8751f55c5da6b5b733e007 结果一目了然,就是取某 Read the rest of this entry
[Shell编程] 我要自己动手做个网站
我要自己做个网站,用shell scripts写cgi程序。 先记录下cgi的环境变量 CGI Environment Variables Environment variables are a series of hidden values that the web server sends to every CGI program you run. Your program can … Read the rest of this entry
[Linux] TCP Wrappers
原文参见 http://www.cyberciti.biz/faq/tcp-wrappers-hosts-allow-deny-tutorial/ 讲了这么几件事: 1:什么是tcp wrappers? 基于主机的网络访问控制系统。上世纪90年代,用来保护unix主机的。 2:哪些程序、服务是用 tcp wrappers 编译的? 先用 whereis Read the rest of this entry
[Linux] rsync
做为一个管理员,或者对于普通的用电脑的人来说,数据才是最重要的。 平时在自己的电脑上,数据要经常备份。有条件的要备份到优盘或者光盘上。 在linux,我现在用rsync来进行远程的备份。 rsync可以在本地和远程的机器之间 Read the rest of this entry