2010年4月30日 星期五

session 和 IE 的問題

今天發現一個很奇怪的問題.....
原本寫的 PHP 程式, 在 firefox, ie 都運作的很好, 後來, 因為功能上要區隔開, 所以將二個網站分別加了 domain name 來 連結,
突然, 組長說, 登不進去.
試了一下子, 發現在 ie 裡會有問題.... 看來是 session 的問題, 又查了一陣子, 發現使用 IP 登入時, session 可以正常運作, 一旦使用 domain name , 就不行了.
試了很久, 發現 session and cookie 都有相同問題.
google 找了很久, 總於發現了一個很不起眼的問題, 今天早上瞄了很多次, 但一直沒想到會是這個問題...
原來, 是 domain name 的名稱不能用 - 或是 _ , 如果用了這二個特殊的字元, session 的動作在 firefox 沒有問題, 可以正常使用, 但是在 ie 裡, session 就有問題....
例如, s_ttrc.nttu.edu.tw 這種網址, 使用 ie 瀏覽器的話, session 就有狀況, 不會有作用, 但是在 firefox 還是好的.
請將網址改為 sttrc.nttu.edu.tw 這樣, ie 瀏覽器使用 session 才會正常.....

還能說什麼呢......

底下這個位址, 是尋找過程中, 覺得還不錯的. 留下來備用.
http://genotrance.wordpress.com/2006/11/23/session-cookies-rejected-by-internet-explorer/

給孩子的備忘錄(作者:梁繼璋)

引用自 http://hk.myblog.yahoo.com/leungkaicheungmichael/article?mid=17394

作者的部落格 http://hk.myblog.yahoo.com/leungkaicheungmichael

給孩子的備忘錄(作者:梁繼璋)

我兒:

寫這備忘錄給你,基於三個原則:
(一)人生福禍無常,誰也不知可以活多久,有些事情還是早一點說好。
(二)我是你的父親,我不跟你說,沒有人會跟你說。
(三)這備忘錄里記載的,都是我經過慘痛失敗得回來的體驗,可以為你的成長省回不少冤枉路。

以下,便是你在人生中要好好記住的事:
(一)對你不好的人,你不要太介懷,在你一生中,沒有人有義務要對你好,除了我和你媽媽。至於那些對你好的人,你除了要珍惜、感恩外,也請多防備一點,因為, 每個人做每件事,總有一個原因,他對你好,未必真的是因為喜歡你,請你必須搞清楚,而不必太快將對方看作真朋友。
(二)沒有人是不可代替,沒有東西是必須擁有。看透了這一點,將來你身邊的人不再要你,或許失去了世間上最愛的一切時,也應該明白,這並不是甚麼大不了的事。
(三)生命是短暫的,今日你還在浪費著生命,明日會發覺生命已遠離你了。因此,愈早珍惜生命,你享受生命的日子也愈多,與其盼望長壽,倒不如早點享受。
(四)世界上並沒有最愛這回事,愛情只是一種霎時的感覺,而這感覺絕對會隨時日、心境而改變。如果你的所謂最愛離開你,請耐心地等候一下,讓時日慢慢沖洗,讓 心靈慢慢沉澱,你的苦就會慢慢淡化。 不要過分憧憬愛情的美,不要過分誇大失戀的悲。
(五) 雖然,很多有成就的人士都沒有受過很多教育,但並不等如不用功讀書,就一定可以成功。你學到的知識,就是你擁有的武器。人,可以白手興家,但不可以手無 寸鐵,緊記!
(六)我不會要求你供養我下半輩子,同樣地我也不會供養你的下半輩子,當你長大到可以獨立的時候,我的責任已經完結。以後,你要坐巴士還是Benz,吃魚翅還 是粉絲,都要自己負責。
(七)你可以要求自己守信,但不能要求別人守信,你可以要求自己對人好,但不能期待人家對你好。你怎樣對人,並不代表人家就會怎樣對你,如果看不透這一點,你 只會徒添不必要的煩惱。
(八)我買了十多二十年六合彩,還是一窮二白,連三獎也沒有中,這證明人要發達,還是要努力工作才可以,世界上並沒有免費午餐。
(九)親人只有一次的緣份,無論這輩子我和你會相處多久,也請好好珍惜共聚的時光,下輩子,無論愛與不愛,都不會再見。

你的爸爸
梁繼璋
(轉載自東週刊之梁心話) www.eastweek.com.hk 可上網瀏覽其他專欄內發表過的文章

2010年4月16日 星期五

open source的磁碟重整軟體

UltraDefrag

官方網站: http://ultradefrag.sourceforge.net/

open source的磁碟重整軟體, 支援 32 及 64 位元版本.
目前為止, 個人認為還不錯.

操作動作, 可參考 http://izaka.pixnet.net/blog/post/24891114 , 很詳細.
還有這個也可以參考 http://blog.joaoko.net/archives/1283

2010年4月15日 星期四

轉檔

很久沒有做轉檔, 最近在轉檔, 發覺都將之前的東西丟掉了...
這幾天, 好不容易又找出幾個軟體, 趕快記下來做個備份.
以下說的, 除了特別注明的之外, 都是 open source 或 free software

DVDFlick,
可以直接將 AVI 加字幕轉成 DVD video 的 iso 檔. 很簡單. 但是字幕的字型, 中文字預設是用細明體, 我試了好久, 就是找不到中文字型, 勉強可以接受的, 就是 arial ms unicode 這種.
如果DVD播放時的字型要好看, 就用下面的方式.

FormatFactory, 格式工廠, 可以轉換各種格式,
我的做法是使用 FormatFactory , 先將 AVI 及字幕檔轉成 mpeg2 格式, 在這裡就可以指定字幕的字型使用中文字型. 例如我選擇用中文的中黑字體. 它會將字幕嵌入到 mpeg2 檔案裡, 接著再用 DVDFlick 將它轉成 DVD video 的 iso 檔, 就可以燒錄了.
缺點是, 要轉二次, 時間是前一個的二倍. 大約要三小時(以內).

如果要轉成 VCD, 先用 DVDx 將 mpeg2 以 VCD 格式轉檔, 並且切成 一片 650MB 大小的影片. 再用 NERO(這是版權軟體) 燒錄為 VCD.
做這個 VCD 時, 突然發現, 現在要轉 VCD , 好像更麻煩了.... 大概都以 DVD 為主了吧. ^_^

w3schools

學習 html, css, php, mysql, javascript.... 等等, 好地方.

http://www.w3schools.com/

2010年4月11日 星期日

在 linux 底下,簡單又快速的製作光碟印象檔


http://lzy-blah.blogspot.com/2007/10/linux.html

2007年10月18日 星期四










在 linux 底下,簡單又快速的製作光碟印象檔








cat /dev/cdrom > mycd.iso

對,就這樣就好了
順便印出 md5 吧
md5sum mycd.iso
md5sum /dev/cdrom
印出兩者後,比對看看是否一樣

不然就丟給程式自己比對吧 XD
md5sum mycd.iso > mycd.iso.sum ; md5sum -c mycd.iso.sum
成功的話,他會印出

mycd.iso: 沒問題













ThinkPad 系列 laptop 加上中鍵捲動功能

http://lzy-blah.blogspot.com/2007/09/linux-thinkpad-laptop.html



2007年9月27日 星期四










[教學]在 linux 上,替 ThinkPad 系列 laptop 加上中鍵捲動功能








前些日子跟某長輩聊天,發現有許多使用 ThinkPad 的 linuxer
竟然都沒去用 ThinkPad 的中鍵捲軸?
雖說沒用也不會怎樣,不過還是少了個好用的功能阿
( netman 大大,我絕對不會說是你的)
其實問題要解決很簡單...就只要加上兩行字就可以了
這邊還是以 Ubuntu 為例,其他 Linux 套件發行版本亦雷同
請跟著我這樣做
sudo gedit /etc/X11/xorg.conf
然後找出下面敘述的這一段

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

把他改成
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
EndSection

然後重新啟動 X-Window 就可以使用中鍵捲動功能了 :D

ThinkPad 系列 laptop 加上中鍵捲動功能

http://lzy-blah.blogspot.com/2007/09/linux-thinkpad-laptop.html



2007年9月27日 星期四










[教學]在 linux 上,替 ThinkPad 系列 laptop 加上中鍵捲動功能








前些日子跟某長輩聊天,發現有許多使用 ThinkPad 的 linuxer
竟然都沒去用 ThinkPad 的中鍵捲軸?
雖說沒用也不會怎樣,不過還是少了個好用的功能阿
( netman 大大,我絕對不會說是你的)
其實問題要解決很簡單...就只要加上兩行字就可以了
這邊還是以 Ubuntu 為例,其他 Linux 套件發行版本亦雷同
請跟著我這樣做
sudo gedit /etc/X11/xorg.conf
然後找出下面敘述的這一段

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

把他改成
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
EndSection

然後重新啟動 X-Window 就可以使用中鍵捲動功能了 :D

TIP Mounting Iso Files

TIP Mounting Iso Files








http://docs.google.com/Doc?id=dfd84wb_1576vtvghc

From Gentoo Linux Wiki



Jump to: navigation, search





This article is part of the Tips & Tricks series.

Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

ISO images are files containing the data of a CD (almost bit per
bit). They can be mounted, using the loopback device. ISO images can
only be mounted read-only (use mkisofs to create images).


[edit] Kernel Requirements


To mount ISO images you need the following in your kernel(as module or builtin):


  • loop-back filesystem support (under Device Drivers - Block devices in kernel 2.6)
  • ISO 9660 CDROM file system support (under File systems - CD-ROM/DVD Filesystems in kernel 2.6)

You also might want this for mounting non-linux ISO images:


  • Microsoft Joliet CDROM extensions (under File systems - CD-ROM/DVD Filesystems in kernel 2.6)





Linux Kernel Configuration: Joliet CDROM Extensions(2.6)


File Fystems --> CD-ROM/DVD Filesystems
<*> ISO 9660 CDROM file system support
[*] Microsoft Joliet CDROM extensions



[edit] Mounting


To mount the ISO images, you'll need to have root access. Login as root or use sudo, and execute:


mount -t iso9660 -o loop,user image.iso /wheretomount

Drop ,user if you don't want users to access the iso files.

Note: If this fails with an error concerning /dev/loop then as root issue the command:


# modprobe loop

Alternatively you may want to add loop to the list of modules that you autoload at boot:


# nano -w /etc/modules.autoload.d/kernel-2.6

and add loop to the bottom of your list of modules.

Hint 1: You can use cdemu to mount BIN images (It's in portage). You can also use bin2iso to convert them to ISO (also in Portage). You may also use bchunk to convert bin/cue CD-images to ISO.

Hint 2: You can use mdf2iso to convert MDF/MDS files to ISO (It's in portage).
Or you can mount a .mdf file with:


mount image.mdf /wheretomount -o loop=/dev/loop0

Hint 3: You can use nrg2iso to convert Nero's .nrg files to ISO (It's in portage).
Or you can mount a .nrg file with:


mount -o loop,offset=307200 image.nrg /wheretomount

Hint 4: You can use ccd2iso to convert Clone CD's .img files to ISO (It's in portage).



Installing Adobe Flash support Fedora Core 9 x64

rpm -ivh http://linuxdownload.adobe.com/adob....0-1.noarch.rpm

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

mkdir -p /usr/lib/mozilla/plugins

yum install nspluginwrapper.{i386,x86_64} pulseaudio-lib.i386

yum install flash-plugin

yum erase gnash

mozilla-plugin-config -i -g -v



Installing Adobe Flash support in Red Hat Fedora Core 9 Codename Sulphur x64



Previous: Configuring Audio and Video Playback in Red Hat Fedora Core 9 Codename Sulphur


Today: Installing Adobe Flash support in Red Hat Fedora Core 9 Codename Sulphur x64


Install Adobe Repository


  • rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
  • rpm import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
    • If that doesn’t work, try this from Mozilla Firefox instead.
    • http://www.adobe.com/go/getflashplayer
    • Select YUM for Linux.
    • Select Agree and install now.
    • adobe-release-i386-1.0-1.noarch.rpm is the file at the time I wrote this.
    • Single right-click from the Mozilla Firefox Downloads window
    • Sinlge left-click on Open
      • Single left-click OK to Do you want to install this file?
      • /home/username/Download/adobe-release-i386-1.0-1.noarch.rpm

    • Type the password for the root account to confirm.
    • Single left-click the Authenticate button.
    • adobe-release-i386-1.0-1.noarch.rpm should install after a few seconds.


  • yum install libflashsupport.{i386,x86_64} nspluginwrapper.{i386,x86_64} pulseaudio-libs.i386
  • mkdir -p /usr/libmozilla/plugins
  • yum install flash-plugin
  • mozilla-plugin-config -i -g -v


2010年4月9日 星期五

fedora 套件更新- livna

http://rpm.livna.org/

Install the livna-release package by running this command(²):

su -c "rpm -ivh http://rpm.livna.org/livna-release.rpm"
提供更多的 yum , rpm 的來源.

2010年4月8日 星期四

firefox 開新的 tabs 位址

原文出處: http://www.bytechip.com/2010/01/firefox-tabs-last/

How to Open Firefox New Tabs next to the last tab

  1. Open Firefox
  2. Enter “about:config” in the URL and press Enter
  3. This will invoke a warning message ” as shown below, Click on the “I’ll be careful, I promise ” button to open the setting page.
  4. Locate the Filter text box and enter “browser.tabs.insertRelatedAfterCurrent”
  5. This will show the key and its value below (which will be enabled)
  6. Double Click on the option to Disable it.
  7. Restart Firefox