How to tar a file using SSH?

Use the following command if you want to create a tar and compress a file (or folder).

tar -czf /path/to/save/file.tar folder_or_file_name

The options used in the above command are outlined below for your understanding.

-c = create
-z = compress a file
-f = use the file mentioned instead of tape drive

SSH ls pagewise or limit long output

If your SSH ls command output is really long, and cannot be viewed on screen – you can use the following command to part of it with a more command to continue down the list.

ls [options here] | more

Example:-

ls -l | more

My 22nd Birthday

I was born around this time around 22 years ago.

Thank you to everybody for your thoughtful birthday wishes via phone call, text message, email and facebook!

Success is not how far you get but…

“Success is not how far you get, but the distance you travel from where you started.”

Today, I came across this well said proverb while watching one of my favorite TV shows, Numb3rs – the 6th season. I often come across such words of wisdom from many different places which I’ll be posting it up on my blog. Stay tuned.


Help! I’m using wordpress and my site disappeared from all search engines.

After a really long time of absence in maintaining my own personal website, I decided to install wordpress blog to get my site back online quickly. Without going over the settings thoroughly, I was happy that my site was back online quickly. I started blogging and hoping my blog posts would have a good impact on search engine results. Unfortunately, my site disappeared from search engines completely!

If you recently installed wordpress and are wondering why your site is not on any search engines, the culprit is the privacy options in wordpress. By default – it is set to reject all search engines besides normal visitors by setting the robots meta tag to noindex, nofollow.

The good thing is that it’s really easy to fix this. Follow the instructions below and you’ll be on your way to wait for Google & other search engine bots to crawl your site again.

  1. Log into WordPress Administration Area (wp-admin)
  2. Go to Settings > Privacy
  3. Select: I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers
  4. Save settings

I hope this helps.

Happy Blogging!

SSH Commands to find files on Linux Server

If you have a dedicated server or a VPS – or any Linux machine with SSH access, the following commands may be useful to you if you are looking to find some files quickly. PuTTY is a good telnet/SSH client if you don’t already have one. Let’s get started.

#1: If you are looking for a particular file in /home directory

find /home -name filename

#2: If you are looking for files whose name is starting with “filename” in public_html directories only, you can use the following command:-

find /home/*/public_html -name filename* 

#3: Instead of viewing your search results in command line, you can write it to file by using this:

find /home/*/public_html -name filename* > /home/filename_search.txt

#4: Alternatively, you can send it via e-mail directly from server using the command below. Don’t forget to replace “Subject Here” with your email subject, and “[email protected]” with your email ID.

find /home/*/public_html -name filename* |mail -s "Subject Here" [email protected]

I hope this was useful.

jQuery Carousel, those cool rotating, pagination, autoslide banners

Have you ever wondered how to setup your own cool rotating & autoslide banners with pagination – those small buttons with 1, 2, 3 to switch between your website banners – especially on homepage? If so, then jQuery Carousel is an excellent jQuery plugin to do just that! It is simple to use and works perfectly.

Requirements:
Please follow the links below to download the respective javascript files. You may download the compressed versions – which can help minimize your sites size.

  1. jQuery Javascript Library
  2. jQuery Carousel Plugin

HTML Markup:

  1. Add the following to the head section of your HTML markup. Ofcourse, you’ll need to update the path to point to your copy of the required files (which can be downloaded above).
    
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script type="text/javascript" src="/js/jquery.carousel.pack.js"></script>
    
    
  2. Add the following to the body section of your HTML markup. This includes your banner files and their respective links. Don’t forget to apply your CSS styles to class “foo” and it’s child HTML tags.
    
    <div class="foo">
      <ul>
        <li><a href="/link/for/banner1"><img src="/path/to/banner/1.jpg" width="900" height="300" alt="Banner 1"></a></li>
        <li><a href="/link/for/banner2"><img src="/path/to/banner/2.jpg" width="900" height="300" alt="Banner 2"></a></li>
      </ul>
    </div>
    
    
  3. Right under the above markup, add the following javascript code to enable jQuery Carousel effect.
    
    <script type="text/javascript">
     $(function(){
     $("div.foo").carousel( {
            direction: "horizontal", // you can change this to vertical
            loop: true,
            pagination: true, // setting this to true adds the pagination 1, 2, 3 etc.
            autoSlide: true, // automatic rotation between the banners
            autoSlideInterval: 5000, // how long in miliseconds till next rotation
            delayAutoSlide: 3000 // how long to pause on each banner
         } );
     });
    </script>
    
    

And that’s all there is to it. Fire up that web browser to see it in action!

There are several more settings which you can play around with to adjust this to your liking. You can visit jQuery Carousel page for more information on it.

I’d love to hear from you with links to see your application of this effect.

Data recovery from a corrupt hard disk

Earlier this week, I was transferring all my important data from my external 120GB USB hard disk to my new laptop. During the process, the transfer became unbearably slow. I decided to cancel it and reboot my computer to get a fresh start.

To my dismay, Windows Vista detects the hard drive but is unable to read it prompting me to format the drive. After a bit of reading, and trying to access the drive in different ways – I got the following error message.

Disk is unaccessible.
The file or directory is corrupted and unreadable.

It was impossible for me to let go of all my data and thus, I started looking into ways to recover it.

During the process, I realized that the format of my drive had changed from NTFS to RAW – which was rather strange. Searching through Google on Data Recovery Software, I stumbled upon a neat software called R-Studio. I downloaded its trial version to give it a try.

It took approximately 7 hours for it to scan through my corrupt hard drive – after which I could view all my folder structure & files in the hard drive. You can only preview data or recover upto 64 Kb in the demo version of R-Studio. I tested its recover data tool and was very impressed to see that it managed to recover my data.

I purchased the full version of the software for a worthy price of USD 79.99 – got the license key immediately after making payment and started off recovering my data.

Thanks to R-Studio, I have recovered most of my data – besides some that resided on bad clusters.