Ubuntu – Find Check package version without installation

We can install package easily in Ubuntu by the apt-get command. But sometimes we may want to find out what packages are available in the repositories as well as the package version.

To search a package, use the apt-cache search <name> command.
For example, apt-cache search nginx
Continue reading Ubuntu – Find Check package version without installation

2012 in review

Happy Chinese New Year!

Keep getting new freelance opportunities since 2013. Hope it is a good sign. =D

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

About 55,000 tourists visit Liechtenstein every year. This blog was viewed about 730,000 times in 2012. If it were Liechtenstein, it would take about 13 years for that many people to see it. Your blog had more visits than a small country in Europe!

Click here to see the complete report.

陶傑 – 又見福克蘭

阿根廷女總統姬絲娜重申,福克蘭(又名馬維諾士)群島主權應該歸還阿根廷。

女總統寫了一封私人信給首相金馬倫,言詞強硬。首先,一開頭就是Mr Prime Minister David Cameron,沒有常用的禮貌語Dear,更加沒有香港商界祝酒詞常見的「尊敬的中聯辦什麼副部長」之「尊敬的」(The honourable),下款也沒有Best regards,或者Yours sincerely之類,跟香港中學生上的英文課完全兩回事。這封信還cc給聯合國秘書長潘基文,有羞辱意味。

阿根廷還在英國左派知識份子的衛報登全版廣告──不要以為「知識份子」就一定有原則,左派知識份子的報紙,也一樣是見廣告費而眼開的──申明一八三三年,英國的皇家海軍來到,「趕走島上的阿根廷居民」,從此將福克蘭(又名馬諾維士)據為殖民地,此一行動,是非法的,必須矯正。

但事實是:一百八十年前,英國的海軍來到時,島上只有幾百人:有西班牙人、愛爾蘭人、法國人,福克蘭是一座荒島,並無像香港新界一樣的「原居民」。
Continue reading 陶傑 – 又見福克蘭

Drupal 7 – Pass values from PHP to Javascript

During Drupal development, sometimes we may need to manipulate some server data in Javascript. In this case, we could create a custom module to retrieve the database data and pass it to browser such that we can it it in Javascript.

1. Implement the hook_init().

function <module-name>_init() {
  drupal_add_js(
    array(
      'eureka' => array( // we should use module name for best practice
        'data' => array(
          'Name' => 'ykyuen',
          'Blog' => 'Eureka!',
          'URL'  => 'https://eureka.ykyuen.info/',
        ),
      )
    ),
    'setting'
  );
}

Continue reading Drupal 7 – Pass values from PHP to Javascript

jQuery – Synchronize Text Input

In Drupal Development, very often we will use Views and Views Filter for searching data. For example, I have a content type which has two name fields.

  1. English Name – field_english_name
  2. Chinese Name – field_chinese_name

 

I would like to have a single text input filter which could search for these 2 fields with an Or condition.
Continue reading jQuery – Synchronize Text Input

陶傑 – 建設性意見

梁營派錢聘用遊行專才,以商業社會的角度,完全沒有問題。

請反梁的人士不要太偏激。

聘僱遊行隊伍,想法有創意,但在市場學上,梁營到底缺乏工商界精英支持,不太會做生意,在這方面吃虧了一點。

問題是每位二百五十元,出手太寒酸。首先是「二百五」,在北京的土話裏,是罵人話,「他這人二百五」,就是說「這人是儍仔」,梁營多廣東人,不明白,聽在中國的耳裏,就皺眉頭。

為什麼不每位至少三千?重賞之下,報名就踴躍了,隨時召集十萬人,僅費三億。這筆小錢,不必班子用公帑付,只要行會的嘴巴歪歪,眼皮眨一眨,就有許多富豪爭着掏腰包,一兩年後,留一塊地,或者什麼工程招標,就可以了。這才叫做政府。
Continue reading 陶傑 – 建設性意見

Dream BIG and go for it =)