存个档,Adobe CS4系列软件破解方法

归类于免费资源 | 杂七杂八 | 网络技术 评论关闭

只要破解Adobe产品中的amtlib.dll库文件就能够轻松无限制使用Adobe CS4产品,具体过程如下:

1、更改系统host文件,更改方法如下:

打开C:\WINDOWS\system32\drivers\etc\ 目录,用记事本打开该文件,添加:

127.0.0.1 activate.adobe.com
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com

(直接将以上文字复制粘贴到Hosts文件即可)保存好后关闭。

上述操作的主要目的是阻止Adobe产品访问产品激活、序列号验证服务器,从而使安装时使用的序列号能长久使用。

2、安装Adobe CS4产品,安装过程中最好临时断开网络。

3、将破解文件amtlib.dll复制覆盖到Adobe CS4产品相应的安装目录,具体文件目录如下:

Photoshop CS4: C:\Program Files\Adobe\Adobe Photoshop CS4

Fireworks CS4: C:\Program Files\Adobe\Adobe Fireworks CS4

Illustrator CS4: C:\Program Files\Adobe\Adobe Illustrator CS4\Support Files\Contents\Windows

Flash CS4: C:\Program Files\Adobe\Adobe Flash CS4

Premiere Pro CS4: C:\Program Files\Adobe\Adobe Premiere Pro CS4

After Effects CS4: C:\Program Files\Adobe\Adobe After Effects CS4\Support Files

Dreamweaver CS4: C:\Program Files\Adobe\Adobe Dreamweaver CS4

InDesign CS4: C:\Program Files\Adobe\Adobe InDesign CS4

通过yum升级php到5.3.2版本的方法

归类于网络技术 9 条评论

去年9月安装的服务器,php的版本已经不能满足安装Kaltura Community Edition (KalturaCE)的需要了,于是必须升级php,采用yum update php*,竟然只能升级到5.1.6,看着安装提示里的:

Required PHP version 5.2.0 and above.  You need to upgrade your PHP

就对自己的服务器窝火,KalturaCE可是好东西呀,服务器不能直接升级PHP可麻烦了。

Kaltura logo
Kaltura logo

继续阅读

, , , , ,

修改MYSQL数据库默认编码的SQL语句

归类于网络技术 评论关闭

通过phpmyadmin新建了一个数据库,如果添加数据库时没有权限或者忘记设置合适的数据库编码,可以用一条sql语句实现。

以修改为gbk编码为例,修改MYSQL数据库默认编码的SQL语句如下:

Alter DATABASE `db_name` DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci

, , , , , ,

windows 2003常用快捷运行命令

归类于网络技术 评论关闭

善于使用Windows操作系统运行命令,是高手的表现,以下列出的是一些最常用的命令:

winver:检查windows版本
wmimgmt.msc:打开windows管理体系结构(wmi)
wupdmgr:windows更新程序
w脚本:windows脚本宿主设置
write:写字板
winmsd:系统信息
wiaacmgr:扫描仪和照相机向导
winchat:xp自带局域网聊天
mem.exe:显示内存使用情况
msconfig:启动
msconfig.exe:系统配置实用程序
mplayer2:简易widnows media player
mspaint:画图板
mstsc:远程桌面连接
mplayer2:媒体播放机
magnify:放大镜实用程序
mmc:打开控制台
mobsync:同步命令
dxdiag:检查directx信息
drwtsn32: 系统医生
devmgmt.msc: 设备管理器
dfrg.msc:磁盘碎片整理程序
diskmgmt.msc:磁盘管理实用程序
dcomcnfg:打开系统组件服务
ddeshare:打开dde共享设置
dvdplay:dvd播放器
nslookup:ip地址侦测器
net stop messenger:停止信使服务
net start messenger:开始信使服务
notepad:打开记事本
nslookup:网络管理的工具向导
ntbackup:系统备份和还原
narrator:屏幕“讲述人”
ntmsmgr.msc:移动存储管理器
ntmsoprq.msc:移动存储管理员操作请求
netstat -an:(tc)命令检查接口
syncapp:创建一个公文包
sysedit:系统配置编辑器
sigverif:文件签名验证程序
sndrec32:录音机
shrpubw:创建共享文件夹
secpol.msc:本地安全策略
syskey:系统加密,一旦加密就不能解开,保护windows xp系统的双重密码
services.msc:本地服务设置
sndvol32:音量控制程序
sfc.exe:系统文件检查器
sfc /scannow:windows文件保护(扫描错误并复原)
tsshutdn:60秒倒计时关机命令
tourstart:xp简介(安装完成后出现的漫游xp程序)
taskmgr:任务管理器 (2000/xp/2003)
eventvwr:事件查看器
eudcedit:造字程序
explorer:打开资源管理器
packager:对象包装程序
perfmon.msc:计算机性能监测程序
progman:程序管理器
regedit.exe:注册表
rsop.msc:组策略结果集
regedt32:注册表编辑器
rononce -p :15秒关机
regsvr32 /u *.dll:停止dll文件运行
regsvr32 /u zipfldr.dll:取消zip支持
cmd.exe:cmd命令提示符
chkdsk.exe:chkdsk磁盘检查
certmgr.msc:证书管理实用程序
calc:启动计算器
charmap:启动字符映射表
cliconfg:sql server 客户端网络实用程序
clipbrd:剪贴板查看器
conf:启动netmeeting
compmgmt.msc:计算机管理
cleanmgr:垃圾整理
ciadv.msc:索引服务程序
osk:打开屏幕键盘
odbcad32:odbc数据源管理器
oobe/msoobe /a:检查xp是否激活
lusrmgr.msc:本机用户和组
logoff:注销命令
iexpress:木马捆绑工具,系统自带
fsmgmt.msc:共享文件夹管理器
utilman:辅助工具管理器
gpedit.msc:组策略

, , , ,

常用Linux系统信息查询命令

归类于网络技术 评论关闭

经常要查看Linux下的操作系统信息,现将经常要用到的查询命令分类列出来如下:

系统信息查询命令

# uname -a               # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue   # 查看操作系统版本
# cat /proc/cpuinfo      # 查看CPU信息
# hostname               # 查看计算机名
# lspci -tv              # 列出所有PCI设备
# lsusb -tv              # 列出所有USB设备
# lsmod                  # 列出加载的内核模块
# env                    # 查看环境变量
 

资源信息查询命令

# free -m                # 查看内存使用量和交换区使用量
# df -h                  # 查看各分区使用情况
# du -sh <目录名>        # 查看指定目录的大小
# grep MemTotal /proc/meminfo   # 查看内存总量
# grep MemFree /proc/meminfo    # 查看空闲内存量
# uptime                 # 查看系统运行时间、用户数、负载
# cat /proc/loadavg      # 查看系统负载
 

磁盘和分区信息查询命令

# mount | column -t      # 查看挂接的分区状态
# fdisk -l               # 查看所有分区
# swapon -s              # 查看所有交换分区
# hdparm -i /dev/hda     # 查看磁盘参数(仅适用于IDE设备)
# dmesg | grep IDE       # 查看启动时IDE设备检测状况
 

网络信息查询命令

# ifconfig               # 查看所有网络接口的属性
# iptables -L            # 查看防火墙设置
# route -n               # 查看路由表
# netstat -lntp          # 查看所有监听端口
# netstat -antp          # 查看所有已经建立的连接
# netstat -s             # 查看网络统计信息
 

进程信息查询命令

# ps -ef                 # 查看所有进程
# top                    # 实时显示进程状态
 

用户信息查询命令

# w                      # 查看活动用户
# id <用户名>            # 查看指定用户信息
# last                   # 查看用户登录日志
# cut -d: -f1 /etc/passwd   # 查看系统所有用户
# cut -d: -f1 /etc/group    # 查看系统所有组
# crontab -l             # 查看当前用户的计划任务
 

服务信息查询命令

# chkconfig –list       # 列出所有系统服务
# chkconfig –list | grep on    # 列出所有启动的系统服务

程序信息查询命令

# rpm -qa                # 查看所有安装的软件包
 

附加:用find命令查找最近修改过的文件

        linux的终端上,没有windows的搜索那样好用的图形界面工具,但find命令确是很强大的。

        比如按名字查找一个文件,可以用 find / -name  targetfilename 。 唉,如果只知道名字,不知道地点,这样也不失为一个野蛮有效的方法。 

        按时间查找也有参数 -atime 访问时间 -ctime 改变状态的时间 -mtime修改的时间。但要注意,这里的时间是以24小时为单位的。查看man手册后使用,你会很迷惑: -mtime n: File<A1><AF>s data was last modified n*24 hours ago. 字面上的理解是最后一次修改发生在n个24小时以前的文件,但实际上:

        find ./ -mtime 0:返回最近24小时内修改过的文件。

        find ./ -mtime 1:返回的是前48~24小时修改过的文件。而不是48小时以内修改过的文件。

        返回10天内修改过的文件?find还可以支持表达式关系运算,所以可以把最近几天的数据一天天的加起来:

        find ./ -mtime 0 -o -mtime 1 -o -mtime 2 ……虽然比较土,但也算是个方法了。

        另外, -mmin参数-cmin / – amin也是类似的。

, , ,

电子书时代来临

归类于网络技术 评论关闭

        上周《纽约时报》有一篇文章,点评了电子书阅读器2008年的发展。我觉得,事情已经很明显了,电子书的普及比所有人预料的都要快,可能在5年内就要超过纸质书。

        下面是报道的译文,以及8款目前市场上的主流阅读器。

1. Eslick

屏幕:6寸

格式:PDF、TXT

价格:230美元(2009年3月上市)

公司:Foxit

网站:http://www.foxitsoftware.com/ebook/

2. iPhone

屏幕:3.5寸

格式:TXT,HTML

价格:300美元

公司:Apple

网站:http://www.apple.com/iphone/

3. Jetbook

屏幕:5寸

格式:TXT,PDF

价格:300美元

公司:ECTACO

网站:http://www.ectaco.com/

4. Kindle

屏幕:6寸

格式:AZW(Kindle format), PRC, MOBI, TXT

价格:359美元

公司:Amazon

网站:http://www.amazon.com/kindle/

5. Sony Reader 700

屏幕:6寸

格式:BBeB (Sony format), TXT, .PDF

价格:400美元

公司:Sony

网站:http://ebookstore.sony.com/reader/

6. iLiad

屏幕:8寸和10寸

格式:TXT,PDF,HTML,CHM(需安装第三方软件)

价格:700美元

公司:iRex

网站:http://www.irextechnologies.com/

7. 易博士 M218B

屏幕:5寸

格式:TXT,HTML,PDF

价格:2200元人民币

公司:广州金蟾

网站:http://www.jcnip.com/

8. 翰林 V3

屏幕:6寸

格式:PDF, DOC, WOL, HTML, TXT, CHM, FB2, DJVU

价格:2200元人民币

公司:天津津科

网站:http://www.jinke.com.cn/

========================

Turning Page, E-Books Start to Take Hold

Ebook的时代正在来临

原载2008年12月24日《纽约时报》

原文网址:http://www.nytimes.com/2008/12/24/technology/24kindle.html

作者:BRAD STONE,MOTOKO RICH

译者:阮一峰

Could book lovers finally be willing to switch from paper to pixels?

书籍爱好者会愿意放弃纸张,转向电子屏幕吗?

For a decade, consumers mostly ignored electronic book devices, which were often hard to use and offered few popular items to read. But this year, in part because of the popularity of Amazon.com’s wireless Kindle device, the e-book has started to take hold.

10年来,消费者一直忽略电子阅读器的存在,认为这些设备很难使用,而且不能提供流行读物。但今年,部分因为Amazon的无线阅读设备Kindle的畅销,它开始进入了主流市场。

The $359 Kindle, which is slim, white and about the size of a trade paperback, was introduced a year ago. Although Amazon will not disclose sales figures, the Kindle has at least lived up to its name by creating broad interest in electronic books. Now it is out of stock and unavailable until February. Analysts credit Oprah Winfrey, who praised the Kindle on her show in October, and blame Amazon for poor holiday planning.

kindle阅读器造型纤薄,颜色为白色,售价359美元,大小与一本平装书相同,1年前进入市场。虽然Amazon公司没有公布销售数量,但是这个产品引起了厂商对于电子书阅读器市场的广泛兴趣。 现在它已经脱销,可能要等到明年2月份才有新货上市。分析师将这归功于著名电视节目主持人Oprah Winfrey,10月份她在电视节目中公开赞扬kindle。分析师还批评amazon没有为销售旺季做好准备。

The shortage is providing an opening for Sony, which embarked on an intense publicity campaign for its Reader device during the gift-buying season. The stepped-up competition may represent a coming of age for the entire idea of reading longer texts on a portable digital device.

Kindle的短缺给Sony公司提供了可趁之机。Sony公司为自家的电子书阅读器,启动了针对年底销售旺季的紧密宣传计划。这种激烈的竞争,也许代表了一个在手持设备上阅读长文本的时代的来临。

“The perception is that e-books have been around for 10 years and haven’t done anything,” said Steve Haber, president of Sony’s digital reading division. “But it’s happening now. This is really starting to take off.”

Sony数字阅读器部门的总裁Steve Haber说,“电子书阅读器的概念大概已经存在10年了,但是发展很有限。事情现在有了变化,这个市场真的开始起飞了。”

Sony’s efforts have been overshadowed by Amazon’s. But this month it began a promotional blitz in airports, train stations and bookstores, with the ambitious goal of personally demonstrating the Reader to two million people by the end of the year.

虽然Sony在Amazon面前黯然失色,但是这个月,它开始在机场、火车站和书店大肆进行广告促销。Sony的目标是到今年年底向200万人出售电子阅读器。

The company’s latest model, the Reader 700, is a $400 device with a reading light and a touch screen that allows users to annotate what they are reading. Mr. Haber said Sony’s sales had tripled this holiday season over last, in part because the device is now available in the Target, Borders and Sam’s Club chains. He said Sony had sold more than 300,000 devices since the debut of the original Reader in 2006.

该公司最新的型号是Reader 700,价格400美元,配备背光和触摸屏,允许使用者在阅读时做笔记。Steve Haber说,Sony本季的销售量是去年的3倍,部分原因是这个设备如今在美国的主要书店中都有出售。他说,自从2006年,Sony开始发售这个产品的第一个型号以来,已经累计出售了30多万台。

It is difficult to quantify the success of the Kindle, since Amazon will not disclose how many it has sold and analysts’ estimates vary widely. Peter Hildick-Smith, president of the Codex Group, a book market research company, said he believed Amazon had sold as many as 260,000 units through the beginning of October, before Ms. Winfrey’s endorsement. Others say the number could be as high as a million.

目前,外界不知道Kindle的销售量是多少,Amazon对此保密。分析师的估计差别很大。有人相信,在10月份Oprah Winfrey开始推荐之前,已经卖出了26万台。其他人则说,数字可能高达100万。

Many Kindle buyers appear to be outside the usual gadget-hound demographic. Almost as many women as men are buying it, Mr. Hildick-Smith said, and the device is most popular among 55- to 64-year-olds.

许多Kindle的买家,看上去不属于传统的电子产品爱好者。购买者中,男女比例几乎相等。有分析师称,该设备在55-64岁人群中最流行。

So far, publishers like HarperCollins, Random House and Simon & Schuster say that sales of e-books for any device — including simple laptop downloads — constitute less than 1 percent of total book sales. But there are signs of momentum. The publishers say sales of e-books have tripled or quadrupled in the last year.

目前,美国主要的各大出版公司说,电子书籍的销售量(包括所有平台)不足总销售量的1%。但是,有强烈的上升迹象。去年一年电子书的销售量翻了3~4倍。

Amazon’s Kindle version of “The Story of Edgar Sawtelle” by David Wroblewski, a best seller recommended by Ms. Winfrey’s book club, now represents 20 percent of total Amazon sales of the book, according to Brian Murray, chief executive of HarperCollins Publishers Worldwide.

Oprah Winfrey在节目中推荐的“The Story of Edgar Sawtelle”一书,是电子书的销售冠军。有人透露,占到Amazon电子书总销售量的20%。

The Kindle version of the book, which can be downloaded by the device itself through its wireless modem, costs $9.99 in the Amazon Kindle store. The Reader version costs $11.99 from Sony’s e-book library, accessible from an Internet-connected computer.

该书可以通过无线网络,直接下载到Kindle上,价格是9.99美元。该书在Sony阅读器上的版本,售价是11.99美元,并且需要通过PC传输到阅读器上。

Even authors who were once wary of selling their work in bits and bytes are coming around. After some initial hesitation, authors like Danielle Steel and John Grisham are soon expected to add their titles to the e-book catalog, their agents say.

许多作者也注意到了这个趋势。在初期的观望之后,很多人都开始同意,将自己的作品做成电子版,在网上出售。

“E-books will become the go-to-first format for an ever-expanding group of readers who are newly discovering how much they enjoy reading books on a screen,” said Markus Dohle, chief executive of Random House, the world’s largest publisher of consumer books.

“许多人最近才发现,在屏幕上读书也是一件很享受的事。他们的人数正在不断增长。电子书将成为他们的首选。”世界最大的普通书籍出版商——兰登书屋的首席执行长Markus Dohle说。

Nobody knows how much consumer habits will shift. Some of the most committed bibliophiles maintain an almost fetishistic devotion to the physical book. But the technology may have more appeal for particular kinds of people, like those who are the heaviest readers.

没有人知道,多少人会改变自己的阅读习惯。一些最热诚的藏书家,对于实体书籍,有着一种近于迷信的热爱。但是技术的发展,对于另一些人的吸引力正变得越来越大。

At Harlequin Enterprises, the Toronto-based publisher of bodice-ripping romances, Malle Vallik, director for digital content and interactivity, said she expected sales of digital versions of the company’s books someday to match or potentially outstrip sales in print.

加拿大的一家爱情小说出版商认为,电子版的销售量总有一天会超过印刷版。

Harlequin, which publishes 120 books a month, makes all of its new titles available digitally, and has even started publishing digital-only short stories that it sells for $2.99 each, including an erotica collection called Spice Briefs.

该出版商每月出版120个品种,现在所有品种都有电子版。并且,一些短篇小说只有电子版出售,每篇的售价是2.99美元。

Perhaps the most overlooked boost to e-books this year — and a challenge to some of the standard thinking about them — came from Apple’s do-it-all gadget, the iPhone.

不过,今年电子书市场最被忽视的潮流,和对传统思维最大的挑战,来自Apple公司的万能小玩意——iPhone。

Several e-book-reading programs have been created for the device, and at least two of them, Stanza from LexCycle and the eReader from Fictionwise, have been downloaded more than 600,000 times. Another company, Scroll Motion, announced this week that it would begin selling e-books for the iPhone from major publishers like Simon & Schuster, Random House and Penguin.

已经有一些专门针对iPhone的电子书阅读程序,发布出来了。其中的Stanza和eReader的下载量,超过了60万次。Scroll Motion公司则宣布,本周起将提供主要出版商新书的iPhone版本。

All of these companies say they are now tailoring their software for other kinds of smartphones, including BlackBerrys.

所有这些公司都说,他们的软件可以为任何品牌的智能电话定制,包括黑莓。

Publishers say these iPhone applications are already starting to generate nearly as many digital book sales as the Sony Reader, though they still trail sales of books in the Kindle format.

出版商说,书籍的iPhone版同Sony Reader版的销售,已经几乎相同。虽然,两者都还远远落后于Kindle版。

Meanwhile, the quest to build the perfect e-book reader continues. Amazon and Sony are expected to introduce new versions of their readers in 2009. Adherents expect the new Kindle will have a sleeker design and a better microprocessor, allowing snappier page-turning.

与此同时,制造更完美的电子书阅读器的尝试,还在不断进行。2009年,Amazon和Sony都会发布各自阅读器的新版本。支持者预期,新版Kindle将变得更薄,处理器的主频将更高,翻页速度将更快。

Mr. Haber of Sony said future versions of the Reader will have wireless capability, a feature that has helped make the Kindle so appealing. This means that the device does not have to be plugged into a computer to download books, newspapers and magazines.

Sony公司阅读器的下一个版本,可能会配备无线上网。正是这个功能,使得Kindle变得很吸引人。有了它,阅读器不用连在电脑,也能下载书籍、报纸和杂志。

Other competitors are on the way. Investors have put more than $200 million into Plastic Logic, a company in Mountain View, Calif. The company says that next year it will begin testing a flexible 8.5-by-11-inch reading device that is thinner and lighter than existing ones. Plastic Logic plans to begin selling it in 2010.

其他的厂商也在追赶中。投资者已经给加州的Plastic Logic公司投入了2亿美元。该公司说,明年将开始试验一种8.5*11英寸、可弯曲的阅读设备。它比现有设备更薄更亮。Plastic Logic计划在2010年销售该产品。

Along the same lines, Polymer Vision, based in the Netherlands, demonstrated a device the size of a BlackBerry that has a five-inch rolled-up screen that can be unfurled for reading. There are also less ambitious but cheaper readers on the market or expected soon, including the eSlick Reader from Foxit Software, arriving next month at an introductory price of $230.

荷兰的Polymer Vision公司,也宣布了类似的可卷曲的阅读设备,屏幕为5英寸左右。另一些公司则准备提供更便宜的产品,Foxit软件公司将在2009年发售Eslick阅读器,价格为230美元。

E Ink, the company in Cambridge, Mass., that has developed the screen technology for many of these companies, says it is testing color screens and hopes to introduce them by 2010.

E Ink公司开发的电子墨水屏幕,正在被上述这些公司使用。该公司说,正在试验彩色屏幕,希望2010年前投入市场。

Many book lovers are quite happy with today’s devices. MaryAnn van Hengel, 51, a graphic designer in Croton-on-Hudson, N.Y., once railed against e-readers at a meeting of her book club. But she embraced the Kindle her husband gave her this fall shortly after Ms. Winfrey endorsed it.

许多书籍爱好者,很喜欢现在的这些设备。51岁的纽约图形设计师MaryAnn van Hengel,一度非常反感在电子屏幕上读书。但是,今年秋天,丈夫送给她一台Kindle后,她开始改变看法了。

Ms. Van Hengel now has several books on the device, including a Nora Roberts novel and Doris Kearns Goodwin’s “Team of Rivals.” She said the Kindle had spurred her to buy more books than she normally would in print.

她说,Kindle使得她去购买更多的书。如果读印刷版,她不会买那么多书。

“I may be shy bringing the Kindle to the book club because so many of the women were so against the technology, and I said I was too,” Ms. Van Hengel said. “And here I am in love with it.”

“当我参加读书聚会时,我会不好意思将Kindle拿出来。因为其他女性对新技术很反感。我说我以前也是这样,”Van Hengel夫人说。“但是,现在我爱上了新技术。”

(完)

, ,

Linux 系统信息查看命令大全

归类于网络技术 评论关闭

系统
    # uname -a # 查看内核/操作系统/CPU信息
    # head -n 1 /etc/issue # 查看操作系统版本
    # cat /proc/cpuinfo # 查看CPU信息
    # hostname # 查看计算机名
    # lspci -tv # 列出所有PCI设备
    # lsusb -tv # 列出所有USB设备
    # lsmod # 列出加载的内核模块
    # env # 查看环境变量

资源
    # free -m # 查看内存使用量和交换区使用量
    # df -h # 查看各分区使用情况
    # du -sh # 查看指定目录的大小
    # grep MemTotal /proc/meminfo # 查看内存总量
    # grep MemFree /proc/meminfo # 查看空闲内存量
    # uptime # 查看系统运行时间、用户数、负载
    # cat /proc/loadavg # 查看系统负载

磁盘和分区
    # mount | column -t # 查看挂接的分区状态
    # fdisk -l # 查看所有分区
    # swapon -s # 查看所有交换分区
    # hdparm -i /dev/hda # 查看磁盘参数(仅适用于IDE设备)
    # dmesg | grep IDE # 查看启动时IDE设备检测状况

网络
    # ifconfig # 查看所有网络接口的属性
    # iptables -L # 查看防火墙设置
    # route -n # 查看路由表
    # netstat -lntp # 查看所有监听端口
    # netstat -antp # 查看所有已经建立的连接
    # netstat -s # 查看网络统计信息

进程
    # ps -ef # 查看所有进程
    # top # 实时显示进程状态

用户
    # w # 查看活动用户
    # id # 查看指定用户信息
    # last # 查看用户登录日志
    # cut -d: -f1 /etc/passwd # 查看系统所有用户
    # cut -d: -f1 /etc/group # 查看系统所有组
    # crontab -l # 查看当前用户的计划任务

服务
    # chkconfig –list # 列出所有系统服务
    # chkconfig –list | grep on # 列出所有启动的系统服务

程序
    # rpm -qa # 查看所有安装的软件包

, ,

值得收藏的经典正则表达式

归类于网络技术 评论关闭

匹配中文字符的正则表达式: [\u4e00-\u9fa5]

匹配双字节字符(包括汉字在内):[^\x00-\xff]

应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)

String.prototype.len=function(){return this.replace([^\x00-\xff]/g,”aa”).length;}

匹配空行的正则表达式:\n[\s| ]*\r

匹配HTML标记的正则表达式:/<(.*)>.*<\/\1>|<(.*) \/>/

匹配首尾空格的正则表达式:(^\s*)|(\s*$)

String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, “”);
}

利用正则表达式分解和转换IP地址:

下面是利用正则表达式匹配IP地址,并将IP地址转换成对应数值的Javascript程序:

function IP2V(ip)
{
re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g //匹配IP地址的正则表达式
if(re.test(ip))
{
return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1
}
else
{
throw new Error(“Not a valid IP address!”)
}
}

不过上面的程序如果不用正则表达式,而直接用split函数来分解可能更简单,程序如下:

var ip=”10.100.20.168″
ip=ip.split(“.”)
alert(“IP值是:”+(ip[0]*255*255*255+ip[1]*255*255+ip[2]*255+ip[3]*1))

匹配Email地址的正则表达式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

匹配网址URL的正则表达式:http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?

利用正则表达式去除字串中重复的字符的算法程序:[注:此程序不正确,原因见红色字体]

var s=”abacabefgeeii”
var s1=s.replace(/(.).*\1/g,”$1″)
var re=new RegExp(“["+s1+"]“,”g”)
var s2=s.replace(re,”")
alert(s1+s2) //结果为:abcefgi

===============================
如果var s = “abacabefggeeii”
结果就不对了,结果为:abeicfgg
正则表达式的能力有限

我原来在CSDN上发贴寻求一个表达式来实现去除重复字符的方法,最终没有找到,这是我能想到的最简单的实现方法。思路是使用后向引用取出包括重复的字符,再以重复的字符建立第二个表达式,取到不重复的字符,两者串连。这个方法对于字符顺序有要求的字符串可能不适用。

得用正则表达式从URL地址中提取文件名的javascript程序,如下结果为2008

s=http://www.zuoxinwu.com/2008.htm
s=s.replace(/(.*\/){0,}([^\.]+).*/ig,”$2″)
alert(s)

利用正则表达式限制网页表单里的文本框输入内容:

用正则表达式限制只能输入中文:onkeyup=”value=value.replace(/[^\u4E00-\u9FA5]/g,”)” onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^\u4E00-\u9FA5]/g,”))”

用正则表达式限制只能输入全角字符: onkeyup=”value=value.replace(/[^\uFF00-\uFFFF]/g,”)” onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^\uFF00-\uFFFF]/g,”))”

用正则表达式限制只能输入数字:onkeyup=”value=value.replace(/[^\d]/g,”) “onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^\d]/g,”))”

用正则表达式限制只能输入数字和英文:onkeyup=”value=value.replace(/[\W]/g,”) “onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^\d]/g,”))”

]]>

, , , , ,

LINUX虚拟主机实现URL重写

归类于网络技术 评论关闭

, , , , ,

让长域名和长链接URL变短的方法

归类于网络技术 评论关闭

让长域名和长链接URL变短的方法

, , , , ,

顶部