<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>{Complexity} &#187; admin</title>
	<atom:link href="http://technote.wsjoung.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://technote.wsjoung.com</link>
	<description>simple note</description>
	<lastBuildDate>Fri, 06 Aug 2010 19:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iptables: block ip address</title>
		<link>http://technote.wsjoung.com/2010/08/06/iptables-block-ip-address/</link>
		<comments>http://technote.wsjoung.com/2010/08/06/iptables-block-ip-address/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 19:02:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=157</guid>
		<description><![CDATA[iptables -A INPUT -s 139.76.64.65 -j DROP iptables -A INPUT -s 139.76.224.65 -j DROP iptables -D INPUT -s 139.76.224.65 -j DROP]]></description>
			<content:encoded><![CDATA[<p>iptables -A INPUT -s 139.76.64.65 -j DROP<br />
iptables -A INPUT -s 139.76.224.65 -j DROP</p>
<p>iptables -D INPUT -s 139.76.224.65 -j DROP</p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2010/08/06/iptables-block-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu VM on Xen FIX: perl: warning: Setting locale failed.</title>
		<link>http://technote.wsjoung.com/2010/07/27/ubuntu-vm-on-xen-fix-perl-warning-setting-locale-failed/</link>
		<comments>http://technote.wsjoung.com/2010/07/27/ubuntu-vm-on-xen-fix-perl-warning-setting-locale-failed/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 04:28:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=153</guid>
		<description><![CDATA[perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to [...]]]></description>
			<content:encoded><![CDATA[<p><code>perl: warning: Setting locale failed.<br />
perl: warning: Please check that your locale settings:<br />
    LANGUAGE = (unset),<br />
    LC_ALL = (unset),<br />
    LANG = "en_US.UTF-8"<br />
    are supported and installed on your system.<br />
perl: warning: Falling back to the standard locale ("C").<br />
locale: Cannot set LC_CTYPE to default locale: No such file or directory<br />
locale: Cannot set LC_MESSAGES to default locale: No such file or directory<br />
locale: Cannot set LC_ALL to default locale: No such file or directory</p>
<p># locale-gen en_US en_US.UTF-8 hu_HU hu_HU.UTF-8</p>
<p># dpkg-reconfigure locales</code></p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2010/07/27/ubuntu-vm-on-xen-fix-perl-warning-setting-locale-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace blank space in file name</title>
		<link>http://technote.wsjoung.com/2010/07/08/replace-blank-space-in-file-name/</link>
		<comments>http://technote.wsjoung.com/2010/07/08/replace-blank-space-in-file-name/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 18:08:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Script]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=144</guid>
		<description><![CDATA[for f in *; do mv &#8220;$f&#8221; `echo $f &#124; tr &#8216; &#8216; &#8216;_&#8217;`; done]]></description>
			<content:encoded><![CDATA[<blockquote><p>
for f in *; do mv &#8220;$f&#8221; `echo $f | tr &#8216; &#8216; &#8216;_&#8217;`; done
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2010/07/08/replace-blank-space-in-file-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery with Other Libraries</title>
		<link>http://technote.wsjoung.com/2010/06/28/using-jquery-with-other-libraries/</link>
		<comments>http://technote.wsjoung.com/2010/06/28/using-jquery-with-other-libraries/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 01:28:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=138</guid>
		<description><![CDATA[Overriding the $-function Including jQuery before Other Libraries Referencing Magic &#8211; Shortcuts for jQuery var J = jQuery.noConflict(); function init(){ J(&#8220;div#sshow&#8221;).slideView(); } J(window).bind(&#8220;load&#8221;, init );]]></description>
			<content:encoded><![CDATA[<ul>
<li>Overriding the $-function</li>
<li>Including jQuery before Other Libraries</li>
<li>Referencing Magic &#8211; Shortcuts for jQuery</li>
</ul>
<blockquote><p>
var J = jQuery.noConflict();<br />
function init(){<br />
    J(&#8220;div#sshow&#8221;).slideView();<br />
}<br />
J(window).bind(&#8220;load&#8221;, init );
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2010/06/28/using-jquery-with-other-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>logrotate debug</title>
		<link>http://technote.wsjoung.com/2010/06/08/logrotate-debug/</link>
		<comments>http://technote.wsjoung.com/2010/06/08/logrotate-debug/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 07:07:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[logrotate]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=135</guid>
		<description><![CDATA[logrotate -f -v /etc/logrotate.conf than it will update /var/lib/logrotate/status]]></description>
			<content:encoded><![CDATA[<p>logrotate -f -v /etc/logrotate.conf</p>
<p>than it will update /var/lib/logrotate/status</p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2010/06/08/logrotate-debug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview questions (2)</title>
		<link>http://technote.wsjoung.com/2010/01/07/interview-questions-2/</link>
		<comments>http://technote.wsjoung.com/2010/01/07/interview-questions-2/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 05:51:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Interview]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=132</guid>
		<description><![CDATA[1) There are integer arrays, A and B. what&#8217;s the best way to generate an array which contains all duplicated elements of A and B. 2) There are integer arrays, A and B. how to figure it out if those contain same elements. 3) There many of files in a folder and some of them [...]]]></description>
			<content:encoded><![CDATA[<p>1) There are integer arrays, A and B. what&#8217;s the best way to generate an array which contains all duplicated elements of A and B.<br />
2) There are integer arrays, A and B. how to figure it out if those contain same elements.<br />
3) There many of files in a folder and some of them contains phone numbers. how to find them.<br />
4) Design restaurant reservation system. class design and data structures. </p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2010/01/07/interview-questions-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring MVC + Tiles</title>
		<link>http://technote.wsjoung.com/2009/12/13/spring-mvc-tiles/</link>
		<comments>http://technote.wsjoung.com/2009/12/13/spring-mvc-tiles/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 02:14:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Tiles]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=126</guid>
		<description><![CDATA[1. create web.xml &#60;?xml version="1.0" encoding="UTF-8"?&#62; &#60;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&#62; &#60;servlet&#62; &#60;servlet-name&#62;action&#60;/servlet-name&#62; &#60;servlet-class&#62;org.springframework.web.servlet.DispatcherServlet&#60;/servlet-class&#62; &#60;load-on-startup&#62;1&#60;/load-on-startup&#62; &#60;/servlet&#62; &#60;servlet-mapping&#62; &#60;servlet-name&#62;action&#60;/servlet-name&#62; &#60;url-pattern&#62;*.do&#60;/url-pattern&#62; &#60;/servlet-mapping&#62; &#60;/web-app&#62; 2. create action-servlet.xml &#60;?xml version="1.0" encoding="UTF-8"?&#62; &#60;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&#62; &#60;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&#62; &#60;property name="basename" value="message" /&#62; &#60;/bean&#62; &#60;bean id="testController" class="com.bluewiseinc.erp.common.web.TestController"&#62; &#60;property name="methodNameResolver" ref="methodNameResolver" /&#62; &#60;/bean&#62; &#60;bean id="methodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"&#62; &#60;property [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. create web.xml</strong><br />
<code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;<br />
  &lt;servlet&gt;<br />
  	&lt;servlet-name&gt;action&lt;/servlet-name&gt;<br />
	  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;<br />
	  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
  &lt;/servlet&gt;<br />
  &lt;servlet-mapping&gt;<br />
    &lt;servlet-name&gt;action&lt;/servlet-name&gt;<br />
    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;<br />
  &lt;/servlet-mapping&gt;<br />
&lt;/web-app&gt;</code></p>
<p><strong>2. create action-servlet.xml</strong><br />
<code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;</p>
<p>  &lt;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt;<br />
    &lt;property name="basename" value="message" /&gt;<br />
  &lt;/bean&gt;  </p>
<p>  &lt;bean id="testController" class="com.bluewiseinc.erp.common.web.TestController"&gt;<br />
	&lt;property name="methodNameResolver" ref="methodNameResolver" /&gt;<br />
  &lt;/bean&gt;  </p>
<p>  &lt;bean id="methodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver"&gt;<br />
    &lt;property name="paramName"&gt;<br />
      &lt;value&gt;med&lt;/value&gt;<br />
    &lt;/property&gt;<br />
    &lt;property name="defaultMethodName"&gt;<br />
      &lt;value&gt;userMain&lt;/value&gt;<br />
    &lt;/property&gt;<br />
  &lt;/bean&gt;</p>
<p>  &lt;!--<br />
  &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;<br />
	&lt;property name="viewClass"&gt;<br />
	  &lt;value&gt;org.springframework.web.servlet.view.JstlView&lt;/value&gt;<br />
	&lt;/property&gt;<br />
	&lt;property name="cache" value="false" /&gt;<br />
	&lt;property name="prefix" value="/WEB-INF/view/" /&gt;<br />
	&lt;property name="suffix" value=".jsp" /&gt;<br />
  &lt;/bean&gt;<br />
  --&gt;<br />
  &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;<br />
    &lt;property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/&gt;<br />
  &lt;/bean&gt;</p>
<p>  &lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;<br />
	&lt;property name="mappings"&gt;<br />
	  &lt;bean class="org.springframework.beans.factory.config.PropertiesFactoryBean"&gt;<br />
	    &lt;property name="location"&gt;<br />
	      &lt;value&gt;/WEB-INF/UrlMap.properties&lt;/value&gt;<br />
	    &lt;/property&gt;<br />
	  &lt;/bean&gt;<br />
    &lt;/property&gt;<br />
  &lt;/bean&gt;</p>
<p>  &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"&gt;<br />
    &lt;property name="definitions"&gt;<br />
      &lt;list&gt;<br />
        &lt;value&gt;/WEB-INF/tiles-def.xml&lt;/value&gt;<br />
      &lt;/list&gt;<br />
    &lt;/property&gt;<br />
  &lt;/bean&gt;</p>
<p>  &lt;bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;<br />
    &lt;property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/&gt;<br />
  &lt;/bean&gt;<br />
&lt;/beans&gt;</code></p>
<p><strong>3. create TestController</strong><br />
<code>package com.bluewiseinc.erp.common.web;<br />
import javax.servlet.http.HttpServletRequest;<br />
import javax.servlet.http.HttpServletResponse;<br />
import org.springframework.web.servlet.ModelAndView;<br />
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;</p>
<p>public class TestController extends MultiActionController {<br />
	public ModelAndView testMain(HttpServletRequest request, HttpServletResponse response) throws Exception {<br />
		return new ModelAndView("test/test_main", "testMain", null);<br />
	}<br />
}</code></p>
<p><strong>4. UrlMap.properties</strong><br />
<code>## test module mapping<br />
/test/index.do=testController</code></p>
<p><strong>5. tiles-def.xml</strong><br />
<code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;<br />
&lt;!DOCTYPE tiles-definitions PUBLIC<br />
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"<br />
       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd"&gt;</p>
<p>&lt;tiles-definitions&gt;<br />
  &lt;definition name="defaultTemplate" template="/WEB-INF/view/tiles/default.jsp"&gt;<br />
    &lt;put-attribute name="header" value="/WEB-INF/view/tiles/def_header.jsp" /&gt;<br />
    &lt;put-attribute name="menu" value="/WEB-INF/view/tiles/def_menu.jsp" /&gt;<br />
    &lt;put-attribute name="footer" value="/WEB-INF/view/tiles/def_footer.jsp" /&gt;<br />
  &lt;/definition&gt;<br />
  &lt;definition name="test_main" extends="defaultTemplate"&gt;<br />
    &lt;put-attribute name="content"   value="/WEB-INF/view/test/test_main.jsp"/&gt;<br />
  &lt;/definition&gt;<br />
&lt;/tiles-definitions&gt;</code></p>
<p><strong>6. message.properties</strong><br />
<code># Page titles<br />
index.title=Test Spring MVC + Tiles</code></p>
<p><strong>7. default.jsp</strong><br />
<code>&lt;%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %&gt;<br />
&lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %&gt;<br />
&lt;%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %&gt;<br />
&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"<br />
    pageEncoding="ISO-8859-1"%&gt;<br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;<br />
&lt;title&gt;&lt;fmt:message key="index.title"/&gt;&lt;/title&gt;<br />
&lt;link rel=stylesheet href="${pageContext.request.contextPath}/css/global.css" type="text/css"&gt;<br />
&lt;script type="text/javascript" src="${pageContext.request.contextPath}/scripts/global.js"&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id="header"&gt;<br />
    &lt;div id="headerTitle"&gt;&lt;tiles:insertAttribute name="header" /&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div id="menu"&gt;<br />
    &lt;tiles:insertAttribute name="menu" /&gt;<br />
&lt;/div&gt;<br />
&lt;div id="content"&gt;<br />
    &lt;tiles:insertAttribute name="content" /&gt;<br />
&lt;/div&gt;<br />
&lt;div id="footer"&gt;<br />
    &lt;tiles:insertAttribute name="footer" /&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2009/12/13/spring-mvc-tiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Configuration Job Log</title>
		<link>http://technote.wsjoung.com/2009/12/13/server-configuration-job-log/</link>
		<comments>http://technote.wsjoung.com/2009/12/13/server-configuration-job-log/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 22:12:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=120</guid>
		<description><![CDATA[Dell PowerEdge  SC1420 Dell CERC SATA 1.5/6ch RAID Controller Windows 2003 / MS SQL 2005 / Accpac ERP 1. Upgrade system BIOS, raid controller firmware on windows 2003 2. Attach a new hard disk and configure raid 0, virtual drive #1 3. Move all data on current D drive to new attached drive 4. Back [...]]]></description>
			<content:encoded><![CDATA[<p>Dell PowerEdge  SC1420</p>
<p>Dell CERC SATA 1.5/6ch RAID Controller</p>
<p>Windows 2003 / MS SQL 2005 / Accpac ERP</p>
<p><img class="aligncenter size-medium wp-image-123" title="IMG_0506" src="http://technote.wsjoung.com/wp-content/uploads/2009/12/IMG_0506-225x300.jpg" alt="IMG_0506" width="225" height="300" /></p>
<p>1. Upgrade system BIOS, raid controller firmware on windows 2003</p>
<p>2. Attach a new hard disk and configure raid 0, virtual drive #1</p>
<p>3. Move all data on current D drive to new attached drive</p>
<p>4. Back up C partition as a image: <a href="http://clonezilla.org/" target="_blank">Clonezilla</a></p>
<p>5. Reconfigure hard disk 1 &amp; 2 as raid 1, virtual drive #0</p>
<p>6. Restore backed up C drive image to new reconfigured virtual drive #0</p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2009/12/13/server-configuration-job-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Server Monitoring Tools</title>
		<link>http://technote.wsjoung.com/2009/11/04/linux-server-monitoring-tools/</link>
		<comments>http://technote.wsjoung.com/2009/11/04/linux-server-monitoring-tools/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 03:33:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitoring]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=115</guid>
		<description><![CDATA[- Network Monitoring tcptrack iptraf - CPU, Memory Monitoring top free - Disk I/O Monitoring iostat(sysstat)]]></description>
			<content:encoded><![CDATA[<p><strong>- Network Monitoring</strong><br />
tcptrack<br />
iptraf</p>
<p><strong>- CPU, Memory Monitoring</strong><br />
top<br />
free</p>
<p><strong>- Disk I/O Monitoring</strong><br />
iostat(sysstat)</p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2009/11/04/linux-server-monitoring-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Pear Image_Graph</title>
		<link>http://technote.wsjoung.com/2009/09/01/php-pear-image_graph/</link>
		<comments>http://technote.wsjoung.com/2009/09/01/php-pear-image_graph/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 20:36:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Pear]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://technote.wsjoung.com/?p=110</guid>
		<description><![CDATA[#apt-get install php-pear #pear install Numbers_Words-0.16.1 #pear install Numbers_Roman-1.0.2 #pear install Image_Canvas-0.3.1 #pear install Image_Graph-0.7.2 (Download TrueType core fonts from http://corefonts.sourceforge.net/) cp *.ttf /usr/share/php/Image/Canvas/Fonts &#60;?php require_once '../../includes/include.php'; require_once 'Image/Graph.php'; require_once 'Image/Canvas.php'; date_default_timezone_set('America/New_York'); $customer_id = $_REQUEST[customer_id]; if (!$customer_id) exit(); $customer_data = get_order_customer_report_xy($customer_id); if (!$customer_data) exit(); $Canvas =&#38; Image_Canvas::factory('png', array('width' =&#62; 575, 'height' =&#62; 280)); // create [...]]]></description>
			<content:encoded><![CDATA[<p>#apt-get install php-pear</p>
<p>#pear install Numbers_Words-0.16.1<br />
#pear install Numbers_Roman-1.0.2<br />
#pear install Image_Canvas-0.3.1<br />
#pear install Image_Graph-0.7.2</p>
<p>(Download TrueType core fonts from http://corefonts.sourceforge.net/)<br />
cp *.ttf /usr/share/php/Image/Canvas/Fonts</p>
<p><img class="alignnone size-full wp-image-111" title="Image_Graph" src="http://technote.wsjoung.com/wp-content/uploads/2009/09/graph.jpg" alt="Image_Graph" width="575" height="280" /></p>
<p><code>&lt;?php<br />
require_once '../../includes/include.php';<br />
require_once 'Image/Graph.php';<br />
require_once 'Image/Canvas.php';<br />
date_default_timezone_set('America/New_York');</p>
<p>$customer_id = $_REQUEST[customer_id];<br />
if (!$customer_id) exit();<br />
$customer_data = get_order_customer_report_xy($customer_id);<br />
if (!$customer_data) exit();</p>
<p>$Canvas =&amp; Image_Canvas::factory('png', array('width' =&gt; 575, 'height' =&gt; 280));</p>
<p>// create the graph<br />
$Graph =&amp; Image_Graph::factory('graph', $Canvas);<br />
// add a TrueType font<br />
$Font =&amp; $Graph-&gt;addNew('font', 'DejaVuSans');<br />
$Font-&gt;setSize(8); </p>
<p>$Graph-&gt;setFont($Font); </p>
<p>// create the plotarea layout<br />
$Graph-&gt;add(<br />
    Image_Graph::vertical(<br />
        Image_Graph::factory('title', array('', 11)),<br />
        Image_Graph::vertical(<br />
            $Plotarea = Image_Graph::factory('plotarea'),<br />
            $Legend = Image_Graph::factory('legend'),<br />
            90<br />
        ),<br />
        5<br />
    )<br />
);          </p>
<p>$Legend-&gt;setPlotarea($Plotarea);    </p>
<p>// create a grid and assign it to the secondary Y axis<br />
$GridY2 =&amp; $Plotarea-&gt;addNew('bar_grid', IMAGE_GRAPH_AXIS_Y_SECONDARY);<br />
$GridY2-&gt;setFillStyle(<br />
    Image_Graph::factory(<br />
        'gradient',<br />
        array(IMAGE_GRAPH_GRAD_VERTICAL, 'white', 'lightgrey')<br />
    )<br />
);     </p>
<p>list($year, $month) = split('[-.-]', $customer_data[0][1]);<br />
$start=mktime(0,0,0,$month,1,$year);<br />
$today=mktime(0,0,0,date('m'),1,date('Y'));<br />
$interv=12-$month+(12*(date('Y')-$year-1))+date('m')+1;</p>
<p>// create a line plot<br />
$Dataset1 =&amp; Image_Graph::factory('dataset');<br />
$Dataset2 =&amp; Image_Graph::factory('dataset'); </p>
<p>$max = 0;<br />
for ($i=0; $i&lt;count($customer_data); $i++) {<br />
        if ($max&lt;$customer_data[$i][0]) $max=$customer_data[$i][0];<br />
}<br />
for ($i=0; $i&lt;$interv; $i++) {<br />
        $Dataset2-&gt;addPoint(date('m/y', mktime(0,0,0,$month,1,$year)), 0);<br />
        $month++;<br />
}<br />
for ($i=0; $i&lt;count($customer_data); $i++) {<br />
        list($year, $month) = split('[-.-]', $customer_data[$i][1]);<br />
        $Dataset1-&gt;addPoint(date('m/y', mktime(0,0,0,$month,1,$year)), $customer_data[$i][0]);<br />
}</p>
<p>$Plot1 =&amp; $Plotarea-&gt;addNew('bar', array(&amp;$Dataset1));<br />
$Plot1-&gt;setLineColor('red'); </p>
<p>$Plot2 =&amp; $Plotarea-&gt;addNew(<br />
    'Image_Graph_Plot_Area',<br />
    $Dataset2,<br />
    IMAGE_GRAPH_AXIS_Y_SECONDARY<br />
); </p>
<p>$Plot2-&gt;setLineColor('gray');<br />
$Plot2-&gt;setFillColor('white@0.2'); </p>
<p>$AxisX =&amp; $Plotarea-&gt;getAxis(IMAGE_GRAPH_AXIS_X);<br />
$labInterv = floor($interv / 13);<br />
$AxisX-&gt;setLabelInterval($labInterv);<br />
$AxisY =&amp; $Plotarea-&gt;getAxis(IMAGE_GRAPH_AXIS_Y);<br />
$AxisY-&gt;setTitle('Orders', 'vertical');<br />
$AxisYsecondary =&amp; $Plotarea-&gt;getAxis(IMAGE_GRAPH_AXIS_Y_SECONDARY); </p>
<p>// output the Graph<br />
$Graph-&gt;done();<br />
db_close()<br />
?&gt; </code></p>
]]></content:encoded>
			<wfw:commentRss>http://technote.wsjoung.com/2009/09/01/php-pear-image_graph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
