2018年5月

no comments yet
23 May 2018

两台电脑通过一根网线共享上网

电脑A为Win7系统,通过无线连接到网络,电脑B为centos6,没有无线,只能用网线连接,通过以下步骤共享电脑A的网络联网:
用网线连接两台电脑。
电脑A鼠标右击无线网络,选择共享,有线网卡被自动设置成192.168.137.1,这个IP就作为电脑B的网关。
(如果在设置共享时提示“Internet链接共享访问启用时出现错误null”,打开Windows Firewall服务即可。)

Read more

no comments yet
14 May 2018

Centos6.x下搭建web环境(Apache+mysql+php)

安装Apache

yum install httpd -y       //用yum安装
chkconfig --levels 235 httpd on    //设置apache为系统引导时启动

编辑apache的配置文件,在最后一行添加 ServerName localhost:80

echo "ServerName localhost:80">>/etc/httpd/conf/httpd.conf

Read more

no comments yet
14 May 2018

MySQL中删除重复记录,只保留Id最小的一条

表结构为:

+--------+--------------+------+-----+---------+----------------+
| Field  | Type         | Null | Key | Default | Extra          |
+--------+--------------+------+-----+---------+----------------+
| id     | int(255)     | NO   | PRI | NULL    | auto_increment |
| url    | varchar(255) | NO   |     | NULL    |                |
| mdnum  | bigint(255)  | NO   | UNI | NULL    |                |
| status | int(255)     | NO   |     | 0       |                |
+--------+--------------+------+-----+---------+----------------+

目前想到的最简单快捷的方法:

Read more