Use the following command to check the memory usage of a specific process.
- cat /proc/<process ID>/status
You will get the following output. Continue reading Linux – Check Memory Usage of a Specific Process
Use the following command to check the memory usage of a specific process.
You will get the following output. Continue reading Linux – Check Memory Usage of a Specific Process
The master of art of living makes little distinction between his work and his play, his labour and his leisure, his mind and his body, his education and his recreation, his love and his religion. He simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him, he is always doing both.
Lao Tzu
By default Finder would not show hidden files. Use the following commands to change this setting.
Add the following line inside the HTML <head> to add the favicon.
Done =)
In debugging PHP program, i always use print() and print_r() to output the variable content to the browser. But this does not work when we are not using browser. A simple way to get the content is to write it to a file.
I found a nice post written by Ivan which provides this simple way with just a few lines of code.
Ivan Kristianto – [TIPS] Write print_r() Output To File Continue reading PHP – Write an Array/Object to File by print_r()
We could get the flagged items by making the flag_get_user_flags() call. Assume we have setup a user flag called connect, the following example will return a list of a “connected” users which are flagged by a specific user (uid = 29). Continue reading Drupal – Get flagged items of a specific user by PHP
The following example illustrates how to move a key value pair in an array.
Continue reading PHP – Move key value pair to the top/bottom of an array
【明報專訊】「你睇吓我哋呢個世界,睇下我哋呢個城市係乜嘢樣,除咗錢呢個字之外,我哋已經分辨唔出是非黑白,我哋每個人都被環境訓練到,好似倒模出嚟咁。鍾意食同一樣嘅嘢、鍾意同一樣電視節目、支持同一種政治立場,信奉同一種生老病死嘅做人方法,this city is dying, you know?」
無綫《天與地》Dr. Dylan金句,全城瘋傳,「城市之死」,成為最時髦議題。這城市的死因,劇中人只說出了箇中現象,問題還沒有說透。蔡子強兄日前在本版點出了關鍵所在——「沉默和冷漠」,為什麼大多數香港人對不公平不公義的事情,都選擇把頭別過去,「認命」,認為什麼都改變不了的態度?健吾兄再作了一番透徹的演繹。因為他們都「自我感覺良好」,覺得目前的處境還不算太差,還有口飯吃,還可以炒賣,炒不起樓還可以炒iPhone 4S,還有一定的自由,還不至於講句異見就被失蹤、被漏稅或被精神病。香港還是不錯的,大家還可以湊合覑,將就將就的過吧!
香港人的沉默和冷漠
回歸14年,香港急速衰敗,不能怨別人,是因為香港人的沉默和冷漠,香港人未衰到貼地仍自我感覺良好,是自招的必然結果。 Continue reading 吳志森 – 假如我們都願意活在黑暗中
Sometimes we may want to render a data without the theme page template. This is useful when we want to retrieve data through asynchronous call such as Ajax.
So let’s create a page content only .tpl.php in the theme folder called page-ajax.tpl.php. Continue reading Drupal – Render a page without page template for Ajax
You can convert the content type which you created manually into a Drupal module using Features. First, download and enable the module.
1. Go to Administer -> Site building -> Features and click Create feature. Continue reading Drupal – Create a Content Type Programmatically by Features