Secure the SSH protocol by Key Authentication

My server was hacked. ToT

One day i found that i couldn’t login the server thru SSH and the CPU usage jumped to 100% for more than 12 hours. Finally i could login as root and found that a new user R00T was created and the SSH service was restarted with all settings in the sshd config file commented out. =.=

So from now on i will use Key Authentication instead of simple Password Authentication. Here is a very useful guide on Linode.com which shows you how to secure your server.
Linode Library – Securing Your Server

In order to use the Key Authentication, you need to generate the private key and public key on your desktop/labtop computers. This is straight forward if you are a Mac or Linux user who could use the ssh-keygen command. But for Windows user, you have to use 3rd party program like PuTTYgen. I suggest using WinSCP + PuTTY.
Continue reading Secure the SSH protocol by Key Authentication

選擇放下,就能活在當下

作者: 賴淑惠

我覺得自己的人生是頗幸福的,應付壓力的能力也不錯,若果你問我感到壓力的經驗,我會想到以下三個。

  • 路試考車
  • 在某船務公司工作,那裡的辦公室文化極差
  • 到日本自駕遊

以上都有一個共通點,就是一個人處理一些沒有信心可完成的事。特別是在那船務公司工作,那裡的所謂“同事”都是很仆街的,不過正是那次經驗讓我變得更堅強,更清楚自己的人生目標。

如果你見已經忘記了快樂的感覺,常常感受到壓力,這書或許會幫到你。

健吾 – 我仍相信有對錯

一個拜金、善忘與不懂得吸取歷史教訓的民族,註定一世為奴。

 

我仍相信有對錯

可是,我們仍然有權選擇相信甚麼是對,甚麼是錯嗎?

香港電台節目《鏗鏘集》曾經做過一個小研究。研究說,這十年內,香港的教育改革項目大大中中小小超過二、三百個:校本評核、推動閱讀、母語教學、校外評估、課程改革、水平參照、語文發展評估、學科改革、全人發展、國民教育、德育培訓……這些四字詞,充塞了老師的時間表。無線電視的新聞節目,也曾經請一位校長把他們強制進行的改革項目的英文縮寫,寫在黑板上。卡啪卡啪,這這那那,列滿整個黑板。

對教育問題,我是由心的揪心的。在公開考試中跑出,是除了中六合彩或三T、在畢菲特買中石油之前入市、加入娛樂圈、被有錢爸爸包養以外,一種最常用的「上進」方法。應付公開考試的責任,就成為了學校的重要包袱。

政府決定把「母語教學」這大劫,就像八萬五一樣輕輕的帶過。也真夠黑色幽默。教育,是人生的作業。教育改革,是以人作為白老鼠的實驗。評核一個教育改革成功和失敗,只有兩個常用的衡工量值方法。一是僱主是否滿意:英語程度、中文程度、全球見識、常識、紀律、責任心云云。我見過英語程度比我差,中文比我的爛中文更爛的上司,月薪比我高四五倍,也念茲在茲的說這一代的大學生太差。我也見過不少每天只想股票、女人和深圳按摩場的上司,說這一代的大學生不夠視野。畢竟,上一代評核這一代,上一代不會說這一代用電腦、找慾照快狠準這些能力。大學生很爛,就是他們的結論。甚至,令我有理由相信他們是出口術,極力痛陳這一代大學生的不濟,實質害怕我們這一代的能力。
Continue reading 健吾 – 我仍相信有對錯

PHP – Add text on an image with background color and save it on the server

About one and a half year ago, i published a blog post about adding text to image in PHP.
PHP – Add Text on an Image

The above example only display the image in browser, but it would not save the image on the server. Today i would like to show you another example which could save the image with text added on server.

What you need is 3 files.

  • index.php
  • kenshin.jpg (The image which you wanna add text on it)
  • arial.ttf (Or any other .ttf font file)

Continue reading PHP – Add text on an image with background color and save it on the server

BeansTag – Override existing meta tag if it already exists

Originally, BeansTag will check if there is any existing meta tags in the page which is going to be rendered. If exists, the BeansTag module will do nothing.

As requested by a BeansTag user, recently i have added a BeansTag settings page where you disable this checking.

 

If this option is checked. BeansTag will override the existing meta data.

Done =)

Reference: BeansTag – Override other metatag modules, possible?

DumpCamp – Introduction to New Relic


In the 2nd DumpCamp meeting, Ronnie showed us a SAAS service called New Relic which provides Application Performance Management solution mainly for web applications and servers. It’s capabilities include but not limit to:
 

  • Performance analytics on Ruby, Rails, PHP, Java, .Net, Python applications
  • Real User Monitoring
  • Server Monitoring
  • SQL/NoSQL Performance Monitoring
  • Web Application Transaction Tracing

The Lite account is free and i tried it today. The setup is easy and straight forward. Just register an account online with some configurations on your web server through SSH. Then you could views your server and web application performance online.
Continue reading DumpCamp – Introduction to New Relic

陶傑 – GDP神話

在英國遇到舊同學 R,他愁眉苦臉,說英國經濟破敗,歐盟也完了,沒有出路。

「確實是,」我知道英國人性格,英國人很懂得看眉頭辨臉色,遠方的人來了,討好對方,功夫有一套:「中國經濟正在急速發展,很多牛津劍橋的精英、哈佛 CEO都到了北京上海。」我順水推舟。

「中國每年經濟增長百分之八,一片興旺,城市越來越現代化,不像倫敦,你看,到處是舊房子。」 R說。

「這也是真的,是你們儍,」我答:「或者是你們頭腦很僵化。譬如:倫敦大笨鐘的國會大樓,三百多年了,追不上時代,如果你們把上下議院這座古老建築拆掉,蓋玻璃幕牆的百層摩天樓,從建築設計、物料採購、地盤泥工,然後裏面重新鋪電線、買傢俬、裝冷氣、換牆紙,通通是新的,這不就有了 GDP?」
Continue reading 陶傑 – GDP神話

Paul Mooney – Self-censorship in SCMP

On April 22, Wang Xiangwei, the new editor-in-chief of the South China Morning Post,informed me that my contract with the newspaper would not be renewed when it expired on May 21. I can’t say I was surprised.

Sitting in a hotel restaurant in Hong Kong on a hot April day, Wang stared down at the table as the conversation began, seemingly unwilling to make eye contact. After a few minutes of chit chat, I asked him directly about my contract. He fidgeted and said he would not be able to renew it due to budget problems.

To me it was clear that this was a political decision. For seven months, he had basically blocked me from writing any China stories for the newspaper. During that period, I only had two stories in the China pages of the newspaper–one on panda bears and one on compensation for AIDS victims. Some two dozen other story suggestions went unanswered by the China Desk–in one case a story was approved, but the editor told me Wang had overruled him. A half-dozen emails to Wang pleading to write more for the newspaper went unanswered.
Continue reading Paul Mooney – Self-censorship in SCMP

Dream BIG and go for it =)