• Squid 版本 2.7.STABLE8
     
    修改 /etc/squid.conf
    # 可支援多個不同 domain
    http_port 80 accel vhost
     
    # 這是要指定後端的
    web server cache_peer 11.22.33.44 parent 80 0 no-query originserver name=example.com
     
    # 這是設定 ACL ,以及他可支援的 domain (我習慣支援整個網域,若是只幫某個網址的話則設 www.example.com
    acl example_com_site dstdomain .example.com http_access allow example_com_site
    以上命名方式只是我的習慣,不需要照抄,要根據自己的環境來調整!
    Web 相關 | 7042 觀看 | 2013-10-21 | 標籤: squid, reverse proxy | Kuann Hung 上傳
  • 0057a3ddace1f0b6fbfa24f1c41468e9.png
     
    今天臨時需要處理一個透明背景的圖片,如果要用 Photoshop 似乎又有點殺雞用牛刀!
     
    上網 google 了一下,發現一個很好用的網站: https://pixlr.com/editor
     
    主要是用 flash 寫的,不過有 Photoshop Lite 的味道,很簡單又好用。今天用的是 Pixlr Editor ,逛了一下,發現還有很多可以處理照片的功能。
    如果不需要大費周章開 Photoshop 的話,倒是可以考慮一下喔!
    Web 相關 | 4438 觀看 | 2013-10-21 | 標籤: png, 透明, 透明圖, cat_applications | Kuann Hung 上傳
  • 如果你的 PHP 有需要讀寫 2GB 以上的檔案。則你會發現內建的套件會發生錯誤,這個時候就需要手動 compiler 產生一個可讀寫的 2GB 以上檔案的 PHP。
    不過需要注意的是,你的系統必須是 64 位元的才可以喔!
     
    先下載 mysql devel 套件,一併 compiler 進 PHP 中
    # yum install mysql-devel*
     
    # wget php-5.3.6.tgz
    # tar -zxvf php-5.3.6.tgz
    # cd php-5.3.6
    # export CFLAGS="-D_FILE_OFFSET_BITS=64"
    #  ./configure --disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter  --without-pear --with-mysql=/usr/include/mysql/
    # make
    # make install
     
    完成後會有一個 php 的執行檔,我自己的作法是把它改成 php64 然後用 cgi 模式呼叫,畢竟需要用到的檔案並不多。
    PHP | 4508 觀看 | 2013-10-21 | 標籤: php, 2G | Kuann Hung 上傳
  • 8092494bfc39d476328c2b7b665fa94a.png
    相信寫 Web 應用的人對於 JSON 都不陌生。尤其是在使用 jquery 傳遞資訊的時候。
    不過有時候因為要解析資料,而資料又帶有中文,所以被編碼過,一下無法看懂的時候,就需要一個好用的 json parser 來幫忙 debug 了。

    這是偶然發現,速度快又簡潔的網站,其中 https://jqplay.org/ 還可以設定 filter 喔!
     
    對於需要使用 json 的人來說,就很方便囉!
    Web 相關 | 5194 觀看 | 2013-10-20 | 標籤: cat_applications | Kuann Hung 上傳
  • 6ae25e31647cc6a78875c4f04dc5a389.png
    其實 Drupal 7 已經提供自訂文字格式了。

    只要在 [ 設定 > 內容撰寫 > 文字格式 ] 中,自訂一個 Javascript 名稱,並且不過濾任何字串即可。
    不過!請注意!這樣會有 XSS 的風險,所以要管制權限,最好只保留給系統管理者使用!
    Web 相關 | 4066 觀看 | 2013-10-20 | 標籤: drupal, javascript | Kuann Hung 上傳
  • 我想應該很多人在使用資料庫的時候都想要一個 "自訂排序" 功能吧?
     
    比如說,如果你的資料庫中有一個欄位叫做 Priority,然後存的資料分別為 High, Normal, Low。所以你在撈資料撈時候自然而然就會希望它排序的時候是 High 的排最前面,然後分別是 Normal and Low。但是很不幸的,如果你直接下 Order By Priority 的話,你會得到的順序會是 High, Low and Normal. 因為他會根據英文字母的排序。所以是 H -> L -> N。
     
    不過神奇的 MySQL (我一直覺得 MySQL 是一個很神奇的資料庫,它提供了許多難以想像的便利功能,又有極佳的效能,重點是免費!!) 提供了一個 Function 可以達到這個目的 - Field
     
    Field 這個 Function 的用法如下:
        FIELD(str,str1,str2,str3,...)
    官網的解釋是 
        Returns the index (position) of str in the str1, str2, str3, ... list. Returns 0 if str is not found.
     
    而如果你要達成前面所說的目的的話,你可以這樣下你的 SQL
    SELECT * FROM Event Order By FIELD( Priority, 'High', 'Normal', 'Low')
    
    為何這樣可以達到目的呢? 因為使用 Field 的時候,它會把 Priority 帶入,並且去比對第二個以後的參數,並回傳該參數的索引 (位置)
     
    所以,如果你的資料是 High,它就會回傳 1,如果是 Low 就回傳 3。當然,如果對應不到的時候,它會回傳 0。這點需要注意,避免發生不預期的結果。
    Database | 14116 觀看 | 2013-10-18 | 標籤: mysql, field, sort, order | Kuann Hung 上傳
  • 如果要在 apache 中設定 multiple domain,又希望自動對應到同樣的程式目錄,可以參考以下的做法!
     
    Web 相關 | 4209 觀看 | 2013-10-17 | Kuann Hung 上傳
  • 相信寫中文的人遇到 Word 的文法檢查時候都會覺得很困擾吧!~ 以下教大家如何移除這個設定囉!
    其他 | 6366 觀看 | 2013-10-17 | Kuann Hung 上傳
  • 花費兩年拍攝的四分鐘短片,像大海般流動的舊金山雲海!台灣多雨環海又潮溼,但是基本上除了進入深山區之外,我們很少有機會看到大量的濃霧。
     
    電影製片人Simon Christen  拍攝了一支名為「Adrift」的影片,雖然影片不過短短的四分鐘,卻耗費將近兩年的時間拍攝而成,辛苦程度不言可喻阿!

    這兩年 Christen 每天都在早上五點起床,並且上網查詢詳細的氣象資訊,評估當天的天氣狀況適不適合拍攝,接著花上45
    分鐘的車程,到 Marin Headlands 拍攝,如果幸運一點當天的天氣光線條件都不錯,那他就會試著多留一點時間取景,驚人的毅力讓人佩服。大概在 2010 年的時候 Christen 就曾經發表過一個名為「The Unseen Sea」的短片,也是靠著他強大的耐力拍攝而成,這些流動的雲霧真的就像大海一樣波濤,只不過軟綿綿像棉花糖的雲讓大海原有的危險感變成像是軟軟的流動棉花,看了真的好想躺上去滾一滾阿∼
     
    Update: Thank you so much to all of you. I am humbled and a little bit overwhelmed with all your comments. I am trying to answer all the questions (please keep 'em coming) but would like to thank each of you for taking the time to write a comment. I am reading them all. THANK YOU.

    Almost 3/4 of a million views and 10k likes in one week, I am floored. It truly makes me happy that my little film is able to connect with you and hopefully evokes the same feeling of happiness that I felt while shooting it.



    Thank you also so much to everybody that has left me tip. You are too kind!



    -



    It has been almost 3 years since I released "The Unseen Sea" and I'm excited and proud to share with you my latest project "Adrift".



    "Adrift" is a love letter to the fog of the San Francisco Bay Area. I chased it for over two years to capture the magical interaction between the soft mist, the ridges of the California coast and the iconic Golden Gate Bridge. This is where “Adrift” was born.



    The weather conditions have to be just right for the fog to glide over the hills and under the bridge. I developed a system for trying to guess when to make the drive out to shoot, which involved checking the weather forecast, satellite images and webcams multiple times a day. For about 2 years, if the weather looked promising, I would set my alarm to 5am, recheck the webcams, and then set off on the 45-minute drive to the Marin Headlands.



    I spent many mornings hiking in the dark to only find that the fog was too high, too low, or already gone by the time I got there. Luckily, once in a while the conditions would be perfect and I was able to capture something really special. Adrift is a collection of my favorite shots from these excursions into the ridges of the Marin Headlands.



    I hope with my short film I am able to convey the feeling of happiness I felt while I experienced those stunning scenes.



    I am so grateful to Jimmy LaValle, from the band “The Album Leaf”, for composing a custom score for Adrift. Jimmy's music is fantastically beautiful and captures the mood perfectly. Please check out his website. Thanks again Jimmy for your hard work.



    I hope you enjoy the film and thank you for watching.



    If you like this short film, please consider using the Tip Jar below, proceeds will go towards the next project...



    Licensing: Adrift is copyrighted. All of my work is available for licensing under a rights-managed agreement. If you are interested in using any of my images and/or time lapse footage, please visit my website or contact me directly. Most of my clips are available up to 4K resolution! All of them support 2.8K and standard HD resolutions of 1080p/720p. Some of my favorite scenes in the film are also available as high resolution prints.



    Visit my website at www.simonchristen.com

    or follow me on facebook: https://www.facebook.com/SimonChristenPhotography

    or 500px: http://500px.com/SimonChristen



    You can follow Jimmy LaValle's work here and get a free copy of the song: http://on.fb.me/1b6c6gy
    風景名勝 | 8430 觀看 | 2013-10-08 | Kuann Hung 上傳
  • 一封公開信
    衆地方召會與水流職事站
    關於李常受之教導的陳明
     
    專題 | 4729 觀看 | 2013-10-05 | Kuann Hung 上傳