Friday, November 27, 2009

How to install Filezilla Ftp client To ubuntu

Install Filezilla Ftp client to ubuntu

sudo aptitude install filezilla

Tuesday, November 24, 2009

Internal Server Error in ubuntu

1. You Should install mod_rewrite to ubuntu
sudo a2enmod rewrite
thanks

How to enable apache mod_rewrite in Ubuntu

1. you should change AllowOverride None to AllowOverride ALL in virtual host File.
2. you should enable mod_rewrite in the ubuntu operating System.
3 If you want to enable mod rewrite you should add the following command in your terminal.

sudo a2enmod rewrite

thanks.

Wednesday, September 30, 2009

Most usefull Linux command

Today i write most use-full linux command. I think this is most important for new linux users.

1. Copy command

$cp -irf source directory target directory

2. size

$du -sh direcotry name

3. Remove the diretory & subdirectory

$rm -irf directoryname

4. Move the files from one directory to another directory

mv -irf sourcedirectory targetdirectory

5. Change ownership on directory or subdirectory

$chown -R user:group directory

6. Find file in the linux system

$find -name eg: find /data1/PROD/ -name apichecb.pls

1. directory name where we want to search the file.

2. file name is which we want to search

7. How to check "File" type in linux

$file filename

8. how to check linux version
$uname -a

9. how to check group information in the linux

$cat /etc/group

10. how to install RPM package

#rpm -ivch packagename

i stand for install

11. change to usb filesystem type from ntfs to ext3

#mke2fs -j /dev/sdb1
then mount the usbfirst check the usb filesystem type

#fdisk -l then use the below command to mount

#mount /dev/sdb1 /mnt/usb

thanks for all



Thursday, September 10, 2009

Regular Expressions in MySQL

Introduction
A very interesting and useful capability of MySQL is to incorporate Regular Expressions (regex) in SQL queries. The regular expression support in MySQL is extensive. Let's take a look at using Regular Expressions in queries and the supported metacharacters.

Using Regular Expressions in queries
A simple example of using Regular Expressions in a SQL query would be to select all names from a table that start with 'A'.

eg:-
SELECT name FROM employees WHERE name REGEXP '^A'

A slight modification in the above example to look for names starting with 'A' or 'D' or 'F' will look like this.


eg:-
SELECT name FROM employees WHERE name REGEXP '^(A|D|F)'

Regular Expression Metacharacters
*
Matches zero or more instances of the string preceding it
+
Matches one or more instances of the string preceding it
?
Matches zero or one instances of the string preceding it
.
Matches any single character, except a newline
[xyz]
Matches any of x, y, or z (match one of enclosed characters)
[^xyz]
Matches any character not enclosed
[A-Z]

Matches any uppercase letter
[a-z]
Matches any lowercase letter
[0-9]
Matches any digit
^
Anchors the match from the beginning
$
Anchors the match to the end
|
Separates alternatives
{n,m}

String must occur at least n times, but not more than m times

{n}
String must occur exactly n times
{n,}
String must occur at least n times
[[:<:]]
Matches beginning of words
[[:>:]]

Matches ending of words

[:class:]
match a character class i.e.,
[:alpha:] for letters
[:space:]
for whitespace
[:punct:]
for punctuation
[:upper:]
for upper case letters

Examples

SELECT age FROM employees WHERE age REGEXP '^[0-9]+$'

/* starts, ends and contains numbers */

SELECT name FROM employees WHERE contact_no REGEXP '^[0-9]{10}$'