Kurinchi Blogger Scribbles …


Archive for April, 2010

Apr 30
2010

Perl: How to debug in Perl?

Last updated: April 30th, 2010

Turn on warnings by
use warning;

To run a perl script with warnings, type -w with the shebang as in
#!/usr/bin/perl -w
print “Content-type: text/html\n\n”;
print “Hello World\n”;

Check if you have the following line in the program
print “Content-type: text/html\n\n”;
This will output the text to the browser from the server.

Print error messages to the browser using
use CGI::Carp qw(fatalsToBrowser);

The other way is to use the print command to debug your program.

Common error messages
» The specified CGI application misbehaved by not returning a complete set of HTTP headers.
» Can’t locate missing-file.pm in @INC (@INC contains: ….. )

Apr 28
2010

Backup Types

Last updated: April 28th, 2010

Full backup
Full backup is process of backing up ALL data.
First step towards all other types of backup
Backup time will be longer
Restore operation takes less time

Differential backup
Differential backup is the process of backing up data that has changed since the last FULL backup.
Requires file maintenance as the backup file will be of similar size or larger than its previous backup
Longer backup time than incremental backup
Faster restoration than incremental backup

Incremental backup
Incremental backup is the process of backing up data that has changed since the last Full, Incremental or Differential backup
Takes lesser backup time as it will have small data to archive
Takes longer restoration time

Mirror backup
Mirror backup is similar to full backup and is a direct copy of the files/folders
Files are not compressed in zip files and are not protected with password. They remain the mirror or exact copy of the source.

Apr 07
2010

How to convert mp3 to audio (cda) format?

Last updated: April 8th, 2010

InfraRecorder – available under GPL license and can be used to convert MP3 music to audio (cda) format in Microsoft Windows.

To convert mp3 to audio (cda) format, all you need to do is to select InfraRecorder » choose Audio Disc » drag the MP3 file to file list » Click Burn the current compilation to disc

Using InfraRecorder, you can also compile a CD/DVD, record disc images (ISO, BIN, CUE), record dual layer DVD’s, fixate discs and many such features.

You can check InfraRecorder at http://infrarecorder.org

Apr 05
2010

How to import mysql dump (.gz or .sql) into a database?

Last updated: April 6th, 2010

When moving mysql database from one server to another or, to test that the data backup works as expected we need to import mysql dump file in the testing environment.

Create the database (test-database) in the testing environment and identify the location of the .gz or .sql file.

If the mysql dump was a .gz file, you need to gunzip to uncompress the file by typing
$ gunzip mysqldump.sql.gz

This will uncompress the .gz file and will just store mysqldump.sql in the same location.
(more…)

Apr 03
2010

How to Compress, Uncompress to .gz, .bz2?

Last updated: April 6th, 2010

Tar (tape archive) does not compress files. They are used for grouping all files in a folder so that it can be transferred across locations. In order to compress the files, you need to use zip, gzip or bzip2 utilities.

gzip, bzip2 are file compression utilities and gunzip, bunzip2 are file uncompression utilities.

bzip2 compresses files to a smaller size compared to gzip, but it takes longer to compress the files. Bzip2 uses Burrows-Wheeler block sorting text compression algorithm (with Huffman coding) and gzip uses Lempel-Ziv coding. so, a file compressed with one utility cannot be uncompressed with the other utility.
(more…)

Apr 01
2010

Apache: client denied by server configuration error

Last updated: April 1st, 2010

Apache Error log shows the message “Client denied by server configuration” and the user sees “Forbidden Access” when they try to visit a web page.

Solution:

Search for the apache configuration file (httpd.conf or vhosts.conf if you have configured a virtual host). Check for the directory permission set for the document root of the web site in question and do the following changes. (more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict