<?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>Phine Solutions &#187; ajax gadgets</title>
	<atom:link href="http://www.phinesolutions.com/topics/ajax-gadgets/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phinesolutions.com</link>
	<description>A web log for web work</description>
	<lastBuildDate>Wed, 30 Jun 2010 16:23:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>monitoring the server load from web</title>
		<link>http://www.phinesolutions.com/monitoring-the-server-load-from-web.html</link>
		<comments>http://www.phinesolutions.com/monitoring-the-server-load-from-web.html#comments</comments>
		<pubDate>Sat, 22 Sep 2007 16:04:43 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[ajax gadgets]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/monitoring-the-server-load-from-web.html</guid>
		<description><![CDATA[From a Linux console, we can choose to show the server load using the &#8216;top&#8221; or &#8220;uptime&#8221; command. To get a simple reflection of the same information, we can also use the &#8220;/proc/loadavg&#8221;.
The first three columns of &#8220;/proc/loadavg&#8221; measure CPU and IO utilization of the last one, five, and 10 minute periods. The fourth column [...]]]></description>
			<content:encoded><![CDATA[<p>From a Linux console, we can choose to show the server load using the &#8216;top&#8221; or &#8220;uptime&#8221; command. To get a simple reflection of the same information, we can also use the &#8220;/proc/loadavg&#8221;.</p>
<p>The first three columns of &#8220;/proc/loadavg&#8221; measure CPU and IO utilization of the last one, five, and 10 minute periods. The fourth column shows the number of currently running processes and the total number of processes. The last column displays the last process ID used.</p>
<p>Using a simple PHP script and Ajax, we can display the load status using &#8220;/proc/loadavg&#8221; on a timer using web interface without having to login to a console.</p>
<p>Here is the html page that we can use to show the status in every 5 seconds. It calls a PHP script which returns the content of /proc/loadavg. And by using Ajax, the page doesn&#8217;t need to be refreshed.</p>
<blockquote><p><em>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
&lt;!&#8211; //<br />
// initialize the ajax stuff<br />
var x;<br />
try {<br />
// Try to create object for Firefox, Safari, IE7, etc.<br />
x = new XMLHttpRequest();<br />
} catch (e) {<br />
try {<br />
// Try to create object for later versions of IE.<br />
x = new ActiveXObject(&#8217;MSXML2.XMLHTTP&#8217;);<br />
} catch (e) {<br />
try {<br />
// Try to create object for early versions of IE.<br />
x = new ActiveXObject(&#8217;Microsoft.XMLHTTP&#8217;);<br />
} catch (e) {<br />
// Could not create an XMLHttpRequest object.<br />
alert(&#8217;Not able to init ajax&#8217;);<br />
}<br />
}<br />
}</p>
<p>setInterval(&#8217;showLoad()&#8217;, 5000);</p>
<p>function showLoad() {<br />
el = document.getElementById(&#8217;LoadStatus&#8217;);<br />
x.onreadystatechange = function() {<br />
if (x.readyState == 4) {<br />
if (x.status &gt;= 200 &amp;&amp; x.status &lt;= 299) {<br />
el.innerHTML = x.responseText;<br />
}<br />
}<br />
}<br />
x.open(&#8221;GET&#8221;, &#8216;/path/to/serverstatus.php?Load&#8217;, true);<br />
x.send(null);<br />
}<br />
// &#8211;&gt;<br />
&lt;/script&gt;<br />
&lt;div id=&#8221;LoadStatus&#8221; style=&#8221;width:400px; height:30px; background-color:#eee;&#8221;&gt;<br />
&lt;/div&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt; </em></p></blockquote>
<p>The simple PHP script that reads the loadavg file:</p>
<blockquote><p><em>&lt;?php<br />
$info = date(&#8221;H:i:s&#8221;) . &#8216; &#8216;;</p>
<p>if (isset($_GET['Load'])) {<br />
$info .= file_get_contents(&#8217;/proc/loadavg&#8217;);<br />
echo $info;<br />
}<br />
?&gt;</em></p></blockquote>
<p>This solution is especially useful when telnet/ssh to a server is hard to do. For example, in a restricted network, or there is no computer around. You might ask without a computer, how to access web in the first place, well smart phone is the answer <img src='http://www.phinesolutions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . As you can see it has more potential to do a lot more stuff if utilizing other Linux commands.</p>
<blockquote></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/monitoring-the-server-load-from-web.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ip location on Google map</title>
		<link>http://www.phinesolutions.com/ip-location-on-google-map.html</link>
		<comments>http://www.phinesolutions.com/ip-location-on-google-map.html#comments</comments>
		<pubDate>Wed, 14 Feb 2007 15:58:33 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[ajax gadgets]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/ip-location-on-google-map.html</guid>
		<description><![CDATA[This little tool takes an ip address and maps it on a Google map. Using the simple API provided by hostip.info, I am trying to pinpoint the geographical location of an ip address. Not sure about the accuracy though. Also, this is a little experiment using the Ajax utility by Javascript Prototype framework. 
If you [...]]]></description>
			<content:encoded><![CDATA[<p>This little tool takes an ip address and maps it on a Google map. Using the <a href="http://www.hostip.info/use.html">simple API provided by hostip.info</a>, I am trying to pinpoint the geographical location of an ip address. Not sure about the accuracy though. Also, this is a little experiment using the Ajax utility by <a href="http://prototypejs.org">Javascript Prototype framework</a>. </p>
<p>If you don&#8217;t enter an ip address or hostname, the tool will try to map your current ip (hopefully).</p>
<p><!-- import prototype 1.5 --><br />
<script type="text/javascript"  src="/tools/js/prototype.js"></script></p>
<p><script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAnDG7rWBsCD3ozUvbrhnVTBRkwgTJAt4oLofty_I-8yOmyhcFWhR1MlypWY6OL7515bsWmCG8X6FFnA" type="text/javascript"></script></p>
<p><script type="text/javascript" src="/tools/js/ipongmap.js"></script></p>
<input type='text' id='Ip' name='ip' value=''>
<input type='button' name='map it' value='map it' onClick="javascript:getIpLocation('Ip', 'ipmap');">
<div id='ipmap' style=''>
</div>
<p>One way I enjoy using this tool is to check where the &#8220;scanners&#8221; or spammers of my server are located. Not that I can do anything about it but just to get some idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/ip-location-on-google-map.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>easy access to unix man page</title>
		<link>http://www.phinesolutions.com/easy-access-to-linux-man-page.html</link>
		<comments>http://www.phinesolutions.com/easy-access-to-linux-man-page.html#comments</comments>
		<pubDate>Thu, 28 Dec 2006 00:59:38 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[ajax gadgets]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/easy-access-to-linux-man-page.html</guid>
		<description><![CDATA[


command

 


]]></description>
			<content:encoded><![CDATA[<p><script src="/tools/js/ajaxCtl.js" language="JavaScript" type="text/javascript"></script></p>
<div style="border: 1px solid #008800; padding: 0pt 10px 10px; margin-top:10px;">
<form name="ManPageForm" action="javascript:ajaxGet('/tools/man.php', 'Man', 1, 'manpage')">
<h2>command</h2>
<input size="20" id="Man1" name="command" type="text" />
<input name="submit" value="m a n" type="submit" /> </form>
<div id='manpage'></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/easy-access-to-linux-man-page.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ascii to char decoder</title>
		<link>http://www.phinesolutions.com/ascii-to-char-decoder.html</link>
		<comments>http://www.phinesolutions.com/ascii-to-char-decoder.html#comments</comments>
		<pubDate>Tue, 26 Dec 2006 16:36:05 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[ajax gadgets]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/ascii-to-char-decoder.html</guid>
		<description><![CDATA[This is a tool to convert an ascii stream to character string. I wrote this tool to make my life easier to peek into the spam page I got in the email and figure how do they hide the Javascript re-direct. Please do not try to inject executable commands or XSS. They are blocked.



  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tool to convert an ascii stream to character string. I wrote this tool to make my life easier to peek into the spam page I got in the email and figure how do they hide the Javascript re-direct. <span style="color:#f00">Please do not try to inject executable commands or XSS. They are blocked.</span></p>
<p><script language="JavaScript" type="text/javascript" src="/tools/js/ajaxCtl.js"></script></p>
<form name="AD" action="javascript:ajaxPost('/tools/decoder.php', 'AsciiDe', 2, 'asciiDecode_result')">
<div>
  decode ascii (replace the example in the text box):</p>
<input type="hidden" name="Param1" Id="AsciiDe1" value="AsciiDecode"/>
  <textarea name="Param2" Id="AsciiDe2" rows="5" cols="40">104 101 108 108 111 32 119 111 114 108 100</textarea></p>
<input type="submit" name="AsciiDecode" value="Go" />
</div>
</form>
<div style="background-color:#eee;">
<div style="background-color:#fff;">output</div>
<div id="asciiDecode_result" style="font:12px 'Courier New', Courier, Fixed; padding:5px;"></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/ascii-to-char-decoder.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a mortgage calculator using ajax + PHP</title>
		<link>http://www.phinesolutions.com/a-mortgage-calculator-using-ajax-php.html</link>
		<comments>http://www.phinesolutions.com/a-mortgage-calculator-using-ajax-php.html#comments</comments>
		<pubDate>Fri, 22 Dec 2006 19:14:04 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[ajax gadgets]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/a-mortgage-calculator-using-ajax-php.html</guid>
		<description><![CDATA[
This little tool is written with ajax and php script.


This mortgage calculator can be used to figure out monthly payments of a home mortgage loan,
based on the home&#8217;s sale price, the term of the loan desired, buyer&#8217;s down payment percentage, and the loan&#8217;s interest rate.
This calculator factors in PMI (Private Mortgage Insurance) for loans where [...]]]></description>
			<content:encoded><![CDATA[<p>
This little tool is written with ajax and php script.
</p>
<p><script language="JavaScript" type="text/javascript" src="/tools/js/ajaxCtl.js"></script></p>
<p>This <b>mortgage calculator</b> can be used to figure out monthly payments of a home mortgage loan,<br />
based on the home&#8217;s sale price, the term of the loan desired, buyer&#8217;s down payment percentage, and the loan&#8217;s interest rate.<br />
This calculator factors in PMI (Private Mortgage Insurance) for loans where less than 20% is put as a down payment.
</p>
<table>
<tr>
<td style="vertical-align:top; width:40%;">
<input type="hidden" id="Mort1" name="form_complete" value="1">
<h1>Purchase &amp; Financing Information</h1>
<h2>Sale Price of Home:</h2>
<input type="text" size="10" id="Mort2" name="sale_price" value="150000"> (In Dollars)</p>
<h2>Percentage Down:</h2>
<input type="text" size="5" id="Mort3" name="down_percent" value="10"> %</p>
<h2>Length of Mortgage:</h2>
<input type="text" size="3" id="Mort4" name="year_term" value="30"> years</p>
<h2>Annual Interest Rate:</h2>
<input type="text" size="5" id="Mort5" name="annual_interest_percent" value="7"> %</p>
<input type="hidden" id="Mort6" name="show_mort" value="1" />
<input type="button" value="Calculate" onmousedown="javascript:ajaxPost('/tools/calcMortgage.php', 'Mort', 5, 'calcresult')" />
<input type="button" value="Show amortization" onmousedown="javascript:ajaxPost('/tools/calcMortgage.php', 'Mort', 6, 'calcresult')" />
</td>
<td>
<div id="calcresult"></div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/a-mortgage-calculator-using-ajax-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>html url decoder</title>
		<link>http://www.phinesolutions.com/82.html</link>
		<comments>http://www.phinesolutions.com/82.html#comments</comments>
		<pubDate>Thu, 21 Dec 2006 18:56:34 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[ajax gadgets]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/82.html</guid>
		<description><![CDATA[This is a little tool to convert the decoded URL back to an Ascii string.



  decode url:






    output:
  





]]></description>
			<content:encoded><![CDATA[<p>This is a little tool to convert the decoded URL back to an Ascii string.</p>
<p><script language="JavaScript" type="text/javascript" src="/tools/js/ajaxCtl.js"></script></p>
<div>
<input type="hidden" name="Param1" Id="UrlDe1" value="UrlDecode"/>
  decode url:<br />
<input type="text" name="Param2" Id="UrlDe2" value="" size="50"/>
<input type="button" name="UrlDecode" value="Go" onmousedown="javascript:ajaxPost('/tools/decoder.php', 'UrlDe', 2, 'urldecode_result')" />
</div>
<table>
<tr>
<td>
    <b>output:</b>
  </td>
<td>
<div id="urldecode_result"></div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/82.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
