Ubuntu – Recover package configuration file using apt-get

Previously i have setup a server with Nginx and MariaDB.
Run Drupal 7 in Nginx

But there is one problem in this setup. I cannot restart the MariaDB service. Whenever it is down, i have to restart the server instance.

At first, i thought the failure is caused by the modification of the /etc/mysql/my.cnf. So i try to restore the original my.cnf. The following solution helps you to restore the default package configuration file.
Continue reading Ubuntu – Recover package configuration file using apt-get

李怡 – 五萬公帑給了五毛黨

藝評獎獲獎人賈選凝終於在內地《南方都市報》作了回應,她大言不慚地反問港人如此不滿,「是否代表我講中了?」

賈小姐,你那篇文理不通、前後矛盾、不知所云的文章,講中了什麼?反擊的輿論與網民,有誰從頭到尾拜讀過?一篇影評為什麼有這麼大的風波?大家針對的主要不是你的文章是好是壞,而是懷疑藝評獎的評審與你之間以私相授受的方式,拿公帑給了你這個五毛黨。證據嘛,請看看昨天本報論壇版鍾祖康的文章,其中指出你得獎文章說,《低俗喜劇》「將guilty pleasure變成guilt-free pleasure」,整句是來自藝評獎主席評審林沛理在2006年1月29日《亞洲週刊》上一篇文章,上面正正寫道:「性奴役的觀賞性亦由一種『罪疚的快感』(guilty pleasure)變成『無罪快感』(guilt-free pleasure)」!
Continue reading 李怡 – 五萬公帑給了五毛黨

陶傑 – 純粹論英文

香港人示威,舉英治時代的龍獅旗,英國的「每日郵報」刊登照片,引起許多英國網民幽默的支持,聲稱「歡迎香港重回英國版圖」,有的也對英國殖民主義「高度肯定」。

百分之九十九網民的評論,一看就知道是以英文為母語的本地人寫的,像這一條:「世界上後悔沒有英國管治的國家滿坑滿谷。他們當初趕走英國,都沒想到跟着來的是什麼」(There are loads of countries in the world who regret not having British rule now. They were so keen to dump us, they couldn’t see what was coming.)

可以判斷,這句英文出自以英語為母語的英國人之手,因為loads of countries,這樣的講法很地道。中國人的英語教科書,只機械地教many,a lot of,plenty of之類,loads of,是很本土的說法,而且countries之後,用的是who而不是which,也可以判斷是年輕一點的人。

但五毛黨是中國的特產。西方國家也有不少的五毛中國人,他們在英美讀書、謀生,思想紅彤彤,還留在他們的祖國。「每日郵報」這條新聞,有沒有中國五毛黨呢?憑英文的文法,以及Chinglish的「風格」,就可以找到。
Continue reading 陶傑 – 純粹論英文

Drupal 7 – Show YouTube video in LightBox2

The following HTML allows you to show a video in LightBox2.

<a href="http://www.youtube.com/embed/<VIDEO ID>?autoplay=1" rel="lightframe">Click me</a>

 

We could control the size of the popup.

<a href="http://www.youtube.com/embed/<VIDEO ID>?autoplay=1" rel="lightframe[|width:320px; height:240px;]">Click me</a>

 

Done =)

Reference:

Drupal 7 – Menu item is disabled after saving the node in different language

i found a bug with the i18n module. Assume i have a node in Traditional Chinese and i edit it in English. The menu item set Menu settings will be disabled after save.

A simple workaround is to alter the node edit form such that the user will be redirected to the language same as the node.
Continue reading Drupal 7 – Menu item is disabled after saving the node in different language

Drupal 7 – Create your own theme function on your custom block

More than a year ago, we have talked about some basic theming in Drupal 6.

In Drupal 7, there are some changes on the theming functions as well as the block hooks. So here is a slightly modified versions from the example of Drupal – Introduction to Drupal Theming @ 3. The logic behind is exactly the same.

ykyuen.info
Continue reading Drupal 7 – Create your own theme function on your custom block

Dream BIG and go for it =)