HowTo Copy a Folder in Linux/Unix

So, I got this question recently from a new Linux user, but I’m pretty sure even people who’ve been using Linux for some time will have a question or two regarding copying files on the command line.

Happy penguins

Unix, and by extension, Linux isn’t known to be very chatty. Most commands are two or at the most three characters long with a hundred options, so a lot of people who’ve come to Linux by way of easy to use distributions such as Ubuntu or Mint have never really used the command line to get done work. I, on the other hand, am an old Linux hand and, frankly, am the most comfortable on the command line.

Continue reading “HowTo Copy a Folder in Linux/Unix”

Stream The Latest BlockBusters For Free Using Popcorn Time

Hollywood has a pretty tight grip on the business of streaming movies and if you’re someone who’d like to watch the latest blockbusters from the comfort of your own couch, you basically have no option but to wait for the theatrical release, even if you’re willing to pay money to companies such as Netflix.

In my opinion, this is the only reason for the massive popularity of mediums such as bittorrent for pirating movies and music. Downloading a good quality print of a movie from a torrent search engine isn’t rocket science but it’s still something that a lot of non-techies don’t know how to do, and they’d be more than willing to pay a fee to the hollywood studios if they’d let them download and see the movies at home. In the absence of any such option, it is natural for people to resort to piracy.

Continue reading “Stream The Latest BlockBusters For Free Using Popcorn Time”

How To Enable php On Apache With OS X Mavericks

phpIf you’re an OS X user developing php based application, you’d have realised that the apache configuration shipped with OS X doesn’t have php enabled out of the box. If you try to open a php script using your browser, you’ll just see the php code as text and not the rendered HTML you’re expecting.

But, don’t fret. It’s actually pretty simple to enable php on OS X. Here is what you should do.

Continue reading “How To Enable php On Apache With OS X Mavericks”

How To Start Apache Server In OS X Mavericks

ApacheMac OS X used to be the one of the easiest operating systems around to get a basic web development setup. For anyone interested in learning HTML/CSS/JS etc, all they had to do was open the sharing pane from system preferences and enable the web sharing option. On OS X 10.9, web sharing has been removed.

That doesn’t mean apache isn’t installed, by default. It is, its just hidden away waiting to be manually invoked using a Terminal command.

Continue reading “How To Start Apache Server In OS X Mavericks”

How To Password Protect Files in Linux

The USP of Linux has always been the strong security and stability it offers. Per user/group permissions and ACLs (access control lists) take care of almost all the security needs of a home users as well as an enterprise customer. If there is a need for even more fine grained control, there are various flavors of Linux available that are specifically designed with industrial grade security in mind and certified by organisations such as the NSA.

If you’re a home user, though, all this doesn’t really matter to you. Sure, it helps to have seperate permissions for different users on the system, if you’re sharing your computer with, say, your sibling, but configuring ACLs for home a user is a little overkill, if you ask me.

If all you need is a way to password protect certain important files from the prying eyes of your siblings, kids or pesky neighbors, Linux doesn’t offer anything *out of the box*. Fear not, though, we have just the right tool for you.

Password Protect Files

mcrypt is a utility designed to encrypt/decrypt a file using standard encryption techniques. If you don’t have mcrypt installed, you can install it with the following command.

apt-get install mcrypt

To password protect a file execute the following command

mcrypt <filename>

The above command will output something like this.

khera@khera:~$ mcrypt test1
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase: Enter password here
Enter passphrase: Repeat password here

File test1 was encrypted.
khera@home:~$

By default, mcrypt creates a new encrypted file with the extension .nc added to the original filename and leaves the original file intact. If this is not what you want, and you’d rather not have any traces of the original file, use mcrypt with the “-u” option.

mcrypt -u <filename>

This will ask you for a password as usual and the only difference will be that when the command finishes executing, the original file, test1 in the above case, will be deleted.

Decrypting a Password Protected File

So, now you know how to password protect file but what about decrypting it.

Turns out mcrypt does that too. Just use mcrypt with the “-d” option and it will decrypt the file for you after confirming the password with you.

mcrypt -d <encrypted filename>

The output should look something like this

khera@khera:~$ mcrypt -d test1.nc
Enter passphrase: Enter password here
File test1.nc was decrypted.

Like, in the encryption phase, mcrypt doesn’t delete the original file by default and if that is what you want, use mcrypt with the -u switch.

mcrypt -u -d <encrypted filename>

This will decrypt the file and delete the original encrypted file leaving no traces of it on your computer.

How was that for an easy encryption/decryption utility?

How To Test The RAM On Your Computer

The RAM is arguably the most important part of your computer. Apart from the processor, of course, but without some kind of memory, even the process is pretty much useless. A computer, without RAM, cannot run any application that you tell it to and might as well be a dead paper weight.

If you’ve noticed unusual freezes and random operating system/application crashes on your computer, the RAM should be your first line of diagnosis. The RAM on a modern computer is composed of millions of cells that store the data for the computer to process and failure of even a single cell can cause weird errors that can be extremely difficult to diagnose.

Memtest is an open source utility that verifies the RAM installed on your computer for any defects. Since, this is an open source tool, there are versions available for practically every operating system and I’m going to use the Mac OS X version of memtest today since that is what I’m most familiar with. You should be able to use the same command line switches with the version of memtest available for your operating system.

Download MemTest For Free

Memtest is available as a free download so just download it to your computer and unzip the file. You should now have a .pkg installer that you can just double click to install memtest. This installer does nothing other than installing the memtest binary to /usr/bin.

To start testing the RAM on your computer, launch Terminal.app and execute memtest.

Sharninders-iMac:~ sharninder$ memtest all 1

The above command will make memtest run through it’s complete test suite once. In general, it is better to test at least twice, or even let it run for a few hours if you want to be completely sure. If you don’t specify any number after the “all”, memtest runs indefinitely and will have to be stopped by pressing the ctrl+c key combination manually.

If Memtest throws up an error or memtest itself freezes, you’ll know for sure that the RAM is bad. If not, well, time to start diagnosing other parts of the computer.

Memtest for PCs

If you’re not running a Mac, you can still use memtest to diagnose the RAM of your PC, though the process is a little different. For PCs, memtest is distributed as images that you can burn onto CDs or USB flash drives.

Download one of the many pre-built images and burn it to a CD or to a USB flash drive, depending on the image. Now, shutdown your computer and reboot it using the CD/USB Key that you just burned. That should start Memtest straight away. Let the diagnostics run for a while or till you’re sure that the RAM has been tested thoroughly.

Have you ever had the RAM in your computer go bad ? How did you diagnose it ?

 

Best WordPress Plugins to Boost your Blog !

WordPress, without a doubt, is one of the most popular and widely used content management system in existence. From its start in 2003 till today, wordpress has been used my millions of sites. Various factors including easy setup, seo friendly nature, ease of use, security, huge number of themes and plugins contribute to its success. One of the most applauded features of wordpress is certainly the support for plugins and the immense number of plugins available. Take a look at some of the free wordpress plugins that can help you make the most out of your blog.

Mobile Friendly Version

Gone are the days when blogs were only targeted for desktop and laptop users. If your blog does not support a mobile version, chances are that you are losing on a lot of quality traffic. The Wptouch plugin is an excellent plugin that automatically converts your blog into a mobile version when viewed on a mobile device.

Site Backup

Keeping the backup of your entire site can be very handy while recovering data loss. The BackUpWordpress plugin makes this task automated by taking a backup of all your files and database every day. You can even have a copy of the backup mailed to you.

SEO

Anyone who wants to make his blog successful needs to have an effective Search Engine Optimization technique. Thankfully, there are a lot of plugins available that make the job easy for novice bloggers to experts. You can choose any one of the plugins from SEO Ultimate, All in one SEO or WordPress SEO by Yoast to cater to all your optimization needs.

Speed Up Your Blog

Cacheing and compressing techniques are often used by bloggers to render their pages faster on the internet. The WP Super Cache plugin generates static html pages that are faster to load and the WordPress Gzip Compression plugin enables gzip compression. You can even install the WP Minify plugin to further boost loading times.

Social Sharing

Social media is a great tool to popularize your blog and a lot of plugins are available in this category to suit your needs. The recommended ones are Digg DiggSharebarAdd This and Sexy Bookmarks and you can install any one that pleases your eyes.

Security

Securing your wordpress site is an absolutely essential step if you take blogging seriously. Two highly effictive plugins that help you secure your blog are Bullerproof Security and Wordfence Security. It is recommended to install only of the security plugin to avoid conflicts between the plugins.

Commenting System

If you use the default commenting system, you can easily become a victim of innumerous spams. Askimet is one of the most popular spam prevention system available. As an alternative, you can install Disqus or IntenseDebate to get an advanced and feature rich commenting system for your wordpress blog.

Contact Form

Contact forms not only makes your blog look more professional, but also avoids the need to share your email id publicly online. Contact Form 7 is one the simplest yet most effective contact form plugin available for wordpress.

These are only some of the vast number of plugins available. Do share with us what other plugins you think are absolutely essential for any wordpress blog.

How To Recover Data From a Memory Card

Memory Cards are as much a part of our daily computing as hard disks and RAM is. The Digital cameras that we use everyday, the mobile phones that we rely on and even some of those tiny netbooks that we use, more often than not use some kind of memory card based storage to store data.

Improvements in technology have made memory cards pretty reliable but there are times when even the best technology fails and when that times comes, you’d be glad to have included a memory card data recovery software in your toolkit.

Since, I’m a Mac OS X user, I’ll be talking about data recovery software that you can use on a Mac to recover data from corrupted memory cards, but there are similar software available for almost all platforms and in fact, the open source program that I’m going to walk you through today is available for Windows and Linux also.

To get started, download TestDisk from CGSecurity. Both the tools are distributed in a single tar.bz2 bundle named after TestDisk, so don’t look too hard if you can’t find PhotoRec on the CGSecurity site. I downloaded version 6.12 since I don’t have Rosetta installed on my Mac. If you have Rosetta installed, download the 6.11 stable version and that should also work for you.

Open the archive and since both of these are command line based tools, launch Terminal and browse over to the directory where you extracted the files.

Run the PhotoRec utility from the command line like this

darkstar:testdisk-6.12-WIP sharninder$ ./photorec

Select the disk that you want to recover data from and hit enter.

The next step is to select the type of partition table that the disk/memory card has. If this disk was being used on a regular PC, it’d most likely have an Intel type partition table, or if you like me use an Intel based Mac then you’d have an EFI/GPT type partition table. If the disk that you’re trying to recover data from is a memory card, it’d most likely be using the Intel partition table format. Select the appropriate choice and hit the enter key.

PhotoRec will now search the hard disk for any partitions of the selected type and display them on the next screen. Select a partition from the list and proceed.

The next step is to choose the type of filesystem. For a memory card, this would most likely be FAT, so select “Other” and hit enter. Photorec will now ask you to select a directory on your system where the recovered files will be saved. Use the arrow keys to to move to whichever directory you want and press ‘C’.

Photorec will now start scanning the entire disk and will save any files that it finds to the directory that you selected earlier.

Let me warn you, though, this is a very long process and scanning an entire disk can take anywhere from a few minutes to a few hours depending on the size of the disk.

The process is also not fool proof. Depending on how much the disk has been used after deleting a particular file, you may or may not be able to recover all your deleted files. This is not Photorec’s fault, though. This is just how filesystems on most modern operating systems work.

HowTo install RockBox on your iPod

Apple’s iPod music player is the most popular music player on the planet. The iPod along with the iTunes store has revolutionized not only the music industry but also the complete music distribution business. It is this music business that has brought back Apple, the company, from the brink of bankruptcy and made it into the household name that it is today.

Even though there are many fans of the iPod’s simple and clean interface, there are many who would like their iPods to do still more. And for them the RockBox open source project brings hope.

RockBox is an alternative open source firmware for a lot of different music players including Apple’s iPod and today we’ll show you how you can also install RockBox on your iPod and make it do much more than what Apple ever intended.

Continue reading “HowTo install RockBox on your iPod”

WinFF – a media convertor for (almost) any format

WinFFHow many times have you come across a movie or a video clip and wished that you could put it on your iPod and watch it on the go ? Or came across a DivX encoded video and wished that you could burn it to a DVD and play it on an old style DVD player ?

With the increasingly fast broadband connections that most of us have these days, videos are becoming as much a part of our daily internet consumption as text is. But, unlike text, videos are not portable – You can’t just take a video from one source and play it anywhere you want. Of course, with media players like VLC, this is less of a problem but even VLC can’t help you if you want videos from a random site to work on, say, your iPod.

If converting videos and juggling between the different file formats is becoming too much for you to handle, you should give WinFF a try.

Continue reading “WinFF – a media convertor for (almost) any format”