- 浏览: 80127 次
- 性别:
- 来自: 杭州
最新评论
-
isaiahzhong:
不对啊,我在hosts.allow下面什么都不配 ...
linux远程访问权限控制(hosts.allow和hosts.deny)
文章列表
CCNA实验二 路由基本配置
环境: Windos XP ,GNS3.0.7 VPCS.exe
目的: 掌握路由的基本配置
步骤:
1、首先打开GNS创建一个工程,然后单击”编辑”选择“图标管理”进入操作“Available symbols“窗口中选择computer ,然后点击小于号“>”添加到右的
- 2010-10-26 13:56
- 浏览 754
- 评论(0)
CCNA实验一 登陆设备控制台
环境: Windows XP ,GNS3.0.7
目的: 懂得使用工具登录到路由设备。
步骤:
首先打开GNS搭建拓扑环境如下:
启动R1并右键查看与console连接的端口(登录时要使用)
- 2010-10-25 16:33
- 浏览 604
- 评论(0)
Vmware 虚拟机通过GNS的模拟路由器连接Internet
1、环境: XP 系统,Vmware 7.0.1,GNS3.0.7.2 集成SecureCRT(也可以没有SecureCRT)
准备:在XP系统下添加Loopback adapter 虚拟网卡 ,一个ADSL拨号连接,用Vmware 安装一台XP虚拟机
2、本地网络连接配置:
- 2010-10-20 18:11
- 浏览 1541
- 评论(0)
实现GNS的模拟路由器连接Internet
1、环境: XP 系统,GNS3.0.7.2 集成SecureCRT(也可以没有SecureCRT)
准备:在XP系统下添加Loopback adapter 虚拟网卡 ,一个ADSL拨号连接
2、网络连接配置:
- 2010-10-20 15:58
- 浏览 1921
- 评论(0)
一.re.match
re.match 尝试从字符串的开始匹配一个模式,如:下面的例子匹配第一个单词。
import re
text = "JGood is a handsome boy, he is cool, clever, and so on..."
m = re.match(r"(\w+)\s", text)
if m:
print m.group(0), '\n', m.group(1)
else:
print 'not match'
re.matc ...
1.ls
os.listdir(os.getcwd())
2.cd 更改当前目录
os.chdir("/tmp")
3.touch 创建文件
f=open('/tmp/123','w')
f.close
4.mkdir 创建目录
os.mkdir('/tmp/123')
5.mkdir -p 创建多级目录
os.makedirs('/tmp/a/b/c')
6.mv 修改文件和目录名称
shutil.move('old','new')
7.rm 删除文件
os.remove('file')
8.rm 删除空文件夹 ...
1.时间计算
8小时之后
date +'%F %T' -d "-8 hours ago 20100808 10:10:10"
8小时之前
date +'%F %T' -d "8 hours ago 20100808 10:10:10"
1970年以来的时间(s)
date +'%s' -d "20100808 10:10:10"
2.lftp上传下载
#!/bin/bash
Ftp(){
lftp << ABC
open 10.0.1.1
user ...
查看表空间的名称及大小:
SQL> select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
2 from dba_tablespaces t, dba_data_files d
3 where t.tablespace_name = d.tablespace_name
4 group by t.tablespace_name;
查看表空间使用情况
SQL> SELECT D.TABLESPACE_NAME,SPACE "SUM_SPACE(M)",BL ...
1. VIM python 自动补全插件:pydiction
这是一个相当不错的 Python 代码自动完成的脚本。
可以实现下面python代码的自动补全:
简单python关键词补全
python 函数补全带括号
python 模块补全
python 模块内函数,变量补全
from module import sub- ...
Example 6-1. Exploring common OS module data methods
In [1]: import os
In [2]: os.getcwd()
Out[2]: '/private/tmp'
In [3]: os.mkdir("/tmp/os_mod_explore")
In [4]: os.listdir("/tmp/os_mod_explore")
Out[4]: []
In [5]: os.mkdir("/tmp/os_mod_explore/test_dir1")
In [ ...
Example 5-1. TCP port checker
#!/usr/bin/env python
import socket
import re
import sys
def check_server(address, port):
#create a TCP socket
s = socket.socket()
print "Attempting to connect to %s on port %s" % (address, port)
try:
s.connect((address ...
Example 4-1. Retrieving email using POP3
#!/usr/bin/env python
import poplib
username = 'someuser'
password = 'S3Cr37'
mail_server = 'mail.somedomain.com'
p = poplib.POP3(mail_server)
p.user(username)
p.pass_(password)
for msg_id in p.list()[1]:
print msg_id
outf = open('%s.eml' ...
Example 3-1. Python single/double quote comparison
In [1]: s = "This is a string with 'quotes' in it"
In [2]: s
Out[2]: "This is a string with 'quotes' in it"
In [3]: s = 'This is a string with \'quotes\' in it'
In [4]: s
Out[4]: "This is a string with 'quotes' in it& ...