博客统计信息

用户名:myxp
文章数:32
评论数:6
访问量:13138
无忧币:47
博客积分:574
博客等级:3
注册日期:2008-06-29

转载:http://www.yylog.org/?p=2812
通过一台装有squid服务的linux主机,该linux主机需安装双网卡,一块连接公网,一块连接内外,客户端将通过该主机的squid代理服务进行互联网访问。
网络配置
[root@202 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0  #内部网卡参数
DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.1.255
HWADDR=00:0C:29:FE:1A:09
IPADDR=192.168.1.200
NETMASK=255.255.255.0
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
ONBOOT=yes
TYPE=Ethernet
[root@202 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ADSL   #外部网卡参数
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
TYPE=xDSL
DEVICE=ppp0
BOOTPROTO=dialup
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=80
LCP_FAILURE=3
LCP_INTERVAL=20
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
PERSIST=no
SYNCHRONOUS=no
DEFROUTE=yes
USER=ad51****33
ETH=eth1
PROVIDER=AD..
转载: http://www.yylog.org/?p=781
TFTP之IOS备份
更具如图要求,将2811路由器ios通过网络备份到192.168.1.100tftp服务器中。
 

Router#show flash  #查看IOS文件

System flash directory:

File Length Name/status

3 50938004 c2800nm-advipservicesk9-mz.124-15.T1.bin

2 28282 sigdef-category.xml

1 227537 sigdef-default.xml

[51193823 bytes used, 12822561 available, 64016384 total]

63488K bytes of processor board System flash (Read/Write)
Router#copy flash tftp  #copy ios至tftp

Source filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin  #原IOS文件

Address or name of remote host []? 192.168.1.100 #tftp服务器地址

Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]? #目标存放文件名

Writing c2800nm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 bytes]

50938004 bytes copied in 40.84 secs (1247000 bytes/sec)


路由器IOS备份完成!
路由器IOS恢复

1.删除路由器IOS

Router#delete flash #删除路由器IOS文件

Delete filename []?c2800nm-advipservicesk9-mz.124-15.T1.bin  #指定删除文件

Delete flash:/c2800nm-advipservicesk9-mz.124-15.T1.bin? [confirm]  #确认删除

Router#show flash

System flash directory:

File Length Name/status

2 28282 sigdef-category.xml

1 227537 sigdef-default.xml

[255819 bytes used, 63760565 available, 64016384 total]

63488K bytes of processor board System flash (Read/Write)
2.在路由器rommon模式下恢复IOS


Router#reload #重启路由器

Proceed with reload? [confirm]

System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)

Copyright (c) 2000 by cisco Systems, Inc.

cisco 2811 (MPC860) processor (revision 0×200) with 60416K/5120K bytes of memory

Boot process failed..

The system is unable to boot automatically. The BOOT

environment variable needs to be set to a bootable

image.

rommon 1 > tftpdnld #IOS恢复命令

Missing or illegal ip address for variable IP_ADDRESS

Illegal IP address.

usage: tftpdnld

Use this command for disaster recovery only to recover an image via TFTP.

Monitor variables are used to set up parameters for the transfer.

(Syntax: “VARIABLE_NAME=value” and use “set” to show current variables.)

“ctrl-c” or “break” stops the transfer before flash erase begins.
The following variables are REQUIRED to be set for tftpdnld:

IP_ADDRESS: The IP address for this unit

IP_SUBNET_MASK: The subnet mask for this unit

DEFAULT_GATEWAY: The default gateway for this unit

TFTP_SERVER: The IP address of the server to fetch from

TFTP_FILE: The filename to fetch
The following variables are OPTIONAL:

TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose

TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=7)

TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)

TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)

FE_SPEED_MODE: 0=10/hdx, 1=10/fdx, 2=100/hdx, 3=100/fdx, 4=Auto(deflt)
rommon 2 > IP_ADDRESS=192.168.1.1  #指定路由器f0/0口地址

rommon 3 > IP_SUBNET_MASK=255.255.255.0 #指定子网掩码

rommon 4 > DEFAULT_GATEWAY=192.168.1.1  #指定默认网关

rommon 5 > TFTP_SERVER=192.168.1.100  #指定tftp服务器地址

rommon 6 > TFTP_FILE=c2800nm-advipservicesk9-mz.124-15.T1.bin  #指定恢复IOS恢复文件

rommon 7 > tftpdnld  #列出配置信息
IP_ADDRESS: 192.168.1.1

IP_SUBNET_MASK: 255.255.255.0

DEFAULT_GATEWAY: 192.168.1.1

TFTP_SERVER: 192.168.1.100

TFTP_FILE: c2800nm-advipservicesk9-mz.124-15.T1.bin

Invoke this command for disaster recovery only.

WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]: y  #确认是否继续,Y继续。

Receiving c2800nm-advipservicesk9-mz.124-15.T1.bin from 192.168.1.100!!!!!!!!!!!!!!!!!!!!!

program flash location 0×63070000

program flash location 0×63080000

program flash location 0×63090000

rommon 9 > dir flash  #恢复成功后查看IOS文件

File size Checksum File name

50938004 bytes (0×3094094) 0x439d c2800nm-advipservicesk9-mz.124-15.T1.bin

rommon 10> boot  #或使用reset重启路由器即可

System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)

Copyright (c) 2000 by cisco Systems, Inc.

cisco 2811 (MPC860) processor (revision 0×200) with 60416K/5120K bytes of memory
Self decompressing the image :

########################################################################## [OK]

Restricted Rights Legend
Use, duplication, or disclosure by the Government is

subject to restrictions as set forth in subparagraph

(c) of the Commercial Computer Software – Restricted

Rights clause at FAR sec. 52.227-19 and subparagraph

(c) (1) (ii) of the Rights in Technical Data and Computer

Software clause at DFARS sec. 252.227-7013.
cisco Systems, Inc.

170 West Tasman Drive

San Jose, California 95134-1706
Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)

Technical Support: http://www.cisco.com/techsupport

Copyright (c) 1986-2007 by Cisco Systems, Inc.

Compiled Wed 18-Jul-07 06:21 by pt_rel_team

Image text-base: 0x400A925C, data-base: 0x4372CE20
This product contains cryptographic features and is subject to United

States and local country laws governing import, export, transfer and

use. Delivery of Cisco cryptographic products does not imply

third-party authority to import, export, distribute or use encryption.

Importers, exporters, distributors and users are responsible for

compliance with U.S. and local country laws. By using this product you

agree to comply with applicable laws and regulations. If you are unable

to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:

http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to

export@cisco.com.

cisco 2811 (MPC860) processor (revision 0×200) with 60416K/5120K bytes of memory

Processor board ID JAD05190MTZ (4292891495)

M860 processor: part number 0, mask 49

2 FastEthernet/IEEE 802.3 interface(s)

239K bytes of non-volatile configuration memory.

62720K bytes of ATA CompactFlash (Read/Write)

Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)

Technical Support: http://www.cisco.com/techsupport

Copyright (c) 1986-2007 by Cisco Systems, Inc.

Compiled Wed 18-Jul-07 06:21 by pt_rel_team
— System Configuration Dialog —

Continue with configuration dialog? [yes/no]:
 
路由器IOS恢复完成!
IOS恢复注意事项:

1. 只能使用交叉线将TFTP与路由器的f0/0口进行连接。

2. tftp_server上必须有路由器匹配的IOS印象文件。

3. tftp_server地址必须与路由器地址在同一网段中[/img]..
转载: http://www.yylog.org/?p=472
在PHP与MySQL开发过程中,我们经常需要将MySQL数据库中信息以web方式呈现在浏览器中,通过以下代码实现获取并显示数据库表信息。
代码如下:






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24





include("conn.php");//调用数据库连接文件
echo "<table width=572 height=56 border=0 cellspacing=1> "; //创建html表格
echo "<tr bgcolor=#9999FF>";
echo "<th width=33 scope=col>id</th>";
echo "<th width=100 scope=col>user_name</th> ";
echo "<th width=100 scope=col>user_pass</th> ";
echo "<th width=100 scope=col>staus</th>";
echo "<th width=100 scope=col>insert_time</th>";
echo "</tr>";
 
$SQL = "select * from user_info";
$query = mysq..
2011-08-05 11:34:24
 http://www.yylog.org/?p=460
2011-07-25 20:06:48

转载:http://www.yylog.org/?p=140
初始化数据库
[mysql@localhost ~]$ mkdir /mydata/mysql_db/data_1001   #创建数据库存放目录
[mysql@localhost ~]$ mkdir /mydata/mysql_db/data_1002
[mysql@localhost ~]$ mkdir /mydata/mysql_db/data_1003
[mysql@localhost mysql_db]$ ./bin/mysql_install_db –basedir=/mydata/mysql_db –datadir=/mydata/mysql_db/data_1001 –user=mysql  #数据库初始化
Installing MySQL system tables…
OK
Filling help tables…
OK
 
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
 
/mydata/mysql_db/bin/mysqladmin -u root password ‘new-password’
/mydata/mysql_db/bin/mysqladmin -u root -h localhost password ‘new-password’
 
Alternatively you can run:
/mydata/mysql_db..
类别:mysql|阅读(149)|回复(0)|(0)阅读全文>>
2010-11-16 21:23:05
http://www.online990.com/htm/20101116/340.htm
2010-08-24 16:10:09
http://www.online990.com/htm/2010814/280.htm
2010-08-03 20:43:12
http://www.online990.com/htm/2010722/277.htm
2010-06-21 10:18:42
htop是一个第三方的进程查看器,与linux传统的top相比,htop更加人性化。它可让用户交互式
操作,支持颜色主题,可横向或纵向滚动浏览进程列表,并支持鼠标操作。http://www.online990.com/htm/2010618/271.htm
http://www.online990.com/htm/201055/264.htm
http://www.online990.com/htm/2010515/266.htm
2010-03-09 14:31:55
http://www.online990.com/htm/201036/252.htm
2010-02-27 17:01:07
http://www.online990.com/htm/2010217/186.htm
2009-06-27 10:18:08
Rsync双机备份
2009-06-27 10:16:53
PXE引导安装Linux
2009-06-27 10:12:48
linux VPN
2009-06-27 10:08:45
linux之reboot
informix7.3.1 for Linux 安装
2008-10-24 17:04:43
mysql日常维护
类别:mysql|阅读(765)|回复(1)|(0)阅读全文>>
2008-10-20 21:01:37
Linux磁盘管理
 <<   1   2   >>   页数 ( 1/2 )