Author: 芳草苑主

  • Samba can share files over internet

    Samba 太强大了,我没想到它可以在公网上共享文件和文件夹,如同在局域网内一样。

    如果给 samba server 一个公网 ip,就可以在 internet 上凭着 \\ip 就访问共享文件和文件夹。有点可怕,因为我原先认为 samba 会区别对待局域网内和局域网外用户,不经过一些特别的设置,samba server 不会让 internet 用户用 \\ip 访问共享文件和文件夹。事实不是这样,至少目前 samba 3.2.8 版不是。

    同理,如果把 WD Mybook World 建为 dmz,它的 public folder 就暴露给所有 internet users 了。

    所以得特别当心,如果想给 samba server internet visible,就不得设置 windows 局域网内共享常见的 guest 无密码访问。

  • CentOS Debian Fedora FreeBSD Ubuntu Comparison

    我还远没有资格做评测,CentOS Debian Fedora FreeBSD Ubuntu 里,除了用过 Fedora,其他的都没试用过。还有一些 linux distribution 有些近期不够活跃,有些在开源路线上不够明朗,对从零学起的用户来说,还是不用考虑把它们也加进 shortlist,就这些主流的 linux distribution 都已很让人困惑,该怎么选择?

    总的来说,选择谁都没有错,殊途同归。但可能这样的回答不会让人满意,那么根据我的研究结果,我用最短的词语来概括 CentOS Debian Fedora FreeBSD Ubuntu 特点,希望有助大家选择。

    • CentOS: 保证兼容(如果以后想买 redhat 其他产品的话)
    • Debian: 承诺免费(不用担心开发者日后见利起意)
    • Fedora: 技术追新(新版本的组件首先在 Fedora 实现,隔好久才能在 redhat 其他产品上见到)
    • FreeBSD: 发布活跃(相对Debian而言)
    • Ubuntu: 面向桌面(虽然近来在服务器领域日渐流行,但它毕竟是针对 laptop 和 desktop 设计的)
  • Ebuyer does not know what I want

    Yesterday I received an newsletter from ebuyer promoting an Extra Value PC at under £200. I particularly like the point no OS comes with this PC. However, the reason for not buying was its 32-bit CPU. I definitely want my next generation PC is 64-bit.

    I discarded that newsletter. The funny thing is just now I received another newsletter from ebuy promoting the same Extra Value PC, but with Vista Ultimate as a package. Of course price is increased, £264.98. It is making things worse.

    As many friends who know me know I hate Vista, ebuyer does not know what I want. Nevertheless, I can not expect ebuyer CRM system being so intelligent.

  • Cut copy paste in vim

    可能因为我刚入门 linux 吧,有些方面我还是认为它不太友好。比如在 ssh 状态使用 vim 作文本编辑器应该是绝佳的选择,我不指责它的编辑性能,倒是愣让人看不明白。难道它就非得用晦涩的文字写 manual?

    我无奈转向 google,一下子就找到了常人通俗易懂的语言,归纳如下:

    Cut 的等效快捷键
    dd delete current line
    D delete from cursor to end of line
    d$ delete from cursor to end of line
    d0 delete from cursor to beginning of line
    dw delete from cursor to end of current word
    db delete from cursor to beginning of current word

    Copy 的等效快捷键
    Y or yy copy (yank) one line
    2Y copy two lines
    10Y copy 10 lines
    yG copy all lines to the end of the file
    yw copy text from the current cursor position to the end of the word
    y$ copy text from the current cursor position to the end of the line

    Paste 的等效快捷键
    P paste above the current cursor position
    p paste below the current cursor position

  • I am with Fedora

    今天 Fedora 11 alpha 发布了。Fedora 10 我还没摸熟呢,Fedora 11 就来了,真让我高兴之中疲于奔命。

    无意中还发现 drupal, mediawiki, planet, wordpress 都包含在 Fedora 发行包中,这是不是跟 Fedora Project 自身使用了这几种技术有关?我的意思是:为什么不包含别的 packages,比如 magento, joomla, etc?

    Fedora 倡导的东西咱就支持一下。不管有用没有,咱全安装了(也就 drupal 暂时派不上用场)。

  • Actinic discounts.fil is giving away secrets

    I have many good reasons to dislike Actinic. One of the reasons is – as growing up to an Actinic expert, one can also be an Actinic hacker. In other words, Actinic is not nicely secured by the vendor. If an Actinic user wants enhanced security, he / she will work ten times harder to close the security hole.

    For example, Actinic does not have online database. Actinic keeps most of data offline, but it must have some data at server side, so itstores data in various files. This is a very doubtful approach. Of course all database software have bugs, but could Actinic file-based data do better than mysql, etc?

    Another example, I recently found Actinic stops recognising coupons after an update. During diagnosis, I found discounts.fil under acatalog folder serves as data file for coupon code etc. acatalog/discounts.fil can be accessed by public by default. All promotion secrets are exposed to competitors / customers by analysing this file. Coupon codes are hashed in discounts.fil, and hashing makes all original coupon codes not recognisable. The Actinic perl script does not compare hashed customer input coupon with hashed coupon code in discounts.fil. It compares raw customer input coupon with hashed coupon code in discounts.fil (of course they will not match). This is a bug in Actinic.

    I think closing security hole is out of most Actinic users’ capability. What is the point for an advanced Actinic user working so hard on Actinic?

  • I look out for RAID

    I am a little beef-witted. Not until today did I realise that all of RAID 0, 1, 5 can improve data access speed.

    When I had a computer with RAID interface about 2 years, I went online and read roughly what difference between RAID 0, 1 and 5. When I read RAID 1 is just mirroring 2 disks, I did not think carefully. I thought at that time – in RAID 1 two disks duplicate data independently, so RAID 1 only benefit data safety, not efficiency.

    Today, I read further then realise RAID 1 can improve data read speed by accessing difficent piece of data on 2 disks. Of course RAID 1 does not help data write speed.

    RAID 1 should be a very good choice for my server. I am also glad to learn RAID can be implemented by software.

  • Openbravo know what users want

    我想把 erp5 安装在 vmware 里,没想到非常麻烦,碰到了一些问题,实在不知道是 erp5 的问题,还是 vmware 的问题,只好 google erp5 vmware 求助。

    But I had a typo in query. I typed in erp vmware, and Openbravo came the first. 原来 Openbravo 针对 vmware, xen 等几个虚拟机分别打包,方便用户下载部署。我看了一下,似乎还没有第二家 erp 供应商为用户提供虚拟机环境的。虽然我今天找得不是 Openbravo,但它对用户的体贴还是要狠赞一个。

  • Gmail now support email template

    我几天前注意到 gmail ui2 改变了一下风格,当时以为只是 look and feel 改变,今天无意中发现 settings 里多了 labs (也可能这个 labs tab 早就存在了,我没注意)。有几个功能比较实用,我就启用了它们。

    最有用的要数 Canned reponses。之前 gmail 一直没有内置的邮件模板功能,虽然可以通过 firefox plugin 或者 google gadget 达到模板功能,但我总认为不够方便,也不够正宗,所以我一直忍受着没有模板的低效率。

    Canned reponses 声称是为懒人设计的(大概是从手机预置短信得来的启发),我用来做预置邮件模板,真是绝佳的解决方案。

  • How to import .vmdk file into vmware server 2.0?

    因为我想把一台虚拟机从一个 host OS 移动到另一个 host OS,所以我在想怎么导入和导出 .vmdk 文件。

    找遍 vmware server 的菜单没找到导入和导出命令,google 了一下好象其他人一讲到这个问题就说要用 vmkstools 来 convert .vmdk 文件,vmkstools 还不是免费的,这可把我愁坏了。再想了一下,虚拟机文件的迁移不该这么复杂啊,因为虚拟机的好处之一就是方便迁移,方便部署。我记得 vmware 1.x 还可以“打开”一个虚拟机文件,vmware 2.0 怎么就没有了呢?

    于是又琢磨了一会,发现原来我把简单的问题复杂化了。虚拟机的迁移只要把整个目录复制到 host OS virtual machine inventory 所在的目录下,然后使用 Menu Virtual Machine -> Add Virtual Machine to Inventory 即可。

    我想,虽然我的 host OS 是 windows,但 vmware server 2.0 已经使用了 linux chroot 那套架构,所有的虚拟机操作都必须在 inventory 目录下进行,导入导出当然得在 inventory 目录下进行,甚至虚拟机 guest OS 加载 host OS 里的 .iso 文件。

    如果 vmware server 2.0 的 host OS 是 linux,不知是不是启用了chroot?我暂时不知道。