Monday, December 29, 2008

IE 6 CSS vs The Standart CSS

http://msdn.microsoft.com/en-us/library/bb250395(VS.85).aspx

Sunday, December 28, 2008

CS3 reactivate problem

1. 进入C:\Documents and Settings\All Users\Application Data\FLEXnet目录;
2. 找到 adobe_00080000_tsf.data 这个文件,删掉它或者将它移到其他地方;
3. 重新运行Flash/Fireworks/Dreamweaver…. 照常注册激活,一切OK~~

http://moscar.cn/?p=598

Wednesday, December 24, 2008

glassfish default setting

location: /usr/local/glassfish-v2ur2
user:admin
pass:adminadmin

http:8080
https:8181
admin:4848

Play RMVB in ubuntu 2

http://hi.baidu.com/rogertu/blog/item/eeeb2013aeec7c26dc54017d.html
一、使用自带的Totem Movie Player播放
1、安装ubuntu-restricted-extras
直接通过 Synaptic Package Manager 安装
2、安装w32codecs
下载安装文件w32codecs_xxx_i386.deb(http://debian-multimedia.org/pool/main/w/w32codecs/)来安装

之后,自带的"Totem Movie Player"即可播放rmvb格式文件。
但在测试时发现不能播放Audio Codec为“Real Aduio 10 (ACC)”格式的rmvb文件,error log(通过consolei启动时可看到)如下:

GStreamer encountered a general stream error
** Message: Error: GStreamer encountered a general stream error.
rmdemux.c(943): gst_rmdemux_loop (): /play/decodebin0/rmdemux0:
stream stopped, reason not-negotiated
(totem:11550): GStreamer-CRITICAL **: gst_object_unref: assertion `object != NULL' failed

目前还不知如何解决。

二、使用MPlayer播放
1. 如“一、使用自带的Totem Movie Player播放”中描述,安装ubuntu-restricted-extras和w32codecs
2. 安装MPlayer
直接通过 Synaptic Package Manager 安装
3. 修改"/etc/mplayer/mplayer.conf"文件(解决不能全屏播放问题)
去掉配置行"#zoom=yes"中的注释符"#"

目前还没有发现不能播放的rmvb文件。

三、使用RealPlayer播放(from: http://www.ubuntux.org/how-to-install-the-realplayer-multimedia-player)
1. Download the RealPlayer11GOLD from http://www.real.com/linux to your home directory.
2. Open Terminal (from this point on, you must have admin rights).
3. Type sudo chmod +x RealPlayer11GOLD.bin
4. Type sudo "./RealPlayer11GOLD.bin"
5. Follow prompts. It'll start the installer. Do as it instructs and hit Enter.
6. It'll ask for the install path. Default is fine and hit enter.
7. It'll ask for a confirmation of install path. Press F to Finish the install.
8. It copies files, installs icons, etc. When you get the prompt, it's done.
9. To launch the app, go to Applications > Sound & Video > RealPlayer 11.

目前还没有发现不能播放的rmvb文件。

Play RMVB in ubuntu

http://www.simplehelp.net/2007/07/27/how-to-play-rmvb-files-in-ubuntu/

This tutorial will take you step by step through installing all of the software necessary to play rmvb (RealMedia Variable Bitrate) files in Ubuntu Linux.

Though the steps and screenshots are specific to Ubuntu, they will likely be similar for other versions of Linux. With that said, be sure to read the MPlayer README file if you’re not using Ubuntu. Similar to some of the other tutorials on Simplehelp, this is almost certainly not the only way to play .rmvb files in Ubuntu, but it’s the easiest way I could find. If you know of a easier method, by all means please feel free to leave a comment.

1. The first step in playing .rmvb files in Ubuntu is to use the Synaptic Package Manager to install MPlayer. When you mark MPlayer for installation, you’ll be prompted to install additional software packages (if they’re not already installed).

play rmvb files in ubuntu linux
click to enlarge
2. After MPlayer has been installed, exit out of the Synaptic Package Manager and visit the MPlayer binary codec download page. Download the codec package for your platform (for example, if you’re using a 32bit Intel or AMD processor, download the Linux x86 package).

Save the file to your desktop (or home folder). Once the download has completed, double-click that file. Select the folder to uncompress, and click the Extract button.

play rmvb files in ubuntu linux
click to enlarge
3. Choose a location to extract the files (your desktop is ideal) and again click Extract.

play rmvb files in ubuntu linux
click to enlarge
4. Make sure the files extracted correctly. They’ll be in a folder titled essential-date.

play rmvb files in ubuntu linux
5. Open up a Terminal by selecting Applications -> Accessories -> Terminal.

play rmvb files in ubuntu linux
6. Enter the following commands (and your password when prompted):

cd Desktop
cd essential-date
sudo mkdir /usr/lib/codecs
sudo cp * /usr/lib/codecs

play rmvb files in ubuntu linux
click to enlarge
7. NOTE: you may need to install libstdc++5 to get .rmvb files to play. Even though it might not be necessary for you, it can’t hurt to install (the package isn’t very big). Run the command: sudo apt-get install libstdc++5 in a Terminal, or use Synaptic and search for libstdc++5. Thanks to everyone who commented (see comments below) for the tip.
8. Launch MPLayer by selecting Applications -> Sound & Video -> MPlayer Movie Player. Right-click in the Mplayer - Video window and select Preferences from the menu.

play rmvb files in ubuntu linux
9. Select the Video tab and change the Available drivers: to x11 X11 (XImage/Shm).

play rmvb files in ubuntu linux
click to enlarge
10. Select the Codecs & demuxer tab and change the Video codec family: to RealVideo decoder and the Audio codec family: to FFmpeg/libavcodec audio decoders. When you’re done, click OK and close down MPlayer.

play rmvb files in ubuntu linux
click to enlarge
11. Locate one of your .rmvb files, right-click it and select Properties.

play rmvb files in ubuntu linux
12. Select the Open With tab and change whatever the default is to MPlayer Movie Player. Click Close.

play rmvb files in ubuntu linux
click to enlarge
13. Double-click any of your .rmvb files and they should open up in MPlayer and start playing.

play rmvb files in ubuntu linux

Thursday, December 18, 2008

How to install uTorrent in Ubuntu with wine

http://news.softpedia.com/news/uTorrent-under-Ubuntu-in-3-Easy-Steps-49037.shtml

sudo apt-get install wine

wget http://download.utorrent.com/1.7.5/utorrent.exe

wine utorrent.exe

http://news.softpedia.com/news/uTorrent-under-Ubuntu-in-3-Easy-Steps-49037.shtml
Step 1 - Install Wine

Open a console and type:

CODE
sudo aptitude install wine

Step 2 - Create uTorrent executable script

CODE
sudo gedit /usr/bin/utorrent

A text editor will open, just paste in the following lines. Remember to leave a blank line after the code below!

CODE
#!/bin/sh
cd ~/utorrent/
if [ "$1" != "" ]; then
var="`echo $1 | sed 's////g'`"
var="Z:${var}"
wine utorrent.exe "$var"
else
wine utorrent.exe
fi

Save and close. This will create a script in your /usr/bin/ folder. You still need to make this script executable, so type the following command in a console:

CODE
sudo chmod a+x /usr/bin/utorrent

Now create a folder called utorrent in your home directory, then download the latest version (Standalone, NOT the installer) of the uTorrent application from Softpedia and place it in the folder you've just created.

Step 3 - Create Desktop Shortcut

In this final step, we're gonna create a desktop shortcut for the uTorrent script above, so you don't have to type any command at all.

Right click on your desktop and go to "Create Launcher...". On the new launcher window, fill the fields as follows:

Type: Application
Name: uTorrent
Command: wine "/your-home-directory/utorrent/utorrent.exe"
Comment: BitTorrent Client

Install KTorrent with WebGUI on Ubuntu

http://lukedoomer.blogspot.com/2008/02/install-ktorrent-with-webui-on-ubuntu.html

1. ktorrent needs php executable path to show web interface so you have to install php command-line interpreter as well

sudo apt-get install php5-cli ktorrent

2. go to Settings / Plugins to load Web Interface plugin first

3. switch to WebInterface Options. if php executable path field shows "Php executable isn't in default path, please enter the path manually" or the light color is red, just set the path to /usr/bin/php then it'll turn green.

https://help.ubuntu.com/community/KTorrent
http://packages.ubuntu.com/feisty-backports/net/ktorrent
http://blog.nanaimoinn.com/index.php?blog=3&p=541&more=1&c=1&tb=1&pb=1
http://en.wikipedia.org/wiki/Comparison_of_BitTorrent_clients

Friday, December 12, 2008

Making aMule Server

http://blog.m-wei.net/?p=308
以前,我都是開我的桌上型電腦來掛驢子,但是想了想,在房間裡面開兩台電腦熱的要命,因此最近我在我的部落格伺服器上裝了 aMule daemon 來掛。

這裡伺服器端和客端都用的是 ubuntu 8.04

首先在伺服器上裝上 amule-daemon

sudo apt-get install amule-daemon

安裝完成後,先修改 /etc/default/amule-daemon 檔案,開啟編輯器

sudo vim(或其他編輯器) /etc/default/amule-daemon

修改該檔案的以下兩部份

# Configuration for /etc/init.d/amule-daemon

# The init.d script will only run if this variable non-empty.
AMULED_USER="(伺服器上的使用者名稱)"

# You can set this variable to make the daemon use an alternative HOME.
# The daemon will use $AMULED_HOME/.aMule as the directory, so if you
# want to have $AMULED_HOME the real root (with an Incoming and Temp
# directories), you can do `ln -s . $AMULED_HOME/.aMule`.
AMULED_HOME="(伺服器上的家目錄位置)"

然後啟動 amule-daemon 以將 amule.conf 製造出來

sudo /etc/init.d/amule-daemon start

製造 md5sum 編碼過的密碼(會用到)

echo -n (密碼) | md5sum

將 - 符號前輸出的字串記起來(可以先透過終端機複製起來)

打開先前家目錄位置中的 .aMule/amule.conf

sudo vim(或其他編輯器) 先前設定的家目錄位置/.aMule/amule.conf

找到 [ExternalConnect] 並編輯下方內容:

[ExternalConnect]
AcceptExternalConnections=1
ECAddress=
ECPort=4712
ECPassword=(先前抄下的字串)
...

之後,將 server.met 塞到 .aMule 目錄
從 http://www.server-met.de/ 找到 All Active & Fake-Free Server.met 下載連結,抄起來(或是複製起來,只怕連結網址會變),然後輸入以下指令讓伺服器下載

wget (剛剛的網址) -O 先前設定的家目錄位置/.aMule/server.met

最後(如果有啟動 ufw 的話),透過 ufw 打開防火牆的一些埠:

sudo ufw allow 4662/tcp
sudo ufw allow 4665/udp
sudo ufw allow 4672/udp
sudo ufw allow 4672/udp

還有要打開遙控的 port 才行

sudo ufw allow proto tcp from (客端 IP) to any port 4712

對了,如果不要限定遙控的 IP 的話那指令就很短:

sudo ufw allow 4712/tcp

設定完成,重新啟動 amule-daemon

sudo /etc/init.d/amule-daemon restart

伺服器端的工作就完成嚕~^_^”

您可以在客戶端裝上 amule-utils-gui(Windows 也有同樣的軟體可以使用)
開啟 amulegui 連線到您的伺服器玩驢子啦

Sunday, December 7, 2008

幾個關於 pureftpd / smbfs / samba 的notes

http://blog.serv.idv.tw/2004/09/26/175/

最近在把一台freebsd 5機器架上 pureftpd / smbfs /samba ,使其當作 ftp / file server,期待藉由區域網芳的串聯,把該server自己的大硬碟和週邊windows client的小硬碟串連起來,這樣要找資料時就不用連到各個機器去一個硬碟一個硬碟找。

同時間,要從外面連回去時也可以用ftp的方式直接連到該 ftp server,一次存取所有資源。

以下是安裝過程中的一些 notes:

[pureftpd]:
在freebsd/linux下,為了要讓 pureftpd可以存取用smbfs掛上去的遠端磁碟機資料,必須在編譯時加上下列參數:
–without-sendfile

[smbfs]:

可以使用
smbutil view

察看有提供連線的資料,使用
mount_smbfs //[username]@[host]/[service] [mountpoint]

來試著連線。

若要加入 /etc/fstab 使開機後自動mount,請先編輯 /etc/nsmb.conf
加入[host:user]的 section,注意! host及section都必須為大寫,既使平常輸入的是小寫!
然後在該section加入
password=[encrypted_password]

的資訊。 encrypted_password 可由
smbutil crypt

這個指令算出來。

最後,在 /etc/fstab 裡加上:
//[username]@[host]/[service] [mountpoint] smbfs rw,-N,-u=[uid],-g=[gid] 0 0

等資訊,用 mount -a 測試看看,用 umount -A -t smbfs 卸載。

[samba3]:

安裝完 samba3後,到/usr/local/etc/smb.conf 設定:
passdb backend = tdbsam
display charset = UCS-2LE
unix charset = CP950
dos charset = CP950

其他使用工具:
pdbedit : 建立使用者帳號

smbpasswd : 更改使用者密碼

samba3 放到一些東西在 /var/db/samba 中,備份時別忘記。

以上的standalone server 都要到 /etc/rc.conf 下加 pureftpd_enable=”YES” 這類資訊。

Map your Windows shared folder into Linux

ref: http://randomspark.wordpress.com/2007/09/02/map-your-windows-shared-folder-into-linux-kubuntu/

This tasks seems simple enough if it were done on a full Windows network. The idiot-proof privilege of mapping a network drive through the Explorer interface will take you only a few seconds (given that you know your away around the Explorer right-click menus of course). The ‘Map Network Drive’ feature still hasn’t made its way into today popular Linux desktop distros (like K/Ubuntu), but it is possible to actually map your shared folder by “mounting” it as an extra drive.

First off, make sure that you have the latest samba and smbnfs packages installed. You can get them by doing the following command if you don’t have them yet:

$ sudo apt-get install samba smbfs

You need the samba packages in order for you to access Windows-based networks (workgroups, for example). This lets you browse through those shared folders in Windows computers on your network.

smbfs lets you mount an smb share on your Linux system, which makes it look like its an extra drive. Kind of like a “mapped network drive” in Windows.

After installing those two, try browsing through your network’s shared folders. Click on ‘Remote Places->Samba Shares’, you should see a list of all the Windows workgroups available on the network. You can also try typing in (at the file browser’s address bar) the IP of the computer where the shared folder is, in the following format

smb://[ip_of_remote_pc]/yoursharedfolder (egs. smb://10.10.1.23/documents)

or

smb://[ip_of_remote_pc]/ (egs. smb://10.10.1.23/)

Now to mount your Samba network share, type the following commands (as normal user):

$ smbmount //server/share /home/user/mount-point -o username=yourusername,password=yourpassword

That should map the shared folder as a local drive.

Mount smbfs
掛載遠端磁碟機 on ubuntu 的方法:
mount -t smbfs -o iocharset=utf8,codepage=unicode,unicode //遠端主機名稱/資料夾 /本機掛載目錄

it is the same as add a Common Internet Filesystem (cifs) by using webmin!

Thursday, December 4, 2008

電腦節 20 叮嚀

http://chinese.engadget.com/2008/12/04/hk-buy-computer-careful-point-hk/

一、事前做功課:
不做功課會後悔的機會超過六成,如果你是生手,那鐵定超過九成。做功課的方法很簡單,要去之前,看一下網頁,請教一下高手。

二、選定想買的產品型號:
在去之前,你應該知道你要買什麼產品,以及哪個型號?為免怕缺貨的問題,你可以多選中意的幾個。萬一真的因缺貨而要選其他型號,若是不熟的產品,請三思再下決定,換型號沒想好的話,有時候會買到不適合或是較貴的產品。

三、找尋真正的店員:
香港大部份店舖均充斥著不同的品牌推廣員(十個店員中有八個是推廣員),所以在詢問價格前要先弄清他是什麼品牌的推廣員(他們薪金以佣金計算),因為你一旦跟某個推廣員纏上,你整天便不能跟該店另外一位店員談話(不明文規定:每位客人只可跟一位店員交涉,避免報錯價情況出現)大部份推廣員均會有該品牌衣服作適別之用。

四、不要完全聽店員的推薦:
不是說店員的話不能信,而是根據經驗,會推利潤較高的機會很高,不見得會推真正比較好的。當然,你若真的不懂,想聽店員的推薦,可以。多聽幾家後,再做交集,這樣就會比較準了。另外,對自己有信心,你自己找好的機種,被店員嫌棄,可別以為是自己的問題,有時候店員會否定你的話來達到他販售的目的。(天呀,我想得真黑暗)

五、所有店舖均包零點及試屏幕(購買LCD屏幕適用):
部份店員會跟你說,廠商規定只會更換有三點死點或光點的產品,他們同樣這樣保證。若然有兩點死點或光點,他們一概不更換。事實上,所有批發商均不會因死點或光點問題與零售商更換來貨,所以每間零售商均會有一定的問題LCD屏幕,只是你會不會押中。(每間零售商均會在盒上作暗號以表明該LCD屏幕有否死點或光點)

六、一般來說沒有九折過外的貨品(電腦展除外):
以平日來說,電腦場內的貨品,店員是不可能提供九折以上的拆扣予顧客。因為大部份貨品的來貨價只是正價的九三至九五折,所以沒有店舖會做賠本生意的。當然廠商當時有特別推廣計劃除外。(注意:部份店舖會把廠商的贈品扣起,然後稱減價賣給顧客,所以價格實際上並沒有便宜,購買前還是先注意廠商有什麼優惠吧!)

七、不要相信任何到貨倉或分店拿貨的說話:
大部份的零售商貨倉就在店內,若店員說要到貨倉或分店提貨,要求你等十五分鐘,那你的貨品很有可能來自兩個途徑。
1. 店員到另一商舖拆借貨品。
2. 店員把陳列品重新包裝以售賣給你。(你在眼前看到的陳列品同樣是成本之一,沒有店舖是不售賣陳列品的。)

八、小心檢查盒的底部或條碼:
大部份廠商現時均會在盒的頂底貼上透明膠帶,以便消費者知悉該產品是否有被開啓,這看似完美的做法。但其實店家在取出陳列品時,均會從底部取出,以保護頂部的透明膠帶。另外,若以條碼封口的話,則在條碼上封上透明膠帶,只要尺寸剛好,一般消費者難以察覺。若條碼位於膠袋上開啓時則用熱風筒吹向條碼,同樣可保條碼潔淨。所以若你認為你買的可能是陳列品,記緊小心檢查盒的底部或條碼。

九、不要付訂金:
買不到就算了,你不會損失什麼。除非你熟店家,不然的話,到時他說拿不到貨blabla,要你換貨還是幹嘛的,你會很麻煩的。要記住,「天下絕對沒有完美的3C產品」,不用抱著這次買不到,下次就沒機會的心態。(一手交錢,一手交貨是最好的)

十、預先選定結算方法:
你與店員一番爭辯後得出來的價格,大多是現金價錢,若你願意付現金,當然沒有問題。若不行馬上拿出你的EPS,告訴店員你要付EPS,大多店員均會馬上說好。因為EPS的手續費有限,加上你馬上拿出EPS代表的買的明確意願,店員會二話不說為你服務。若你付Credit Card 或分期,應提早告知,以免雙方浪費時間。一般Visa、Master Card 要加2%、AE Card 加3%、分期付款 加5%。

十一、要發票:
有的廠商保養需要發票,別為了貪便宜就不拿發票了。除此之外,如非必要請讓店員把有盒上的 Serial Number 條碼撕走,因為這 Serial Number 條碼到廠商有可能換到禮品。
十二、多跑多看:

你第一次問到會最便宜最優惠的價格幾乎等於零。不需要一開始覺得不錯就把錢付出去了。
十三、別貪小便宜:

如果你問到有一家特別便宜,你別以為你賺到了。一定要記得殺頭生意有人做,賠本生意沒 人做。會便宜很多,一定有特別原因,除非你找到原因,不然看看就算了。當然,並不是便宜就是會騙人,不便宜就是不騙人,黑心商人有時候把問題產品賣更貴, 這就是人性呀。

十四、配件一定要檢查
不少資訊產品會在配件動手腳,你不檢查小心這裡被黑,被調包為副廠、甚至仿冒都有可能。

十五、若能的話,兩人以上同行
兩人以上同行有很多好處,一來可以殺價,二來多隻眼睛。產品檢查完後,你可能會去領錢,別讓你的產品離開視線,有的黑心店家會偷偷掉包你的產品,這時另個人就很好用了。

十六、展覽中有人向你推銷東西
大仔,若嫌身上錢多,可以請客就算了。有人向你推銷東西,無論如何都要拒絕。此外,不幸若被推銷成功了,回家後若後悔了,你有七天鑒賞期,可無條件退貨。

十七、財不露白,錢請放好
人多的地方,是小偷的天堂。再加上電腦節3C產品這麼貴有錢人多的是。

十八、女生建議穿多一點
在人多人擠人的時候,女生會不會被吃豆腐很難說。我曾經跟SHOW GIRL一同走一段路程,結果她被摸屁股,如果你穿得火辣,在人擠人時,實在很難不控制不和陌生人身體的接觸。穿多一點至少可以保護一下重點部位。

十九、不到最後一刻絕不輕言拿出錢來
買的東西請決定好,檢查好、要拿走時,再給錢。到最後一刻你只要錢沒拿出來,覺得有所不妥,都可以掉頭走人,不用不好意思。若一開始就給錢,你就只好乖乖跟著店家走了。

二十、雖然便宜,但老闆態度不好
老板的態度不好,你還奢求他的售後服務嗎?

Thursday, November 20, 2008

圖文教學 如何設定Pfsense 為Vpn Server

http://www.pczone.com.tw/vbb3/thread/16/143430/
pfSense 是一個自由、開放源碼可定制的系統,適合用作防火牆與路由器,功能強大,可做 Firewall、NAT、DHCP、PPTP VPN、流量控制等。今天這裡就向大家介紹下 用於 PPTP VPN Sever 設置了!

首先登陸到 pfsense 的管理界面
http://wiki.osslab.org.tw/@api/deki/files/106/=1.jpg


選擇 VPN--->PPTP
http://wiki.osslab.org.tw/@api/deki/files/107/=2.jpg


在彈出的界面選擇 Configuation ,並輸入WAN 的 IP 和 VPN 將分配的 IP 段,填好後單擊最下面的 Save, 接著要記得單擊 Apply changes 應用按鈕哦。
http://wiki.osslab.org.tw/@api/deki/files/108/=3.jpg

然後選擇 Users ,點旁邊的 + 按鈕來添加 VPN 帳戶
http://wiki.osslab.org.tw/@api/deki/files/109/=4.jpg

輸入帳戶ID和密碼,然後 Save。
http://wiki.osslab.org.tw/@api/deki/files/111/=6.jpg


接下來,選擇 Firewall--->Rules
http://wiki.osslab.org.tw/@api/deki/files/112/=7.jpg


在彈出的界面選擇 PPTP VPN 來添加一條規則連
http://wiki.osslab.org.tw/@api/deki/files/102/=8.jpg


添加一條規則連,允許 PPTP 的 TCP/IP協議進入到 LAN
http://wiki.osslab.org.tw/@api/deki/files/103/=9.1.jpg
http://wiki.osslab.org.tw/@api/deki/files/104/=9.2.jpg


save後就可以看到下面的畫面了,點選 Applyy changes 應用
http://wiki.osslab.org.tw/@api/deki/files/105/=10.jpg

OK,PPTP VPN server 就設置好了

Monday, November 17, 2008

Use pfSense to set IPSec VPN

CUHK
setting client
http://www.cuhk.edu.hk/itsc/chinese/network/vpn/cwinxp.html
setting host
http://www.cuhk.edu.hk/itsc/network/vpn/fedora.html

MONO howto.
http://doc.m0n0.ch/handbook/ipsec-tunnels.html
pfsense howto.
http://doc.pfsense.org/index.php/VPN_Capability_IPSec