The Guru Of Tech - Gobind

Asterisk Insall, Codec Install, Vicidial Install.

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS.

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS.

Monday, October 31, 2011

Compare Two Databases [TableName,ColumnName ............etc]

SELECT
table_schema,
MIN(Table_Name) AS TableName,
column_name,
column_default,
is_nullable,
data_type,
character_maximum_length,
numeric_precision,
numeric_scale,
column_comment
FROM (
SELECT
table_schema,
Table_Name,
column_name,
ordinal_position,
column_default,
is_nullable,
data_type,
character_maximum_length,
numeric_precision,
numeric_scale,
character_set_name,
collation_name,
column_type,
column_key,
extra,
privileges,
column_comment
FROM information_schema.columns AS i1
WHERE table_schema='DATABASE_NAME1'

 

UNION ALL
SELECT
table_schema,
Table_Name,
column_name,
ordinal_position,
column_default,
is_nullable,
data_type,
character_maximum_length,
numeric_precision,
numeric_scale,
character_set_name,
collation_name,
column_type,
column_key,
extra,
privileges,
column_comment
FROM information_schema.columns AS i2
WHERE table_schema=''DATABASE_NAME2'
) AS tmp
GROUP BY table_name,column_name,data_type
HAVING COUNT(*) = 1
ORDER BY column_name

Enable .htaccess in Linux (apache)

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit

AllowOverride must be All instead of None in httpd.conf

Block an IP address under Linux

If you just want to block access to all port from an ip 65.55.44.100 then type command :

#iptables -A INPUT -s 65.55.44.100 -j DROP
#service iptables save
#service iptables restart

If you just want to block access to one port from an ip 65.55.44.100 to port 25 then type command:

# iptables -A INPUT -s 65.55.44.100 -p tcp --destination-port 25 -j DROP
#service iptables save
#service iptables restart

Unblock An IP Address:
Use the following syntax (the -d options deletes the rule from table):

# iptables -D INPUT -s 65.55.44.100 -j DROP
# service iptables save
#service iptables restart

Tail command & Head command in Linux

#tail -n 100 /var/log/dmesg | more

The above example would list the last 100 lines in the file /var/log/dmesg

#head -n 100 /var/log/dmesg | more

The above example would list the first 100 lines in the file /var/log/dmesg

Find Soft Links in System - Linux

For Root Directory

#find / -type l -ls -d


For Particular Directory

#find /directoryname -type l -ls -d

Increase History Size in linux (centos)

Go to

 

#vim /etc/profile

Edit

HIST SIZE=1000

 

Check Processor / CPU is 64 bit / 32 bit

Check Processor / CPU is 64 bit / 32 bit

# uname -p
or
# uname --processor

-p, --processor print the processor type or "unknown"

################################################## ###########

# getconf LONG_BIT
which returns either 32 or 64 says nothing about the cpu capabilities, just the os that is running.