Categories
Tips

Down for Everyone or Just Me! Uptime Monitoring…

Down for Everyone or Just Me is a very simple service which basically help you check if a particular website is down for everyone or just you!

If you are using free wi-fi on a public network, often it blocks some websites form opening. One such free wi-fi network near my home blocks all blogspot.com domain blogs and on top of it, they do not show any custom error message when I request a blogspot.com blog!

I remember for the first time, when I connected to it and saw all blogspot.com blogs down. For a moment, I thought I should post about it as many people think blogspot never goes down (and they are right as well). But then I wanted to make sure, if its unlucky me or overloaded Google! A simple service like this can help a lot in many situation.

The URL’s to result page have bookmarkable structure. Like you can bookmark this to check if Devils Workshop is down for everyone or just you.

ADVERTISEMENT

Link: Down for Everyone or Just Me

Server Monitoring…

Now apart from this manual checking, their sponsor (or parent company) Uptime Party offers server monitoring service for webmasters and professionals.

On registration, you can setup to monitor 1 server for free. For more than 1, they charge you accordingly. As most of blogger run only 1 main blog, free package is sufficient for most of us.

You can configure email notification on per server basis, for events like web downtime, email downtime, ftp downtime, etc.

I signed up for free account and configured email notification for Devils Workshop web downtime. I use Google Apps for emails.

Link: Uptime Party

Categories
Tips

Creating Custom Search Page in WordPress Blog

In wordpress, there are two types of webpages – “posts” and “pages”. While “posts” are generated dynamically, “pages” are statics and created explicitly. You can create as many “pages” as you want and put them anywhere in your blog’s structure. Few pages I have here includes – about page, contact page, joining DW page, etc.

Apart from these “pages”, I use a special “search page” with extra-level of customization. It is technically outside my wordpress setup. I do not use wordpress built-in search mechanism. Instead I use, Google custom search like many of you. I will explain why I use Google custom search some other time!

For time being, if you notice my search page do not have any sidebar compared to say “contact page”. A simple way to disable sidebar for any post/page is to surround “get_sidebar()” call in theme with if-else block. But for sake of slight performance improvement and few other reasons I prefer maintaining a dedicated search page outside my wordpress setup. But as you can see, it is blended with my theme very-well!

So here is “how-to” guide to create such “search pages” outside wordpress:

ADVERTISEMENT
    1. Create a page say in root-directory of your blog. Name it something like – search.php. It will have URL like – http://www.devilsworkshop.rsites.dev6.rt.gw/search.php
    2. Next log into AdSense or Google Custom Search Engine, and create a new custom search or update existing search engine.
    3. Just remember to use above URL (step 1) for search result pafe
    4. Then add following code as it is to it:
      <?php
      define('WP_USE_THEMES', false);
      require('wp-blog-header.php');
      get_header();
      ?>
      <!-- Google Search Result CODE -->
      <?php
      get_footer();
      ?>
    5. Finally replace “Google Search Result CODE” line in above code with codes you will get from Google.
    6. Save/Upload search.php in your blog’s root directory.

If you need to use some CSS, use it inline on Google search result code’s first line, i.e.

<div id="cse-search-results"></div>

Example:

<div id="cse-search-results" style="width:980px;"></div>

I needed to set width attribute like above to expand search results into space made available by absence of sidebar.

Try this and use comments form below if you stuck! I hope this answer your question Anurag. 🙂

Related: WordPress Plugin Series

Categories
Tips

Using IF ELSE in Blogger Blog

There is no doubt that WordPress is a better blogging platform than Blogger, but this is equally true that Blogger is an Ideal Start for newbies. It is a common trend that one starts with Blogger, Gains some maturity and then switches to WordPress. There are several problems with Blogger and most of the Blogger users are those who don’t have any Technical Background  For them, here is an explanation of using If Else type coding in the Blogger Template. This will enable bloggers to optimize their blog in different ways.

If Else type Conditional programing can be done by using <b:if cond=’ ‘>…..</b:if> tag. To Try this just log-in to your blogger account and move DashBoard > Layout > Edit HTML and check the “Expand Widget Templates” Option.

Now, take an objective: Lets say, we want to use different Meta tags for different pages (i.e. posts), which is not possible by any other method . Just enter the following  code at the proper place:

<b:if cond='data:blog.url == "http://yourblog.com/2008/06/yourpost.html"'>
<meta content='xyz,pqr' name='keywords'/>
<meta content='Your Description' name='description'/>
...............
</b:if>
ADVERTISEMENT

Please Replace http://yourblog.com/2008/06/yourpost.html with the actual URL of that post. You will notice that the condition is made for the variable data:blog.url and equality operator == is used. You can use some other variables and operators. The != operator is used for Not Equal to cases .

I am sure that now you can guess the meaning of above source code. It simply says that if the URL of the page is equal to http://yourblog.com/2008/06/yourpost.html then apply the following meta tag. If you want to assign a meta tag set for the Home page of your blog then instead of using the URL of your homepage you can use data:blog.homepageUrl and your code will become like:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
......
</b:if>

If you want to assign a meta tag set for all the post-pages (i.e., the pages other than your homepage) use this code:

ADVERTISEMENT
<b:if cond='data:blog.pageType == "index"'>
.........
</b:if>

The variable data:blog.pageType looks for the type of page. Post pages are identified by item and homepage of your blog is identified by index. Hence, for homepage you can use both,  data:blog.url == data:blog.homepageUrl and data:blog.pageType == “index” .

You can use the above conditional coding in various ways to optimize your blog. I have several suggestions for you, but you can discover more ways as per your need.

  • Your home page will only feature the actual title of your blog, whereas post pages will feature your blog title, plus the title of your blog post. To Optimize your blog for Search Engines you need to modify it so that the past pages have titles of your blog post only. To get this done look for <title><data:blog.pageTitle/></title> and replace it with the following code
    <b:if cond='data:blog.pageType == "index"'>
    <title><data:blog.title/></title>
    <b:else/>
    <title><data:blog.pageName/></title>
    </b:if>
  • Similarly , sometimes you want to display some page-elements on homepage and not on post pages ( or , vice-versa ) . You can use this conditional coding again for this objective . Just Go to Page Element section and select the required page element to edit . The editor will open in a new window .Just focus on the URL of this window. At the end you can find the widgetId=HTML# . This is the widget ID of this page element . Now , switch back to the EDIT HTML section and locate that widget ( may use Find option of your browser ). You will notice a layout tag <data:content/> inside this widget code . This tag displays the contents of that page element on any page. You can do your conditional programing around this. For example you want to hide it from homepage, just do this:
    <b:if cond='data:blog.pageType == "item"'><data:content/></b:if>

    This trick can be used for many purposes, like displaying Ads, Featured Posts, Special Messages for visitors.

I hope that this article will help you in optimizing your Blogger blog. If you need any help, feel free to contact us. 🙂


[Editor Note: This post is by guest blogger Arpit Kumar. He blogs at TechRaga on Internet & technology. He is very active twitter user, in case if you like to follow him on twitter.

If you like to write for Devils Workshop, please check this. Details about our revenue sharing programs are here.]

Categories
Tips

Gmail’s 10 Latest Lab Features

Gmail introduced a lab edition in June with 13 features. Over the time they kept adding these features and here is post listing latest lab features.

But before exploring further, for those who missed these lab features completely, these can be activated selectively by going to Lab tab under Gmail Settings.

And here are some cool and latest features:

Right-side chat

Move the chat box to the right side of the inbox. This is good if you have longer chat list which pushes your labels box below. By the way there is a small “options” link below chat box, which let you resize it to 4 different sizes.

Right-side labels

Move the labels box to the right side of the inbox. This is good if you use labels a lot. You can move labels or chat or both boxes on right side.

Default ‘Reply to all’

Make ‘Reply to all’ your default option for responding to emails. Good for developers who collaborate on projects as you will never forget copying to someone in group.

Quote selected text

Quote the text you have selected when you reply to a message. This works best if you use keyboard shortcuts. This type of quoting replies is quite popular with people who spend lots of time on forums or mailing lists.

Navbar drag and drop

Allows you to reorder the items in your navbar using drag and drop. Some Lab features adds extra boxes to your navbar. Enabling this feature can save a lot of scrolling in some cases.

Forgotten Attachment Detector

Prevents you from accidentally sending messages  without the relevant attachments. Prompts you if you mention attaching a file, but forgot to do so. There was a greasemonkey script to do this from long time.

Vacation Time!

Lets you specify starting and ending dates for the vacation autoresponder. This is good for guys who forget to setup vacation responder in last minute rush. Using this you can set a vacation responder as soon as you make reservations for your vacation.

Custom Label Colors

Lets you create your own combination of colors for labels. Instead of choosing one of the standard colors from the label dropdown menu, click on Add custom colors. Pick your combination of colors, hit Apply, and enjoy.

Mark as Read Button

Tired of spending all that effort to click on the more actions menu every time you want to mark messages as read without reading them? Now just enable this lab and that is just a button click away!

Go to label

Enable keyboard shortcuts and hit ‘g’ then ‘l’ to display a popup for selecting a label to go to. Quite useful for guys who use labels a lot. Personally I will use labels more often now.

Let us know which lab features you are enjoying and which one feature you are missing in Gmail. Personally, I miss to-do list a lot in Gmail.

Related: 13 More Gmail Lab Features

Categories
Tips

Using Firebug Console to log from GreaseMonkey Scripts

This is for all Greasemonkey developers who also use Firebug. Firebug is one of the best Firefox extension for developers.

To start with, almost every Greasemonkey developer uses built-in API method “GM_log()” to log debugging messages to Firefox’s javascript console.

While normal javascript developers use Firebug’s API method “console.log()” to log debugging messages to Firebug console.

Now problem is, if you try calling “console.log()” directly from Greasemonkey scripts, it will not work. As Firebug’s console object reside outside Greasemonkey scripts scope.

ADVERTISEMENT

There are few workarounds to use Firebug console to log Greasemonkey debugging messages. But one which always work for me is detailed below.

Simplest way is to use…

unsafeWindow.console.log()

You can use other firebug logging functions similarly by prefixing unsafeWindow to them. Complete information about Firebug console can be found here.

ADVERTISEMENT

Next what if you are editing your older Greasemonkey script! A simple way to use text-editors search-and-replace feature and replace all occurrences of “GM_log” with “unsafeWindow.console.log”.

Well it may be nice for some but geeks way is different! I will recommend adding following lines of code at the beginning of your Greasemonkey scripts.

if(unsafeWindow.console){
   var GM_log = unsafeWindow.console.log;
}

The beauty of above codes is, it will first check if Firebug console is available. If yes, then all output from GM_log will be sent to Firebug console. And when Firebug is not available, it will simply use Firefox’s built-in javascript console without any error!

Next if you want to switch back to Firefox’s built-in javascript console, you can do that by just removing or commenting above code.

ADVERTISEMENT

Disable logging for all GM_log calls…

While developing Greasemonkey scripts, we use GM_log a lot to speed-up coding. But once we are done, ideally we should remove all unnecessary GM_log calls from script as keep Firefox or Firebug console busy.

But this may not sound good idea for some guys who code scritps for sites which changes so often. So better approach is to disable logging via GM_log by adding one line of code, as below, in the beginning of script.

var GM_log = function (){};

This will basically assign an empty function to GM_log. Even smarter approach is to use code like below…

var GM_Debug = 0;

if(!GM_Debug) {
   var GM_log = function(){};
}

Now all you have to change one character to enable/disable logging.

If you have noticed you are basically assigning a different function to GM_log to override it. Those who are new to javascript may find it little strange, but its perfectly valid!

Categories
Tips

How I Made $332 From One Post!

Yep, you got it right, its $332 I made from one single post! And now as I look back I feel I could have made at least twice more than that!

If you are a reader of this blog, then you may have came across my post titled – Get Unlimited Bandwidth & Storage with Dreamhost. It was about a very limited, once-in-a-lifetime kinda offer.

I not only host this and many other websites/blogs with Dreamhost but also actively use its affiliate program. But $332 with one single post was unthinkable. Well it happened with me and here is my analysis but first let me show you screenshot of my Dreamhost reward panel.

As you can see there are five $47 and one $97 reward entries in 7 days window i.e. from September 5 (when I made post) to September 10 (last day to fetch ‘unlimited’ offer). Now lets do some simple math : 5x$47 + $97 = $332.

Apart from this jackpot, I have been always successful with Dreamhost affiliate program because…

ADVERTISEMENT
  1. Dreamhost is really best webhosting service overall. Mind my use of word “overall” as its unfair to compare performance of Dreamhost with a dedicated server solutions.
  2. Dreamhost is beyond a webhosting service. There is a large community of Dreamhosters, who runs dedicated forums, wikis, blogs where you will find lots of information as well how-to guide on every single topic related to webhosting.
  3. They have nice affiliate program which not only pays your webhosting bills but also generate lots of hard-cash if used smartly. By the way I was not aware about this fact while signing up for Dreamhost. I was not aware about promo-codes either! It still hurts to loose those $97 in discount. 🙁
  4. Above all is about Dreamhost’s greatness but what I think works best is the fact that I am promoting something which I use myself. 🙂

I was sure about nice response to that post about as it was really a great offer. But at the most I was expecting 1 or 2 signups. And now when it brought me $332 via 6 signups, I feel I underestimated it because…

ADVERTISEMENT
  1. I don’t use “Featured Post” like option as Darren Rowse use on Problogger. I am sure that in this special case, it would have helped me get at least 5 more signups.
  2. I did not use service like Digg, Stumble Upon to promote that post.
  3. I know some people who were thinking about switching to Dreamhost from long time. I guess I should have mailed them that article.
  4. I could have written a follow up or reminder post on say September 9, with title like “Last Day to Grab Unlimited Webhosting” or something like that.
  5. There are popular forum related to webhosting. I could have used them.

Well opportunities are countless. Next time, I may follow above 5 points only to discover more of them at the end of the party.

Anyway my purpose of posting this story is to tell you that affiliate programs do work if used smartly. Also  there are more ways to monetize your blog beyond Google AdSense! 🙂

Link: Signup for Dreamhost (promo code included in link)

Categories
Tips

Google Chrome for Mac and Linux

Google’s open source browser is now unofficially ported to Mac and Linux by geeks at CodeWeavers.

Officials ports for non-Windows OS are under-development and will take some time to hit your desktops. But those who are eager, can try Crossover Chromium.

On Mac, it will support Intel based OS X 10.4 or higher. PowerPC Macs are not supported. On Linux side you can run it on almost all distributions.

Crossover is a standard Mac app which allows you to install many popular Windows applications and games on your Intel OS X Mac.

I tested it on my Macbook Pro. It took a lot of time for first-time initialization. And Overall application performance is also bad. I hope Linux users find some better result. Personally, I will wait for official Port. I don’t like Chrome much but as a web-developer I have to check my designs and services in Chrome to as it is gaining large pie of browser market share.

Link: Crossover Chromium

Related: Googles Chrome’s Features and alternative Firefox Plugins for same

Categories
Tips

Enable Right-Click On Any Website (Including Orkut)

There are many websites which prefer to disable right-clicking on web-pages specially images. To do this they normally use one of JavaScript ways.

The most popular way is to add following code to element tag on which you want to disable right-clicking.

oncontextmenu="return false;"

For example, say you have code for an image like below…

ADVERTISEMENT

<img src=”something” />

Change it to…

<img src=”something” oncontextmenu="return false;"/>

Now reason I am posting about this is, popular social networking site Orkut, which I use quite often, started using code like above and disabled right-clicking on album images.

ADVERTISEMENT

So as usual, we got to do something to get back our right to “right-click”!

GreaseMonkey Script: If you use Firefox and GreaseMonkey, then easiest way to enable right click on any website is to install right to “right-click” script.

JavaScript: If you are not fond of GreaseMonkey, then you can try following JavaScript.

javascript: var items = document.evaluate('//*[@oncontextmenu="return false;"]', document, null, 7 , null); for ( i = 0; i < items.snapshotLength; i++){items.snapshotItem(i).removeAttribute('oncontextmenu');};void(0);

Bookmarklet: You can also use this bookmarklet in Firefox and other standard-compliant browser.

ADVERTISEMENT

Internet Explorer: If you are an IE user, specially IE 6 then paste following code in address bar and hit enter whenever you stuck. Please note code below is for Orkut only and most likely to break anytime.
javascript: document.getElementById('m').oncontextmenu="";void(0);

Important Note:

From above all solutions, I am planning to take GreaseMonkey solution further. I will add more anti right-clicks hacks soon. As of now this script takes care of most famous way so it should work on many sites.

We can not blindly set “oncontextmenu” attribute to null or “return true” as some sites provides useful functions by overriding browser context-menu. WordPress, Google docs are some popular examples.

If you find a site where right-click is disabled and this script is failing to work,  please leave a comment below with page URL and element description where it failed to work. I will try to update this script ASAP.

Link: Install Right to “Right-Click” Script (How?)

Related: JavaScript to Unmask Password on Web Pages

Categories
Tips

Related Post Solution For Blogspot Blogger

Google for wordpress related posts plugin and you will find many of them but for Blogspot Blogger situation is was quite different.

Mohamed Rias posted a solution which involve some Blogger template hacks but solves long pending related post problem. He described all modifications in very clean and simple manner so I think every Blogger can benefit from it.

Below is screenshot of a blog using this hack…

For codes and instructions check Mohamed Rias’s post. Thanks Debajyoti Das.

Link: Related Post Solution for Blogspot Bloggers

Related: Google AdSense Tricks for Blogspot Bloggers

Categories
Tips

Orkut AutoScrap Reply Tool aka Vacation Responder

Gaurav Dua launched a new tool for Orkut users which allows you to send automatic replies to scraps. This can be used on lines of vacation responder feature found in popular mail services.

How it Works?

  • First signup for AutoScrap Reply. (Its free)
  • At the time of signing up, you need to give your orkut login information and also write scrap text once. Reply scrap text can be anything. As an example you can write, “Hey I am out on vacation, will revert back to you on Monday”.
  • Next you will get a code which you need to embed in your scrapbook.
  • Now, whenever anyone send you a scrap, they will get set reply message automatically.
  • Next you can  and his scrap is either kept or deleted from your scrapbook depending on the option you choose at the time of singing up.

You can change settings/scrap deletion option from control panel you will get at Orkut Plus. Your received scraps are also stored in your scraps page there.

This is really good, easy to use service for Orkut users who are not yet addicted to Orkut.

Link: Signup for AutoScrap Reply

Related: Orkutfeeds – Get RSS Feed for Scraps, Communities and  Topics on Orkut