Search results for [ %s ] - 79 hit

[轉載][MySQL]MySQL 的 SET NAMES xxx 字元編碼問題分析

轉載自: PHPChina


近來接受 BBT 的培訓,做一個投票系統。系統程式碼倒不是很難,但是我的時間主要花費在了研究字符集和編碼上面。MySQL 和 Apache 兩個系統的編碼 (字符集) 問題讓我費勁腦筋,吃盡苦頭。網上對這些問題的解決比較零散,比較片面,大部分是提供解決方法,卻不說為什麼。於是我將這幾天收穫總結一下,避免後來者再走彎路。這篇文章對 PHP 編寫有一點幫助 (看完你就知道,怎樣讓你的 PHP 程式在大部分空間提供商的伺服器裡顯示正常),但是更多幫助在於網路伺服器的架設和設置。
Read more

[轉載]平民 RAID 架設與評測

本文是截取自 PC ADV 電腦王第 49 期 (2008年8月) 的 “平民 RAID 架設與評測” 文章,這是一本不錯的雜誌,完整的內容建議大家可以去買來閱讀。
Read more

vi 與 vim 的指令整理

vi 被稱做是「編輯器之神」,是 unix 家族中功能最強大的文字編輯器,讓用戶只要使用鍵盤就可以完成所有的編輯操作。而 vim 則是 vi 的加強版,在 Windows 上也找得到 vim 的芳蹤。

vi 有分為功能模式、編輯模式、命令列模式...操作上有眾多的指令經常令初學者卻步! 它的指令還有區分大小寫,以下是我所整理出來那些令人卻步的指令:

  • 以下指令的前面標記 * 表示為常用指令。
  • 若指令的第一個字元為 :/? 表示要在「命令列」輸入,通常是先按 ESC 就回到功能模式,直接輸入指令就會切換到最下方的命令列,輸入完要按 Enter 才會執行。
    Read more

CSS 及網頁設計的相關網頁

網頁設計

Read more

本站推薦的 Thunderbird 擴充套件 (Addons)

好用的

其他

  • Clippings: 讓你儲存常用的文字資料,方便貼上郵件內容。
  • XNote++: 郵件的便利貼,方便你編寫郵件的備註事項。
  • Display Mail User Agent T: 以圖示顯示寄件者的郵件軟體或郵件系統。
  • HTML Source Editor: 編輯郵件原始碼。
  • Manually sort folders: 可以將帳號或郵件匣手動排序。
  • Mail Merge: 這套件讓你做到像電子報發信機一樣的客製化欄立功能。
  • Provider for Google Calendar: 新版的 Thunderbird 已經整合 Google 日曆了,只需在新增行事曆時,選擇「存放於網際網路」,然後在「使用者名稱」輸入你的 Gmail 帳號,即可連結 Google 日曆。但 Thunderbird 只能連結 Gmail 帳號擁有人的日曆,不能存取別人共用給你的日曆,也不能存取 Google Tasks! 安裝本套件可讓你連結別人共用的日曆與 Google Tasks。
  • Darko: Thunderbird 雖提供暗色的佈景主題,但套用暗色的佈景主題之後,郵件的內容仍是白底的! 安裝此套件可將郵件的內容處理成暗色系,並優化郵件的文字內容 (但不到很完美)。

附件問題

ThunderBird 有時會有一些附件的問題,這些問題通常來自 MS Outlook 使用非標準的格式所導致:

  • 當你收到的附件變成「winmail.dat」,請安裝 LookOut 這個外掛程式。
  • 當你收到的附件變成「ATTxxxxxx」,則請進入 ThunderBird 的「設定編輯器」,將「mail.strictly_mime.parm_folding」參數設為 0 或 1。

參考網頁

正規表示式 (Regular Expression) 語法整理

正規表示式 (Regular Expression, 簡寫 regex、regexp 或 RE) 是用於字串比對的小型語言,又稱正則表達式、正規表示法、規則運算式、常規表示法 (Wiki)。

很多程式語言和軟體都會附加「正規表示式」這項功能。在字串的處理上,針對大量、重複、有固定邏輯的文字,正規表示式是非常強而有力的工具! 即便不是程式設計師,在可以在運用到正規表示式的場合 (例如: 文字編輯器),能幫你節省許多文字處理的時間。但是不同的軟體所附加的正規表示式可能略有差異,這部份就要稍加留意。

不過在初學者的眼中,正規表示式卻又像是天書一樣的難以理解。以下文章針對正規表示式的相關語法做解說,你可到線上測試工具,以實際的例子去做測試。

Read more

在 Blogger 中使用 dp.SyntaxHighlighter 顯示程式碼

db.SyntaxHighlighter 是一支不錯的程式碼高亮度顯示程式,特點為:

  1. 顯示行號
  2. 支援12種程式語言
  3. 模組化載入需要的程式語言
  4. 支援 “<pre>” 及 “<textarea>” 區塊
  5. 純文字檢視
  6. 複製到剪貼簿
  7. 直接列印程式碼

缺點就是載入速度較慢。

安裝步驟

  1. 修改 blogger 樣板,搜尋 “</body>”,在 “上方” 加入(你可以選擇你要的語言載入即可):
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shCore.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushPhp.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushJScript.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushSql.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushXml.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushDelphi.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushPython.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushRuby.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushCss.js'></script>
    <script class='javascript' src='http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/shBrushCpp.js'></script>
    <script class='javascript'>
    dp.SyntaxHighlighter.ClipboardSwf = 'http://syntaxhighlighter.googlecode.com/svn/tags/1.5.0/Scripts/clipboard.swf';
    dp.SyntaxHighlighter.HighlightAll('code');
    </script>

    (因為 “偷吃步” 的關係,程式直接連到 dp.SyntaxHighlighter 的 SVN 上,你可以視情況下載回來放到自己的伺服器)

  2. dp.SyntaxHighlighter 原本已經有一個 CSS 檔了,但如果將這個 CSS 檔以 “Link” 的方式載入,卻無法正常顯示。所以,請自行增加下列 CSS 到 blogger 樣板的 CSS 區段:
    /*dp.highlighter*/
    .dp-highlighter {
      font-family: "Consolas", "Courier New", Courier, mono;
      font-size: 12px;
      background-color: #E7E5DC;
      width: 99%;
      overflow: auto;
      margin: 18px 0px 18px 0px;
      padding-top: 1px; /* adds a little border on top when controls are hidden */
      border:1px inset;
      max-height:200px;
    }
    .dp-highlighter .bar {
      padding-left: 45px;
    }
    .dp-highlighter.collapsed .bar,
    .dp-highlighter.nogutter .bar {
      padding-left: 0px;
    }
    .dp-highlighter ol {
      list-style: decimal; /* for ie */
      list-style: decimal-leading-zero; /* better look for others */
      background-color: #fff;
      margin: 0px 0px 1px 45px; /* 1px bottom margin seems to fix occasional Firefox scrolling */
      padding: 0px;
      color: #5C5C5C;
    }
    .dp-highlighter.nogutter ol {
      list-style-type: none !important;
      margin-left: 0px;
    }
    .dp-highlighter ol li,
    .dp-highlighter .columns div {
      border-left: 3px solid #6CE26C;
      background-color: #f8f8f8;
      padding-left: 10px;
      line-height: 14px;
    }
    .dp-highlighter.nogutter ol li,
    .dp-highlighter.nogutter .columns div {
      border: 0;
    }
    .dp-highlighter .columns {
      color: gray;
      overflow: hidden;
      width: 100%;
    }
    .dp-highlighter .columns div {
      padding-bottom: 5px;
    }
    .dp-highlighter ol li.alt {
      background-color: #fff;
    }
    .dp-highlighter ol li span {
      color: Black;
    }
    /* Adjust some properties when collapsed */
    .dp-highlighter.collapsed ol {
      margin: 0px;
    }
    .dp-highlighter.collapsed ol li {
      display: none;
    }
    /* Additional modifications when in print-view */
    .dp-highlighter.printing {
      border: none;
    }
    .dp-highlighter.printing .tools {
      display: none !important;
    }
    .dp-highlighter.printing li {
      display: list-item !important;
    }
    /* Styles for the tools */
    .dp-highlighter .tools {
      padding: 3px 8px 3px 10px;
      font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
      color: silver;
      background-color: #f8f8f8;
      text-align1: right;
      padding-bottom: 10px;
      border-left: 3px solid #6CE26C;
    }
    .dp-highlighter.nogutter .tools {
      border-left: 0;
    }
    .dp-highlighter.collapsed .tools {
      border-bottom: 0;
    }
    .dp-highlighter .tools a {
      font-size: 9px;
      color: #a0a0a0;
      text-decoration: none;
      margin-right: 10px;
    }
    .dp-highlighter .tools a:hover {
      color: red;
      text-decoration: underline;
    }
    /* About dialog styles */
    .dp-about { background-color: #fff; margin: 0px; padding: 0px; }
    .dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
    .dp-about td { padding: 10px; vertical-align: top; }
    .dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
    .dp-about .title { color: red; font-weight: bold; }
    .dp-about .para { margin: 0 0 4px 0; }
    .dp-about .footer { background-color: #ECEADB; border-top: 1px solid #fff; text-align: right; }
    .dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; width: 60px; height: 22px; }
    /* Language specific styles */
    .dp-highlighter .comment, .dp-highlighter .comments { color: #008200; }
    .dp-highlighter .string { color: blue; }
    .dp-highlighter .keyword { color: #069; font-weight: bold; }
    .dp-highlighter .preprocessor { color: gray; }
  3. 儲存即可

使用方法

  • 方法一 - 使用 “<textarea>” 區塊,需將 “&” 轉換為 “&amp;”:
    <textarea name="code" class="程式語言">
    程式碼
    </textarea>
  • 方法二 - 使用 “<pre>” 區塊,需將 “&” 轉換為 “&amp;”、”<” 轉換為 “&lt;”、”>” 轉換為 “&gt;”:
    <pre name="code" class="程式語言">
    程式碼
    </pre>

參考網頁

[Perl]Perl 的相關網頁資源

手冊

教學/手冊

Read more

[Perl]CGI 模組常用語法

載入 CGI 模組

use CGI qw/:standard/;
my $CGI = CGI->new();

取得所有輸入的參數名稱

@param_name = $CGI->param();

取得特定參數的內容

$value = $CGI->param( "param_name" );

取得所有參數的名稱及內容

%param = $CGI->Vars;

轉換 $url 為 url 可接受的字串

$url_escape = $CGI->escape( $url )

取得目前網頁的編碼

$charset = $CGI->charset();

指定網頁的編碼,並送出網頁表頭

print $CGI->header( -charset=>"utf-8", -expires=>"-1d" );

[轉載]利用 google 半秒破 500 網

轉載自: 黑客基地


其實 google 搜尋器變了駭客工具也不是新聞,老手早亦用到,新手的也可來試試。

只要將以下字串作搜尋的話,你都得到很多密碼,當然若要得心應手便需要更多研究及借助其他軟件,但初步先懂得去找。

inurl

「inurl」是駭客重要的搜尋方法,可搜到網址包括的關鍵字,例如輸入「allinurl:login password」作搜尋,便會很易找到有 login 和 password 的網頁。

filetype

「filetype」是駭客專用語法,例如想找 mdb 的資料庫檔案,可用「password filetype:mdb」作搜尋,便會找到密碼文件,進階用法可配合 inurl: 使用,例如 girl filetype:jpg site:com 便可搜到所有 .com 網站,而檔案為 girl.jpg 或網頁內容有 girl 字串的網頁。

Index of /admin

Index of /admin」搜到的結果大多數是容許使用 index browsing 的網站,隨便按下一個連結便看到網站的資料夾和檔案分佈。

Read more

return top