显示标签为“云端技术”的博文。显示所有博文
显示标签为“云端技术”的博文。显示所有博文

2012年6月12日

Python-字串样式比对


Python-字串样式比对

首先必须先汇入re模组,有关regular expression的相关说明可参考http://en.wikipedia.org/wiki/Regular_expression
ex1: 比对字串样式:句首为Wellcome中间有空格或tab隔开,句子结尾是here。括号中的字串会抓取到match.groups()中。要取出其中的每个字串,可以用match.group(i),i为要取出找到的第几个字串。
>>> import re>>> match=re.match('Wellcome[ \t]*(.*)here','Wellcome to here')>>> dir(match)['__copy__', '__deepcopy__', 'end', 'expand', 'group', 'groupdict', 'groups', 'span', 'start']>>> print match.groups()('to ',)>>> match.group(1)'to '

ex2 取出字串样式为'/(.*)/(.*)/(.*)'括号中的字串>>> match=re.match('/(.*)/(.*)/(.*)','/usr/home/sample')>>> match.groups()('usr', 'home', 'sample')>>> match.group(1)'usr'>>>

2012年6月11日

VMware vCenter Converter Standalone client 安装步骤


VMware vCenter Converter Standalone client 安装步骤
要连线到你安装好的VMware Esxi时,你必须要先安装VMware vCenter Converter Standalone client连线软体,这个软体也是免费提供的,可到VMware网站下载,或参考如何注册及下载vmware相关免费(free)软体1.首先先选择要安装的语言版本。


 图_VMware vCenter Converter Standalone client 安装步骤_1
图_VMware vCenter Converter Standalone client 安装步骤_1

2.选择[Next>]下一步确认要安装。
 图_VMware vCenter Converter Standalone client 安装步骤_2
图_VMware vCenter Converter Standalone client 安装步骤_2

3.选择[Next>]同意下列说明。
 图_VMware vCenter Converter Standalone client 安装步骤_3
图_VMware vCenter Converter Standalone client 安装步骤_3

4.选择[I agree to the terms in the license agreement]同意版权说明,并按[Next>]继续。
 图_VMware vCenter Converter Standalone client 安装步骤_4
图_VMware vCenter Converter Standalone client 安装步骤_4
5.输入组织名称并按[Next>]继续。
 图_VMware vCenter Converter Standalone client 安装步骤_5
图_VMware vCenter Converter Standalone client 安装步骤_5
6.若欲修改安装目录,可选择[Change]来改变,否则按[Next>]继续。
 图_VMware vCenter Converter Standalone client 安装步骤_6
图_VMware vCenter Converter Standalone client 安装步骤_6
7.设定完成后按[Install]开始安装。
 图_VMware vCenter Converter Standalone client 安装步骤_7
图_VMware vCenter Converter Standalone client 安装步骤_7
8.系统会出现安装进度。
 图_VMware vCenter Converter Standalone client 安装步骤_8
图_VMware vCenter Converter Standalone client 安装步骤_8
9.安装完成后会出现[Finish],按下后完成安装。
 图_VMware vCenter Converter Standalone client 安装步骤_9
图_VMware vCenter Converter Standalone client 安装步骤_9
10.桌面会出现一个VMware vSphere Client的图示供连结。
图_VMware vCenter Converter Standalone client 安装步骤_10
图_VMware vCenter Converter Standalone client 安装步骤_10



2012年6月10日

Python-原始段落显示方法-三个单引号或双引号


Python-原始段落显示方法-三个单引号或双引号
一般指定一个单引号或双引号的字串给变数时,无法断行,要断行或空格需要使用特殊符号'\n' 及'\t'。
>>> s='\nHello \n Where are you \nHear Hear\n\n'>>> print s
Hello
Where are youHear Hear

当你要显示一个段落,不想用特殊符号且希望在显示时格式遭到破坏时,可以使用三个单引号或双引号将一个段落的字串包含在其中即可。>>> s='''... Hello... Where are you... Hear Hear...... '''>>> s'\nHello \n Where are you \nHear Hear\n\n'>>> print s
Hello
Where are youHear Hear

2012年6月9日

python 物件型态取得使用方法协助-help 指令


python 物件型态取得使用方法协助-help 指令
当你对python物件使用上有不清楚或想知道更多使用方法时,可利用dir或help的指令直接对已指定值的变数或方法套上这两个指令即可。
dir函式只是给出可使用的方法或属性名称,要详细了解这个方法或名称如何使用,就必须用help的函式了。


>>> S'Hello'>>> dir(S)['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__str__', 'capitalize', 'center', 'count', 'decode','encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']

>>> help(S.split)Help on built-in function split:
split(...)
S.split([sep [,maxsplit]]) -> list of strings

Return a list of the words in the string S, using sep as the
delimiter string. If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator.
>>>
利用help函式,会显示这个方法或函式的语法与说明。

2012年6月8日

python 物件型态取得使用方法协助-dir 指令


python 物件型态取得使用方法协助-dir 指令
当你对python物件使用上有不清楚或想知道更多使用方法时,可利用dir或help的指令直接对已指定值的变数或方法套上这两个指令即可。
当你呼叫内建的dir函式时,会传回来指定物件可用的属性及方法串列。

>>> S='hello'>>> dir(S)['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__str__', 'capitalize', 'center', 'count', 'decode','encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']>>>
dir 会显示此物件的所有方法串列,有底线的代表是此物件的实作,前后双底线的是python用于实作细节的命名模式,一般我们是用不到。串列中没有底线的名称是可以对此物件呼叫的方法或属性。

2012年6月6日

Python-物件型态-字串-2

Python-物件型态-字串-2 
字串运算时,原字串并未作任何改变。字串常用的方法有:


1.寻找子字串的偏移量
>>> S='Hello'
>>> S.find('el')
1
>>> S'Hello'


2.以另一个字串取代子字串的内容
>>> S.replace('el','ABC')
'HABClo'
>>> S'Hello'


3.以分界字元或字串将原字串切割成多个子字串串列
>>> S='aaa,bbb,ccc,ddd'
>>> S.split(',')
['aaa', 'bbb', 'ccc', 'ddd']
>>> S'aaa,bbb,ccc,ddd'


2012年6月4日

如何中断VMware Esxi Server的VMware vSphere Client连线

如何中断VMware Esxi Server的VMware vSphere Client连线



一般来说VMware Esxi Server会设定固定IP来让VMware vSphere Client可以从远端来连线,但为了安全考量,你可以将连线关闭来防止其他人连线,因为Esxi本身并没有防火墙来防此外部连线,欲关闭连线可参考下列设定方式,中断连线并不会影响正在运行的虚拟机运作:1.进入系统后选定<F2>Customize System进入系统。
 图_如何中断VMware Esxi Server的VMware vSphere Client连线_1

图_如何中断VMware Esxi Server的VMware vSphere Client连线_1


2.进入设定画面后选择Disable Management Network来中断vSphere Client的远端连线。

2012年6月3日

如何设定VMware Esxi Server让VMware vSphere Client可以连线


如何设定VMware Esxi Server让VMware vSphere Client可以连线


一般来说VMware Esxi Server会设定固定IP来让VMware vSphere Client可以从远端来连线,当你安装好VMware Esxi时,预设是使用DHCP给定一个动态IP位置,所以我们必须设定一个固定IP给这台伺服器,设定方式可参考下列说明:


1.进入系统后选定<F2>Customize System进入系统。
 图_如何设定VMware Esxi Server让VMware vSphere Client可以连线_1
图_如何设定VMware Esxi Server让VMware vSphere Client可以连线_1


2.选定Configure Management Network选项来设定网路。

2012年6月2日

VMware Esxi连线及开机密码设定方法



VMware Esxi连线及开机密码设定方法

1.当VMware Esxi安装完成后(安装步骤可参考VMware Esxi安装步骤(教学)),预设是没有开机密码的,且为安全性考量,远端是无法连线的。



 图_VMware Esxi连线及开机密码设定方法_1
图_VMware Esxi连线及开机密码设定方法_1

2012年6月1日

VMware Esxi安装步骤(教学)



VMware Esxi安装步骤(教学)

在安装Esxi之前,请先确认你的电脑有支援虚拟化运算,一般来说你必须设定Bios,使它支援虚拟化指令集,一般来说是将Bios中Virtulization Technology (VT) 相关功能设定为enabled ,因为每一台设备的Bios设定皆不一定,所以无法逐一介绍。

1.若你是实体机器,请将Bios设定为光碟开机,并将光碟插入光碟机中,若你是想在VMware Workstation中建立,可参考如何利用VMware Workstation中建立Esxi虚拟机的步骤将开机设定为ISO档即可。
图_VMware Esxi安装步骤(教学)_1
图_VMware Esxi安装步骤(教学)_1

2.系统会跑相关的开机程序,若安装上有问题则会显示错误讯息,有可能因为你安装的版本不适合你的机器,故你可以参考如何寻找合适的VMware ESXi 版本安装虚拟主机(或伺服器,如IBM及HP各型号),寻找可以安装的Esxi版本。


2012年5月31日



如何利用VMware Workstation中建立Esxi虚拟机


本篇文章除了介绍如何在VMware Workstation中建立虚拟机的方法外,也可以做为Esxi的安装方法参考。要在VMware中建立Esxi的虚拟机之前,请先将你的Bios中Virtulization Technology (VT) 相关功能设定为enabled,因为每一台设备的Bios设定皆不一定,所以无法逐一介绍。
1.首先开启VMware Workstation,点选[File]=>[New]=>[Virtual Machine]


图_如何利用VMware Workstation中建立Esxi虚拟机_1
图_如何利用VMware Workstation中建立Esxi虚拟机_1


2.点选[Typical(recommended)]的设定选项,若您要自订各项设定则可选择[Custom(advanced)]的选项。

2012年5月29日

如何在Google blogger的文章的HTML程式码中直接插入Google Adsense的广告


如何在Google blogger的文章的HTML程式码中直接插入Google Adsense的广告
如果你希望你的Google Adsense广告出现在你想出现的文章位置,你可以参考以下的做法:
1.首先你必须在你的Google Adsense中建立一个你想要的广告,并按[获取代码]以取得JavaScript程式码。

图_如果你希望你的Google Adsense广告出现在你想出现的文章位置_1
图_如果你希望你的Google Adsense广告出现在你想出现的文章位置_1

2012年5月28日

Python-物件型态-数字


Python-物件型态-数字
1.整数四则运算
>>> 123+456579>>> 123-456-333>>> 123*45656088>>> 123/4560除法会只取整数结果

2012年5月21日

如何下载Trilead VM Explorer (VMX)

如何下载Trilead VM Explorer (VMX)


Trilead VM Explorer (VMX)是一套免费(Free)管理VMware的软体,它可以对VMware ESXi及Hyper-V Server 2008 R2的虚拟机进行档案备份,下载的方法如下:1.连线至http://www.trilead.com/Download/的网址2.勾选两个必读选项

如何寻找合适的VMware ESXi 版本安装虚拟主机(或伺服器,如IBM及HP各型号)

如何寻找合适的VMware ESXi 版本安装虚拟主机(或伺服器,如IBM及HP各型号)


1.输入寻找主机合适VMware ESXi版本的网址http://www.vmware.com/resources/compatibility/search.php2.选择主机的制造厂牌,如IBM, HP, DELL等.3.若还有其他资讯可在其他选项

如何注册及下载vmware相关免费(free)软体

如何注册及下载vmware相关免费(free)软体


1.进入VMware网站,点选"我的VMware" ,若是第一次登入请"注册我的VMware",若已注册过则直接登入即可。

如何建置免费的私有云或虚拟化环境(Free Private Cloud Computing with VMware Virtualization)

如何建置免费的私有云或虚拟化环境(Free Private Cloud Computing with VMware Virtualization)



相关文字说明,可参考VMware网站,本篇文章仅就操作面进行解说。首先需要下载相关的软体:
  1. VMware vSphere Hypervisor (ESXi)
  2. VMware vCenter Converter Standalone client
  3. VMware vSphere Client
  4. Trilead VM Explorer (VMX)

BlogAD