Random Link for Wordpress Blogs

By abhishek

I recently started my Photo Blog, after various considerations i choosed Wordpress for it, currently i have more than 20 photos posted on it which is not actually a big number but i found that the older images or posts will never be seen to the readers as they don't appear on the frontpage for more than 4-5 days, which created a requirement of creating a Random Link on frontpage to show a Random post to the user if he wants to and this began search for a module or a plugin as its said in wordpress.

But No Luck i found various plugins but i needed something very very simple so i thought going by the code which lead me using the following code in my header.php to create a Random Post link

<?php
$randomPost = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY rand() LIMIT 1");
echo '<a href="'.$randomPost.'">>>Random Image<<</a>';
?>

The above code is quite simple and does exactly what is needed to generate a random post link for your wordpress blog.

Dreamhost Review

By abhishek

Well its been 10 months since i am using dreamhost its quite early to write up a review but still i would like to share , thanks to Amit Singh, Aman Jain and  Rohit Srivastav for recommending me dreamhost, the experience so far have been satisfactory i cannot say that there was no downtime, actually i have seen a lot of them :) still i am happy with it.

There have been instances when my hosting was altogether shifted by the support team to a different server to resolve issues, the support is excellent, the hosting plan in itself is good at least for shared hosters you get everything unlimited i.e. u can host unlimited website i currently host a dozen of them, and yes the One Click Installs are amazing, The affiliate programme is amazing i paid for first year of hosting and already i have earned much to pay for my next few years of hosting with them

I am using shared hosting since 10 years now tried different hosting providers but liked dreamhost so if you are planning to get a shared hosting i would recommend you Dreamhost, and yes you also get a domain free when registering for Hosting Plans.

I recommend the L1 Yearly plan of dreamhost if you are really interested use this link to register and get a $50 discount :)

Why should one go with Dreamhost ?

Suggestion

If you are hosting multiple sites don't host them with a single account. create different accounts for each site after all u have unlimited accounts in ur plan.

I would also like to share some of the emails from support


These guys moved me to a new server

Hello,

On Wed, 30 Sep 2009, you wrote:

> > Hi Team,
> >
> > Thankx for moving me to a new server tough i would like to know why i
> > was moved, was i consuming lot of resources if yes do let me know so
> > that i can optimize a bit

    Nope, that wasn't it. We're just doing a bit of upgrading and
restructuring on our end. You can read all about it here:

http://wiki.dreamhost.com/Server_Moves#Why_do_servers_change.3F

If there's anything else we can do for you, please let us know.

Thanks!
Dan W

Why did u try to restore when i never wanted it

> What do you mean by you are unable to restore my website i never requested
> > to do so.

Sorry about that. Another representative was working on this for you and
mistakenly tried to restore your website. You may disregard this.

Write back if I can do anything else for you.

Thanks!
Mike S

Funny

so far the experience is good

I recommend Dreamhost for your hosting

What to expect from Drupal Sprint India 2009

By abhishek

A formal announcement for Drupal Sprint India 2009 was already done last month and is available here!!

I am very sure that now you would be very curious to know what is it all about so this post might clear some of your confusion.

Whats in Drupal Sprint India 2009

Hey, this event is for YOUUUUUUUUU !!!

Why should i attend ??

a) If you are a newbie

  • You will get a chance to learn something very dynamic.
  • You will get a chance to know Drupal which is one of the best opensource Content Management System ever created.
  • You will get an opportunity to build up network with Drupal Geeks from India and abroad.
  • You will get an opportunity to be contribute to Drupal in various forms.

b) If you are a Drupaler

  • You can showcase your skills via talks/workshops.
  • You can help in Bug Fixing
  • You can help in Documenting Drupal
  • You can help in Localizing Drupal
  • You will meet Drupal enthusiasts from all over India and across

 IFFFFFFFFFF you are unable to make it to pune this time.

so what are you waiting for register under various categories in Drupal Sprint India by visiting http://drupalindia2009.plug.org.in/

 

Where .deb files are stored in Ubuntu ?

By abhishek

We always hear people saying ubuntu works well only when you have a strong internet connection as the Install CD doesn't contain all the packages required agreed now a CD cannot contain all the packages you require so you need to download the packages but there is a clear misunderstanding among new users that they always need to download these packages, Its essential to download them once but if you are reinstalling ubuntu on new machine you need not download these packages all over again if you have installed required packages on one of the machine you can use the content of below listed directory for installation

/var/cache/apt/archives

this directory contains the debian packages download by the apt-get :)

so have fun reuse the content for each install and save time and bandwidth

Search Engine Optimization using 301 Redirects

By abhishek

Search Engine Optimizations, i am very sure that all would have heard this term by now, in simple terms its a process of "making your website Search Engine friendly" there are various ways methods to do this, let me be very clear there is no specific way by which you can have a perfectly optimized website, in this post i discuss one of the methods by which you can remove the confusion of a search engine :).

Confused Search Engine !!! yes this happens often, just because of a silly mistake done unknowingly. Search engine often gets confused due to the links for example http://www.example.com and http://example.com may open same website but they are 2 different links and hence there are chances that both of them gets listed on search engines which is not what you will want to happen how to solve this problem ?

And i have a one line answer to this "by using 301 redirects" or "URL Redirections" below is the process by which you can implement this on various types of websites

For Websites hosted on Linux Servers

Edit .htaccess present in web root and add the following lines

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]

This will redirect requests for example.com to www.example.com ensure you have mod_rewrite enabled.

For Websites hosted on IIS use the following steps

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled "a redirection to a URL".
  • Enter the redirection page
  • Check "The exact url entered above" and the "A permanent redirection for this resource"
  • Click on 'Apply'

Just in case you don't have control on the server as if you are on a shared hosting which does not provide any such service you can also programatically  redirect below are the code for PHP and ASP similar kind of code is applicable for others

For PHP

<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example.com" );
?>

For ASP

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.example.com/"
%>