2007年5月25日星期五

诺顿误杀netapi32.dll官方解决方案

赛门铁克针对企业及个人在下载问题病毒库后误删系统文件的情况,官方对此问题给出了相应的解决方案,分别针对服务器端及客户端
Backdoor.haxdoor临时解决方案

  Version: 1.4

  在windows XP sp2简体中文版打上补丁KB924270以后,SAV更新到5月17日的病毒定义以后,会把C:\windows\system32\ netapi32.dll和 C:\windows\system32\lsasrv.dll认为是backdoor.haxdoor, 并且把他们隔离掉。 会造成重起机器后无法进入系统,安全模式也无法进入,蓝屏。

  服务器

  立即liveupdate, 更新到最新的病毒定义库(20070517.v73)。

  如果liveupdate有问题,请从这里进入到68645或者以后的文件夹,下载后缀名是xdb的文件,放到服务器的SAV安装文件夹里面(是个共享文件夹,一般的位置是C:\program files\SAV或者C:\program files\SAV\symantec antivirus. 如果服务器内装有winzip等软件,可能会把这个XDB改成zip或者rar, 需要改回到xdb)。

  客户端

  可以从服务器下载到更新后的病毒定义,对于无法从服务器自动更新病毒定义的客户端,请从这里进入到68645或者以后的文件夹,下载 ****x86.exe文件,在本机运行更新病毒定义。出现过这个问题的电脑,理论上SAV下载更新的病毒定义后,会扫描隔离区,发现误报的dll文件后会自动修复并恢复到原来的位置,这些已经有很多用户确认。

  但是为保险起见,建议用户在工作量允许得前提下,用windows XP盘里面的i386下面的netapi32.dll和lsasvr.dll文件,替换C:\windows\system32下的这两个文件。

  对于已经蓝屏的电脑:

  1, 使用windows XP安装盘启动

  2, 进入系统恢复控制台。

  3, 使用安装盘I386目录下的netapi32.dll和lsasrv.dll文件替换系统system32下和dllcache下的文件

  a. cd \windows\system32

  b. expand (CD drive letter):\i386\netapi32.dl_

  c. expand (CD drive letter):\i386\lsasrv.dl_

  d. cd dllcache

  e. expand (CD drive letter):\i386\netapi32.dl_

  f. expand (CD drive letter):\i386\lsasrv.dl_

  4, 重启电脑

  5,更新到前面所述的新的病毒定义。

2007年5月22日星期二

[转载]详细讲解MySQL数据库的安全配置

  MySQL 是完全网络化的跨平台关系型数据库系统,同时是具有客户机/服务器体系结构的分布式数据库管理系统。它具有功能强、使用简便、管理方便、运行速度快、安全可靠性强等优点,用户可利用许多语言编写访问MySQL 数据库的程序,特别是与PHP更是黄金组合,运用十分广泛。

  由于MySQL是多平台的数据库,它的默认配置要考虑各种情况下都能适用,所以在我们自己的使用环境下应该进行进一步的安全加固。作为一个MySQL的系统管理员,我们有责任维护MySQL数据库系统的数据安全性和完整性。

  MySQL数据库的安全配置必须从两个方面入手,系统内部安全和外部网络安全,另外我们还将简单介绍编程时要注意的一些问题以及一些小窍门。

2、系统内部安全:

  首先简单介绍一下MySQL数据库目录结构。MySQL安装好,运行了mysql_db_install脚本以后就会建立数据目录和初始化数据库。如果我们用MySQL源码包安装,而且安装目录是/usr/local/mysql,那么数据目录一般会是/usr/local/mysql/var。数据库系统由一系列数据库组成,每个数据库包含一系列数据库表。MySQL是用数据库名在数据目录建立建立一个数据库目录,各数据库表分别以数据库表名作为文件名,扩展名分别为MYD、MYI、frm的三个文件放到数据库目录中。

  MySQL的授权表给数据库的访问提供了灵活的权限控制,但是如果本地用户拥有对库文件的读权限的话,攻击者只需把数据库目录打包拷走,然后拷到自己本机的数据目录下就能访问窃取的数据库。所以MySQL所在的主机的安全性是最首要的问题,如果主机不安全,被攻击者控制,那么MySQL的安全性也无从谈起。其次就是数据目录和数据文件的安全性,也就是权限设置问题。

  从MySQL主站一些老的binary发行版来看,3.21.xx版本中数据目录的属性是775,这样非常危险,任何本地用户都可以读数据目录,所以数据库文件很不安全。3.22.xx版本中数据目录的属性是770,这种属性也有些危险,本地的同组用户既能读也能写,所以数据文件也不安全。3.23.xx版本数据目录的属性是700,这样就比较好,只有启动数据库的用户可以读写数据库文件,保证了本地数据文件的安全。

  如果启动MySQL数据库的用户是MysqSQL,那么象如下的目录和文件的是安全的,请注意数据目录及下面的属性:

shell>ls -l /usr/local/mysql
total 40
drwxrwxr-x 2 root root 4096 Feb 27 20:07 bin
drwxrwxr-x 3 root root 4096 Feb 27 20:07 include
drwxrwxr-x 2 root root 4096 Feb 27 20:07 info
drwxrwxr-x 3 root root 4096 Feb 27 20:07 lib
drwxrwxr-x 2 root root 4096 Feb 27 20:07 libexec
drwxrwxr-x 3 root root 4096 Feb 27 20:07 man
drwxrwxr-x 6 root root 4096 Feb 27 20:07 mysql-test
drwxrwxr-x 3 root root 4096 Feb 27 20:07 share
drwxrwxr-x 7 root root 4096 Feb 27 20:07 sql-bench
drwx------ 4 mysql mysql 4096 Feb 27 20:07 var
shell>ls -l /usr/local/mysql/var
total 8
drwx------ 2 mysql mysql 4096 Feb 27 20:08 mysql
drwx------ 2 mysql mysql 4096 Feb 27 20:08 test
shell>ls -l /usr/local/mysql/var/mysql
total 104
-rw------- 1 mysql mysql 0 Feb 27 20:08 columns_priv.MYD
-rw------- 1 mysql mysql 1024 Feb 27 20:08 columns_priv.MYI
-rw------- 1 mysql mysql 8778 Feb 27 20:08 columns_priv.frm
-rw------- 1 mysql mysql 302 Feb 27 20:08 db.MYD
-rw------- 1 mysql mysql 3072 Feb 27 20:08 db.MYI
-rw------- 1 mysql mysql 8982 Feb 27 20:08 db.frm
-rw------- 1 mysql mysql 0 Feb 27 20:08 func.MYD
-rw------- 1 mysql mysql 1024 Feb 27 20:08 func.MYI
-rw------- 1 mysql mysql 8641 Feb 27 20:08 func.frm
-rw------- 1 mysql mysql 0 Feb 27 20:08 host.MYD
-rw------- 1 mysql mysql 1024 Feb 27 20:08 host.MYI
-rw------- 1 mysql mysql 8958 Feb 27 20:08 host.frm
-rw------- 1 mysql mysql 0 Feb 27 20:08 tables_priv.MYD
-rw------- 1 mysql mysql 1024 Feb 27 20:08 tables_priv.MYI
-rw------- 1 mysql mysql 8877 Feb 27 20:08 tables_priv.frm
-rw------- 1 mysql mysql 428 Feb 27 20:08 user.MYD
-rw------- 1 mysql mysql 2048 Feb 27 20:08 user.MYI
-rw------- 1 mysql mysql 9148 Feb 27 20:08 user.frm


  如果这些文件的属主及属性不是这样,请用以下两个命令修正之:

shell>chown -R mysql.mysql /usr/local/mysql/var
shell>chmod -R go-rwx /usr/local/mysql/var


  用root用户启动远程服务一直是安全大忌,因为如果服务程序出现问题,远程攻击者极有可能获得主机的完全控制权。MySQL从3.23.15版本开始时作了小小的改动,默认安装后服务要用mysql用户来启动,不允许root用户启动。如果非要用root用户来启动,必须加上--user=root的参数(./safe_mysqld --user=root &)。因为MySQL中有LOAD DATA INFILE和SELECT ... INTO OUTFILE的SQL语句,如果是root用户启动了MySQL服务器,那么,数据库用户就拥有了root用户的写权限。不过MySQL还是做了一些限制的,比如LOAD DATA INFILE只能读全局可读的文件,SELECT ... INTO OUTFILE不能覆盖已经存在的文件。

  本地的日志文件也不能忽视,包括shell的日志和MySQL自己的日志。有些用户在本地登陆或备份数据库的时候为了图方便,有时会在命令行参数里直接带了数据库的密码,如:

shell>/usr/local/mysql/bin/mysqldump -uroot -ptest test>test.sql
shell>/usr/local/mysql/bin/mysql -uroot -ptest


  这些命令会被shell记录在历史文件里,比如bash会写入用户目录的.bash_history文件,如果这些文件不慎被读,那么数据库的密码就会泄漏。用户登陆数据库后执行的SQL命令也会被MySQL记录在用户目录的.mysql_history文件里。如果数据库用户用SQL语句修改了数据库密码,也会因.mysql_history文件而泄漏。所以我们在shell登陆及备份的时候不要在-p后直接加密码,而是在提示后再输入数据库密码。

  另外这两个文件我们也应该不让它记录我们的操作,以防万一。

shell>rm .bash_history .mysql_history
shell>ln -s /dev/null .bash_history
shell>ln -s /dev/null .mysql_history


  上门这两条命令把这两个文件链接到/dev/null,那么我们的操作就不会被记录到这两个文件里了。

3、外部网络安全:

  MySQL数据库安装好以后,Unix平台的user表是这样的:

mysql> use mysql;
Database changed
mysql> select Host,User,Password,Select_priv,Grant_priv from user;
+-----------+------+----------+-------------+------------+
| Host | User | Password | Select_priv | Grant_priv |
+-----------+------+----------+-------------+------------+
| localhost | root | | Y | Y |
| redhat | root | | Y | Y |
| localhost | | | N | N |
| redhat | | | N | N |
+-----------+------+----------+-------------+------------+
4 rows in set (0.00 sec)


  Windows平台的user表是这样的:

mysql> use mysql;
Database changed
mysql> select Host,User,Password,Select_priv,Grant_priv from user;
+-----------+------+----------+-------------+------------+
| Host | User | Password | Select_priv | Grant_priv |
+-----------+------+----------+-------------+------------+
| localhost | root | | Y | Y |
| % | root | | Y | Y |
| localhost | | | Y | Y |
| % | | | N | N |
+-----------+------+----------+-------------+------------+
4 rows in set (0.00 sec)

  我们先来看Unix平台的user表。其中redhat只是我试验机的机器名,所以实际上Unix平台的MySQL默认只允许本机才能连接数据库。但是缺省root用户口令是空,所以当务之急是给root用户加上口令。给数据库用户加口令有三种方法:

  1)在shell提示符下用mysqladmin命令来改root用户口令: shell>mysqladmin -uroot password test。

  这样,MySQL数据库root用户的口令就被改成test了。(test只是举例,我们实际使用的口令一定不能使用这种易猜的弱口令)

  2)用set password修改口令:mysql> set password for root@localhost=password('test');。

  这时root用户的口令就被改成test了。

  3)直接修改user表的root用户口令:

mysql> use mysql;
mysql> update user set password=password('test') where user='root';
mysql> flush privileges;

  这样,MySQL数据库root用户的口令也被改成test了。其中最后一句命令flush privileges的意思是强制刷新内存授权表,否则用的还是缓冲中的口令,这时非法用户还可以用root用户及空口令登陆,直到重启MySQL服务器。

  我们还看到user为空的匿名用户,虽然它在Unix平台下没什么权限,但为了安全起见我们应该删除它:mysql> delete from user where user=''; 。

  Windows版本MySQL的user表有很大不同,我们看到Host字段除了localhost还有是%。这里%的意思是允许任意的主机连接MySQL服务器,这是非常不安全的,给攻击者造成可乘之机,我们必须删除Host字段为%的记录: mysql>delete from user where host='%'; 。

  默认root用户的空密码也是必须修改,三种修改方法和Unix平台一样。

我们注意到Host字段为localhost的匿名用户拥有所有的权限!就是说本地用户用空的用户名和空的口令登陆MySQL数据库服务器可以得到最高的权限!所以匿名用户必须删除!


mysql> delete from user where user='';


  对user表操作以后不要忘了用flush privileges来强制刷新内存授权表,这样才能生效。


  默认安装的Windows版MySQL存在的不安全因素太多,我们在安装后一定要进一步配置!


  MySQL的5个授权表:user, db, host, tables_priv和columns_priv提供非常灵活的安全机制,从MySQL 3.22.11开始引入了两条语句GRANT和REVOKE来创建和删除用户权限,可以方便的限制哪个用户可以连接服务器,从哪里连接以及连接后可以做什么操作。作为MySQL管理员,我们必须了解授权表的意义以及如何用GRANT和REVOKE来创建用户、授权和撤权、删除用户。

  在3.22.11版本以前的MySQL授权机制不完善,和新版本也有较大的不同,建议升级到最新版本的MySQL。(本书的操作例子是以MySQL 3.23.49为样本)我们先来了解授权表的结构。

  1)MySQL授权表的结构与内容:

mysql> desc user;
+-----------------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-----------------+------+-----+---------+-------+
| Host | char(60) binary | | PRI | | |
| User | char(16) binary | | PRI | | |
| Password | char(16) binary | | | | |
| Select_priv | enum('N','Y') | | | N | |
| Insert_priv | enum('N','Y') | | | N | |
| Update_priv | enum('N','Y') | | | N | |
| Delete_priv | enum('N','Y') | | | N | |
| Create_priv | enum('N','Y') | | | N | |
| Drop_priv | enum('N','Y') | | | N | |
| Reload_priv | enum('N','Y') | | | N | |
| Shutdown_priv | enum('N','Y') | | | N | |
| Process_priv | enum('N','Y') | | | N | |
| File_priv | enum('N','Y') | | | N | |
| Grant_priv | enum('N','Y') | | | N | |
| References_priv | enum('N','Y') | | | N | |
| Index_priv | enum('N','Y') | | | N | |
| Alter_priv | enum('N','Y') | | | N | |
+-----------------+-----------------+------+-----+---------+-------+
17 rows in set (0.01 sec)

  user表是5个授权表中最重要的一个,列出可以连接服务器的用户及其加密口令,并且它指定他们有哪种全局(超级用户)权限。在user表启用的任何权限均是全局权限,并适用于所有数据库。所以我们不能给任何用户访问mysql.user表的权限!

权限说明:

+-----------+-------------+-------------------+
| 权限指定符| 列名 |权限操作 |
+-----------+-------------+-------------------------------+
| Select | Select_priv | 允许对表的访问,
不对数据表进行访问的select语句不受影响,比如select 1+1|
+-----------+-------------+-------------------------------+
| Insert | Insert_priv | 允许对表用insert语句进行写入操作。 |
+-----------+-------------+-------------------------------+
| Update | Update_priv | 允许用update语句修改表中现有记录。 |
+-----------+-------------+-------------------------------+
| Delete | Delete_priv | 允许用delete语句删除表中现有记录。 |
+-----------+-------------+-------------------------------+
| Create | Create_priv | 允许建立新的数据库和表。 |
+-----------+-------------+-------------------------------+
| Drop | Drop_priv | 允许删除现有的数据库和表。 |
+-----------+-------------+-------------------------------+
| Index | Index_priv | 允许创建、修改或删除索引。 |
+-----------+-------------+-------------------------------+
| Alter | Alter_priv | 允许用alter语句修改表结构。 |
+-----------+-------------+-------------------------------+
| Grant | Grant_priv | 允许将自己拥有的权限授予其它用户,包括grant。 |
+-----------+-------------+-------------------------------+
| Reload | Reload | 允许重载授权表,刷新服务器等命令。 |
+-----------+-------------+-------------------------------+
| Shutdown | Shudown_priv| 允许用mysqladmin
shutdown命令关闭MySQL服务器。该权限比较危险, |
| | | 不应该随便授予。 |
+-----------+-------------+-------------------------------+
| Process | Process_priv| 允许查看和终止
MySQL服务器正在运行的线程(进程)以及正在执行的查询语句 |
| | | ,包括执行修改密码的查询语句。该权限比较危险,不应该随便授予。 |
+-----------+-------------+-------------------------------+
| File | File_priv | 允许从服务器上读全局可读文件和写文件。
该权限比较危险,不应该随便授予。|
+-----------+-------------+-------------------------------+

mysql> desc db;
+-----------------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-----------------+------+-----+---------+-------+
| Host | char(60) binary | | PRI | | |
| Db | char(64) binary | | PRI | | |
| User | char(16) binary | | PRI | | |
| Select_priv | enum('N','Y') | | | N | |
| Insert_priv | enum('N','Y') | | | N | |
| Update_priv | enum('N','Y') | | | N | |
| Delete_priv | enum('N','Y') | | | N | |
| Create_priv | enum('N','Y') | | | N | |
| Drop_priv | enum('N','Y') | | | N | |
| Grant_priv | enum('N','Y') | | | N | |
| References_priv | enum('N','Y') | | | N | |
| Index_priv | enum('N','Y') | | | N | |
| Alter_priv | enum('N','Y') | | | N | |
+-----------------+-----------------+------+-----+---------+-------+
13 rows in set (0.01 sec)

  db表列出数据库,而用户有权限访问它们。在这里指定的权限适用于一个数据库中的所有表。

mysql> desc host;
+-----------------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-----------------+------+-----+---------+-------+
| Host | char(60) binary | | PRI | | |
| Db | char(64) binary | | PRI | | |
| Select_priv | enum('N','Y') | | | N | |
| Insert_priv | enum('N','Y') | | | N | |
| Update_priv | enum('N','Y') | | | N | |
| Delete_priv | enum('N','Y') | | | N | |
| Create_priv | enum('N','Y') | | | N | |
| Drop_priv | enum('N','Y') | | | N | |
| Grant_priv | enum('N','Y') | | | N | |
| References_priv | enum('N','Y') | | | N | |
| Index_priv | enum('N','Y') | | | N | |
| Alter_priv | enum('N','Y') | | | N | |
+-----------------+-----------------+------+-----+---------+-------+
  host表与db表结合使用在一个较好层次上控制特定主机对数据库的访问权限,这可能比单独使用db好些。这个表不受GRANT和REVOKE语句的影响,所以,你可能发觉你根本不是用它。

mysql> desc tables_priv;
+-------------+-----------------------------+----+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------------------------+----+
| Host | char(60) binary | | PRI | | |
| Db | char(64) binary | | PRI | | |
| User | char(16) binary | | PRI | | |
| Table_name | char(60) binary | | PRI | | |
| Grantor | char(77) | | MUL | | |
| Timestamp | timestamp(14) | YES | | NULL | |
| Table_priv | set('Select','Insert', | | | | |
| | 'Update','Delete','Create', | | | | |
| | 'Drop','Grant','References',| | | | |
| | 'Index','Alter') | | | | |
| Column_priv | set('Select','Insert', | | | | |
| | 'Update','References') | | | | |
+-------------+-----------------------------+----+
8 rows in set (0.01 sec)

  tables_priv表指定表级权限。在这里指定的一个权限适用于一个表的所有列。

mysql> desc columns_priv;
+-------------+------------------------+------+---+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------------+------+---+
| Host | char(60) binary | | PRI | | |
| Db | char(64) binary | | PRI | | |
| User | char(16) binary | | PRI | | |
| Table_name | char(64) binary | | PRI | | |
| Column_name | char(64) binary | | PRI | | |
| Timestamp | timestamp(14) | YES | | NULL | |
| Column_priv | set('Select','Insert', | | | | |
| | 'Update','References') | | | | |
+-------------+------------------------+------+---+
7 rows in set (0.00 sec)

  columns_priv表指定列级权限。在这里指定的权限适用于一个表的特定列。

  2)MySQL授权表运行机制:

  MySQL的访问控制分两个步骤:

  a)服务器检查是否允许该用户连接。

  b)如果该用户有权连接,那么服务器还会检查它的每一个请求是否有足够的权限。比如:用户检索数据库中的一个表需要有这个数据库的select权限,用户删除数据库中的一个表需要有这个数据库的drop权限。

  授权表的user, db, host表使用这两个步骤,tables_priv和columns_priv表只使用第二步(检查请求)。每个授权表包含决定一个权限何时运用的范围列和决定授予哪种权限的权限列。

  范围列指定表中的权限何时运用。每个授权表条目包含User和Host列来指定权限何时运用于一个给定用户从给定主机的连接。其他表包含附加的范围列,如db表包含一个Db列指出权限运用于哪个数据库。类似地,tables_priv和columns_priv表包含范围字段,缩小范围到一个数据库中的特定表或一个表的特定列。

下面是user表的Host字段和User字段组合的一些例子:

+-----------------------------+--------+--------------+
| Host值 | User值 | 匹配的连接 |
+-----------------------------+--------+--------------+
| 'x.y.z' | 'test' | test用户只能从x.y.z连接数据库 |
+-----------------------------+--------+--------------+
| 'x.y.z' | '' | 任何用户可以从x.y.z连接数据库 |
+-----------------------------+--------+--------------+
| '%' | 'test' | test用户可以从任意主机连接数据库 |
+-----------------------------+--------+--------------+
| '' | '' | 任何用户可以从任意主机连接数据库 |
+-----------------------------+--------+--------------+
| '%.y.z' | 'test' | test用户可以从y.z域的任意主机连接数据库 |
+-----------------------------+--------+--------------+
| 'x.y.% ' | 'test' | test用户可以从x.y.net,
x.y.com, x.y.edu等主机连接数据库|
+-----------------------------+--------+--------------+
| '192.168.1.1' | 'test' | test用户可以从IP地址为
192.168.1.1的主机连接数据库 |
+-----------------------------+--------+--------------+
| '192.168.1.% ' | 'test' | test用户可以从C类子网
192.168.1中的任意主机连接数据库 |
+-----------------------------+--------+--------------+
| '192.168.1.0/255.255.255.0' | 'test' | 同上 |
+-----------------------------+--------+--------------+

  SQL的字符串通配符%表示匹配任意字符,可以是0个字符,通配符_表示匹配一个字符。

  权限列指出在范围列中指定的用户拥有何种权限。该表使用GRANT语句的权限名称。对于绝大多数在user、db和host表中的权限列的名称与GRANT语句中有明显的联系。如Select_priv对应于SELECT权限。

  3)授权表使用举例:

  grant用于给增加用户和创建权限,revoke用于删除用户权限。

  下面是一些用grant增加用户和创建权限的例子:

mysql> grant all privileges on *.* to
test@localhost identified by 'test' with grant option;

  这句增加一个本地具有所有权限的test用户(超级用户),密码是test。ON子句中的*.*意味着"所有数据库、所有表"。with grant option表示它具有grant权限。

mysql> grant select,insert,update,delete,create,drop
privileges on test.* to test1@'192.168.1.0/255.255.255.0' identified by 'test';

  这句是增加了一个test1用户,口令是test,但是它只能从C类子网192.168.1连接,对test库有select,insert,update,delete,create,drop操作权限。

  用grant语句创建权限是不需要再手工刷新授权表的,因为它已经自动刷新了。

  给用户创建权限还可以通过直接修改授权表:

mysql> insert into user values("localhost","test",password("test"),"Y","Y","Y","Y","Y","Y",
"Y","Y","Y","Y","Y","Y","Y","Y");
mysql> flush privileges;

  这两句和上面第一句grant的效果是一样的,也是增加了一个本地的test超级用户。我们看到用grant方便多了,而且还不需flush privileges:

mysql> insert into user (host,user,password) values
("192.168.1.0/255.255.255.0","test1",PASSWORD("test"));
mysql> insert into db values("192.168.1.0/255.255.255.0",
"test","test1","Y","Y","Y","Y","Y","Y","N","N","N","N")
mysql> flush privileges;

  这三句和上面第二句grant的效果也是一样的,也是增加了一个只能从C类子网192.168.1连接,对test库有select,insert,update,delete,create,drop操作权限的test1用户,口令是test。要取消一个用户的权限,使用revoke语句。revoke的语法非常类似于grant语句,除了to用from取代并且没有identified by和with grant option子句,下面是用revoke删除用户权限的例子:

mysql> revoke all on test.* from test1@'192.168.1.0/255.255.255.0';

  这句revoke就撤消了上面第二句grant创建的权限,但是test1用户并没有被删除,必须手工从user表删除:

mysql> delete from user where user='test1';
mysql> flush privileges;


  这样,test1用户就彻底删除了。


  这些只是MySQL授权表的简单使用,更多详细的资料请见MySQL提供的手册。

3、编程需要注意的一些问题:

  不管是用哪种程序语言写连接MySQL数据库的程序,有一条准则是永远不要相信用户提交的数据!

  对于数字字段,我们要使用查询语句:SELECT * FROM table WHERE ID='234',不要使用SELECT * FROM table WHERE ID=234这样的查询语句。MySQL会自动把字串转换为数字字符并且去除非数字字符。如果用户提交的数据经过了mysql_escape_string处理,这样我们就可以完全杜绝了SQL inject攻击。

各种编程语言该注意的问题:

  1)所有Web程序:

    a)尝试在Web表单输入单引号和双引号来测试可能出现的错误,并找出原因所在。

    b)修改URL参数带的%22 ('"'), %23 ('#'), 和 %27 (''')。

    c)对于数字字段的变量,我们的应用程序必须进行严格的检查,否则是非常危险的。

    d)检查用户提交的数据是否超过字段的长度。

    e)不要给自己程序连接数据库的用户过多的访问权限。

  2)PHP:

    a)检查用户提交的数据在查询之前是否经过addslashes处理,在PHP 4.0.3以后提供了基于MySQL C API的函数mysql_escape_string()。

  3)MySQL C API:

    a)检查查询字串是否用了mysql_escape_string() API调用。

  4)MySQL++:

    a)检查查询字串是否用了escape和quote处理。

  5)Perl DBI:

    a)检查查询字串是否用了quote()方法。

  6)Java JDBC:

    a)检查查询字串是否用了PreparedStatement对象。

4、一些小窍门

  1)如果不慎忘记了MySQL的root密码,我们可以在启动MySQL服务器时加上参数--skip-grant-tables来跳过授权表的验证 (./safe_mysqld --skip-grant-tables &),这样我们就可以直接登陆MySQL服务器,然后再修改root用户的口令,重启MySQL就可以用新口令登陆了。


  2)启动MySQL服务器时加上--skip-show-database使一般数据库用户不能浏览其它数据库。

  3)启动MySQL服务器时加上--chroot=path参数,让mysqld守护进程运行在chroot环境中。这样SQL语句LOAD DATA INFILE和SELECT ... INTO OUTFILE就限定在chroot_path下读写文件了。这里有一点要注意,MySQL启动后会建立一个mysql.sock文件,默认是在/tmp目录下。使用了chroot后,MySQL会在chroot_path/tmp去建立mysql.sock文件,如果没有chroot_path/tmp目录或启动MySQL的用户没有这个目录写权限就不能建立mysql.sock文件,MySQL会启动失败。比如我们加了--chroot=/usr/local/mysql/启动参数,那么最好建立一个启动MySQL的用户能写的

/usr/local/mysql/tmp目录,当然我们也可以用--socket=path来指定mysql.sock文件的路径,但这个path一定要在chroot_path里面。

  4)启动MySQL服务器时加上--log-slow-queries[=file]参数,这样mysqld会把SQL命令执行时间超过long_query_time的写入file文件。如果没有指定=file,mysqld默认会写到数据目录下的hostname-slow.log。如果只指定了filename,没有指定路径,那么mysqld也会把filename写到数据目录下。我们通过这个日志文件可以找出执行时间超长的查询语句,然后尽可能的优化它减轻MySQL服务器的负担。

  5)如果我们只需本机使用MySQL服务,那么我们还可以加上--skip-networking启动参数使MySQL不监听任何TCP/IP连接,增加安全性。(非常推荐)

  6)MySQL的更多mysqld启动选项请见MySQL手册4.16.4 mysqld Command-line Options。

Franklin D. Roosevelt:For a Declaration of War

At 7:53 a.m. on Sunday, December 7, 1941, the first assault wave of Japanese fighter planes attacked the U.S. Naval base at Pearl Harbor, Hawaii, taking the Americans completely by surprise.
The first attack wave targeted airfields and battleships. The second wave targeted other ships and shipyard facilities. The air raid lasted until 9:45 a.m. Eight battleships were damaged, with five sunk. Three light cruisers, three destroyers and three smaller vessels were lost along with 188 aircraft. The Japanese lost 27 planes and five midget submarines which attempted to penetrate the inner harbor and launch torpedoes.
Three prime targets; the U.S. Pacific Fleet aircraft carriers, Lexington, Enterprise and Saratoga, were not in the harbor and thus escaped damage.
The casualty list at Pearl Harbor included 2,335 servicemen and 68 civilians killed, and 1,178 wounded. Over a thousand crewmen aboard the USS Arizona battleship were killed after a 1,760 pound aerial bomb penetrated the forward magazine causing catastrophic explosions.
Pearl Harbor Slide Show - 20 photos
News of the "sneak attack" was broadcast to the American public via radio bulletins, with many popular Sunday afternoon entertainment programs being interrupted. The news sent a shockwave across the nation, resulting in a tremendous influx of young volunteers into the U.S. Armed Forces. The attack also united the nation behind President Franklin D. Roosevelt and effectively ended the American isolationist movement.
On Monday, December 8, President Roosevelt appeared before Congress and made this speech asking for a declaration of war against Japan, calling the previous day "...a date which will live in infamy..."
Listen to the entire speech - 7:11
=================================

Mr. Vice President, Mr. Speaker, members of the Senate and the House of Representatives:
Yesterday, December 7, 1941 - a date which will live in infamy - the United States of America was suddenly and deliberately attacked by naval and air forces of the Empire of Japan.

The United States was at peace with that nation, and, at the solicitation of Japan, was still in conversation with its government and its Emperor looking toward the maintenance of peace in the Pacific.

Indeed, one hour after Japanese air squadrons had commenced bombing in the American island of Oahu, the Japanese Ambassador to the United States and his colleague delivered to our Secretary of State a formal reply to a recent American message. And, while this reply stated that it seemed useless to continue the existing diplomatic negotiations, it contained no threat or hint of war or of armed attack.

It will be recorded that the distance of Hawaii from Japan makes it obvious that the attack was deliberately planned many days or even weeks ago. During the intervening time the Japanese Government has deliberately sought to deceive the United States by false statements and expressions of hope for continued peace.

The attack yesterday on the Hawaiian Islands has caused severe damage to American naval and military forces. I regret to tell you that very many American lives have been lost. In addition, American ships have been reported torpedoed on the high seas between San Francisco and Honolulu.

Yesterday the Japanese Government also launched an attack against Malaya.Last night Japanese forces attacked Hong Kong.Last night Japanese forces attacked Guam.Last night Japanese forces attacked the Philippine Islands.Last night the Japanese attacked Wake Island.And this morning the Japanese attacked Midway Island.

Japan has therefore undertaken a surprise offensive extending throughout the Pacific area. The facts of yesterday and today speak for themselves. The people of the United States have already formed their opinions and well understand the implications to the very life and safety of our nation.

As Commander-in-Chief of the Army and Navy I have directed that all measures be taken for our defense, that always will our whole nation remember the character of the onslaught against us.

No matter how long it may take us to overcome this premeditated invasion, the American people, in their righteous might, will win through to absolute victory.

I believe that I interpret the will of the Congress and of the people when I assert that we will not only defend ourselves to the uttermost but will make it very certain that this form of treachery shall never again endanger us.

Hostilities exist. There is no blinking at the fact that our people, our territory and our interests are in grave danger.

With confidence in our armed forces, with the unbounding determination of our people, we will gain the inevitable triumph. So help us God.

I ask that the Congress declare that since the unprovoked and dastardly attack by Japan on Sunday, December 7, 1941, a state of war has existed between the United States and the Japanese Empire.

Franklin D. Roosevelt - December 8, 1941

====================================
Three days later, December 11, Japan's allies, Germany and Italy, both declared war on the United States. The U.S. Congress responded immediately by declaring war on them. Thus the European and Southeast Asian wars had become a global conflict with the Axis Powers; Japan, Germany, Italy and others, aligned against the Allied Powers; America, Britain, the Soviet Union and others.

We shall fight them on the beaches

Winston Churchill

"I have, myself, full confidence that if all do their duty, if nothing is neglected, and if the best arrangements are made, as they are being made, we shall prove ourselves once again able to defend our Island home, to ride out the storm of war, and to outlive the menace of tyranny, if necessary for years, if necessary alone.

At any rate, that is what we are going to try to do. That is the resolve of His Majesty's Government-every man of them. That is the will of Parliament and the nation.

The British Empire and the French Republic, linked together in their cause and in their need, will defend to the death their native soil, aiding each other like good comrades to the utmost of their strength.
Even though large tracts of Europe and many old and famous States have fallen or may fall into the grip of the Gestapo and all the odious apparatus of Nazi rule, we shall not flag or fail.

We shall go on to the end, we shall fight in France, we shall fight on the seas and oceans, we shall fight with growing confidence and growing strength in the air, we shall defend our Island, whatever the cost may be, we shall fight on the beaches, we shall fight on the landing grounds, we shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender, and even if, which I do not for a moment believe, this Island or a large part of it were subjugated and starving, then our Empire beyond the seas, armed and guarded by the British Fleet, would carry on the struggle, until, in God's good time, the New World, with all its power and might, steps forth to the rescue and the liberation of the old."

The Star Spangled Banner

By Francis Scott Key

Oh, say can you see by the dawn's early light
What so proudly we hailed at the twilight's last gleaming?
Whose broad stripes and bright stars thru the perilous fight,
O'er the ramparts we watched were so gallantly streaming?
And the rocket's red glare, the bombs bursting in air,
Gave proof through the night that our flag was still there.
Oh, say does that star-spangled banner yet wave
O'er the land of the free and the home of the brave?

On the shore, dimly seen through the mists of the deep,
Where the foe's haughty host in dread silence reposes,
What is that which the breeze, o'er the towering steep,
As it fitfully blows, half conceals, half discloses?
Now it catches the gleam of the morning's first beam,
In full glory reflected now shines in the stream:
'Tis the star-spangled banner! Oh long may it wave
O'er the land of the free and the home of the brave!


And where is that band who so vauntingly swore
That the havoc of war and the battle's confusion,
A home and a country should leave us no more!
Their blood has washed out their foul footsteps' pollution.
No refuge could save the hireling and slave
From the terror of flight, or the gloom of the grave:
And the star-spangled banner in triumph doth wave
O'er the land of the free and the home of the brave!


Oh! thus be it ever, when freemen shall stand
Between their loved home and the war's desolation!
Blest with victory and peace, may the heav'n rescued land
Praise the Power that hath made and preserved us a nation.
Then conquer we must, when our cause it is just,
And this be our motto: "In God is our trust."
And the star-spangled banner in triumph shall wave
O'er the land of the free and the home of the brave!

2007年5月21日星期一

The New Colossus

A poem by Emma Lazarus is graven on a tablet within the pedestal on which the statue stands
===========================


Not like the brazen giant of Greek fame,

With conquering limbs astride from land to land;

Here at our sea-washed, sunset gates shall stand

A mighty woman with a torch, whose flame

Is the imprisoned lightning, and her name

Mother of Exiles. From her beacon-hand

Glows world-wide welcome; her mild eyes command

The air-bridged harbor that twin cities frame.

"Keep ancient lands, your storied pomp!" cries she

With silent lips. "Give me your tired, your poor,

Your huddled masses yearning to breathe free,

The wretched refuse of your teeming shore.

Send these, the homeless, tempest-tost to me,

I lift my lamp beside the golden door!"

2007年5月19日星期六

[转载]怎样破解P2P终结者

P2P终结者使用了ARP嗅探和ARP欺骗方法,所以破解P2P终结者的基本方法就是用ARP攻击的方法,归纳起来有以下方法:

1. 使用VLAN
只要你的PC和P2P终结者软件不在同一个VLAN里,他就拿你没办法。

2. 使用双向IP/MAC绑定
在PC上绑定你的出口路由器的MAC地址,P2P终结者软件不能对你进行ARP欺骗,自然也没法管你,不过只是PC绑路由的MAC还不安全,因为P2P终结者软件可以欺骗路由,所以最好的解决办法是使用PC,路由上双向IP/MAC绑定,就是说,在PC上绑定出路路由的MAC地址,在路由上绑定PC的IP和MAC地址,这样要求路由要支持IP/MAC绑定,比如HIPER路由器。

3. 使用IP/MAC地址盗用+IP/MAC绑定
索性你把自己的MAC地址和IP地址改成和运行P2P终结者软件者一样的IP和MAC, 看他如何管理, 这是一个两败俱伤的办法,改动中要有一些小技巧,否则会报IP冲突。要先改MAC地址,再改IP,这样一来WINDOWS就不报IP冲突了(windows傻吧),做到这一步还没有完,最好你在PC上吧路由的MAC地址也绑定,这样一来P2P终结者欺骗路由也白费力气了。

xp系统:只要用arp命令绑定自己MAC和路由MAC就行了,
如:arp 自己IP 自己MAC
arp 路由IP路由MAC
最好都绑定一下,我试过,只绑定路由的话,出了IP冲突就上不去了,别人照样能T你下线.如果绑定了自己的话,IP冲突了也能上网
9x/2000就需要软件了
下载(anti arp sniffer)就行了

防ARP工具集合
下载地址为:
http://www.sbei.org/best/showdown.asp?soft_id="106"

设置好路由IP,mac
不过我是xp系统也安装了这个软件,可以清楚的看到谁想T你下线或者想限制你
建议更换xp
只要上面设置一下,p2p终结者就报废了,

xp系统在cmd状态输入: arp -a
如果路由IP 还有自己IP最后面状态是static,那么就表示绑定成功
arp -d
绑定之前也最好输入一下,删除非法绑定

或者你在网上下载一个网络执法官在局域网的任何一台机子使用就行了。这个软件就不用说了吧,很好的网管软件。

2007年5月17日星期四

[转载]CSS知识补遗

1. Block和inline元素对比

  所有的HTML元素都属于block和inline之一。
  block元素的特点是:
  总是在新行上开始;
  高度,行高以及顶和底边距都可控制;
  宽度缺省是它的容器的100%,除非设定一个宽度
div, p, h1, form, ul和li是块元素的例子。
  相反地,inline元素的特点是:
  和其他元素都在一行上;
  高,行高及顶和底边距不可改变;
  宽度就是它的文字或图片的宽度,不可改变。
  span, a, label, input, img, strong 和em是inline元素的例子。
  用display: inline 或display: block命令就可以改变一个元素的这一特性。什么时候需要改变这一属性呢?
  让一个inline元素从新行开始;
  让块元素和其他元素保持在一行上;
  控制inline元素的宽度(对导航条特别有用);
  控制inline元素的高度;
  无须设定宽度即可为一个块元素设定与文字同宽的背景色。

2. 再来一个box黑客方法

  之所以有这么多box黑客方法,是因为IE在6之前对box的理解跟别人都不一样,它的宽度要包含边线宽和空白。要想让IE5等同其他浏览器保持一致,可以用CSS的方法:
  padding: 2em;
  border: 1em solid green;
  width: 20em;
  width/**/:/**/ 14em;
  第一个宽度所有浏览器都认得,但IE5.x不认得第2行的宽度设置,只因为那一行上有空白的注释符号(多么蠢的语法分析!),所以IE5.x就用20减掉一些空白,而其他浏览器会用14这个宽度,因为它是第2行,会覆盖掉第1行。

3. 页面的最小宽度

  min-width是个非常方便的CSS命令,它可以指定元素最小也不能小于某个宽度,这样就能保证排版一直正确。但IE不认得这个,而它实际上把width当做最小宽度来使。为了让这一命令在IE上也能用,可以把一个放到 标签下,然后为div指定一个类:
  <body>
  <div class="container">
  然后CSS这样设计:
  #container
  {
  min-width: 600px;
  width:expression(document.body.clientWidth <> 1200? ”1200px“ : ”auto";
  }

4. IE与宽度和高度的问题

  IE不认得min-这个定义,但实际上它把正常的width和height当作有min的情况来使。这样问题就大了,如果只用宽度和高度,正常的浏览器里这两个值就不会变,如果只用min-width和min-height的话,IE下面根本等于没有设置宽度和高度。
  比如要设置背景图片,这个宽度是比较重要的。要解决这个问题,可以这样:
  .box
  {
  width: 80px;
  height: 35px;
  }
  body .box
  {
  width: auto;
  height: auto;
  min-width: 80px;
  min-height: 35px;
  }
  所有的浏览器都可以使用第一个box设置,但IE不认得第2段设置,因为其中用到了子选择器命令。第2个设置更特殊些,所以它会覆盖掉第1个设置。

5. 字体变形命令

  text-transform 命令很有用,它有3个值:text-transform: uppercase, text-transform: lowercase 和 text-transform: capitalize。第1个会把文字变成全大写,第2个变成全小写,第3个变成首字母大写。这对拼音文字非常有用,即使输入时有大小写错误,在网页上也看不到。

6. IE中图片文字消失的问题

  有时会遇到文字或背景图突然消失的问题,刷新一下又出现了,这在靠近漂浮元素时更容易发生(注:没见过)。此时,可以为消失的元素设定:position: relative ,如果不行,再考虑为这些元素指定一个宽度试试。

7. 不可见文字

  不论因为何种原因希望某些网页文字不在浏览器中显示,比如为了打印或为了小屏幕而让某些文字不显示,都可以用 display: none 。这非常简单,但有时对某些人这有点没用,他们能去掉这个控制,这时就要用到: position: absolute; left: -9000px 。
这实际上是把文字指定在页面以外显示。

8. 为手持设备设计专门的CSS

  也就是手机/PDA等小屏幕用户,可以专门设计一个CSS来让网页显示更舒服些。为此,可以把浏览器窗口调整到150点宽来看效果。指定专门的手持设备的CSS的语法是:
  <link media="handheld" href="handheldstyle.css" type="text/css" rel="stylesheet">
  也可以阅读专门的手持设备可用性。

9. 3D效果的按钮

  以前要想制作带有3D效果,并且点击下去还会变化的按钮,就得用图片替换的方法,现在CSS就可以了:
  a
  {
  display: block;
  border: 1px solid;
  border-color: #aaa #000 #000 #aaa;
  width: 8em;
  background: #fc0;
  }
  a:hover
  {
  position: relative;
  top: 1px;
  left: 1px;
  border-color: #000 #aaa #aaa #000;
  }
  至于效果,还可以自己调整了。

10. 在不同页面上使用同样的导航代码

  许多网页上都有导航菜单,当进入某页时,菜单上相应这一项就应该变灰,而其他页亮起来。一般要实现这个效果,需要写程序或专门为每一页做设计,现在靠CSS就可以实现这个效果。
  首先,在导航代码中使用CSS类:
<ul>
>li><a href="#" class="home">Home</a></li>
<li><a href="#" class="about">About us</a></li>
<li><a href="#" class="contact">Contact us</a></li>
</ul>
  然后分别为每一页的Body指定一个id,和上面类同名。如<body id="contact">。
  然后设计CSS如下:
  #home .home, #about .about, #about .about
  {
  commands for highlighted navigation go here
}
  这里,当id设为home时,.home就会起作用,也就是class设为home的那一行导航条就会显示出特殊效果来。其他页也是如此。

图片灰圈白框效果

真的是非常简单,但是这个创意可不算简单,效果也挺漂亮的

HTML:
<div class="pic">
CSS定义:
.pic{padding:4px;border:1px solid #ADB4B8;background:#FFF}

2007年5月14日星期一

[转载]谈谈技术人员的最终出路

  做为技术人员,大家都觉得工资高,工作稳定,还能学到很多的东西。是大部份走出校门或性格内向,或希望过平静生活的人的必然选择。其实,你们有没有问过自己,这条路到底走对了吗?
  一个刚毕业的大学生,从事销售和从事技术两种不同的工作,可能工资的差距会达到数倍之远。对于初出校门的人来说,不无一种极端的诱惑力。刚毕业的年青人,当然会果断的选择技术之路。
  两年后,我们再看看,由于经验的积累,做业务的积累了部份客户资源,做技术的积累了好的经验,在各自的领域内都大展开了手脚,收入也基本接近了。
  再以后呢,技术之路越来越难走,毕竟做技术需要的大量的时间和精力,否则就跟不上现在时代的技术更新了,做业务的呢,客户群越来越大,经验越来越丰富,谁的收入会更高?
  两种不同的职业,它们有着各自不同的特点,技术行业是个撑不死,饱不了的地方,而销售行业则是没有尽头的发展之路。
  过了三十岁,大家会选择什么呢,结婚、生子,人生的一条老路,做技术的大多都成为了技术部门的负责人,职位不错;做销售的呢?可能还是个业务员,毕竟做大量的业务都集中在少数人手里。古往今来,财富的集中是如此的相似!但是观察两个职业成功人士的比较,是不是相差太远了?
  学到死,做到死、发不了财的技术,有什么值得人留恋的!
  到了三十岁,你还有自信面对繁重的工作吗?你有刚出社会的人的活力吗?你能和他们比工作时间,玩命地在老板面前表现吗?你能丢下妻儿出差一、两个月吗?能被小你十来岁的小孩命令来命令去吗?
  我不能。。。。。。
  有人会说,我有了技术!
  技术经验是什么?一些老的,过去了的东西,他代表着你所留恋的过去,你所放不下的那一部份,你会以经验来判别事物,选择工作方法。在新老技术交替的时间内,经验可以起到承前启后的作用,让你威风八面。可是,你还会用到多少两年以前的经验呢?
  大家所掌握的技术终会过时,脑子僵化的时候总会到来。那时,你何去何从?
  如果你的目标只是买个狗窝,摆个小烟摊,请不要再往下看了。“知足者常乐”也是一种人生的境界,我羡慕那些五台山上的和尚,我做不到!
  到处是高级住宅,我为什么只住10平的小屋?满大街跑的小车,我为什么要天天挤公交?我要为三十岁后不再挤公交车而奋斗!

  转型------技术人的必须选择!
  转型做什么呢?
  技术的优势在于什么?前些年是不是白干了?
  如何转型?
  让我们分析一下职业,什么样的工作能让我们越老越是宝。
  干部!
  不用说就是第一名,看看中央领导人就知道了嘛。
  财务
  每个老总都喜欢用年龄大点的,稳重嘛!大部份公司还要请个老头子之类的做财务总监。只拿工资不打卡。无它,做假帐的高手。我家老头子每到年底可是按天拿钱。
  教师
  好工作啊,老教授嘛,不老怎么成得了教授。娶老婆的重点发展目标。嫁嘛?就算了。
  上面所说的几个职业,技术人是很难有机会了,毕竟大多数人没有办法再转这么大个弯。
  我们的出路,只有两个方面:销售和技术型管理!
  先说说做销售。
  大家是不是有这种感觉,做销售的人天天都在说现在的客户难打交道。而你是不是感觉客户其实人很好,很容易成为朋友。这就是你的优势!
  你先前的技术基础,己经让他们很容易的接受你了。而你和他们有着很多的话题,能真正的为他们解决很多实际的问题。经常站在他们的角度为他们着想,你说出来的话能令他们信服。这样的业务人员,哪个客户不爱呢?
  做销售,最难的怎么和客户取得第一次的联系,你己经可以依靠技术突破这一点了,你还怕什么。只要心不太黑,客户永远都是你的朋友。   只要多学学心理学,好好锻炼一下自己的口材、勤减一下肥。碰几次壁、吃几次亏后你哪点不像是业务高手。
  再说技术型管理。
  你己经有了技术,有了那么多经验。只要把它们全部拿出来,做事、培训新人。你会发现别人看你的眼睛都是仰视的。其实,你不过是剥夺了他们实际动手的机会,也许还会让他们顺着你的思路,成为你延长了的手。成为你表现能力的更大的舞台。那时,一切的功劳都是你的,老板怎么会不重视你,你的职位又怎会不上升了?
  不过,这只是下乘之道。
  上乘之道在于攻心。。。。。。
  首先在于攻自己的心。
  第一步,树立起自己的目标,多少时间内,工资上涨多少、职位到什么。不管你的直属上司是老板还是谁。如果己经觉得到头了,就离开吧。寻找新的目标。不要犹豫。
  第二步,拿出自己的所有能力,展现给其它人看,尽心尽力做好每一件事情。也许,伯乐的眼睛正在这时候盯着你。
  第三步,提升自己技术和管理能力,我所指的技术能力不是要你再不停的追求最新的技术,你没有那么多时间了。应该反过头来,寻求技术的本源,掌握了他,技术再怎么发展,你只需要花一点点时间就能掌握最新的。
  对于管理能力,只要不损害老板的利益,该管的尽量去管,不该管的尽量提意见,无论对错,无论成败,对你来说,都是经验的积累。
  第四步,敢于担起责任,不管事情的结果是否会失败。一个有勇气承担失败责任的人,更会让人尊敬。而且,失败了你又会损失多少了,最大不过是走人罢了。
  其次攻他人的心
  无论是对上还是对下,都应该是有勇有谋,利用技术的理性分析能力,把握住事物的关键,“知己知彼”的结果,绝大部份都是“百战不殆”。
  对下,应该尽量地去关心他们,因难自己背;好事让点出来,名声让出来一点,反正你的名声也不少了,他们做得好,别人也会说你带得好;他们做错了,你再出马搞定,就不是一点点名声了。
  对于属下和同事,也不要保留技术,我们不是靠手艺吃饭,不是收藏古董,为什么非要等到变成垃圾了才拿出来丢人现眼呢。尽力去做吧!让大家都成为你的徒弟。你的人气自然就来了。
  总之,还有很多很多。。。。。。
  我想,最辉煌的时间总会过去的,在这个充满了金钱的社会,谁不是天平上的的砝码。同样大小的黄金,总要重过铁吧!
  在这里,我一直在想着,想着以后我应该走的路,同时也祝各位住自己的房子,开自己的车子,花自己的票子,摆自己的面子。

2007年5月11日星期五

论坛常用的页数做法

先是一个<div class="p_bar">
CSS定义:
.p_bar {margin: 1px 0px;clear: both;}
.p_bar a {float: left;padding: 1px 4px;font-size: 12px;text-decoration: none;}

然后在这个DIV里
<a href="forum-11-2.html" class="p_num">1</a>一个个列下去

CSS定义:
.p_num {background-color: #FFFFFF;border: 1px solid #DEDEB8;margin-right:1px;vertical-align: middle;}
a:hover.p_num {background-color: #F5FBFF;border: 1px solid #86B9D6;text-decoration: none;}

2007年5月9日星期三

I Have A Dream

In 1950's America, the equality of man envisioned by the Declaration of Independence was far from a reality. People of color — blacks, Hispanics, Orientals — were discriminated against in many ways, both overt and covert. The 1950's were a turbulent time in America, when racial barriers began to come down due to Supreme Court decisions, like Brown v. Board of Education; and due to an increase in the activism of blacks, fighting for equal rights.

Martin Luther King, Jr., a Baptist minister, was a driving force in the push for racial equality in the 1950's and the 1960's. In 1963, King and his staff focused on Birmingham, Alabama. They marched and protested non-violently, raising the ire of local officials who sicced water cannon and police dogs on the marchers, whose ranks included teenagers and children. The bad publicity and break-down of business forced the white leaders of Birmingham to concede to some anti-segregation demands.

Thrust into the national spotlight in Birmingham, where he was arrested and jailed, King organized a massive march on Washington, DC, on August 28, 1963. On the steps of the Lincoln Memorial, he evoked the name of Lincoln in his "I Have a Dream" speech, which is credited with mobilizing supporters of desegregation and prompted the 1964 Civil Rights Act. The next year, King was awarded the Nobel Peace Prize.
The following is the exact text of the spoken speech, transcribed from recordings.
-------------------------------------------------
I am happy to join with you today in what will go down in history as the greatest demonstration for freedom in the history of our nation.
Five score years ago, a great American, in whose symbolic shadow we stand today, signed the Emancipation Proclamation. This momentous decree came as a great beacon light of hope to millions of Negro slaves who had been seared in the flames of withering injustice. It came as a joyous daybreak to end the long night of their captivity.

But one hundred years later, the Negro still is not free. One hundred years later, the life of the Negro is still sadly crippled by the manacles of segregation and the chains of discrimination. One hundred years later, the Negro lives on a lonely island of poverty in the midst of a vast ocean of material prosperity. One hundred years later, the Negro is still languishing in the corners of American society and finds himself an exile in his own land. So we have come here today to dramatize a shameful condition.

In a sense we have come to our nation's capital to cash a check. When the architects of our republic wrote the magnificent words of the Constitution and the Declaration of Independence, they were signing a promissory note to which every American was to fall heir. This note was a promise that all men, yes, black men as well as white men, would be guaranteed the unalienable rights of life, liberty, and the pursuit of happiness.

It is obvious today that America has defaulted on this promissory note insofar as her citizens of color are concerned. Instead of honoring this sacred obligation, America has given the Negro people a bad check, a check which has come back marked "insufficient funds." But we refuse to believe that the bank of justice is bankrupt. We refuse to believe that there are insufficient funds in the great vaults of opportunity of this nation. So we have come to cash this check — a check that will give us upon demand the riches of freedom and the security of justice. We have also come to this hallowed spot to remind America of the fierce urgency of now. This is no time to engage in the luxury of cooling off or to take the tranquilizing drug of gradualism. Now is the time to make real the promises of democracy. Now is the time to rise from the dark and desolate valley of segregation to the sunlit path of racial justice. Now is the time to lift our nation from the quick sands of racial injustice to the solid rock of brotherhood. Now is the time to make justice a reality for all of God's children.

It would be fatal for the nation to overlook the urgency of the moment. This sweltering summer of the Negro's legitimate discontent will not pass until there is an invigorating autumn of freedom and equality. Nineteen sixty-three is not an end, but a beginning. Those who hope that the Negro needed to blow off steam and will now be content will have a rude awakening if the nation returns to business as usual. There will be neither rest nor tranquility in America until the Negro is granted his citizenship rights. The whirlwinds of revolt will continue to shake the foundations of our nation until the bright day of justice emerges.

But there is something that I must say to my people who stand on the warm threshold which leads into the palace of justice. In the process of gaining our rightful place we must not be guilty of wrongful deeds. Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred.

We must forever conduct our struggle on the high plane of dignity and discipline. We must not allow our creative protest to degenerate into physical violence. Again and again we must rise to the majestic heights of meeting physical force with soul force. The marvelous new militancy which has engulfed the Negro community must not lead us to distrust of all white people, for many of our white brothers, as evidenced by their presence here today, have come to realize that their destiny is tied up with our destiny and their freedom is inextricably bound to our freedom. We cannot walk alone.

As we walk, we must make the pledge that we shall march ahead. We cannot turn back. There are those who are asking the devotees of civil rights, "When will you be satisfied?" We can never be satisfied as long as the Negro is the victim of the unspeakable horrors of police brutality. We can never be satisfied, as long as our bodies, heavy with the fatigue of travel, cannot gain lodging in the motels of the highways and the hotels of the cities. We can never be satisfied as long as a Negro in Mississippi cannot vote and a Negro in New York believes he has nothing for which to vote. No, no, we are not satisfied, and we will not be satisfied until justice rolls down like waters and righteousness like a mighty stream.

I am not unmindful that some of you have come here out of great trials and tribulations. Some of you have come fresh from narrow jail cells. Some of you have come from areas where your quest for freedom left you battered by the storms of persecution and staggered by the winds of police brutality. You have been the veterans of creative suffering.

Continue to work with the faith that unearned suffering is redemptive.
Go back to Mississippi, go back to Alabama, go back to South Carolina, go back to Georgia, go back to Louisiana, go back to the slums and ghettos of our northern cities, knowing that somehow this situation can and will be changed. Let us not wallow in the valley of despair.

I say to you today, my friends, so even though we face the difficulties of today and tomorrow, I still have a dream. It is a dream deeply rooted in the American dream.

I have a dream that one day this nation will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident: that all men are created equal."

I have a dream that one day on the red hills of Georgia the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.

I have a dream that one day even the state of Mississippi, a state sweltering with the heat of injustice, sweltering with the heat of oppression, will be transformed into an oasis of freedom and justice.

I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character.

I have a dream today.

I have a dream that one day, down in Alabama, with its vicious racists, with its governor having his lips dripping with the words of interposition and nullification; one day right there in Alabama, little black boys and black girls will be able to join hands with little white boys and white girls as sisters and brothers.

I have a dream today.

I have a dream that one day every valley shall be exalted, every hill and mountain shall be made low, the rough places will be made plain, and the crooked places will be made straight, and the glory of the Lord shall be revealed, and all flesh shall see it together.

This is our hope. This is the faith that I go back to the South with. With this faith we will be able to hew out of the mountain of despair a stone of hope. With this faith we will be able to transform the jangling discords of our nation into a beautiful symphony of brotherhood. With this faith we will be able to work together, to pray together, to struggle together, to go to jail together, to stand up for freedom together, knowing that we will be free one day.

This will be the day when all of God's children will be able to sing with a new meaning, "My country, 'tis of thee, sweet land of liberty, of thee I sing. Land where my fathers died, land of the pilgrim's pride, from every mountainside, let freedom ring."

And if America is to be a great nation this must become true. So let freedom ring from the prodigious hilltops of New Hampshire. Let freedom ring from the mighty mountains of New York. Let freedom ring from the heightening Alleghenies of Pennsylvania!

Let freedom ring from the snowcapped Rockies of Colorado!

Let freedom ring from the curvaceous slopes of California!

But not only that; let freedom ring from Stone Mountain of Georgia!

Let freedom ring from Lookout Mountain of Tennessee!

Let freedom ring from every hill and molehill of Mississippi. From every mountainside, let freedom ring.

And when this happens, When we allow freedom to ring, when we let it ring from every village and every hamlet, from every state and every city, we will be able to speed up that day when all of God's children, black men and white men, Jews and Gentiles, Protestants and Catholics, will be able to join hands and sing in the words of the old Negro spiritual, "Free at last! free at last! thank God Almighty, we are free at last!"

The Declaration of Independence

IN CONGRESS, JULY 4, 1776
The unanimous Declaration of the thirteen united States of America

When in the Course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness. — That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, — That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn that mankind are more disposed to suffer, while evils are sufferable than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security. — Such has been the patient sufferance of these Colonies; and such is now the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.

He has refused his Assent to Laws, the most wholesome and necessary for the public good.

He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; and when so suspended, he has utterly neglected to attend to them.

He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, a right inestimable to them and formidable to tyrants only.

He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their Public Records, for the sole purpose of fatiguing them into compliance with his measures.

He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.

He has refused for a long time, after such dissolutions, to cause others to be elected, whereby the Legislative Powers, incapable of Annihilation, have returned to the People at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.

He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage their migrations hither, and raising the conditions of new Appropriations of Lands.

He has obstructed the Administration of Justice by refusing his Assent to Laws for establishing Judiciary Powers.

He has made Judges dependent on his Will alone for the tenure of their offices, and the amount and payment of their salaries.

He has erected a multitude of New Offices, and sent hither swarms of Officers to harass our people and eat out their substance.

He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.

He has affected to render the Military independent of and superior to the Civil Power.

He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; giving his Assent to their Acts of pretended Legislation:

For quartering large bodies of armed troops among us:

For protecting them, by a mock Trial from punishment for any Murders which they should commit on the Inhabitants of these States:

For cutting off our Trade with all parts of the world:

For imposing Taxes on us without our Consent:

For depriving us in many cases, of the benefit of Trial by Jury:

For transporting us beyond Seas to be tried for pretended offences:

For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at once an example and fit instrument for introducing the same absolute rule into these Colonies

For taking away our Charters, abolishing our most valuable Laws and altering fundamentally the Forms of our Governments:

For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.

He has abdicated Government here, by declaring us out of his Protection and waging War against us.

He has plundered our seas, ravaged our coasts, burnt our towns, and destroyed the lives of our people.

He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation, and tyranny, already begun with circumstances of Cruelty & Perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.

He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands.

He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions.

In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. A Prince, whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.

Nor have We been wanting in attentions to our British brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, and we have conjured them by the ties of our common kindred. to disavow these usurpations, which would inevitably interrupt our connections and correspondence. They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.

We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these united Colonies are, and of Right ought to be Free and Independent States, that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace contract Alliances, establish Commerce, and to do all other Acts and Things which Independent States may of right do. — And for the support of this Declaration, with a firm reliance on the protection of Divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.

John Hancock

New Hampshire:
Josiah Bartlett, William Whipple, Matthew Thornton

Massachusetts:
John Hancock, Samuel Adams, John Adams, Robert Treat Paine, Elbridge Gerry

Rhode Island:
Stephen Hopkins, William Ellery

Connecticut:Roger Sherman, Samuel Huntington, William Williams, Oliver Wolcott

New York:
William Floyd, Philip Livingston, Francis Lewis, Lewis Morris

New Jersey:Richard Stockton, John Witherspoon, Francis Hopkinson, John Hart, Abraham Clark

Pennsylvania:
Robert Morris, Benjamin Rush, Benjamin Franklin, John Morton, George Clymer, James Smith, George Taylor, James Wilson, George Ross

Delaware:
Caesar Rodney, George Read, Thomas McKean

Maryland:
Samuel Chase, William Paca, Thomas Stone, Charles Carroll of Carrollton

Virginia:
George Wythe, Richard Henry Lee, Thomas Jefferson, Benjamin Harrison, Thomas Nelson, Jr., Francis Lightfoot Lee, Carter Braxton

North Carolina:
William Hooper, Joseph Hewes, John Penn

South Carolina:
Edward Rutledge, Thomas Heyward, Jr., Thomas Lynch, Jr., Arthur Middleton

Georgia:
Button Gwinnett, Lyman Hall, George Walton

2007年5月8日星期二

《国际歌》英语歌词

The Internationale: Original English Version
Original words by Eugene Pottier.
Original music by Pierre Degeyter.

Arise ye starvelings [or workers] from your slumbers
Arise ye criminals of want
For reason in revolt now thunders
and at last ends the age of cant.
Now away with all your superstitions
Servile masses arise, arise!
We'll change forthwith [or henceforth] the old conditions
And spurn the dust to win the prize.

CHORUS

Then come comrades rally
And the last fight let us face
The Internationale
Unites the human race. (repeat).

We peasants, artisans and others,
Enrolled amongst the sons of toil
Let's claim the earth henceforth for brothers
Drive the indolent from the soil.
On our flesh for too long has fed the raven
We've too long been the vultures prey.
But now farewell to spirit craven
The dawn brings in a brighter day.

CHORUS

No saviour from on high delivers
No trust we have in prince or peer
Our own right hand the chains must shiver
Chains of hatred, greed and fear.
Ere the thieves will out with their booty
And to all give a happier lot.
Each at his forge must do his duty
And strike the iron while its hot.

CHORUS
__________________________________



A more modern Version : The Internationale
Words: Billy Bragg
Music: Pierre Degeyter

Stand up, all victims of oppression
For the tyrants fear your might
Don't cling so hard to your possessions
For you have nothing, if you have no rights
Let racist ignorance be ended
For respect makes the empires fall
Freedom is merely privilege extended
Unless enjoyed by one and all

Chorus:
So come brothers and sisters
For the struggle carries on
The Internationale
Unites the world in song
So comrades come rally
For this is the time and place
The international ideal
Unites the human race

Let no one build walls to divide us
Walls of hatred nor walls of stone
Come greet the dawn and stand beside us
We'll live together or we'll die alone
In our world poisoned by exploitation
Those who have taken, now they must give
And end the vanity of nations
We've but one Earth on which to live

And so begins the final drama
In the streets and in the fields
We stand unbowed before their armour
We defy their guns and shields
When we fight, provoked by their aggression
Let us be inspired by like and love
For though they offer us concessions
Change will not come from above