<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6067865819156952867</id><updated>2024-12-13T01:35:41.930+05:30</updated><category term="GPS Nokia"/><category term="GPS Sri Lanka"/><category term="Javascript form validate"/><category term="Kannel"/><category term="Nokia 5800 GPS"/><category term="SMS"/><category term="SSL"/><category term="Server side clock"/><category term="Squid"/><category term="buffers"/><category term="cache"/><category term="certificate"/><category term="check_http"/><category term="clock"/><category term="cross site scripting"/><category term="drop_caches"/><category term="home directory"/><category term="html nested loops"/><category term="javascript clock"/><category term="javascript nested loop"/><category term="kannel sms"/><category term="linux memory"/><category term="monitoring"/><category term="nagios"/><category term="openssl"/><category term="php clock"/><category term="prevent invalid char"/><category term="proxy server"/><category term="receive sms"/><category term="remove invalid char"/><category term="samba"/><category term="save sms"/><category term="server clock"/><category term="shell script"/><category term="show hide html contents"/><category term="show hide php"/><category term="smbd"/><category term="standard input is not a socket"/><category term="time"/><title type='text'>Suhada Fernando</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-1026390023131612109</id><published>2014-08-29T12:14:00.000+05:30</published><updated>2014-08-29T13:17:23.988+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="certificate"/><category scheme="http://www.blogger.com/atom/ns#" term="check_http"/><category scheme="http://www.blogger.com/atom/ns#" term="monitoring"/><category scheme="http://www.blogger.com/atom/ns#" term="nagios"/><category scheme="http://www.blogger.com/atom/ns#" term="openssl"/><category scheme="http://www.blogger.com/atom/ns#" term="shell script"/><category scheme="http://www.blogger.com/atom/ns#" term="SSL"/><title type='text'>Monitor your SSL certificates through Nagios with shell scripts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Recently I had a requirement to monitor few SSL 
certificate expiry dates through Nagios. The easiest method was to 
define a service with check_http. –S for SSL and –C for warning dates.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
define service{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; generic-service&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Inherit default values from a template&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; host_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXXweb&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service_description&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXX.lk Certificate Expire&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; check_command&amp;nbsp;&amp;nbsp; check_http! -S -H XX.XX.XX.XX -C 90&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
That worked for some hosts but unfortunately there were some SSL issues in some hosts.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
But I could get the certificate details through openssl command.
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
echo | openssl s_client -connect XXX.lk:443 2&amp;gt;/dev/null | openssl x509 -noout -dates&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
So what my option was to write a shell script with relevant EXIT codes to Nagios and configure Nagios to run it periodically.&amp;nbsp;&amp;nbsp;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Step 1&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Created a separate command definition in /etc/nagios/objects/commands.&lt;wbr&gt;&lt;/wbr&gt;cfg&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
define command{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; command_name&amp;nbsp;&amp;nbsp;&amp;nbsp; check_cus_command&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; command_line&amp;nbsp;&amp;nbsp;&amp;nbsp; $ARG1$&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
So I need only to call check_cus_command with my full command.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Step 2&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Create a custom script at /usr/lib64/nagios/plugins/ with right permission 755 and I call it expscript.sh&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;Thank to &lt;a href=&quot;http://superuser.com/questions/618370/check-expiry-date-of-ssl-certificate-for-multiple-remote-servers&quot;&gt;http://superuser.com/questions/618370/check-expiry-date-of-ssl-certificate-for-multiple-remote-servers&lt;/a&gt;, I found a script only had to do some minor modifications to support Nagios EXIT codes.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
#!/bin/bash&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
DEBUG=false&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
#DEBUG=true&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
warning_days=90 # Number of days to warn about soon-to-expire certs&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
#certs_to_check=&#39;&lt;a href=&quot;http://xxx.yyy.lk:443/&quot; target=&quot;_blank&quot;&gt;XXX.YYY.lk:&lt;wbr&gt;&lt;/wbr&gt;443&lt;/a&gt;&#39;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
certs_to_check=$1&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
for CERT in $certs_to_check&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
do&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; $DEBUG &amp;amp;&amp;amp; echo &quot;Checking cert: [$CERT]&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; output=$(echo | openssl s_client -connect ${CERT} 2&amp;gt;/dev/null |\&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; sed -ne &#39;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&#39; |\&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; openssl x509 -noout -subject -dates 2&amp;gt;/dev/null)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; if [ &quot;$?&quot; -ne 0 ]; then&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $DEBUG &amp;amp;&amp;amp; echo &quot;Error connecting to host for cert [$CERT]&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; logger -p local6.warn &quot;Error connecting to host for cert [$CERT]&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; continue&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; fi&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; start_date=$(echo $output | sed &#39;s/.*notBefore=\(.*\).*not.*/\&lt;wbr&gt;&lt;/wbr&gt;1/g&#39;)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; end_date=$(echo $output | sed &#39;s/.*notAfter=\(.*\)$/\1/g&#39;)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; start_epoch=$(date +%s -d &quot;$start_date&quot;)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; end_epoch=$(date +%s -d &quot;$end_date&quot;)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; epoch_now=$(date +%s)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; if [ &quot;$start_epoch&quot; -gt &quot;$epoch_now&quot; ]; then&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $DEBUG &amp;amp;&amp;amp; echo &quot;Certificate for [$CERT] is not yet valid&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; logger -p local6.warn &quot;Certificate for $CERT is not yet valid&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; fi&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; seconds_to_expire=$(($end_&lt;wbr&gt;&lt;/wbr&gt;epoch - $epoch_now))&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; days_to_expire=$(($seconds_to_&lt;wbr&gt;&lt;/wbr&gt;expire / 86400))&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; #$DEBUG &amp;amp;&amp;amp; echo &quot;Days to expiry: ($days_to_expire)&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; echo &quot;Days to expiry: ($days_to_expire) - $end_date&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; warning_seconds=$((86400 * $warning_days))&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; if [ &quot;$seconds_to_expire&quot; -lt &quot;$warning_seconds&quot; ]; then&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; #$DEBUG &amp;amp;&amp;amp; echo &quot;Cert [$CERT] is soon to expire ($seconds_to_expire seconds)&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &quot;Cert [$CERT] is soon to expire ($seconds_to_expire seconds)&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; logger -p local6.warn &quot;cert [$CERT] is soon to expire ($seconds_to_expire seconds)&quot;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; exit 1&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; elif [ &quot;$seconds_to_expire&quot; -gt &quot;$warning_seconds&quot; ]; then&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; exit 0&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp; fi&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
done&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Step 3&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
My service definition at my relevant host;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
define service{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; generic-service&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; Inherit default values from a template&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; host_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXX.YYYWeb&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service_description&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XXX.YYY Cert&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; check_command&amp;nbsp;&amp;nbsp; check_cus_command!sh /usr/lib64/nagios/plugins/&lt;wbr&gt;&lt;/wbr&gt;expscript.sh &lt;a href=&quot;http://xxx.yyy.lk:443/&quot; target=&quot;_blank&quot;&gt;XXX.YYY.lk:443&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; servicegroups&amp;nbsp;&amp;nbsp; URL_Checks&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
That’s it…..&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/1026390023131612109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2014/08/monitor-your-ssl-certificates-through.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/1026390023131612109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/1026390023131612109'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2014/08/monitor-your-ssl-certificates-through.html' title='Monitor your SSL certificates through Nagios with shell scripts'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-3869046186085942569</id><published>2013-10-08T12:47:00.000+05:30</published><updated>2013-10-08T12:51:34.949+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="buffers"/><category scheme="http://www.blogger.com/atom/ns#" term="cache"/><category scheme="http://www.blogger.com/atom/ns#" term="drop_caches"/><category scheme="http://www.blogger.com/atom/ns#" term="linux memory"/><title type='text'>Linux Running out of Memory for buffers/cache</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;H1 { margin-bottom: 0.08in; }H1.western { font-family: &quot;Liberation Serif&quot;,serif; }H1.cjk { font-family: &quot;WenQuanYi Zen Hei Sharp&quot;; font-size: 24pt; }H1.ctl { font-family: &quot;Lohit Devanagari&quot;; font-size: 24pt; }PRE.cjk { font-family: &quot;WenQuanYi Zen Hei Sharp&quot;,monospace; }P { margin-bottom: 0.08in; }CODE.cjk { font-family: &quot;WenQuanYi Zen Hei Sharp&quot;,monospace; }CODE.ctl { font-family: &quot;Lohit Devanagari&quot;,monospace; }A:link {  }&lt;/style&gt;


&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;Recently
our systems guys got some Nagios warnings on one of our servers that
it is running out of RAM. When we were logged in to the system yes it
is... it was something like this,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;$ free -m&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
             &lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;total       used       free     shared    buffers     cached&lt;/span&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;Mem:          1504       1491         13          0         91        764&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;(not
actual data)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;But
what are these buffers and cached, They over consumes my RAM. But
what are the details below that...!!&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;-/+ buffers/cache:        635       &lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;b&gt;869&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;Swap:         2047          6       2041&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;Swap
of course about your disk swap space.. Buffers/cache ..?? After I
google it i just found this post that talks everything about this
matter...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.linuxatemyram.com/&quot;&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;http://www.linuxatemyram.com/&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;“ &lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;Disk
caching makes the system much faster! There are no downsides, except
for confusing newbies. It does not take memory away from applications
in any way, ever! If your applications want more memory, they just
take back a chunk that the disk cache borrowed. Disk cache can always
be given back to applications immediately! You are not low on ram! “&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;So
it says it is not a problem at all... But for the purpose of removing
warnings on Nagios I wanted to clear this cache memory. So this is
the command for that;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;sync;
echo 3 &amp;gt; /proc/sys/vm/drop_caches&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;explanation
of this command as follows; Ref:
http://www.linuxinsight.com/proc_sys_vm_drop_caches.html&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h1 class=&quot;western&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif;&quot;&gt;drop_caches&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;Writing
to this will cause the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;To
free pagecache:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;echo
 1 &amp;gt; /proc/sys/vm/drop_caches&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;To
free dentries and inodes:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;echo
 2 &amp;gt; /proc/sys/vm/drop_caches&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;To
free pagecache, dentries and inodes:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;echo
 3 &amp;gt; /proc/sys/vm/drop_caches&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;As
this is a non-destructive operation, and dirty objects are not
freeable, the user should run &quot;sync&quot; first in order to make
sure all cached objects are freed.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: FreeSans, sans-serif; font-size: small;&quot;&gt;Note: All the credits goes to the actual owners of the references...&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/3869046186085942569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2013/10/linux-running-out-of-memory-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/3869046186085942569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/3869046186085942569'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2013/10/linux-running-out-of-memory-for.html' title='Linux Running out of Memory for buffers/cache'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-1616115870387586355</id><published>2013-08-30T15:25:00.001+05:30</published><updated>2013-08-30T15:29:05.272+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="samba"/><category scheme="http://www.blogger.com/atom/ns#" term="smbd"/><category scheme="http://www.blogger.com/atom/ns#" term="standard input is not a socket"/><title type='text'>Common SAMBA Errors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Recently my SAMBA server started crashing giving bellow errors in logs;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;&lt;i&gt;standard input is not a socket&lt;/i&gt;, assuming -D option&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;[2013/08/30 09:06:22.619250,&amp;nbsp; 0] ../source3/smbd/server.c:1280(main)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;Google didn&#39;t help me as well as my previous SAMBA experiences couldn&#39;t come up with a solution. Luckily I found this forum post and yes... he maid my day....&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a href=&quot;http://www.hkepc.com/forum/viewthread.php?tid=1923469&quot;&gt;&lt;span class=&quot;st&quot;&gt;http://www.hkepc.com/forum/viewthread.php?tid=1923469&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;st&quot;&gt;All the credits goes to the writer...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;st&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
vim /etc/sysfconfig/samba&lt;br /&gt;
and edit;&lt;br /&gt;
SMBDOPTIONS=&quot;-D&quot;&lt;br /&gt;
&lt;br /&gt;
So according to the man page of smbd -D causes the server to operate as a daemon. &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/1616115870387586355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2013/08/common-samba-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/1616115870387586355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/1616115870387586355'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2013/08/common-samba-errors.html' title='Common SAMBA Errors'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-6648493000631975571</id><published>2011-10-28T15:53:00.001+05:30</published><updated>2011-10-28T15:56:49.029+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="html nested loops"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript nested loop"/><category scheme="http://www.blogger.com/atom/ns#" term="show hide html contents"/><category scheme="http://www.blogger.com/atom/ns#" term="show hide php"/><title type='text'>Show Hide HTML Contents inside Nested Loops</title><content type='html'>Show hide contents with Javascript is not a big issue in php, HTML development. But when it comes to dynamically changing environment, contents inside a loop which the number of rows not known, it gets little difficult. Because Javascripts are running on client side and it will do the job through content IDs. Below code will show you how to show/hide contents inside a loop where the number of rows not predefined and also the number of rows inside a single row also not predefined. Basically a nested loop.&lt;br /&gt;
&lt;br /&gt;
This is the Javascript code inside the &amp;lt;head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
function toggle(div_id, count) &lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i=0;i&amp;lt;=count;i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var a=div_id+&quot;-&quot;+i;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var divval = document.getElementById(a);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (divval != null)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if ( divval.style.display == &#39;none&#39; ) &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; divval.style.display = &#39;block&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; divval.style.display = &#39;none&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is the php,&lt;br /&gt;
&lt;br /&gt;
$count = 0;&lt;br /&gt;
while(condition for loop1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $count2 = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while(condition for loop2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;nbsp; id=&#39;&amp;lt;? echo $count.&quot;-&quot;.$count2 ?&amp;gt;&#39; style=&quot;display:none&quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $count2 = $count2+1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $count = $count+1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr id=&#39;&amp;lt;? echo $count.&quot;-more&quot; ?&amp;gt;&#39; style=&quot;display:block&quot;; align=&quot;right&quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;img src=&quot;./images/more.png&quot; align=&quot;right&quot; onmouseover=&quot;this.src=&#39;./images/moremo.png&#39;;&quot; onmouseout=&quot;this.src=&#39;./images/more.png&#39;;&quot; onclick=&quot;toggle(&#39;&amp;lt;? echo $count ?&amp;gt;&#39;, &#39;&amp;lt;? echo $count2 ?&amp;gt;&#39;)&quot; height=&quot;17&quot; width=&quot;40&quot;&amp;nbsp; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
The basic idea of this code is a &#39;show more records&#39; button inside the first loop. (one button per record) According to the button click event it will show/hide the result of the second loop.&lt;br /&gt;
What I have done here is sending the div_id (count of the first loop) and the number of records in the second loop to the JScript. The JScript will run another loop for the count of the second mentioned loop and do the necessary. See how I have created dynamic div ids.&lt;br /&gt;
&lt;br /&gt;
Simple but powerful JavaScripts&lt;br /&gt;
Regards, &lt;br /&gt;
&amp;nbsp;&amp;nbsp;</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/6648493000631975571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2011/10/show-hide-html-contents-inside-nested.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/6648493000631975571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/6648493000631975571'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2011/10/show-hide-html-contents-inside-nested.html' title='Show Hide HTML Contents inside Nested Loops'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-5929413352950233165</id><published>2011-09-20T17:10:00.000+05:30</published><updated>2011-09-20T17:17:59.589+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="clock"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript clock"/><category scheme="http://www.blogger.com/atom/ns#" term="php clock"/><category scheme="http://www.blogger.com/atom/ns#" term="server clock"/><category scheme="http://www.blogger.com/atom/ns#" term="Server side clock"/><category scheme="http://www.blogger.com/atom/ns#" term="time"/><title type='text'>Server side (web) clock on your client&#39;s browser</title><content type='html'>There you can find many number or Javascript clocks available on the Internet, graphical as well as numerical. But all they do is showing the clock in the client&#39;s machine. What if the client machine&#39;s time is not correct? or the viewer is from another region or timezone but you need to display the clock according to your regional or server time. Here is the solution.&lt;br /&gt;
&lt;br /&gt;
I&#39;m calling this in my page onload event;&lt;br /&gt;
&lt;i&gt;&amp;lt;BODY onLoad=&quot;startTimee(&amp;lt;? echo $a ?&amp;gt;, &amp;lt;? echo $b ?&amp;gt;, &amp;lt;? echo $c ?&amp;gt;)&quot;&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Here is my piece of PHP code, this should be located before the &amp;lt;body&amp;gt; tag;&lt;br /&gt;
&lt;i&gt;&amp;lt;?&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;$a = date(&#39;H&#39;);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;$b = date(&#39;i&#39;);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;$c = date(&#39;s&#39;);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;?&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Finally my simple Javascript, displays the server ticking clock;&lt;br /&gt;
&lt;i&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var a;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var b;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var c;&lt;/i&gt;&lt;br /&gt;
&amp;lt;! --This should be defined before all JS functions so it will work as global values for JS. --&amp;gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;function startTimee(x, y, z)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var today=new Date();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var h=today.getHours();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var m=today.getMinutes();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var s=today.getSeconds();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;a=x-h;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;b=y-m;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;c=z-s;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;startTime();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;function startTime()&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var today=new Date();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var h=today.getHours();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var m=today.getMinutes();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;var s=today.getSeconds();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;h=h+(a);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;m=m+(b);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;s=s+(c);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if (s&amp;gt;59)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;s=(s)-60;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;m=m+1;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if (s&amp;lt;0)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;s=60+(s);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;m=m-1;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if (m&amp;gt;59)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;m=(m)-60;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;h=h+1;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if (m&amp;lt;0)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;m=60+(m);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;h=h-1;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if (h&amp;gt;12) &lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;h=h-12;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;// add a zero in front of numbers&amp;lt;10&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;m=checkTime(m);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;s=checkTime(s);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;document.getElementById(&#39;txt&#39;).innerHTML=h+&quot;:&quot;+m+&quot;:&quot;+s;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;t=setTimeout(&#39;startTime()&#39;,500);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;function checkTime(i)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if (i&amp;lt;10)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; i=&quot;0&quot; + i;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;return i;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;lt;/script&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
What I all do is taking the time difference with my server and clients machine on page load and assignees them to JS global values. Finally add (or subtract) it to the normal JS clock. Simple as that, (but powerful :) ) So you can embed this with any JS clock on the web as your requirement.&lt;br /&gt;
&lt;br /&gt;
Note: the actual time may be differ + or - 5 to 10 seconds depending on the page load time. &lt;br /&gt;
&lt;br /&gt;
Regards, </content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/5929413352950233165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2011/09/web-server-side-clock-on-your-client.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/5929413352950233165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/5929413352950233165'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2011/09/web-server-side-clock-on-your-client.html' title='Server side (web) clock on your client&#39;s browser'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-8091335394900173566</id><published>2011-09-12T15:11:00.000+05:30</published><updated>2011-09-12T15:14:19.073+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="cross site scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript form validate"/><category scheme="http://www.blogger.com/atom/ns#" term="prevent invalid char"/><category scheme="http://www.blogger.com/atom/ns#" term="remove invalid char"/><title type='text'>Remove and/or prevent inserting invalid characters on client side</title><content type='html'>&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This simple Javascript will prevent inserting &#39; &amp;lt; &#39; &#39; &amp;gt; &#39; and &#39; &quot; &#39; characters from your HTML form,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;lt;SCRIPT language=Javascript&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function reminvalid(evt)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var charCode = (evt.which) ? evt.which : event.keyCode&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((charCode &amp;lt; 60 || charCode &amp;gt; 62) &amp;amp;&amp;amp; charCode != 34)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;The primary requirement of this code is to prevent cross site scripting on the web form. You can modify the char code(s) as the requirement.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Unfortunately this won&#39;t prevent copy and paste insertion. So I had to embed this code too..&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;function delinvalid(string)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; output =&amp;nbsp; string.replace(/[&amp;lt;&amp;gt;&quot;]+/g,&#39; &#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return output;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will remove the unwanted characters and replace by a space (or any other character you specify after the comma, in this case &#39; &#39;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;You can use it this way too,&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;string.replace(/[^a-zA-Z 0-9]+/g,&#39; &#39;); &lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Then it will remove everything other than a-z A-Z 0-9 and space.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Remember to use the below notation if you want to replace the &#39;^&#39; sign.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;pre class=&quot;default prettyprint&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;string.&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;/\^/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&#39;\r\n&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Here is my input element,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;lt;input name=&quot;***&quot; type=&quot;text&quot; size=&quot;**&quot; id=&quot;**&quot; onkeypress=&quot;return reminvalid(event)&quot; onChange=&quot;this.value=delinvalid(this.value)&quot;&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Simple and powerful Javascripts....&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif; font-size: small;&quot;&gt;Regards.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/8091335394900173566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2011/09/remove-andor-prevent-inserting-invalid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/8091335394900173566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/8091335394900173566'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2011/09/remove-andor-prevent-inserting-invalid.html' title='Remove and/or prevent inserting invalid characters on client side'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-8373410094349896188</id><published>2011-06-28T11:49:00.000+05:30</published><updated>2011-09-12T15:16:17.458+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="home directory"/><category scheme="http://www.blogger.com/atom/ns#" term="proxy server"/><category scheme="http://www.blogger.com/atom/ns#" term="Squid"/><title type='text'>Install Squid on your home directory</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;color: white; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Squid is a open source proxy server mostly running on linux environment&amp;nbsp; (also there is a version for windows too). The default path that the squid will install is &lt;i&gt;/usr/local/squid/.&lt;/i&gt; You can change the path by using &lt;i&gt;./configure --prefix=/some/other/directory/squid&lt;/i&gt; at the compilation of squid. (Please refer &lt;a href=&quot;http://wiki.squid-cache.org/SquidFaq/CompilingSquid&quot;&gt;http://wiki.squid-cache.org/SquidFaq/CompilingSquid&lt;/a&gt;) &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;color: white; line-height: normal;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;color: white; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Occasionally some may want to install squid on the home directory. As usual you need to set the permission &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;squid/var/logs &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;amp; &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;cache_dir&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; directories to the &lt;i&gt;cache_effective_user&lt;/i&gt; you have configured at &lt;i&gt;squid.conf&lt;/i&gt;. the default is &lt;i&gt;squid:squid&lt;/i&gt;. &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;The problem arise here is it still gives an error saying permission denied.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;color: white; line-height: normal;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;color: white; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;The solution is easy. Change your &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;cache_effective_user&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; to your home directory name. And set permission of above mentioned directories to the same. Ya.. It works....&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;a href=&quot;http://wiki.squid-cache.org/SquidFaq/CompilingSquid&quot; target=&quot;_blank&quot;&gt;http://wiki.squid-cache.org/&lt;wbr&gt;&lt;/wbr&gt;SquidFaq/CompilingSquid&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://wiki.squid-cache.org/SquidFaq/InstallingSquid&quot; target=&quot;_blank&quot;&gt;http://wiki.squid-cache.org/&lt;wbr&gt;&lt;/wbr&gt;SquidFaq/InstallingSquid&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://wiki.squid-cache.org/SquidFaq/ConfiguringSquid&quot; target=&quot;_blank&quot;&gt;http://wiki.squid-cache.org/&lt;wbr&gt;&lt;/wbr&gt;SquidFaq/ConfiguringSquid&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/8373410094349896188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2011/06/install-squid-on-your-home-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/8373410094349896188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/8373410094349896188'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2011/06/install-squid-on-your-home-directory.html' title='Install Squid on your home directory'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-7487087313546813824</id><published>2011-04-19T13:34:00.000+05:30</published><updated>2011-04-19T15:53:28.646+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GPS Nokia"/><category scheme="http://www.blogger.com/atom/ns#" term="GPS Sri Lanka"/><category scheme="http://www.blogger.com/atom/ns#" term="Nokia 5800 GPS"/><title type='text'>Enable Sri Lanka GPS navigation on your Nokia device</title><content type='html'>&lt;div style=&quot;background-color: black; color: white;&quot;&gt;There are so many GPS enabled mobile devices coming to Sri Lanka but unfortunately Nokia doesn&#39;t provide the map of SL at there OVI store. Last week I got some time to play with my Nokia 5800 and thought to find someway to install an offline map works in SL. First I installed Google maps but unfortunately it doesn&#39;t work offline on Symbian OSes. (It says it works on Android). After few more tryouts I could find some posts regarding Garmin XT on mobile devices and finally it worked.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;So below this post actually not something I invented but provide A to Z guidance to install SL map on your Nokia device without browsing so many posts, articles and wasting time.&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;b&gt;Download file contains&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;* GarminMobileXTforSymbianS603rdEdition_50040.exe &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;https://rs644l32.rapidshare.com/#%21download%7C644l3%7C210942170%7CGarminMobileXTforSymbianS603rdEdition_50040.exe%7C14202%7CR%7E81F088171A5F9C0807D00F8C6C5AD756&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
* GarminMobileXTFreeBasemap_4xxxx.exe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.filestube.com/8dd01917eaa6ea0403e9,g/GarminMobileXTFreeBasemap-4xxxx.html&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
* GarminMobileXTSupportFiles_4xxxx.exe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://mytopfiles.com/programs/file/GarminMobileXTSupportFiles_4xxxx/199896.htm&quot;&gt;Download&lt;/a&gt;&lt;br /&gt;
* garmin_kgen.exe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.mediafire.com/?undbhcyehbz&quot;&gt;Download&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;* Download the Garmin Sri Lankan Map &lt;a href=&quot;http://rapidshare.com/files/411692548/gmapsupp.img&quot;&gt;From Here&lt;/a&gt;. &lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;i&gt;For devices with limited memory, use &lt;/i&gt;&lt;a href=&quot;http://rapidshare.com/files/412193805/gmapsupp.img&quot;&gt;&lt;i&gt;this map instead&lt;/i&gt;&lt;/a&gt;&lt;i&gt;.  This contains only A-Grade Roads, and contains most of the important  locations in Colombo. Not required to use, if you are on a Nokia.&lt;/i&gt;&lt;br /&gt;
* 5800_manual.pdf&lt;br /&gt;
* GarminMobile20_GarminMobileXTOwnersManual.pdf&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;i&gt;Note: You can skip part 1&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;b&gt;1. Setting up Apparatus, The Nokia 5800&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;1. Back up all data using PC Suite (go to Nokia website).&lt;br /&gt;
2. Soft reset by pressing *#7370#. Should take about 2-3 mins and you  lose all your data (except on memory card). But don’t worry, you have  back up remember?&lt;br /&gt;
3. On your Nokia 5800, go to Application &amp;gt; Location &amp;gt; Positioning  &amp;gt; Positioning Methods. Enable “Assisted GPS” and “Integrated GPS”  ONLY. This will ensure you don’t get charge using WAP or 3G network for  Internet.&lt;br /&gt;
4. Go to Application &amp;gt; Location &amp;gt; GPS Data &amp;gt; Position &amp;gt;  Options &amp;gt; Satellite status. This will show the satellite signals  you’re receiving. Be sure you are outdoor in an open area. Balcony  doesn’t work well, believe me I’ve tried. Once you’ve got AT LEAST 4  satellite signal, go back indoor, you don’t want people to think you’re  crazy, waving your phone around.&lt;br /&gt;
5. Now you’re ready for GarminXT.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;b&gt;2. Installing GarminXT on Nokia 5800.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;1. Once you’ve downloaded, unzip the  files to someplace accessible preferably on your desktop. If you  haven’t, please download it.&lt;br /&gt;
2. Connect your phone via USB and select  ‘Mass storage mode’.&lt;br /&gt;
3. From you PC, double click “GarminMobileXTforSymbianS603rdEdition_50040.exe” to install and wait.&lt;br /&gt;
4. Double click “GarminMobileXTFreeBasemap_4xxxx.exe” to install. Wait..&lt;br /&gt;
5. Double click “GarminMobileXTSupportFiles_4xxxx.exe” to install.&lt;br /&gt;
6. Remove USB connection between PC and phone. When prompted ‘Launch GarminXT’ do not click Yes, just Cancel.&lt;br /&gt;
7. From your phone, go to Menu &amp;gt; Settings &amp;gt; Application Manager  &amp;gt; Installation files. There should be GarminXT.sis file. Install it.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;b&gt;3. Cracking GarminXT on Nokia 5800.&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;1. Run GarminXT from your phone at Menu &amp;gt; Application &amp;gt; Garmin. It  will prompt you with some settings. Choose your preferable.&lt;br /&gt;
2. Select “Use other device” when it prompts you to buy or trial. You will get a screen, “Where To?” and “View map”&lt;br /&gt;
3. In GarminXT, go to Tools &amp;gt; Settings &amp;gt; About. Jot down “Card ID”, you will need it. Exit GarminXT&lt;br /&gt;
4. On your PC, run “garmin_kgen.exe” and enter the “Card ID” from previous steps.&lt;br /&gt;
5. Generate it and you will get a string of codes. Copy the codes to  Notepad and save it as “sw.unl”. *Be sure you don’t save it as  sw.unl.txt”*&lt;br /&gt;
6. Connect your phone to PC and select “Mass storage mode”.&lt;br /&gt;
7. Copy “sw.unl” to Garmin folder. Usually located at E:/Garmin.&lt;br /&gt;
9. Copy “gmapsupp.img” from downloaded file to Garmin folder. “gmapsupp.img” is the Sri Lankan map.&lt;br /&gt;
8. Disconnect your phone from PC.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;b&gt;4. Restore your Nokia 5800&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;1. Reconnect your phone via PC Suite.&lt;br /&gt;
2. Restore your settings through back up.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;b&gt;5. Setting up GarminXT on Nokia 5800&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
1. Run GarminXT on your phone.&lt;br /&gt;
2. Go to Tools &amp;gt; Settings &amp;gt; System &amp;gt; Remote GPS. Change to “Use Attached GPS” by disabling the “Bluetooth GPS”.&lt;br /&gt;
3. Go to Tools &amp;gt; Manage My Data &amp;gt; Map Sets &amp;gt; MapSource. Make sure all maps are enabled.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;4. Toying GarminXT on Nokia 5800.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
Run GarminXT, &lt;br /&gt;
Select “View Map” and wait for a while. The satellite will find you. It took me 5 mins or so. Just have patience and faith.&lt;br /&gt;
Now you’ll see where you are.&lt;br /&gt;
Go back and select “Where To?”. If you’re at home and wants GarminXT  to store you current location as home, then select “Home”&lt;br /&gt;
Pat yourself and say “Well done”. The rest is up to you.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;To add the Detailed overlay map follow the below guidelines. &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Download the Garmin Overlay Map &lt;a href=&quot;http://rapidshare.com/files/412193804/gmapsup2.img&quot;&gt;from Here&lt;/a&gt;.&lt;br /&gt;
2. Copy and Paste it to the Root of the Garmin Folder in your MMC. &lt;br /&gt;
3. Launch Garmin Mobile XT.&lt;br /&gt;
4. Go to Tools (Spanner Icon) -&amp;gt; Settings -&amp;gt; Map and Scroll all the way down till you see Map Features option. &lt;br /&gt;
5. Inside Map Features locate Small Town (Off by Default) – Open it and Set it to Small Label. &lt;br /&gt;
6. Exit and View Map to see updated Details.&lt;br /&gt;
7. Details will only be visible at and below Zoom Level 3.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;If you want to install some locked maps here is the way.. This example is how to install the India map. (Have not try personally)&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white; text-align: left;&quot;&gt;&lt;b&gt;How to install Indian map in Garmin Mobile XT&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white; text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;You can download the Indian Map from this torrent:  http://thepiratebay.org/torrent/5272640/Garmin_MapSource_City_Navigator_India_2009.30_img_version&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;Steps to follow&lt;/div&gt;&lt;ol style=&quot;background-color: black; color: white;&quot;&gt;&lt;li&gt;Connect mobile to PC in Mass Storage mode. Go to: Computer\Nokia 5800 XpressMusic\Memory card\Garmin&lt;/li&gt;
&lt;li&gt;There will be two .img files GMAPBMAP.IMG-Base map and GMAPSUPP.IMG-Malaysian map (which comes with the installation)&lt;/li&gt;
&lt;li&gt;Download the indian map image from the torrent.&lt;/li&gt;
&lt;li&gt;Rename it to: GMAPSUP2.IMG&lt;/li&gt;
&lt;li&gt;Copy to Computer\Nokia 5800 XpressMusic\Memory card\Garmin&lt;/li&gt;
&lt;li&gt;Safely disconnect mobile from PC.&lt;/li&gt;
&lt;li&gt;Run the Garmin KeyGen.exe in PC. Type your UnitID (already know where is this. See the first post)&lt;/li&gt;
&lt;li&gt;First, click generate for software unlock code.&lt;/li&gt;
&lt;li&gt;Select map product as custom mapset.&lt;/li&gt;
&lt;li&gt;It will show a dialog box. Type the FID as 281&lt;/li&gt;
&lt;li&gt;Generate map unlock code.&lt;/li&gt;
&lt;li&gt;Copy the newly generated code and save it in GMAPSUP2.unl&lt;/li&gt;
&lt;li&gt;Copy to Computer\Nokia 5800 XpressMusic\Memory card\Garmin&lt;/li&gt;
&lt;li&gt;Enter the two codes in Garmin XT when asked (better save these in a text file.)&lt;/li&gt;
&lt;li&gt;Good to go. You are done!!&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;For more details please visit&amp;nbsp;&lt;a href=&quot;http://gpssrilanka.blogspot.com/&quot;&gt;http://gpssrilanka.blogspot.com/&lt;/a&gt;. Finally we must be really thankful them for their clear guidance.&lt;/div&gt;&lt;div style=&quot;background-color: black; color: white;&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/7487087313546813824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2011/04/enable-sri-lanka-gps-navigation-on-your.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/7487087313546813824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/7487087313546813824'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2011/04/enable-sri-lanka-gps-navigation-on-your.html' title='Enable Sri Lanka GPS navigation on your Nokia device'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6067865819156952867.post-3719876330840277951</id><published>2011-03-04T16:02:00.000+05:30</published><updated>2011-04-19T17:22:35.255+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kannel"/><category scheme="http://www.blogger.com/atom/ns#" term="kannel sms"/><category scheme="http://www.blogger.com/atom/ns#" term="receive sms"/><category scheme="http://www.blogger.com/atom/ns#" term="save sms"/><category scheme="http://www.blogger.com/atom/ns#" term="SMS"/><title type='text'>How to receive and save SMS through Kannel</title><content type='html'>This is the relevant configuration part of the kannel.conf file;&lt;br /&gt;
&lt;br /&gt;
group = sms-service&lt;br /&gt;
keyword = default&lt;br /&gt;
#keyword-regex = .*&lt;br /&gt;
catch-all = yes&lt;br /&gt;
max-messages = 0&lt;br /&gt;
get-url = &quot;http://localhost:23456/sms.php?ORIGINATOR=%p&amp;amp;RECEIVER=%P&amp;amp;SMS=%a&amp;amp;SOURCE_PRV=%o&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At local host (same as where i run my kannel server) i have this code in the file sms.php;&lt;br /&gt;
&lt;br /&gt;
$query = &quot;insert into sms set sender=&#39;&quot;.$_GET[&quot;ORIGINATOR&quot;].&quot;&#39;, receiver=&#39;&quot;.$_GET[&quot;RECEIVER&quot;].&quot;&#39;, msg=&#39;&quot;.$_GET[&quot;SMS&quot;].&quot;&#39;, source_prv=&#39;&quot;.$_GET[&quot;SOURCE_PRV&quot;].&quot;&#39;&quot;;&lt;br /&gt;
$result = mysql_query($query);&lt;br /&gt;
if(!$result) die(sql_error());&lt;br /&gt;
&lt;br /&gt;
Make sure that you have defined your database connectivity parameters before this code. What kannel does is just he receive a SMS it calls the URL defined as the get-url in the .conf file. And passing the parameters in GET method. Now you are able to receive and save a SMS through kannel.</content><link rel='replies' type='application/atom+xml' href='http://suhadafdo.blogspot.com/feeds/3719876330840277951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://suhadafdo.blogspot.com/2011/03/how-to-recieve-and-save-sms-from-kannel.html#comment-form' title='28 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/3719876330840277951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6067865819156952867/posts/default/3719876330840277951'/><link rel='alternate' type='text/html' href='http://suhadafdo.blogspot.com/2011/03/how-to-recieve-and-save-sms-from-kannel.html' title='How to receive and save SMS through Kannel'/><author><name>Suhada</name><uri>http://www.blogger.com/profile/07750261154517801435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLJCyi4pSn7GwchUJF5FqoD9T7t788O1NAzlLZdMl0Lu5lbcQTSRDQvH00Sdzbspbxab_veaDI3xKf9PAIrshzVIsRGaR1OuHG5GDxElYqJcLRIkqKvAhQGNLAUN9e9rM/s220/198e079.jpg'/></author><thr:total>28</thr:total></entry></feed>