“linux”目录存档

shell电话本

2010年08月23日,星期一

前几天在MSDN上看到有人用shell写了个电话本程序,为了巩固一下以前学过的, 自己也来弄一个shell电话本[绝非抄袭]。其实不能算一个电话本,因为只有两个域:名字和地址,权当练习,不尽完美之处,请海涵:D

#!/bin/sh
#Date: 2010-08-22
#QQ: 32281309
#MSN: pgj1207@hotmail.com
#Site: www.genepeng.cn

function AddUser()
{
while :
do
echo -n “Enter user name: ”
read UserName
if [ "$UserName" = "" ]; then
continue
else
break
fi
done

while :
do
echo -n “Enter Address: ”
read Address
if [ "$Address" = "" ]; then
continue
else
break
fi
done

echo -e “$UserName\t$Address” >> $FileName
}
(全文…)

win7 VMware 7.0下centos不能上网

2010年08月21日,星期六

之前的CentOS是xp和VMware下安装的,上网等功能一切正常,但后来装了win7后上网功能出现了问题
情况如下:
-> win7 ping不通虚拟机下CentOS
-> CentOS 能ping win7和外网,但是不能浏览网页
-> 在win7下,用putty也访问不了CentOS
-> win7, CentOS的防火墙都关了

后来发现原来是安装的瑞星防火墙的原因, 改变相应的设置,或直接把瑞星防火墙关掉就可以了

在windows下用wingrub安装backtrack 4 final双系统

2010年03月19日,星期五

在windows操作系统下利用wingrub安装backtrack 4 final,不需要你另外的磁盘分区、U盘.

下面讲一下安装过程

1. 安装WinGrub/Grub4DOS

http://sourceforge.net/projects/grub4dos/ 下载,然后安装,安装好了之后,打开wingrub, 点击Tools/Install Grub, 选择BOOT.ini, 填入”Back Track 4 Final”到Title, 再点击 Install, 这时会自动拷贝GRLDR 到c:\ ,还会创建c:\grub文件夹.

2. 从bt4-final.iso里拷贝/casper and /boot 到c:\

3. 修改C:\boot\grub\menu.lst. 当你打开文件时已经有一些内容, 但没有find –set-root /GRLDR这句话,所以应该加上。

最终内容应该为:<!– more –>

# By default, boot the first entry.
default 0

# Boot automatically after 30 secs.
timeout 10

splashimage=/boot/grub/bt4.xpm.gz

title BackTrack4 Pre Final Persistant USB
find –set-root /GRLDR
kernel /boot/vmlinuz BOOT=casper boot=casper persistent rw vga=0×317
initrd /boot/initrd.gz

title BackTrack4 Pre Final USB
find –set-root /GRLDR
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw vga=0×317
initrd /boot/initrd.gz

title BackTrack4 Forensics USB (no swap)
find –set-root /GRLDR
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw vga=0×317
initrd /boot/initrdfr.gz

title BackTrack4 in Text Mode USB
find –set-root /GRLDR
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw quiet
initrd /boot/initrd.gz

title BackTrack Graphical Mode from RAM USB
find –set-root /GRLDR
kernel /boot/vmlinuz BOOT=casper boot=casper toram nopersistent rw quiet
initrd /boot/initrd.gz

title Memory Test
find –set-root /GRLDR
kernel /boot/memtest86+.bin

title Boot the First Hard Disk
root (hd0,0)
chainloader +1

4. 重起电脑, 这时可选择Back Track 4 Final进入系统。进入时会显示loading and wait, 时间比较久(有时我随便输入一些文字,就马上就可以了, 你也可以试一下)

QT 学习笔记

2009年10月20日,星期二
  1. The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals or slots.
  2. Classes that use the Q_OBJECT macro must have moc run on them. This isn’t a problem because qmake automatically adds the necessary rules to the makefile. But if you forget to regenerate your makefile using qmake and moc isn’t run, the linker will complain that some functions are declared but not implemented.

KDE与GNOME的战争史

2009年10月15日,星期四

http://www.ixpub.net/thread-1031155-1-1.html

文章不错