部落格文章訂閱


貧窮不能等,因為時間久了,你就會貧窮習慣了;
夢想不能等,因為努力晚了,人老就無能為力了;
學習不能等,因為懂得少了,就沒本事夢想成真了;
健康不能等,因為身體垮了,人生的一切就都沒了。


自訂搜尋

找不到想要的文章嗎? 請直接再下面的搜尋框裡輸入要查詢文章內容關鍵字 ,就能夠更快速的取得想要閱讀的問題喔~~謝謝大家的支持與愛護~若有任何建議事項, 歡迎透過留言板留言給我喔!!


  • 你不能決定生命的長度,但可以控制它的寬度;
  • 你不能左右天氣,但可以改變心情;
  • 你不能改變容顏,但可以展現笑容;
  • 你不能控制他人,但可以掌握自己;
  • 你不能預知明天,但可以利用今天;
  • 你不能樣樣勝利,但可以事事盡力。

free counters

Updated Mar 13 2009 to reflect improvements in Ubuntu 8.04 and later.

Linux has excellent software-based RAID built into the kernel. Unfortunately information on configuring and maintaining it is sparse. Back in 2003, O’Reilly published Managing RAID on Linux. That book is still mostly up-to-date, but finding clear instructions on the web for setting up RAID has become a chore.

Here is how to install Ubuntu Server with software RAID 1 (disk mirroring). This guide has been tested on Ubuntu Server 8.04 LTS (Hardy Heron). I strongly recommend using Ubuntu Hardy or later if you want to boot from RAID1.

Software RAID vs. hardware RAID

Some system administrators still sneer at the idea of software RAID. Years ago CPUs didn’t have the speed to manage both a busy server and RAID activities. That’s not true any more, especially when all you want to do is mirror a drive with RAID1. Linux software RAID is ideal for mirroring, and due to kernel disk caching and buffering it can actually be faster than RAID1 on lower end RAID controllers. However, for larger requirements like RAID 5, the CPU can still get bogged down with software RAID.

Frank 發表在 痞客邦 留言(0) 人氣()

RAID 5 With LVM on Ubuntu
Server Training - Server Management

RAID 5 provides the best of both worlds in software RAID, speed and redundancy.  You will need at least 3 separate drive partitions on 3 separate drives in order to create RAID 5.  This tutorial also will show you how to install Logical Volume Management on the RAID 5 array.  

You will need to create RAID aware partitions on your drives before you can create RAID and you will need to install mdadm on Ubuntu.  For a tutorial on that CLICK HERE.

You may have to create the RAID device first by indicating the RAID device with the block major and minor numbers.   Be sure to increment the "2" number by one each time you create an additional RAID device.

# mknod /dev/md2 b 9 3

Frank 發表在 痞客邦 留言(0) 人氣()

現在的 IDE 硬碟越來越便宜,也越來越容易損壞,所以市面上出了一堆 IDE RAID 卡,但我發現在 Debian 上面都非常難裝,為了晚上能安心睡覺,還是弄弄 kernel 內建的 md 吧。但我的系統已經安裝了 Debian,是否有辦法把現有系統升級成 md 呢?

答案是有的,這邊就跟各位分享我升級成 raid 1 的經驗。

升級過程的步驟請繼續看下去 :p

1. 加入一顆相當大小的新硬碟到系統,並建立 raid partations type=fd

Frank 發表在 痞客邦 留言(0) 人氣()

Mail::factory()

Mail::factory() – creates a mailer instance

Synopsis

require_once 'Mail.php';

object &factory ( string $backend , array $params = array() )

Frank 發表在 痞客邦 留言(0) 人氣()

以Apache2的環境為例,並且已經啟用Apache2 的 rewrite 模組也開啓了。


只要編寫在該網站目錄中的 .htaccess 即可,範例如下:

Frank 發表在 痞客邦 留言(0) 人氣()

在论坛里有人问我如何统计在线人数?我也不知道什么是最好的方法。下面是本站的实现的原理,我把它写出来,供大家参考。这只是我的方法,肯定不是最好的,还希望高手们予以指正。

其实,要真正统计同时在并发在线的人数,是一件不太现实的事,这是因为HTTP协议是种无状态的协议。当客户端向服务器发出一个请求时,服务器会马上建立一个新的TCP/IP连接,在该会话结束后,如页面完全载入后,这个连接就关闭了。一般来说,在线人数指的定是在一定时间段内同时访问站点的人数,而不是基于HTTP协议的并发连接数。

让我们先来看看一个访客是如何访问一个网站的。他在浏览器的地址栏里输入了目标网站的地址,然后在一段时间内持续浏览该网站的网页,最后,关闭浏览器或输入新的网址——浏览结束了。对于服务器端来说,访客到来是可以知道的,访客在浏览页面也是可以知道的,可是怎么知道什么时候走的呢?由于HTTP协议是无状态的,所以无法知道。通常的做法是记下访客最后一次浏览站点页面的时间。如果该访客在一个特定的时间内没有新的动作,那么可以认为他走了。

根据上面的这个思路,我觉得最好用数据库,因为数据库要比其他方法如文本文件的效率要高。下面的例子是使用MySQL的,很容易使用其他类型的数据库系统。然后,在所有的页面中调用这个PHP文件,一方面更新数据,另一方面可以显示在线的人数。但是,有一个问题--到底在多长时间内访问的人算是并发的呢?一般来说,是半个小时,也就是1800秒,具体的要根据网站的情况来确定。这个时间越长,统计出的并发在线的人数就越多。本站的是15分钟,900秒。用访问者的IP地址表示一个访问者是个不错的方法。在拨号上网的情况下,被分配了相同IP地址的两个用户在短时间内浏览同一个网站的概率是很小的。

首先,用MySQL的工具建一个表:

Frank 發表在 痞客邦 留言(0) 人氣()

jQuery 是一个非常强大的JS类库,现在越用觉得越好用了。
使用jquery如何操作select(下拉框)呢?

主要讲下怎么动态添加option  动态选择option,假如我们的select 控件的 id 属性为 sel
jquery 清空option         $("#sel").empty();

Frank 發表在 痞客邦 留言(0) 人氣()

利用 package 來安裝軟體套件,您有選單模式或是命令列模式的選擇。兩者間的不同點如下所述︰
選單模式需要取得軟體庫的索引檔,而這個檔案通常是有點容量的,所以如果您的網際連線頻寬不足時,將會有點時間性的浪費,但是它有個好處,就是會依據您所選取的 package,來自行加選額外所需的套件,也就是不用擔心套件相依性的問題。
您可以透過 /stand/sysinstall 指令來進入選單模式。

而命令列模式的好處在於只需取得要安裝的軟體套件包裝檔案即可,無需額外下載所有套件的索引檔,但是您需要同時取得與要安裝軟體俱有相依性的套件包裝檔,這對於該軟體套件不熟悉者是較不親善的安裝方式。

Frank 發表在 痞客邦 留言(0) 人氣()

Generating print-ready well-formatted PDF documents with PHP is not an easy task. Traditionally, there are two main approaches to PDF generation with PHP. Given sufficient time and patience, both partially get the job done, but still leave a lot to be desired:

HTML-to-PDF: This approach is widely used in mainstream applications. Here an HTML document is programmatically created and converted to a PDF, using one of the many open source libraries. Since HTML, however, is not a page-oriented format (as is PDF), it is impossible to perform a 1-to-1 mapping between HTML and PDF. Typical word processing file format features, such as header and footers, orphans and widows or even page numbers can simply not be represented in HTML.

Programmatic: This approach offers total control of the resulting PDF. However, it requires that the x and y coordinates of every line of text, every geometrical shape and graphic be set from program code. Not only is this an extremely time-consuming solution, but is also very brittle: Every time a graphical designer changes the layout of a document, a programmer must re-work his or her program code.

A completely new approach

In this article, the author presents an entirely new, third approach. It relies on templates being created in a WYSIWYG environment, such as Microsoft® Word or Open Office, and then being populated with data in PHP. The resulting document can be saved not only to PDF, but also DOCX, DOC and RTF.

Frank 發表在 痞客邦 留言(0) 人氣()

The goal of the LiveDocx Zend Framework component phpLiveDocx is to make the interaction with the backend SOAP service LiveDocx as simple and as native to PHP as possible. phpLiveDocx embodies the KISS principle of the Zend Framework.

Technically, however, it is possible to instantiate and interact with the SOAP service directly from PHP. PHP 5 ships with the excellent SoapClient, which offers almost all the functionality that is required.

Checking for the SOAP extension

Although the SOAP extension is available on most PHP 5 installations, it is possible to disable it. To ensure you have the SOAP extension installed and enabled, take a look at the output of echo phpinfo();. If you see the following section, you are good to go.

PHP 5 Soap extension

Frank 發表在 痞客邦 留言(0) 人氣()

This article offers a second approach to using LiveDocx in PHP without the Zend Framework. This one does not require the PHP 5 SOAP extension, but does require the SOAP library NuSOAP.

The majority of the code on this page was contributed by Mats Andersson. He took the original code and ported it to work with NuSOAP. A big thank you goes out for his work!

Download and install NuSOAP

Visit the NuSOAP homepage and download the current version of NuSOAP. For the purpose of this article, we are using v0.7.3. Your mileage may vary for other versions. Then, set the include path (see line, containing set_include_path()) to the path in which NuSOAP is installed.

Download templates

Once you have the libraries in place, download the following template files. They are used by the sample applications:

Frank 發表在 痞客邦 留言(0) 人氣()

How To

Download and install FreeNAS
  • Reserve some space on OS partition for later adding packages. (500MB should be enough)

System Configuration

Frank 發表在 痞客邦 留言(0) 人氣()

 

做人最高境界--厚道 

 

謙卑的力量 
  

Frank 發表在 痞客邦 留言(0) 人氣()

Google has released the source code for an an Android phone GPS program called My Tracks, which lets people record where they've been, log journeys in Google Docs, and post their trip maps online.
"You can expect My Tracks to become better than ever with the contributions we hope it will receive from other developers, and also that many applications which work side-by-side with My Tracks will be written," Google engineer Rodrigo Damazio said in an e-mail list posting Friday. "For instance, one could easily build an application for tracking fitness activities, geocaching, aviation, and so on."

The move means also means enthusiasts can help with translation and programmers can create spin-offs for which they can charge money if they desire, he added. The software is governed under Google's preferred open-source license, the Apache License 2.0.
My Tracks lets people track their location on a map; the software shows a variety of details including speed, average speed, elevation gain, and distance traveled. Trips can be shown on Google Maps, publicly or privately, and each trip's statistics can be added to a Google Docs spreadsheet.

Frank 發表在 痞客邦 留言(1) 人氣()

由於select 的選項有效參數只有disable,readonly 的參數對select 無作用。
有時是為了做一些限制,不讓使用者選擇,


但預設選擇的欄位值(form field value)仍是要傳遞(submit)。
使用了部份的方式來達到這樣的作用。

Frank 發表在 痞客邦 留言(1) 人氣()