<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Tarik Guelzim</title>
	<atom:link href="http://www.tarikguelzim.com/wpr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tarikguelzim.com/wpr</link>
	<description>Computer Science, Networking, Telecom, Web 2.0 &#38; Open Source</description>
	<pubDate>Sun, 14 Dec 2008 23:33:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Intro to Hidden Markov Models</title>
		<link>http://www.tarikguelzim.com/wpr/intro-to-hidden-markov-models/</link>
		<comments>http://www.tarikguelzim.com/wpr/intro-to-hidden-markov-models/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 23:33:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Algorithms]]></category>

		<category><![CDATA[Artificial Intelligence]]></category>

		<category><![CDATA[HMM]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/?p=1255</guid>
		<description><![CDATA[Hidden Markov Models
Here&#8217;s a very good introduction to HMM:
Introduction
Hidden Markov models are widely used in science, engineering and many other areas (speech recognition, optical character recognition, machine translation, bioinformatics, computer vision, finance and economics, and in social science). 
Definition: The Hidden Markov Model (HMM) is a variant of a finite state machine having a set of [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="color: #ff33cc;">Hidden Markov Models</span></h1>
<p id="smaller" style="text-align: left;">Here&#8217;s a very good introduction to HMM:</p>
<h4>Introduction</h4>
<p>Hidden Markov models are widely used in science, engineering and many other areas (speech recognition, optical character recognition, machine translation, bioinformatics, computer vision, finance and economics, and in social science). </p>
<p><strong><em>Definition:</em></strong> The Hidden Markov Model (HMM) is a variant of a <a href="http://www.nist.gov/dads/HTML/finiteStateMachine.html"><em>finite state machine</em></a> having a set of hidden <a href="http://www.nist.gov/dads/HTML/state.html"><em>states</em></a>, <strong><em>Q</em></strong>, an output <a href="http://www.nist.gov/dads/HTML/alphabet.html"><em>alphabet</em></a><em> </em>(observations), <strong><em>O</em></strong>, transition probabilities, <strong><em>A</em></strong>, output (emission) probabilities, <em><strong>B</strong></em>, and initial state probabilities, <strong>Π</strong>. The current state is not observable. Instead, each state produces an output with a certain probability (<strong><em>B</em></strong>). Usually the states, <em><strong>Q</strong></em>, and outputs, <em><strong>O</strong></em>, are understood, so an HMM is said to be a triple, ( <strong><em>A</em></strong>, <em><strong>B</strong></em>, <em><strong>Π</strong></em><em><strong> </strong></em>).</p>
<p><strong><em>Formal Definition:</em></strong></p>
<p>Hidden states <em><strong>Q</strong></em> = { <em>q</em><sub><em>i</em></sub> }, <em>i</em> = 1, . . . , <em>N </em>.</p>
<p>Transition probabilities <em><strong>A</strong></em> = {<em>a</em><sub><em>ij</em></sub> = <em>P</em>(<em>q</em><sub><em>j</em></sub> at <em>t</em> +1 | <em>q</em><sub><em>i</em></sub> at <em>t</em>)}, where <em>P</em>(<em>a</em> | <em>b</em>) is the conditional probability of <em>a</em> given <em>b</em>, <em>t</em> = 1, . . . , <em>T</em> is time, and <em>q</em><sub><em>i</em></sub> in <strong><em>Q</em></strong>. Informally, <strong><em>A</em></strong> is the probability that the next state is <em>q</em><sub><em>j</em></sub> given that the current state is <em>q</em><sub><em>i</em></sub>.</p>
<p> Observations (symbols) <strong><em>O</em></strong> = { <em>o<sub>k</sub> </em>}, <em>k</em> = 1, . . . , <em>M </em>.</p>
<p>Emission probabilities <em><strong>B</strong></em> = { <em>b<sub>ik</sub> </em>= <em>b<sub>i</sub></em>(<em>o</em><sub><em>k</em></sub>) = <em>P</em>(<em>o</em><sub><em>k</em></sub> | <em>q</em><sub><em>i</em></sub>) }, where <em>o<sub>k</sub> </em>in <strong><em>O</em></strong>. Informally, <strong><em>B</em></strong> is the probability that the output is <em>o<sub>k</sub> </em>given that the current state is <em>q</em><sub><em>i</em></sub>.</p>
<p>Initial state probabilities <strong><em>Π</em></strong> = {<em>p<sub>i</sub> </em>= <em>P</em>(<em>q</em><sub><em>i</em></sub> at <em>t</em> = 1)}.</p>
<p><strong>Canonical problems</strong></p>
<p>There are 3 canonical problems to solve with <strong>HMM</strong>s:</p>
<ol>
<li>Given the model parameters, compute the probability of a particular output sequence. This problem is solved by the <a title="Viterbi algorithm" href="http://en.wikipedia.org/wiki/Viterbi_algorithm">Forward</a> and Backward algorithms (described below).</li>
<li>Given the model parameters, find the most likely sequence of (hidden) states which could have generated a given output sequence. Solved by the <a title="Viterbi algorithm" href="http://en.wikipedia.org/wiki/Viterbi_algorithm">Viterbi algorithm</a> and Posterior decoding.</li>
<li>Given an output sequence, find the most likely set of state transition and output probabilities. Solved by the <a title="Baum-Welch algorithm" href="http://en.wikipedia.org/wiki/Baum-Welch_algorithm">Baum-Welch algorithm</a></li>
</ol>
<h4>Forward Algorithm</h4>
<p>Let <em>α</em><sub><em>t</em></sub>(<em>i</em>) be the probability of the partial observation sequence <em>O<sub>t</sub></em> = {<em>o</em>(1), <em>o</em>(2), &#8230; , <em>o</em>(<em>t</em>)} to be produced by all possible state sequences that end at the <em>i</em>-th state. </p>
<p align="center"><em>α</em><sub><em>t</em></sub>(<em>i</em>) = <em>P</em>(<em>o</em>(1), <em>o</em>(2), &#8230; , <em>o</em>(<em>t</em>) <em></em>| <em>q</em>(<em>t</em>) = <em>q</em><sub><em>i</em></sub> ).</p>
<p>Then the unconditional probability of the partial observation sequence is the sum of <em>α</em><sub><em>t</em></sub>(<em>i</em>) over all <em>N</em> states.   </p>
<p>The Forward Algorithm is a recursive algorithm for calculating <em>α</em><sub><em>t</em></sub>(<em>i</em>) for the observation sequence of increasing length <em>t</em> . First, the probabilities<br />
for the single-symbol sequence are calculated as a product of initial <em>i</em>-th state probability and emission probability of the given symbol <em>o</em>(1) in the <em>i</em>-th state. Then the recursive formula is applied. Assume we have calculated <em>α</em><sub><em>t</em></sub>(<em>i</em>) for some <em>t</em>. To calculate <em>α</em><sub><em>t</em>+1</sub>(<em>j</em>), we multiply every <em>α</em><sub><em>t</em></sub>(<em>i</em>) by the corresponding transition probability from the <em>i</em>-th state to the <em>j</em>-th state, sum the products over all states, and then multiply the result by the emission probability of the symbol <em>o</em>(<em>t</em>+1). Iterating the process, we can eventually calculate <em>α</em><em><sub>T</sub></em>(<em>i</em>), and then summing them over all states, we can obtain the required probability.</p>
<p><strong><em>Formal Definition</em></strong></p>
<p><em><strong>Initialization:</strong></em></p>
<p align="center"><strong>  </strong><em>α</em><sub>1</sub>(<em>i</em>) = <em>p<sub>i</sub> </em><em>b<sub>i</sub></em>(<em>o</em>(1)) , <em>i</em> =1, &#8230; , <em>N</em></p>
<p><strong><em>Recursion:</em></strong></p>
<p align="center"> </p>
<p align="left">here  <em>i</em> =1, &#8230; , <em>N </em>, <em>t</em> =1, &#8230; , <em>T</em> - 1</p>
<p><strong><em>Termination:</em></strong></p>
<p align="center"> </p>
<h4>Backward Algorithm</h4>
<p>In a similar manner, we can introduce a symmetrical backward variable <em>β</em><sub><em>t</em></sub>(<em>i</em>) as the conditional probability of the partial observation sequence from <em>o</em>(<em>t</em>+1) to the end to be produced by all state sequences that start at <em>i</em>-th state (3.13). </p>
<p align="center"><em>β</em><sub><em>t</em></sub>(<em>i</em>) = <em>P</em>(<em>o</em>(<em>t</em>+1), <em>o</em>(<em>t</em>+2), &#8230; , <em>o</em>(<em>T</em>) <em></em>| <em>q</em>(<em>t</em>) = <em>q</em><sub><em>i</em></sub> ).</p>
<p>The Backward Algorithm calculates recursively backward variables going backward along the observation sequence. The Forward Algorithm is typically used for calculating the probability of an observation sequence to be emitted by an HMM, but, as we shall see later, both procedures are heavily used for finding the optimal state sequence and estimating the HMM parameters.</p>
<p><strong><em>Formal Definition</em></strong></p>
<p><strong><em>Initialization:</em></strong></p>
<p align="center"><strong>  </strong><em>β</em><em><sub>T </sub></em>(<em>i</em>) = 1 , <em>i</em> =1, &#8230; , <em>N</em></p>
<p>According to the above definition, <strong></strong><em>β</em><sub><em>T</em></sub>(<em>i</em>) does not exist. This is a formal extension of the below recursion to <em>t</em> = <em>T</em>.</p>
<p><strong><em>Recursion:</em></strong></p>
<p align="center"> </p>
<p align="left">here  <em>i</em> =1, &#8230; , <em>N </em>, <em>t</em> = <em>T</em> - 1,  <em>T</em> - 2 , . . . , 1</p>
<p><strong><em>Termination:</em></strong></p>
<p align="center"> </p>
<p>Obviously both Forward and Backward algorithms must give the same results for total probabilities <em>P</em>(<em>O</em>) = <em>P</em>(<em>o</em>(1), <em>o</em>(2), &#8230; , <em>o</em>(<em>T</em>) ).</p>
<p> </p>
<h4>Posterior decoding</h4>
<p>There are several possible criteria for finding the most likely sequence of hidden states. One is to choose states that are individually most likely at the time when a symbol is emitted. This approach is called posterior decoding. </p>
<p>Let <em>λ</em><sub><em> t</em></sub>(<em>i</em>) be the probability of the model to emit the symbol <em>o</em>(<em>t</em>) being in the <em>i</em>-th state for the given observation sequence <em>O</em>. </p>
<p align="center"><em>λ</em><sub><em> t</em></sub>(<em>i</em>) = <em>P</em>( <em>q</em>(<em>t</em>) = <em>q</em><sub><em>i</em></sub> | <em>O</em> ).</p>
<p>It is easy to derive that</p>
<p align="center"><em>λ</em><sub><em> t</em></sub>(<em>i</em>) = <em>α</em><sub><em>t</em></sub>(<em>i</em>) <em>β</em><sub><em>t</em></sub>(<em>i</em>) / <em>P</em>( <em>O</em> ) , <em>i</em> =1, &#8230; , <em>N </em>, <em>t</em> =1, &#8230; , <em>T</em></p>
<p>Then at each time we can select the state <em>q</em>(<em>t</em>) that maximizes <em>λ</em><sub><em> t</em></sub>(<em>i</em>). </p>
<p align="center"><em>q</em>(<em>t</em>) = arg max {<em>λ</em><sub><em> t</em></sub>(<em>i</em>)}</p>
<p>Posterior decoding works fine in the case when HMM is ergodic, i.e. there is transition from any state to any other state. If applied to an HMM of another architecture, this approach could give a sequence that may not be a legitimate path because some transitions are not permitted. </p>
<h4>Viterbi algorithm</h4>
<p>The Viterbi algorithm chooses the best state sequence that maximizes the likelihood of the state sequence for the given observation sequence.</p>
<p>Let <em>δ</em><sub><em> t</em></sub>(<em>i</em>) be the maximal probability of state sequences of the length <em>t</em> that end in state <em>i</em> and produce the <em>t</em> first observations for the given model.</p>
<p align="center"><em>δ</em><sub><em> t</em></sub>(<em>i</em>) = max{<em>P</em>(<em>q</em>(1), <em>q</em>(2), &#8230;, <em>q</em>(<em>t</em>-1) ; <em>o</em>(1), <em>o</em>(2), &#8230; , <em>o</em>(<em>t</em>) | <em>q</em>(<em>t</em>) = <em>q</em><sub><em>i</em></sub> ).}</p>
<p> The Viterbi algorithm is a dynamic programming algorithm that uses the same schema as the Forward algorithm except for two differences:</p>
<ol>
<li>It uses maximization in place of summation at the recursion and termination steps.</li>
<li>It keeps track of the arguments that maximize <em>δ</em><sub><em> t</em></sub>(<em>i</em>) for each <em>t</em> and <em>i</em>, storing them in the <em>N</em> by <em>T</em> matrix <strong><em>ψ</em></strong>. This matrix is used to retrieve the optimal state sequence at the backtracking step.</li>
</ol>
<p><strong><em>Initialization:</em></strong></p>
<table border="0" align="center">
<tbody>
<tr>
<td><strong></strong><em>δ</em><sub>1</sub>(<em>i</em>) = <em>p<sub>i</sub> b<sub>i</sub></em>(<em>o</em>(1)) </td>
</tr>
<tr>
<td><em>ψ</em><sub>1</sub>(<em>i</em>) = 0 , <em>i</em> =1, &#8230; , <em>N</em></td>
</tr>
</tbody>
</table>
<p>According to the above definition, <em>β</em><sub><em>T</em></sub>(<em>i</em>) does not exist. This is a formal extension of the below recursion to .</p>
<p><strong><em>Recursion:</em></strong></p>
<table border="0" align="center">
<tbody>
<tr>
<td><strong></strong><em>δ</em><sub><em>t </em></sub>( <em>j</em>) = max<em><sub> i </sub></em>[<em>δ</em><sub><em>t </em>- 1</sub>(<em>i</em>) <em>a</em><sub><em>ij</em></sub>]<em> b<sub> j </sub></em>(<em>o</em>(<em>t</em>)) </td>
</tr>
<tr>
<td><em>ψ</em><sub><em>t</em></sub>( <em>j</em>) = arg max<em><sub> i </sub></em>[<em>δ</em><sub><em>t </em>- 1</sub>(<em>i</em>) <em>a</em><sub><em>ij</em></sub>]  </td>
</tr>
</tbody>
</table>
<p><strong><em>Termination:</em></strong></p>
<table border="0" align="center">
<tbody>
<tr>
<td><em>p<sup>*</sup></em> = max<em><sub> i </sub></em>[<em>δ<sub>T</sub></em>( <em>i </em>)] </td>
</tr>
<tr>
<td><em>q</em><sup>*</sup><em><sub>T</sub></em> = arg max<em><sub> i </sub></em>[<em>δ<sub>T</sub></em>( <em>i </em>)]  </td>
</tr>
</tbody>
</table>
<p><strong><em>Path (state sequence) backtracking:</em></strong></p>
<p align="center"> <em>q</em><sup>*</sup><em><sub>t</sub></em> = <em>ψ</em><sub><em>t</em>+1</sub>( <em>q</em><sup>*</sup><sub><em>t</em>+1</sub>) , <em>t</em> = <em>T</em> - 1,  <em>T</em> - 2 , . . . , 1</p>
<p> </p>
<h4>References</h4>
<ol>
<li>Hidden Markov model, <a href="http://www.nist.gov/dads/HTML/hiddenMarkovModel.html">http://www.nist.gov/dads/HTML/hiddenMarkovModel.html</a> </li>
<li>Hidden Markov model, <a href="http://en.wikipedia.org/wiki/Hidden_Markov_model">http://en.wikipedia.org/wiki/Hidden_Markov_model</a></li>
<li><a title="Lawrence Rabiner" href="http://en.wikipedia.org/wiki/Lawrence_Rabiner">Lawrence R. Rabiner</a>, <a class="external text" title="http://www.caip.rutgers.edu/~lrr/Reprints/tutorial on hmm and applications.pdf" href="http://www.caip.rutgers.edu/~lrr/Reprints/tutorial%20on%20hmm%20and%20applications.pdf">A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition</a>. <em>Proceedings of the <a title="IEEE" href="http://en.wikipedia.org/wiki/IEEE">IEEE</a></em>, 77 (2), p. 257–286, February 1989.</li>
<li>V. Petrushin. Hidden Markov Models: Fundamentals and Applications. <a href="http://www.accenture.com/NR/rdonlyres/6EA0F25D-7FA7-4B43-AFDB-CBA983F1347F/0/HMMTutorialPart2.pdf">Part 2: Discrete and Continuous Hidden Markov Models</a>, Online Symposium for Electronics Engineers. 2000 </li>
</ol>
<h4> </h4>
<p><span>©Nikolai V. Shokhirev, 2004-2006</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/intro-to-hidden-markov-models/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating a search engine to parse, index and search PDF file content</title>
		<link>http://www.tarikguelzim.com/wpr/creating-a-search-engine-to-parse-index-and-search-pdf-file-content/</link>
		<comments>http://www.tarikguelzim.com/wpr/creating-a-search-engine-to-parse-index-and-search-pdf-file-content/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 15:23:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[asprise]]></category>

		<category><![CDATA[Bash]]></category>

		<category><![CDATA[CGI]]></category>

		<category><![CDATA[indexg]]></category>

		<category><![CDATA[linux shell]]></category>

		<category><![CDATA[lucene]]></category>

		<category><![CDATA[OCR]]></category>

		<category><![CDATA[parsing]]></category>

		<category><![CDATA[PDF]]></category>

		<category><![CDATA[pdfbox]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/creating-a-search-engine-to-parse-index-and-search-pdf-file-content/</guid>
		<description><![CDATA[I recently came across a need to search the &#8220;bulletin officiel&#8221; in Morocco, which is a government magazine that lists laws, verdicts, explanations as well as all other official material. Given that the solution presented by a govenment website didn&#8217;t allow searching this database, I decided to create a search engine that parses, indexes and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a need to search the &#8220;bulletin officiel&#8221; in Morocco, which is a government magazine that lists laws, verdicts, explanations as well as all other official material. Given that the solution presented by a govenment website didn&#8217;t allow searching this database, I decided to create a search engine that parses, indexes and returns results for queries on terms, Google-style strings and regex. I among other requirements, this search engine must be platform independent and command line based in order to integrate it with Linux shell as well as CGI scripts. I designed it using Java and Lucene, aspriseX and pdfbox. The following is the code (beta) that demonstrate this functionality:</p>
<p><code><br />
/**<br />
* Tarik Guelzim<br />
* This is an indexer/search engine for pdf files<br />
* Version 0.1<br />
*<br />
* OCR funcitonality is still in pre-alpha<br />
*/</code></p>
<p>package core;</p>
<p>import com.asprise.util.ocr.OCR;<br />
import com.asprise.util.pdf.PDFReader;<br />
import java.awt.image.BufferedImage;<br />
import java.io.File;<br />
import java.io.FileInputStream;<br />
import java.io.IOException;<br />
import java.util.HashMap;<br />
import java.util.logging.Level;<br />
import java.util.logging.Logger;<br />
import org.apache.lucene.analysis.standard.StandardAnalyzer;<br />
import org.apache.lucene.index.IndexWriter;<br />
import org.apache.lucene.document.Document;<br />
import org.apache.lucene.queryParser.ParseException;<br />
import org.apache.lucene.queryParser.QueryParser;<br />
import org.apache.lucene.search.Hits;<br />
import org.apache.lucene.search.IndexSearcher;<br />
import org.apache.lucene.search.Query;<br />
import org.apache.lucene.store.Directory;<br />
import org.apache.lucene.store.FSDirectory;<br />
import org.pdfbox.searchengine.lucene.LucenePDFDocument;</p>
<p>public class Main {</p>
<p>/**<br />
* @param args pdf file o be added<br />
*/<br />
public static void main(String[] args) {<br />
HashMap params = null;<br />
// parse args<br />
params = parseArgs(args);<br />
// dispatch commands<br />
if (((String) params.get(&#8221;cmd&#8221;)).equals(&#8221;index&#8221;)) {<br />
// build index<br />
buildIndex((String) params.get(&#8221;idxFile&#8221;),<br />
(String) params.get(&#8221;pdfFile&#8221;));</p>
<p>} else if (((String) params.get(&#8221;cmd&#8221;)).equals(&#8221;query&#8221;)) {</p>
<p>displayIndex(searchIndex((String) params.get(&#8221;idxFile&#8221;),<br />
(String) params.get(&#8221;qString&#8221;),<br />
(String) params.get(&#8221;dField&#8221;)));<br />
} else if (((String) params.get(&#8221;cmd&#8221;)).equals(&#8221;optimize&#8221;)) {<br />
optimizeIndex(((String) params.get(&#8221;idxFile&#8221;)));<br />
} else if (((String) params.get(&#8221;cmd&#8221;)).equals(&#8221;ocr&#8221;)) {<br />
ocrPdf((String) params.get(&#8221;pdfFile&#8221;));<br />
} else {<br />
System.err.println(&#8221;Usage: pdfagent {query | index} index_file pdf_file_name&#8221;);<br />
}<br />
}</p>
<p>/**<br />
* OCR text from images<br />
* @param fname pdf file<br />
*/<br />
private static void ocrPdf(String fname) {<br />
try {<br />
OCR ocr = new OCR();<br />
PDFReader reader = new PDFReader(new File(fname));<br />
reader.open();<br />
int pages = reader.getNumberOfPages();<br />
for (int i = 0; i &lt; pages; i++) {<br />
BufferedImage image = reader.getPageAsImage(i);<br />
System.out.println(ocr.recognizeEverything(image));<br />
}<br />
reader.close();<br />
} catch (IOException ex) {<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
}<br />
}</p>
<p>/**<br />
* optimize index<br />
* @param idxFile index path<br />
*/<br />
private static void optimizeIndex(String idxFile) {<br />
try {<br />
IndexWriter iw = new IndexWriter(idxFile, new StandardAnalyzer(), isIndexExist(idxFile));<br />
iw.optimize();<br />
} catch (IOException ex) {<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
}<br />
}</p>
<p>/**<br />
* build pd index<br />
* @param idxFile index file path<br />
* @param pdfFile pdf file<br />
*/<br />
private static void buildIndex(String idxFile, String pdfFile) {</p>
<p>IndexWriter iw = null;<br />
LucenePDFDocument pdfDoc = null;<br />
Document luceneDoc = null;</p>
<p>try {<br />
// lucene index</p>
<p>iw = new IndexWriter(idxFile, new StandardAnalyzer(),<br />
isIndexExist(idxFile));</p>
<p>pdfDoc = new LucenePDFDocument();<br />
luceneDoc = LucenePDFDocument.getDocument(new FileInputStream(pdfFile));</p>
<p>// luceneDoc = pdfDoc.convertDocument(new File(pdfFile));<br />
addDoc(iw, luceneDoc);</p>
<p>iw.optimize();<br />
iw.close();</p>
<p>} catch (IOException ex) {<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
}<br />
}</p>
<p>private static void displayIndex(Hits hits) {<br />
try {<br />
if (hits.length() == 0) {<br />
System.out.println(&#8221;No results found.&#8221;);<br />
} else {<br />
for (int i = 0; i &lt; hits.length(); i++) {<br />
System.out.println(&#8221;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;);<br />
System.out.println(&#8221;URL: &#8221; + hits.doc(i).get(&#8221;url&#8221;));<br />
System.out.println(&#8221;Modified: &#8221; + hits.doc(i).get(&#8221;modified&#8221;));<br />
System.out.println(&#8221;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221;);</p>
<p>System.out.println(hits.doc(i).get(&#8221;contents&#8221;));<br />
}<br />
}<br />
} catch (IOException ex) {<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
}<br />
}</p>
<p>/**<br />
* search the index for a stri  ng<br />
* @param indexFile index file path<br />
* @param qString string query<br />
* @param idxField the field to search<br />
* @return hits for the query<br />
*/<br />
private static Hits searchIndex(String indexFile, String qString, String idxField) {<br />
Hits hits = null;<br />
IndexSearcher searcher = null;<br />
Directory fsDir = null;<br />
Query query = null;<br />
QueryParser qParser = null;</p>
<p>try {<br />
//query index<br />
System.out.println(&#8221;Searching for &#8221; + qString + &#8221; in &#8221; + indexFile + &#8221; &#8212; field: &#8221; + idxField);</p>
<p>// create index searcher<br />
fsDir = FSDirectory.getDirectory(indexFile, false);<br />
searcher = new IndexSearcher(fsDir);<br />
// parse query<br />
qParser = new QueryParser(idxField, new StandardAnalyzer());<br />
query = qParser.parse(qString);<br />
//query = QueryParser.parse(qString, idxField, new StandardAnalyzer());<br />
System.out.println(query.toString());<br />
// search<br />
hits = searcher.search(query);</p>
<p>} catch (IOException ex) {<br />
System.err.println(&#8221;Index file&#8221; + indexFile + &#8221; doesn&#8217;t exist&#8221;);<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
System.exit(1);<br />
} catch (ParseException ex) {<br />
System.err.println(&#8221;Error while parsing the index.&#8221;);<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
} finally {<br />
return hits;<br />
}</p>
<p>}</p>
<p>/**<br />
* Singelton for indx file<br />
* @param idxFile file to check<br />
* @return exist or not<br />
*/<br />
private static boolean isIndexExist(String idxFile) {<br />
File file;<br />
boolean create = true;</p>
<p>if (((file = new File(idxFile)).exists() &amp;&amp; file.isDirectory())) {<br />
create = false;<br />
}</p>
<p>return create;<br />
}</p>
<p>/**<br />
* parse cmd line args<br />
* @param args params<br />
* @return array of params<br />
*/<br />
private static HashMap parseArgs(String[] args) {<br />
HashMap cmdMap = new HashMap();<br />
switch (args.length) {<br />
case 2:<br />
cmdMap.put(&#8221;cmd&#8221;, (String) args[0]);<br />
cmdMap.put(&#8221;idxFile&#8221;, (String) args[1]);<br />
cmdMap.put(&#8221;pdfFile&#8221;, (String) args[1]);<br />
break;<br />
case 3:<br />
cmdMap.put(&#8221;cmd&#8221;, (String) args[0]);<br />
cmdMap.put(&#8221;idxFile&#8221;, (String) args[1]);<br />
cmdMap.put(&#8221;pdfFile&#8221;, (String) args[2]);<br />
break;<br />
case 4:<br />
cmdMap.put(&#8221;cmd&#8221;, (String) args[0]);<br />
cmdMap.put(&#8221;idxFile&#8221;, (String) args[1]);<br />
cmdMap.put(&#8221;qString&#8221;, (String) args[2]);<br />
cmdMap.put(&#8221;dField&#8221;, (String) args[3]);<br />
break;<br />
default:<br />
System.err.println(&#8221;Usage: pdfagent {query | index} index_file pdf_file_name&#8221;);<br />
System.exit(1);<br />
break;<br />
}<br />
return cmdMap;<br />
}</p>
<p>/**<br />
* Add document to the index<br />
* @param iw<br />
* @param doc<br />
*/<br />
private static void addDoc(IndexWriter iw, Document doc) {<br />
try {<br />
iw.addDocument(doc);</p>
<p>} catch (IOException ex) {<br />
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);<br />
}<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/creating-a-search-engine-to-parse-index-and-search-pdf-file-content/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configuring Wireless Cards under Linux with Ndiswrapper</title>
		<link>http://www.tarikguelzim.com/wpr/configuring-wireless-cards-under-linux-with-ndiswrapper/</link>
		<comments>http://www.tarikguelzim.com/wpr/configuring-wireless-cards-under-linux-with-ndiswrapper/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 03:59:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Linux Configuration]]></category>

		<category><![CDATA[ndiswrapper]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/configuring-wireless-cards-under-linux-with-ndiswrapper/</guid>
		<description><![CDATA[I have configured  an old   laptop I owned  to access the wireless network I have. The box runs fedora core 5 and a mini pci 1350 card.  Since there&#8217;s a lack of documentation online on how to install and configure some hardware I decided to share my experise in this area with everyone, so buckle [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0in"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">I have configured  an old   laptop I owned  to access the wireless network I have. The box runs fedora core 5 and a mini pci 1350 card.  Since there&#8217;s a lack of documentation online on how to install and configure some hardware I decided to share my experise in this area with everyone, so buckle up and enjoy the ride. (Modify the driver names to suit your environment). </span></font></font></p>
<p><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">1- download ndiswrapper  src files from the sourceforge site</span></font></font><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"></span></font></font></p>
<p><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">2- logging as root using </span></font></font><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"></span></font></font></p>
<ul>
<li><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"># su -</span></font></font></li>
</ul>
<ul>
<li>#make &amp;&amp; make install</li>
</ul>
<p><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">3- after the sources compile and the software installs you need to get install the windows drivers for the mini pci 1350</span></font></font></font></p>
<ul>
<li><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><font size="3">#cd /to/wlan/card/windows/drivers</font></span></font></font></li>
<li><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">                  <font size="3">#ndiswrapper  -i bcmwl5.inf</font></span></font></font></font></li>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">                  <font size="3">#ndiswrapper -l ( you should see hardware present)<br />
</font></span></font></font></font></font></li>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><font size="3">#ndiswrapper -m</font></span></font></font></font></font></font></font></li>
</ul>
<p style="margin-bottom: 0in">&nbsp;</p>
<p><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">4- note that if you are using kernel &gt; 2.6.15,  it is precompiled with the bcm43xx drivers so you need to prevent loading it during boot up.</span></font></font></font></font></font></font></font></font></p>
<ul>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">                  <font size="3">#echo  “blacklist  bcm43xx”  &gt;&gt;  /etc/modprobe.d/blacklis</font></span>t</font></font></font></font></font></font></font></li>
</ul>
<p><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">5- unload the bcm43xx driver using</span></font></font></font></font></font></font></font></font></font></p>
<p style="margin-bottom: 0in"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">              </span></font> </font></font></font></font></font></font></font></p>
<ul>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">     <font size="3">#rmmod bcm43x</font></span></font></font></font></font></font></font></font></font></li>
</ul>
<p><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">6- load the ndiswrapper module</span></font></font></font></font></font></font></font></font></font></font></p>
<p style="margin-bottom: 0in"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">                  </span></font> </font></font></font></font></font></font></font></font></p>
<ul>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">#modprobe ndiswrapper</span></font></font></font></font></font></font></font></font></font></font></li>
</ul>
<p><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">7- scan for networks and connect</span></font></font></font></font></font></font></font></font></font></font></p>
<ul>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><font size="3">#iwlist wlan0 scan</font></span></font></font></font></font></font></font></font></font></font></li>
<li><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">                 <font size="3">#ifup wlan0</font></span></font></font></font></font></font></font></font></font></font></font></li>
</ul>
<p style="margin-bottom: 0in"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font color="#000000"><font size="3"><span style="background: transparent none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">and voila!!</span></font></font></font></font></font></font></font></font></font></font></font></font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/configuring-wireless-cards-under-linux-with-ndiswrapper/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dropping to Single Mode from GRUB</title>
		<link>http://www.tarikguelzim.com/wpr/dropping-to-single-mode-from-grub/</link>
		<comments>http://www.tarikguelzim.com/wpr/dropping-to-single-mode-from-grub/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 03:49:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Linux Configuration]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/dropping-to-single-mode-from-grub/</guid>
		<description><![CDATA[Lately I have locked myself out my gentoo linux box and not been able to log on to root.
This situation happens to most of Careless! Linux users, but thanks to the GRUB flags, one might
able to overcome this situation with ease.
my /boot/grub/grub.conf looks like this
on your machine, you can do
1. $more /boot/grub/grub.conf to view yours
 [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have locked myself out my gentoo linux box and not been able to log on to root.</p>
<p>This situation happens to most of Careless! Linux users, but thanks to the GRUB flags, one might</p>
<p>able to overcome this situation with ease.</p>
<p>my /boot/grub/grub.conf looks like this</p>
<p>on your machine, you can do</p>
<p>1. <em>$more /boot/grub/grub.conf</em> to view yours</p>
<p><em> default 0</em></p>
<p><em>timeout 30</em></p>
<p><em>splashimage=(hd0,0)/grub/splash.xpm.gz</em></p>
<p><em>title=Gentoo Linux</em></p>
<p><em>root (hd0,0)</em></p>
<p><em>kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3  doscsi</em></p>
<p><em>initrd /initramfs-genkernel-x86-2.6.17-gentoo-r7</em></p>
<p>2. Now reboot the machine, and at the grub menu press &#8216;e&#8217; then &#8216;e&#8217;</p>
<p>now what do you wanna do is boot the machine to single mode.</p>
<p>3. Go down to the line  kernel /kernel&#8230; and add &#8216;1&#8242; to its end. you&#8217;ll wind up with:</p>
<p><em>kernel /kernel-genkernel-x86-2.6.17-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3  doscsi <strong>1</strong></em></p>
<p>4. Now press ENTER and &#8216;b&#8217; et voila.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/dropping-to-single-mode-from-grub/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configuring PXE linux install using TFTP + NFS</title>
		<link>http://www.tarikguelzim.com/wpr/configuring-pxe-linux-install-using-tftp-nfs/</link>
		<comments>http://www.tarikguelzim.com/wpr/configuring-pxe-linux-install-using-tftp-nfs/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 03:20:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Linux Configuration]]></category>

		<category><![CDATA[dhcp]]></category>

		<category><![CDATA[nfs]]></category>

		<category><![CDATA[tftp]]></category>

		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/configuring-pxe-linux-install-using-tftp-nfs/</guid>
		<description><![CDATA[I recently came across a project in which I had to setup a clustered J2EE system based on TOMCAT and MySQL. The project required fail safe environment, load balancing and clustering of a web based application in a Vmware contained setup. Nevertheless, installing and configuring 15 linux machines is a tiring and time consuming task, [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a project in which I had to setup a clustered J2EE system based on TOMCAT and MySQL. The project required fail safe environment, load balancing and clustering of a web based application in a Vmware contained setup. Nevertheless, installing and configuring 15 linux machines is a tiring and time consuming task, so I thought of seting up a PXE server that serves the new computers the distros to install and even better, I created a kickstart file with the package I need to render the installation itself automatic.<br />
These are the Step by step I followed on configuring a working PXE server integrated with       the pxelinux boot loader from a fresh install of Red Hat Linux.</p>
<p>PXE Server Setup</p>
<dl>
<dt>
</dt>
</dl>
<p>Install the tftp server and pxe server</p>
<dl>
<dt>
</dt>
<dd>
<pre class="example">yum install tftp-server pxe</pre>
</dd>
<dt>
</dt>
</dl>
<p>Get the pxelinux boot loader.           The pxelinux boot loader is bundled in the syslinux tar           file. Retrieve this from <a href="http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-2.00.tar.gz">           http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-2.00.tar.gz</a>.           (Or latest version in that directory.)</p>
<dl>
<dt>
</dt>
<dd>
</dd>
<dt>
</dt>
</dl>
<p>Copy the boot loader into place.           After expanding the compressed tar archive, copy the file           &#8216;pxelinux.0&#8242; into your tftpboot area. As in the following           example:</p>
<dl>
<dt>
</dt>
<dd>
<pre class="example">cp syslinux-2.00/pxelinux.0 /tftpboot/X86PC/UNDI/linux-install/</pre>
</dd>
<dt>
</dt>
</dl>
<p>Create the pxelinux configuration directory.           The boot loader expects a directory to be present in the           same directory it was loaded from. It expects this directory           to be named <tt>pxelinux.cfg</tt>, and looks for a file in           that directory based on the IP address of the machine. If it           does not find a file whose name is based on the IP address,           it will look for a file named <tt>default</tt>.</p>
<dl>
<dt>
</dt>
<dd>
</dd>
<dt>
</dt>
</dl>
<p>Create configuration files.           Here is an example pxelinux configuration file named           <tt>default</tt>.</p>
<dl>
<dt>
</dt>
<dd>
<pre class="example">serial 0 9600 0xab3
default localboot
timeout 100
prompt 1
display display.msg

label localboot
        LOCALBOOT 0

label 7.3
        kernel vmlinuz-7.3
        append initrd=initrd-7.3.img lang= lowres devfs=nomount ramdisk_size=8192 console=ttyS0,9600</pre>
</dd>
<dt>
</dt>
</dl>
<p>Create the display message file.           In the above pxelinux configuration file, there was a           <tt>display.msg</tt> reference with the <strong>           display</strong> keyword. Below is an example file:</p>
<dl>
<dt>
</dt>
<dd>
<pre class="example">PXE Booting to install Red Hat Linux.

Current images are:
Localboot -- Exit PXE, boot locally

7.3 --- For Red Hat Linux 7.3 interactive installation</pre>
</dd>
<dt>
</dt>
</dl>
<p>Make available the kernel and initrd.           The kernel and initrd images are available from the           <tt>images/pxeboot</tt> directory of the install image. (The           install image is either on the CD or the base of the           individual version&#8217;s filesystem tree on an ftp/http/file           server.)</p>
<dl>
<dt>
</dt>
<dd>
</dd>
<dt>
</dt>
</dl>
<p>Rename the files to suit the boot loader configuration.           The filenames of the kernel and the initial RAM disk           must match the configuration entries in the pxelinux           configuration file. To suit the running example:</p>
<dl>
<dt>
</dt>
<dd>
<pre class="example">mv initrd-everything.img initrd-7.3.img
mv vmlinuz ../vmlinuz-7.3</pre>
</dd>
<dt>
</dt>
</dl>
<p>Configure the PXE server configuration file.           With the Red Hat Linux RPM, the PXE server is           configured by default to work with the NBP (Network           Boot Prompt), which does not work with this example.           Additionally, this example opts to have workstations           boot off the network by default, load the pxelinux,           and then time out to local boot from the pxelinux           boot loader.</p>
<dl>
<dt>
</dt>
<dd>
<pre>The two sections that need to be changed look like:</pre>
<pre class="example">[X86PC/UNDI/linux-install/ImageFile_Name]
0
2
linux</pre>
<pre>and</pre>
<pre class="example">[X86PC/UNDI/MENU]
0,Local Boot
13,Remote Install Linux
# 14,Remote Boot Linux</pre>
<pre>Those sections should look like:</pre>
<pre class="example">[X86PC/UNDI/linux-install/ImageFile_Name]
0
0
pxelinux</pre>
<pre>and</pre>
<pre class="example">[X86PC/UNDI/MENU]
#0,Local Boot
13,Remote Install Linux
# 14,Remote Boot Linux</pre>
</dd>
<dt>
</dt>
</dl>
<p>Confirm that the appropriate services are accessible.           The main services that must be started and accessible           for the PXE booting process are:</p>
<dl>
<dt>
</dt>
<dd>
<ul>
<li>
<pre>tftpdxinetd (for tftpd)pxe</pre>
</li>
<li></li>
<li></li>
</ul>
<pre>The way to check is to use           <strong>chkconfig</strong>.</pre>
<pre class="example">[root linux-install]# /sbin/chkconfig --list tftp
tftp            off
[root linux-install]# /sbin/chkconfig tftp on
[root linux-install]# /sbin/chkconfig --list xinetd
xinetd          0:off   1:off   2:off   3:on    4:on    5:on    6:off
[root linux-install]# /sbin/chkconfig --list pxe
pxe             0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root linux-install]# /sbin/chkconfig pxe on</pre>
<pre>In the above example, tftp was not configured to start by           default, nor was pxe. However, xinetd was.  To configure           tftp and pxe to start automatically, <strong> chkconfig           &lt;service&gt; on</strong> was run. Since tftp is a part of           xinetd, as long as xinetd is running, nothing past the           <strong>chkconfig tftp on</strong> needs to be done to use           the tftp service. However, pxe must be started at this point           to begin using it prior to a reboot. The below example           illustrates confirming that xinetd is running as well as           starting pxe.</pre>
<pre class="example">[root etc]# /sbin/service xinetd status
xinetd (pid 821) is running...
[root etc]# /sbin/service pxe status
pxe is stopped
[root etc]# /sbin/service pxe start
Starting pxe:                                              [  OK  ]</pre>
</dd>
<dt>
</dt>
</dl>
<p>Add the PXE entries to <tt>/etc/services</tt>.           While not required, it may be helpful to add the PXE           service entries to the           <tt>/etc/services</tt> file.</p>
<dl>
<dt>
</dt>
</dl>
<dl>
<dt>
</dt>
<dd>
<p class="example">pxe   67/udp<br />
pxe 4011/udp</p>
</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/configuring-pxe-linux-install-using-tftp-nfs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building an web application using Struts + Dojo pitfalls and solutions</title>
		<link>http://www.tarikguelzim.com/wpr/building-an-web-application-using-struts-dojo-pitfalls-and-solutions/</link>
		<comments>http://www.tarikguelzim.com/wpr/building-an-web-application-using-struts-dojo-pitfalls-and-solutions/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 05:18:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Dojo]]></category>

		<category><![CDATA[J2EE]]></category>

		<category><![CDATA[Struts]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/building-an-web-application-using-struts-dojo-pitfalls-and-solutions/</guid>
		<description><![CDATA[In this article, I am going to share my experience and solutions to problems I encountered while currently building a web application in Struts and Dojo.
PS. This article is an ongoing progress!
]]></description>
			<content:encoded><![CDATA[<p>In this article, I am going to share my experience and solutions to problems I encountered while currently building a web application in Struts and Dojo.</p>
<p><span id="more-1235"></span>PS. This article is an ongoing progress!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/building-an-web-application-using-struts-dojo-pitfalls-and-solutions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Beryl + Netbeans blank window problem</title>
		<link>http://www.tarikguelzim.com/wpr/beryl-netbeans-blank-window-problem/</link>
		<comments>http://www.tarikguelzim.com/wpr/beryl-netbeans-blank-window-problem/#comments</comments>
		<pubDate>Tue, 27 May 2008 17:52:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux Configuration]]></category>

		<category><![CDATA[beryl]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tarikguelzim.com/wpr/beryl-netbeans-blank-window-problem/</guid>
		<description><![CDATA[ Assuming that you have Beryl installed and configured, it is known that Netbeans will start and display a blank screen. This is due to the fact that Beryl doesn&#8217;t support SWT yet. This is a workaround this situation:
  #yum install libXp
  assuming you're using bash
  $ echo "export AWT_TOOLKIT='MToolkit'" &#62;&#62; ~/.bashrc
 [...]]]></description>
			<content:encoded><![CDATA[<p> Assuming that you have Beryl installed and configured, it is known that Netbeans will start and display a blank screen. This is due to the fact that Beryl doesn&#8217;t support SWT yet. This is a workaround this situation:</p>
<pre class="code">  #yum install libXp</pre>
<pre class="code">  assuming you're using bash
  $ echo "export AWT_TOOLKIT='MToolkit'" &gt;&gt; ~/.bashrc
  $ echo "export AWT_TOOLKIT='MToolkit'" &gt;&gt; ~/.bash_profile

  $source ~/.bashrc
  $~/.bash_profile</pre>
<pre class="code"></pre>
<pre class="code">and this should work.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tarikguelzim.com/wpr/beryl-netbeans-blank-window-problem/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
