SOHO : Small Office Home Office
Freeware - Opensource software tips, tricks, tweaks & fixes for managing, securing, improving the performance of SOHO Desktop, Laptop, Networks

Sunday, May 22, 2011

How to Show if your server is Online or Offline?

One way to try to find out if a server is online is to try and open a socket connection to the server. If the connection fails, one can assume that the server is down (although the problem can be somewhere else too).

Check out this function and read all the user comments:

Here's a very simple demonstration of php code:
<?php if (fsockopen('www.yourserver.com', 80)){     
echo(
'The server in online');  

} else{  
 
echo(
'The server in offline');  
?>
The first parameter is the IP address of the server you want to check (in this case, www.yourserver.com, it could also be something like 111.222.333.444). The 80 is the port number (for HTTP), which can sometimes be different (21 for FTP etc.).
Continue Reading...

Monday, May 2, 2011

Change newer older post link blogger

Changing Older Post and Newer Post with Next and Previous
Before
After


Follow the steps below:

  1. Log in to blogger with your ID
  2. Click Layout
  3. Click Edit HTML tab
  4. Click “Download Full Template”, please back up first your template (important)
  5. Please check the small box beside Expand Widget Template


Wait for a while until the process finished. Find the following code on your template:
<span id='blog-pager-newer-link'>      <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'><data:newerPageTitle/></a>      </span>    </b:if>   <b:if cond='data:olderPageUrl'>      <span id='blog-pager-older-link'>      <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'><data:olderPageTitle/></a>      </span>    </b:if>   <b:if cond='data:blog.homepageUrl != data:blog.url'>      <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>      <b:else/>      <b:if cond='data:newerPageUrl'>        <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>      </b:if>    </b:if>
Look at the code in red printed.
Change the code <data:newerPageTitle/> with the word Next and the code <data:olderPageTitle/> with the word Previous


Click Save Template button
Finished. 



Changing Older Post and Newer Post with Icon
To change Older Post and Newer Post with icon, the first step is preparing the icon which you want to use. For example the icons look like this:
Please upload the icons you have to a server that you usually use to place an image, and note the URL address. For example the icons’ URL address as follow:


http://lh6.ggpht.com/_pt7i0nbIOCY/SVGKP6ApR7I/AAAAAAAAAok/jdxY8orBJ10/Next_thumb%5B2%5D.png?imgmax=800

http://lh3.ggpht.com/_pt7i0nbIOCY/SVGWOwXOtlI/AAAAAAAAAo8/iCG-SNx6gMI/previous_thumb%5B1%5D.png?imgmax=800


http://lh4.ggpht.com/_pt7i0nbIOCY/SVGKSFmGSsI/AAAAAAAAAos/dzYf7KrG0S4/home_thumb%5B3%5D.png?imgmax=800

Change the above code into like this:
<img alt='Next' border='0' src='http://lh6.ggpht.com/_pt7i0nbIOCY/SVGKP6ApR7I/AAAAAAAAAok/jdxY8orBJ10/Next_thumb%5B2%5D.png?imgmax=800' title='Next'/><img alt='previous' border='0' src='http://lh3.ggpht.com/_pt7i0nbIOCY/SVGWOwXOtlI/AAAAAAAAAo8/iCG-SNx6gMI/previous_thumb%5B1%5D.png?imgmax=800' title='previous'/><img alt='home' border='0' src='http://lh4.ggpht.com/_pt7i0nbIOCY/SVGKSFmGSsI/AAAAAAAAAos/dzYf7KrG0S4/home_thumb%5B3%5D.png?imgmax=800' title='home'/>
If you have had the code as above, the next step is to place it on your template code, here are the ways:
  1. Log in to blogger with your ID
  2. Click Layout
  3. Click Edit HTML tab
  4. Click “Download Full Template”, please back up your template first (important)
  5. Please check the small box beside Expand Widget Templates






Wait for while until the process finished. Find this code on your template:
<span id='blog-pager-newer-link'>      <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'><data:newerPageTitle/></a>      </span>    </b:if>   <b:if cond='data:olderPageUrl'>      <span id='blog-pager-older-link'>      <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'><data:olderPageTitle/></a>      </span>    </b:if>   <b:if cond='data:blog.homepageUrl != data:blog.url'>      <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>      <b:else/>      <b:if cond='data:newerPageUrl'>        <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>      </b:if>    </b:if>
Look at the code in red printed
Change the code <data:newerPageTitle/>, <data:olderPageTitle/>, and <data:homeMsg/> with your icon code. E.g.
<span id='blog-pager-newer-link'>      <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'><img alt='Next' border='0' src='http://lh6.ggpht.com/_pt7i0nbIOCY/SVGKP6ApR7I/AAAAAAAAAok/jdxY8orBJ10/Next_thumb%5B2%5D.png?imgmax=800' title='Next'/></a>      </span>    </b:if>   <b:if cond='data:olderPageUrl'>      <span id='blog-pager-older-link'>      <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'><img alt='previous' border='0' src='http://lh3.ggpht.com/_pt7i0nbIOCY/SVGWOwXOtlI/AAAAAAAAAo8/iCG-SNx6gMI/previous_thumb%5B1%5D.png?imgmax=800' title='previous'/></a>      </span>    </b:if>   <b:if cond='data:blog.homepageUrl != data:blog.url'>      <a class='home-link' expr:href='data:blog.homepageUrl'><img alt='home' border='0' src='http://lh4.ggpht.com/_pt7i0nbIOCY/SVGKSFmGSsI/AAAAAAAAAos/dzYf7KrG0S4/home_thumb%5B3%5D.png?imgmax=800' title='home'/></a>      <b:else/>      <b:if cond='data:newerPageUrl'>        <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>      </b:if>    </b:if>
Click Save Template button


The example of the result will be like this:
Continue Reading...

Sunday, May 1, 2011

Back to Top floating blogger widget

 “Back To Top” floating image icon at the right side of your blog. You can see this button at right side of my blog. This hack is useful if the website or blog pages are too long. It always maintains the same position and if you click on it, it will take you to the very top of the page. This saves your visitors from an unnecessary hassle of scrolling up.

1. Login in to blogger dashboard
2. Go to Layout
3. Click on Add a Gadget
4. Select Html/Javascript
5. Copy n paste the below code in above opened editor
<a style="display:scroll;position:fixed;bottom:5px;right:5px;" href="#" title="Back to Top"><img src="https://lh4.googleusercontent.com/_JD82gUGAvhk/Tb1AqypDCiI/AAAAAAAABIU/r0EZkzH6eH4/s42/Back-to-top.png" /></a>

Tip: 
  1. Add the gadget to the footer
  2. You can change image url with your image.
Continue Reading...