Wednesday, September 9, 2009

My first Google gadget: flickr-show

Here it is:



This example shows photos published by anyone on Flickr with the tag UT12.

[Update 2010-10-14] Version 1.1 is now functioning, with bug fixes and a photo pre-loading new feature.

Friday, August 21, 2009

Connecting Xbox 360 Wirelessly in Hospital

I am volunteering to build a few mobile gaming stations for the Mott Children and Women's Hospital, well, more for the Children's part, with Xbox 360 consoles. I am facing a dilemma of connecting the Xboxes to the network, preferably wirelessly. I've got a Microsoft USB 802.11g wireless adapter. The problems are on the network side.

At the University of Michigan Health System (UMHS), which the Mott hospital is part of, wireless networks are based on Cisco's Unified Wireless Network architecture. A segregated wireless LAN named guest is provided for patients and their families visiting the hospital, which so far has worked nicely for everyone.

Now, the problem. The guest WLAN requires authentication. The process is not complicated: You find the guest WLAN, connect to it, open a browser, enter your last name and a valid email address. That's it! Of course, in the unbounded wisdom of Microsoft product designers, they removed the browser from the game console, which means a user is able to connect to the guest wireless LAN, but has no way to go through that simple authentication process.

I have tried the MCEBrowser. The problem with that is that it requires Microsoft Windows Media Center to run, which is fine for home users but not in a hospital environment, not to mention the great pain that Windows Media Center is by itself.

One suggestion given to me is to use a Cisco wireless workgroup bridge to connect the Xbox 360, which is quite interesting and I will try that soon. However, I am not clear how that works around the authentication issue, yet.

Tuesday, August 11, 2009

VoIP, SIP, and Free Phone Calls

Now that I am switching to MagicJack, I got to try some SIP stuff.

This sounds very interesting: Connecting Google Voice directly via a SIP phone.

And so is this: MagicJack SIP info.

Wednesday, August 5, 2009

Drupal 6 + jQP + jQuery Plugins

I have been having some fun with jQuery lately and I truly love it. I write this article to log what I have put together for a project using Drupal and Ajax.

I work at MCIT of the University of Michigan Health System. I have been using Drupal as a platform for some in-house network management tools allowing our desktop support teams to help with supporting customers with some of their networking needs, such as moving a switch port to a different VLAN, changing the speed/duplex settings of a port, etc. Allowing direct customer facing support staff to perform those simple tasks simplifies the work flow and provides a better overall experience to the end user, yet enterprise network management tools such as Ciscoworks does not provide the level of granular control. By the way, is there anyone interested in a tool like this as a Drupal module? If so, I might get it cleaned up and open source it.

Anyway, the tool existed as a web application before I came along which was developed in PHP. I wanted to give it a more intuitive interface and better user experience. Drupal and Ajax are my choice of platform. As Drupal uses jQuery so naturally that becomes the choice of tool kit for building the user interface.

Drupal is a content management system (or CMS) with an active community around it. Documentation about installing and developing for Drupal can be found on their website and via Google. Everything else mentioned in this article needs a bit of work on your Drupal installation.

  1. jQuery and jquery_update


    Drupal has had jQuery since version 5 something. However, the Drupal core does not come with the latest version of jQuery. That is where the jquery_update module comes in. Simply download the module for your version of Drupal. If you are using Drupal 6, all you need to do then is enable to module. With Drupal 5.x however, you would have to follow the instructions in a file in the module's directory to complete the jQuery update.


  2. jQuery UI

    The jQuery UI plugin "provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications." More on the installation and use of jQuery UI later.


  3. jQuery Grid

    The jQuery Grid plugin does exactly what the name says, but it does that really well! Again, more details later. But in the mean time, I strongly recommend the demos that the project author, Tony Tomov, has built on his site.


  4. jquery-json

    "JSON plugin for jQuery, provides simple ways to convert to JSON and back again."


  5. jQuery Plugin Handler (jQP)

    The jQP module is the glue that one can use to put the pieces listed above in 2, 3 and 4 into Drupal.



To allow a Drupal module to use jQuery plugins, the jQP module can help. Install the jQP module just like any other Drupal module, enable it, then add the jQuery plugins.

A jQuery plugin may be installed in a number of different locations. For simplicity sake, I install all my jQuery plugins in the .../sites/all/js_libraries/ folder. This folder is one of those the jQP module searches for JavaScript libraries.

For example, I download the jQuery Grid plugin and unpack it in the jqGrid subdirectory under the above mentioned .../js_libraries/ folder, each version in a different sub-folder. So version 3.4.4 is in .../js_libraries/jqGrid/3.4.4/, version 3.5 in .../js_libraries/jqGrid/3.5/, etc.

Then create a .../js_libraries/jqGrid/jquery.jqGrid.info file with the contents below:

name = jquery.jqGrid
description = Files from jQuery jqGrid plug-in.
project_url = http://www.trirand.com/blog

scripts[0][0] = 3.4.4/jquery.jqGrid.js
stylesheets[0][0] = 3.4.4/themes/basic/grid.css
stylesheets[0][1] = 3.4.4/themes/jqModal.css

scripts[3.4.4][0] = 3.4.4/jquery.jqGrid.js
stylesheets[3.4.4][0] = 3.4.4/themes/basic/grid.css
stylesheets[3.4.4][1] = 3.4.4/themes/jqModal.css

scripts[3.5][0] = 3.5/jquery.jqGrid.js
stylesheets[3.5][0] = 3.5/css/ui.jqgrid.css
stylesheets[3.5][1] = 3.5/css/jquery.searchFilter.css


The above .info file will show three entries in the Drupal Administer » Site building » Javascript libraries page:



Now, to use the default version of the jQuery Grid plug-in, add this line to the code:
 drupal_add_js_library('jquery.jqGrid');

Or add this line to use a particular version:
 drupal_add_js_library('jquery.jqGrid', '3.4.4');

Tuesday, August 4, 2009

谷歌 Chrome OS 和 Linux

我可能是少数中的少数:我一直对苹果的机器、操作系统不感兴趣。可能我这人也 cheap,首先苹果产品的价格我拒绝接受。其次 Linux 和开源软件世界给予我的个人自由是吸引我的最大因素,远远超过 Mac OS 美观的外表。

刚刚读了这篇文章《Will Linux Shine as Google Chrome OS?》,我同意作者 Christopher Smart 的观点,谷歌此举对 Linux 和开源软件有益。让用惯 Windows 的人去接受另外一种是用电脑的方法,是要花很大的功夫的。谷歌 Chrome OS 如果成功,她最直接的作用就是让用户亲身体验 Windows 之外的使用电脑的方法。尽管 Chrome OS 是针对 netbook(上网本)这个档次的机器,但是一个用户用过 Chrome OS 之后再延伸到 netbook 之外,相对就容易多了。

Monday, August 3, 2009

Deal of eeePC 900A on Buy.com

Buy.com is selling Asus eeePC 900A's for $179.

If they had put a 8GB SSD in it, instead of a measly 4GB, this would be a sweet deal. A webcam would be a plus.

Sunday, August 2, 2009

低功耗家用服务器

家里现在有两台服务器,一台是用一个很老的奔腾3(Pentium-III)改装的,换过电源,目前应该说还不错。只是主板只能用 PC133 内存,目前装到 512MB 已经到极限,没法再扩展。另外一台是自己组装的,用的一个 NewEgg 买来的组件,目前也还不错。问题是现在硬盘都已经基本上被我塞满了,所以必须想些办法了。

网上找到这个博客:Lower Power Computing,可以关注一下。

Friday, July 31, 2009

Netbooks

有一段时间了,对市场上的 netbook 大批出现极感兴趣。后来一位同事挑唆,忍不住买了一台翻新的(refurbished)Dell Mini 9。一用之下,爱不释手。机器来的时候安装的 Ubuntu 8.04,不久 9.04 出台,我就给她装上了,效果非常不错。平时我基本上用 Google 的 Gmail 和网上办公软件,有她之后更觉方便,基本上可以随时随地看点什么,或者写点什么。不久之前回国,外甥女看了也爱上了这台小机器,于是我就送给了她。因为行程匆忙,没有时间教她怎么连接国内的 DSL 服务上网,结果被我妹夫找人把 Ubuntu 给换成了 Windows。

这个小插曲让我觉得有些失落。上网搜了一下“Linux netbook”,有这样感觉的还真不止我一个。有人问“Has Microsoft Killed the Linux Netbook?”“Is Linux dead in the netbook water?”也有人宣称“Demise of the solid-state Linux Netbook”。华硕(Asus)本来是第一家做 netbook 的电脑商,也经不起金钱的诱惑,向微软投怀送抱

对我个人而言,用 Linux 有十几年了,所以用 Ubuntu 得心应手,没有丝毫的不便。特别是 9.04 的出台解决了许多硬件兼容问题,让安装使用都更为方便。当然我也理解微软视窗系统使用者的心理,人对于自己熟悉的环境、事物总是恋恋难舍,这是自然。然而我用 Linux 最大的理由是我对于个人自由不可剥夺的崇尚,美国人有一句话,不自由毋宁死 (Patrick Henry: "Give me Liberty, or give me Death!")。用了一段时间 netbook 我最大的心得就是她给人的自由:我可以用她来阅读、写作、工作、娱乐;用 Skype 我可以与远在中国南方老家的父母“面对面”交谈。这一切用以前的 laptop 也能做到,只是 netbook 让你更减少一点负重。

从中国回来之后,把家里的 iTalkBB 换成了 MagicJack。目前使用的时间还不长,看来效果还不错,唯一的缺点是要有一台 Windows XP PC 一直开着才能打电话。当然,我也可以要打电话的时候才开机,其余时间就让进来的电话留言好了。不过,现在有了 netbook 这也不是一个大问题,我到 eBay 上找了一台便宜的 eeePC 900,接上 MagicJack 的 USB 接口,装上里面带的软件,就成了。可惜 MagicJack 现在还不支持 Linux,不然我就可以把 Windows XP 也去掉了。再装上 Skype,家里父母要找我也随时都可以了。

没有了我的 Mini,很有些不习惯。于是又到 eBay 上搜索了一番,找到一台配置相当的 Asus eeePC 901,最后价钱加运费一共 $201.98,也与我的那台 Mini 差不多。等机器到了,要做的一件事就是装上 Ubuntu 9.04!如果能找微软把上面预装 XP 钱要回来就更理想了,不过想想算了,没时间找他们算这笔小账。

Saturday, June 20, 2009

Ubuntu 服务器安装

用了很多年的 Gentoo Linux,每次更新的时候总是有这样那样的错误,有些累了。逐渐桌面上转向 Ubuntu,服务器改用同样的系统似乎也更合乎情理一些。

家里现在的服务器一台老的 PATA 硬盘开始出现故障,昨天安装系统的一台机器是从 NewEgg 买来的一个使用 VIA C3 的套件安装的。开始安装 Ubuntu 9.04 的时候还算顺利,但是装完之后出现一些问题,不知道是否与硬盘上有一些老的系统文件有关。但是重新安装之后还是死机,想来可能还是与网上其他人发现的 ACPI 问题有关。

于是下载了 8.04,安装过程基本顺利,就是在识别硬盘上原有的 RAID 和 LVM 设置的过程没有 9.04 那么流畅,8.04 基本上得手动走过整个 RAID 和 LVM 设置的程序,其实也不用做什么,原有的 RAID 和 LVM 设置都可以保留。这也是用 LVM 的一个好处吧,后期修改存储容量比较方便。

网络地址设置


系统安装过程中好像没有手工设置网络地址一块,每次都是自动选择 DHCP。好在这块的设置不难,网上发表的资料搜一下就有。网址的设置是在 /etc/network/interfaces 文件里,把原来用 DHCP 的一行注释掉,加上静态的网址设置就成了:
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 172.16.4.88
netmask 255.255.255.0
network 172.16.4.0
broadcast 172.16.4.255
gateway 172.16.4.1

之后,还要做一下网络端口的重新启动:
sudo pkill dhcp-client
sudo /etc/init.d/networking restart

这之后,就不必人守在服务器前面了,系统管理的工作基本上都可以通过 SSH 来做。

Tuesday, May 12, 2009

Using Google for jQuery

刚刚看了这篇《3 reasons why you should let Google host jQuery for you》,很有道理。这段时间用 Drupal+jQuery 写了一个客户网络接口管理的软件,慢慢上了路。对于 jQuery 的许多功能还没有真正用上,现在仅仅 Ajax 这一块就让我有了许多的惊喜。以后慢慢地可以在这里写一些心得下来。

[Update]
Upon revisiting the article quoted above, I found an update by the author, Dave Ward, titled Do you know about this undocumented Google CDN feature? -- Just what I was looking for!