vB·流水账

生命在于折腾。

架设一个截图服务器

2013-6-4 vibbow

以下内容是关于在Ubuntu Server里架设一个基于PHP - Selenium - Firefox的网页截图服务器。

在进行接下来的操作之前,你需要一个VPS或者独立服务器,建议服务器拥有1G内存/2核心处理器或更高的配置。

废话不多说,直接进入具体步骤:


1. 安装Java。这里我安装的是OpenJDK 7,你也可以使用Oracle Java:

apt-get install openjdk-7-jdk

2. 安装配置 LAMP。这教程网上太尼玛多了,建议自行Google。我的方法是直接用Tasksel

tasksel install lamp-server
apt-get install php5-curl

3. 安装Xvfb

apt-get install xvfb

4. 安装Firefox以及文泉驿正黑字体

apt-get install firefox ttf-wqy-zenhei

5. 下载 Selenium,直接下载那个Selenium Server到服务器上即可。
下载地址:http://docs.seleniumhq.org/download/

6. 从 Github 上 Clone 下来我的源代码,将源代码放在网页目录下 (默认为/var/www)

https://github.com/vibbow/screenshot-server.git

7. 启动 Xvfb

Xvfb :99 -ac -screen 0 1024x768x24 > /tmp/xvfb.log 2>&1 &
export DISPLAY=:99

8. 尝试运行一下 Selenium,看有没有任何问题

java -jar selenium-server-standalone-2.33.0.jar

如果没有问题的话,最后Selenium会提示他监听在 0.0.0.0:4444。

9. 访问一下你的网站,看能否正常截图吧~~~


其他配置说明:

1. 如果你想让 Xvfb 和 Selenium 开机自动运行,可以将以下内容添加到自启动文件里 (内容仅供参考,请酌情修改)

Xvfb :99 -ac -screen 0 1024x768x24 > /tmp/xvfb.log 2>&1 &
export DISPLAY=:99 && java  -Xms64m -Xmx256m -jar /opt/selenium-server-standalone-2.33.0.jar > /tmp/selenium.log 2>&1 &

2. 如果你想能正确截取Flash,请安装以下包:

apt-get install flashplugin-installer

恩,应该就是这些步骤了,如果遇到问题的话,欢迎留言。

最后再来转条推:https://twitter.com/vibbow/status/341668152813441024

评论(3) 浏览(27669)

Download Office 365 / 2013 offline installation package

2013-3-24 vibbow

如果你想阅读中文版本,请点击这里

This article only applies to:
You already subscribe Office 365, but you want to download the offline installation package.
You already purchase Office 2013, but you want to install it in a different language.

 

Before download Office, you need to prepare few things:

1. Download Office Deployment Tool for Click-to-Run

http://www.microsoft.com/en-us/download/details.aspx?id=36778

Update: The latest "Office Deploy Tools for Click-to-Run" may have some issue with download, here is the old version, you can verify the digital signature to make sure this file is from Microsoft: setup.zip

2. A text editor, like notepad or notepad++. Except Microsoft Word

3. A fast and stable Internet connection. The size of offline installation package is about 1GB. So fast internet connect will save lot's of time.


Here is the step of How to download offline installation package:

1. Download "Office Deployment Tool for Click-to-Run", run it and extract it to a easy to find path, like "C:\Office15\"
点击查看原图

2. Go to the path you selected before (In this example, is "C:\Office15\"), use text editor to open configuration.xml, delete all the content, and copy the following content into it:

<Configuration>
  <Add SourcePath="C:\Office15\" OfficeClientEdition="64" >
    <Product ID="ProfessionalRetail">
      <Language ID="en-us" />
    </Product>
  </Add>
</Configuration>

In here, you need to change following staff:

  • Change "SourcePath" to the path you selected in the first step.
  • Change "OfficeClientEdition" to the edition of Office you want to download. 32 means 32bit edition, 64 means 64bit edition.
  • Change "Product ID" to the product you want to download. The list of Product ID is at the end of this article
  • Change "Language ID" to the language you want to download. The list of Language ID is at the end of this article.

3. Open "Command Line" (Click "Start", search "CMD", and run the "cmd" program), go to the path you selected at first step, then run the following command:

setup.exe /download configuration.xml

And now it will start to download Office. It may take a long time, so don't close the window before it says done.
点击查看原图

When the download is finished, congratulation, you had download the Office 365 / 2013


Here is the step of How to install Office using the offline installation package:

1. Go to the path you download Office, go to Office directory, go to Data directory, you will find a folder name with numbers. record this number.
点击查看原图

2. Go to the path you download Office, use text editor to open configuration.xml, delete all the content and copy the following content into it:

<Configuration>
  <Add SourcePath="C:\Office15\" Version="15.0.4481.1005" OfficeClientEdition="64" >
    <Product ID="ProfessionalRetail">
      <Language ID="en-us" />
    </Product>
  </Add>
  <Display Level="Full" AcceptEULA="TRUE" />
</Configuration>

In here, you need to change the following staff:

  • Change SourcePath, OfficeClientEdition, Product ID and Language ID to the same things when you download Office.
  • Change Version to the numbers you recorded in the first step.

3. Open "Command Line", go to the path you download Office, then run the following command:

setup.exe /configure configuration.xml

If you see the installation screen, then congratulation. If you got any errors, please make sure the xml file is currect. If the error are still happened, you can leave me a command after this article (If you know where to fill), or ask me on twitter: @vibbow


For the full list of product id / language id, please visit this link:
http://vsean.net/blog/post/191

评论(31) 浏览(114830)

Office 2013 / Office 365离线安装包下载方法

2013-3-14 vibbow

If you want to read English version, please click HERE

本文仅适用于:
订阅了Office 365,但是想下载离线安装包的用户。
购买了Office 2013,但是想安装其他语言的用户。

虽然Office 2013可以通过安装语言包来更改语言,但是没有原生的爽啊,于是花了一个小时,研究出了这么一个下载方法。请盗版用户主动无视,因为这里都是零售版的,你们的KMS,神Key神马的在这里不灵的~~~

在进行正式内容前,你需要先准备几样东西:

1. Office即选即用部署工具

http://www.microsoft.com/en-us/download/details.aspx?id=36778

更新:新版的Office部署工具在下载时可能会遇到问题,这里是旧版的部署工具,你可以验证文件的数字签名以确保文件是来自Microsoft:setup.zip

2. 一个文本编辑器
Windows自带的记事本或者Notepad++之类的都可以,别用word就行。

3. 一个相对稳定快速的网络连接
离线安装包大约有1GB的内容,因此一个高速稳定的网络能省很多事情。

接下来开始正式内容:

1. 下载“Office即选即用部署工具”,然后运行之,将其释放到一个比较好找目录里,比如说 D:\Office15\
点击查看原图

2. 打开你刚才选择的目录,打开 configuration.xml 文件,将里面的内容删掉,然后将下面的内容复制进去,保存:

<Configuration>
  <Add SourcePath="D:\Office15\" OfficeClientEdition="64" >
    <Product ID="ProfessionalRetail">
      <Language ID="zh-cn" />
    </Product>
  </Add>
</Configuration>

SourcePath里的内容改为你第一步选择的路径。
OfficeClientEdition里的内容改为你想下载的Office类型。32 表示32位版,64 表示64位版
Product ID里的内容改为你想下载的Office版本,具体版本号对应的参数请参考文章最末的附录
Language ID里的内容改为你想下载的Office语言,具体语言对应的参数请参考文章最末的附录

3. 打开命令行,进入你第一步选择的目录,然后运行以下命令:

setup.exe /download configuration.xml

这一步是实际的下载步骤,因此会在这里停留很长时间。只要你看一直有流量在跑,就说明这个程序没有挂掉,请不要看他没有什么动静就直接把他关了。
点击查看原图

等这一步下载完,你就成功的下载了Office 2013 / Office 365的离线安装包。


接下来说明一下如何使用离线安装包安装Office 2013 / Office 365

1. 进入你下载的目录,进入Office目录,进入Data目录,你会看到一个数字命名的文件夹,把这串数字记下来
点击查看原图

2. 回到你下载Office的目录,继续编辑configuration.xml文件,将里面原有的内容删掉,把下面的内容复制进去:

<Configuration>
  <Add SourcePath="D:\Office15\" Version="15.0.4481.1005" OfficeClientEdition="64" >
    <Product ID="ProfessionalRetail">
      <Language ID="zh-cn" />
    </Product>
  </Add>
  <Display Level="Full" AcceptEULA="TRUE" />
</Configuration>

其中SourcePath, OfficeClientEdition, Product ID, Language ID都改成和你下载时一样的内容
Version里的内容改成第一步记录的那串数字

3. 打开命令行,进入你第一步选择的目录,然后运行如下命令:

setup.exe /configure configuration.xml

如果你成功的看见了安装界面,那么恭喜你。如果任何一步提示了什么错误,请确定你没有操作错误,如果依然提示错误,欢迎在下面留言,我会尽可能的回答。


要查看完整的Product ID和Language ID列表,请参阅以下链接:
http://vsean.net/blog/post/191

评论(33) 浏览(50947)

让Windows 8自动开启数字键盘的方法

2012-12-7 vibbow

每次Windows 8开机的时候,数字键盘都是禁用的,还得按一下Number Lock,很不爽。

如果你也有和我一样的不爽,那么下载附件,双击导入里面的注册表以后就OK了~

下载:EnableNumLockWin8.zip

评论(0) 浏览(5192)

附件列表插件 for Emlog 5.0

2012-11-25 vibbow

插件很简单,就是找回在Emlog 5.0里被删除的,在文章末尾的那个附件列表。

没有图,也没有真像。需要的安装激活即可,无需任何设置。

此插件只兼容到Emlog 5.0.1

下载地址:attachment.zip

评论(3) 浏览(5388)