Change Linode VPS hostname on Ubuntu

這個問題已經困擾了我好一陣子,但是也不太影響功能運作所以我也就放著了,今天偶然搜尋到這篇文章,才讓我恍然大悟。

主要的目標是要更換 Ubuntu 上面的 hostname,這原本只是一件再簡單不過的是,然而,至少在 linode 上你必須多做一個動作才能辦到。一般來說更動 hostname 是去修改 /etc/hostname 即可,但是在 linode 上的 ubuntu 11.10,無論你把 hostname 改成什麼都會被 linode dhcp server 指定的 hostname 給覆蓋(通常是 lixxx-xxx)。所以在更改 /etc/hostname 之後還要到 /etc/default/dhcpcd,找到

SET_HOSTNAME=‘yes’

這行,把它改成

SET_HOSTNAME=‘no’

然後重開機就可以了。重開機的目的主要是讓他所有設定能夠徹底的重跑,login 的時候也能順便確認是不是已經順便 apply 自己的 hostname 了。

, , , ,

沒有回應

brew install irssi issue on OS X Lion

The main problem is during the installation of irrsi through Homebrew. Since Apple has altered the perl lib path to a different location, therefore we are gonna have to modify the formula to get it done. However, there’s a folk has personally released his own version to be a temp solution for now, as following:

brew install https://raw.github.com/AndrewVos/homebrew/master/Library/Formula/irssi.rb

this quick post is just to memo, in case i need it someday …

, , ,

沒有回應

Ubuntu 10.10 Youtube 全螢幕問題

實在是受不了 windows deploy 開發環境的種種麻煩,就決定把 laptop 換 Ubuntu Desktop,又因為 11 還有些問題存在,所以就先裝 10.10。大致上都用得很爽,剛剛想看 youtube 的時候,發現全螢幕模式 freeze 了,google 看了幾個方法後,紀錄一下對我有用的方法(也有人說去右鍵調 setting 就可以,但是對我無效)。

「如果你是用 Ubuntu 10.10 又用 Intel 的內建顯卡,看 flash base video player 開全螢幕會卡住(有聲音影像不動)」,解法如下:

sudo mkdir /etc/adobe
sudo su
sudo echo \"OverrideGPUValidation = 1\" >> /etc/adobe/mms.cfg

以上。

, , ,

沒有回應

jQuery Plugin: TagSelect

It has been a while since my last post, cuz I am too lazy to do so. Anyway, here’s my new post with a newly drafted jQuery plugin: TagSelect.

The basic idea of the plugin is that we developers would sometimes have to develop tag selection function in web forms, and the usual way to do this is by checkbox or radiobox with an option named “others”, like this:

Actually, we can do this much easier instead of having these massive html codes.

With a given source as JavaScript Array, we transform all the tags into html link button, the users could either click the button to choose from exist tags or add their own by typing it themselves.

Furthermore, it also allows developer to apply autocomplete function with jQuery Autocomplete.

note: what I employed is the older version of jquery autocomplete and has been deprecated, it’s not compatible with the latest version as a part of jQuery UI. However, you could hack the code to apply this plugin to jQuery UI Autocomplete if you want, which is not a hard work.

UPDATE: The latest version now supports the latest version of jQuery UI Autocomplete instead of the deprecated one.

syntax:

$.tagselect(datasrc, delimiter, $input, ac_enable, jqueryui_css);
datasrc: Your data source as an array. delimiter: Used to separate your tags. $input: Target input/textarea element. ac_enable: Whether enable jQuery UI Autocomplete or not. true/false jqueryui_css: You can employ your own customized css for jQuery, set the jqueryui_css as your css’s URL or location. If there is no value given, the default would be the basic theme of jQuery UI.

And it’s really simple to do this:

HTML:

<input id="input1" class="selected-input" type="text"/>

JavaScript:

var tags1 = [ ‘線上遊戲’, ‘網頁遊戲’, ‘社交遊戲’, ‘行動遊戲’, ‘單機遊戲’, ‘PS2′, ‘N64′, ‘NDS’, ‘PSP’, ‘PS3′, ‘XBOX’, ‘Udyr’, ‘Annie’, ‘Nocturne’, ‘Rammus’, ‘Taric’ ];
$(‘#tag1′).tagselect(tags1, ‘ ‘, $(‘#input1′), ac_enable=true);

It would detect if the autocomplete function exists or not, if so then apply it automatically.

Demo: TagSelect Demo Src: TagSelect@Github

, , , , ,

沒有回應

Fred Wilson’s 10 Golden Principles of Successful Web Apps

The 10 Golden Principles of Successful Web Apps from Carsonified on Vimeo.

Spend some time for this, it should be worth listening.

,

沒有回應