2012年12月20日 星期四

Free book info

http://it-ebooks.info/google/?q=android

Human Body 3D

http://www.zygotebody.com/#nav=3.21,123.53,250

[HTML] SEO

Follow the rule to do your website SEO.

http://searchengineland.com/seo-checklist-of-best-and-worst-practices-part1-43752
http://searchengineland.com/seo-checklist-part-2-best-practices-44075

雞蛋糕的作法


http://bbs.moninet.com.tw/board/topic.cgi?forum=53&topic=1278

目前使用鬆餅粉去作, 結果吃起來太硬, 上連結有很多可參考資料;等實作出鬆軟的蛋糕, 再作分享~

http://dorcaschang.pixnet.net/blog/post/25345073-【食譜】雞蛋糕
這裡有提到一些TIP,


1. 在參照完你所使用市面上的蛋糕粉食譜,以他的比例調配完所需的麵糊之後,將麵糊放入冰箱2~3小時。這個步驟會讓你的麵糊更安定,在製作的時候會發得比較好,你會發現相同的材料,冰過的麵糊做出來的比較好吃~
2. 如果你參照的是使用低筋麵粉直接調配麵糊的食譜,那千萬不要自行將糖減掉太多的量,因為不加糖或是糖太少會讓麵糊出筋。
這大概就是所謂的關鍵,因為作成糊之後,沒有等就去加熱;另外,不想吃太多糖,就沒加那麼多,是不是會出筋~
製作雞蛋糕所使用的材料,
大概也就是那幾樣:
使用市面上蛋糕粉製作(快速法):蛋糕粉、雞蛋、水或牛奶
省錢拼經濟法(較麻煩):低筋麵粉、雞蛋、水或牛奶、泡打粉、糖

打發也是一項關鍵: http://www.360doc.com/content/11/0301/20/837810_97264668.shtml


2012年12月19日 星期三

[HTML] Div align center

Refer to the page:
http://www.webtech.tw/info.php?tid=45

1. For FireFox、Chrome、Opera:
margin: 0px auto;

2. For IE8:
<div style="text-align:center;">
 <div style="margin:0 auto;border: 2px solid blue; width:150px;">這裡是文字</div>
</div>

3. For IE7:
*margin: 0px auto;

4. For IE6:
_margin: 0px auto;

2012年12月3日 星期一

Apply free SSL CA

Instantssl provides 90 days free CA for SSL connection.

http://www.instantssl.com/ssl-certificate-products/free-ssl-certificate.html

Before you apply your SSL solution, need to create server.key and server.csr based on your web server solution.

Then you need to have domain name account to get validated mail such as webmaster@yourdomain.com.

Finally, after reviewing your oganization then approval your CA.
Follow the SSL setup to install .crt file.

Set SMTP example for PHPMailer


The example is how to send mail via Gmail smtp server.

1. You need has Gmail account and set POP enable in mail setting.
2. You need to enable openssl function in php.ini or server is support openssl.
    extension=php_openssl.dll
3. Use the example in phpmailer.php and modify your mail information as below.

<?php
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

$mail->IsSMTP(); // telling the class to use SMTP

try {
  $mail->Host       = "smtp.gmail.com"; // SMTP server
  $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
  $mail->SMTPAuth   = true;                  // enable SMTP authentication
  $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
  $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
  $mail->Port       = 465;                   // set the SMTP port for the GMAIL server
  $mail->Username   = "your@gmail.com";  // GMAIL username
  $mail->Password   = "xxxxx";            // GMAIL password
  $mail->AddReplyTo('you@gmail.com', 'First Last');
  $mail->AddAddress('to@com.tw', 'John Doe');
  $mail->SetFrom('you@gmail.com', 'First Last');
  $mail->AddReplyTo('you@gmail.com', 'First Last');
  $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  $mail->MsgHTML(file_get_contents('contents.html'));
  $mail->AddAttachment('images/phpmailer.gif');      // attachment
  $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
  $mail->Send();
  echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
  echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Boring error messages from anything else!
}
?>

Also can use Microsoft Exchange server as SMTP.


<?php

ini_set('display_errors', 1);   # enable PHP error reporting
error_reporting(E_ALL);

require_once('../class.phpmailer.php');
$mail = new PHPMailer();

$mail->IsSMTP();  // telling the class to use SMTP
$mail->Host     = "Exchange server name"; // SMTP server
$mail->SMTPAuth = true;
$mail->Username = "Domain\account";
$mail->Password = "xxxx";

//$mail->SetLanguage("en", DIR_3RDPARTY."/phpmailer/language/");

$mail->From     = "From@com.tw";
$mail->FromName = "your name";
$mail->AddAddress("To@com.tw");

$mail->Subject  = "SMTP Test";
$mail->Body = "Hello World";

if(!$mail->Send()) {
    echo 'Message was not sent.';
    echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
    echo "Sent";
}
?>

2012年12月2日 星期日

Generate and install Self Signed SSL Certificate for XAMPP


Step 1: Generate a Private Key
C:\xampp\apache\bin>openssl genrsa -des3 -out server.key 1024 

Step 2: Generate a CSR
C:\xampp\apache\bin>openssl req -new -key server.key -config “C:\xampp\php\extras\openssl\openssl.cnf” -out server.csr

Step 3: Remove Passphrase from Key
C:\xampp\apache\bin>copy server.key server.key.org
C:\xampp\apache\bin>openssl rsa -in server.key.org -out server.key

Step 4: Generating a Self-Signed Certificate
C:\xampp\apache\bin>openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt 

Step 5: Installing the Private Key and Certificate

C:\xampp\apache\bin>copy server.crt c:\xampp\apache\conf\ssl.crt
C:\xampp\apache\bin>copy server.key c:\xampp\apache\conf\ssl.key

or configure the setting

<VirtualHost ssltest.com:443>
    DocumentRoot "path/to/ssltest.com"
    ServerName ssltest.com
    ServerAlias www.ssltest.com
    ServerAdmin you@ssltest.com
 
    SSLEngine on
 
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW
    :+SSLv2:+EXP:+eNULL
 
    SSLCertificateFile "path/to/server.crt"
 
    SSLCertificateKeyFile "path/to/server.key"
 
    <FilesMatch "\.(cgi|shtml|phtml|php|php5|php4|php3?)$">
       SSLOptions +StdEnvVars
    </FilesMatch>
 
    <Directory "path/to/cgi-bin">
       SSLOptions +StdEnvVars
   </Directory>
    SetEnvIf User-Agent ".*MSIE.*" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
</VirtualHost>



Step 6: Restart Apache and Test