Blogs

Search Engine Friendly Redirects

301 redirect is the most efficient and Search Engine friendly method for webpage redirection. If you have to change file names or move pages around, it's the safest option and preserves your search engine rankings. The code "301" is interpreted as "moved permanently".

With php:

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://host.domain.tld" );
?>

With mod_rewrite:

RewriteEngine on

#Redirect Old domain to New domain
RewriteRule (.*) http://host.domain.tld/$1 [R=301,L]

# Redirect a particular domain
RewriteCond %{http_host} ^domain\.tld$ [NC]
RewriteRule ^(.*)$ http://host.newdomain.tld/$1 [R=301,L]

# Redirect a particular file
RewriteRule ^old_file.html$ http://host.domain.tld/new_file.html [R=301,L]

Block IP addresses from accessing your site via .htaccess

There are couple ways to block an IP, the one general way is to use htaccess deny feature.

SetEnvIf REMOTE_ADDR "^xxx.xxx.xxx.xxx$" badip
SetEnvIf REMOTE_ADDR "^xxx.xxx.xxx.xxx$" badip

<Limit GET POST>
order deny,allow
deny from env=badip
</Limit>

Disk ARchive (Backup and Restore) using dar and kdar(dar Frontend)

Dar is a shell command that makes backup of a directory tree and files. Its features include splitting archives over several files, CDs, ZIPs, or floppies, compression, full or differential backups, strong encryption, proper saving and restoration of hard links and extended attributes, remote backup using pipes and external command (such as ssh), and rearrangement of the “slices” of an existing archive. It can now run commands between slices, encrypt archives, and quickly retrieve individual files from differential and full backups.

Delete Qmail Server messages Queue

qmail is a mail transfer agent that runs on Unix. It was more secure replacement for the popular Sendmail program. The author offered a $500 prize for the first person to publish a verifiable security hole in the latest version of the software.

Change your Network card MAC ( Media Access Control) address Using macchanger

Media Access Control address, a hardware address that uniquely identifies each node of a network. In IEEE 802 networks, the Data Link Control (DLC) layer of the OSI Reference Model is divided into two sublayers: the Logical Link Control (LLC) layer and the Media Access Control (MAC) layer. The MAC layer interfaces directly with the network medium.Consequently, each different type of network medium requires a different MAC layer. On networks that do not conform to the IEEE 802 standards but do conform to the OSI Reference Model, the node address is called the Data Link Control (DLC) address.

Blogging From Ubuntu Using Drivel

Drivel is a GNOME client for working with online journals, also known as weblogs or simply blogs. It retains a simple and elegant design while providing many powerful features.

Read Full article here

Extract individual files from an RPM

To extract an individual file from an rpm package without installing the rpm:

  1. Use rpm2cpio or rpm -qpl to list files and full paths in the package:
    $ rpm2cpio <package_name> | cpio -t

  2. Use rpm2cpio to extract a file. Run this command from /tmp or elsewhere in order to avoid overwriting any current system files.
    This creates the full path in the current directory and extracts the file specified.
    $ rpm2cpio <package_name> | cpio -iv --make-directories <full-file-path>

  3. To extract everything to the current directory:
    $ rpm2cpio <package_name> | cpio -ivd

SSH your Debian servers without password

Secure Shell is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over unsecure channels. It is intended as a replacement for telnet, rlogin, rsh, and rcp. For SSH2, there is a replacement for FTP: sftp.This might be useful if you are trying to connect everytime to your server remotely.

Read Full Story

Load your PHP pages faster with GZip compression

If you have heavy pages with lots of images and text, you can greatly improve its' performance by dynamically compressing the page with php.

Put the below code in the header of each php page.

<? ob_start("ob_gzhandler"); ?>

It automatically gzips the page for browsers that support it.

This could also be set in the php.ini file instead, so all php pages are automatically compressed without having to add the above code in each and every php page.

In php.ini add the below code:

output_handler = ob_gzhandler

Kubuntu 6.10 (Edgy Eft) Step By Step Installation with Screenshots

Kubuntu is a user friendly operating system based on KDE, the K Desktop Environment. With a predictable 6 month release cycle and part of the Ubuntu project, Kubuntu is the GNU/Linux distribution for everyone.

Read Full article here

Syndicate content
Comment