Jump to Navigation

204 - Top 5 large files in a directory

If you want to figure out large files in a specific directory.

# du -s /var/log/* | sort -nr | head -5

There are a lot of files in a current directory and want to figure out.

# du -s ./* | sort -nr | head -5


  • du

 This command is used to summarize disk usage of each file in a file system, recursively for directories.


203 - Change the MySQL's DATADIR

The default MySQL's datadir is placed in the /var/lib/mysql.
if you plan on using MySQL tables to store a lot of data and your /var partition might be a small space, it causes a space problem.
You had better move the MySQL's datadir to another space.

1. Stop your mysql server

# service mysqld stop  (or /etc/init.d/mysqld stop)

2. Create the new directories

3. chown the directory to the mysql:mysql user

202 - Required packages for Nagios & CentOS v6

If you install Nagios into CentOS v6, you need the following packages.
Check the packages before the installation.

yum install httpd php
yum install gcc glibc glibc-common
yum install gd gd-devel
yum install openssl-devel


201 - Disable firewall (iptable)

iptables is administration tool / command for IPv4 packet filtering and NAT.

The firewall serves as an antidote to access from unwanted connections. This facility is an important and commonly used in server
environments to restrict any ports that might be accessed, both internally and externally.

To disable the firewall on Red Hat Linux system and its derivatives (Fedora, CentOS, etc) :

As root user >

200 - Bash if statement conditions

1. and, or

You can use "-a" or "&&" for and and "-o" or "||"for or

if [ [ condition 1] -a [ condition 2] ]; then
  [ Execute if both are true. ]
if [ [ Condition 1] -o [ Condition 2] ]; then
  [ Execute if either is true. ]

* Sample

Shell Script:

199 - putty 0.61 : Access Denied Message

It was being caused by GSSAPI authentication. The better option is to set PuTTY not to try using it.

PuTTY options :
Connection -> SSH -> Auth -> GSSAPI
Uncheck the 'Attempt GSSAPI authentication' checkbox.

Other option :
Disabled GSSAPIAuthentication in sshd_config in your Linux Server.
Explicitly disable GSSAPI authentication in SSH client program configuration file, i.e. edit the /etc/ssh/ssh_config and add in this

198 - rm: cannot remove

When you try to delete directories & files, If you have the errors, even though you have a write permission.

rm: cannot remove `./data/test.txt': Permission denied
rm: cannot remove directory `./data/files': Permission denied

1. chmod the permission on those.


197 - iostat

The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation
to their average transfer rates. The iostat command generates reports that can be used to change system configuration to better balance
the input/output load between physical disks.

iostat is part of the sysstat package, so go ahead and install it :


196 - ORA-01555: snapshot too old

ORA-01555 is caused by many reason. One of them is "fetch across commit" in PL/SQL sometimes.
Generally you should COMMIT less frequently within a PL/SQL loop to prevent ORA-1555 errors.
The higher frequency of commit, the sooner the extents in the undo/ rollback segments will be cleared for new transactions,
then it causes ORA-1555 errors.

To fix this problem, easy to rewrite code like this:


195 - Oracle SGA Memory

The SGA is a chunk of memory that is allocated by an Oracle Instance (during the nomount stage) and is shared among Oracle processes,
hence the name. It contains all sorts of information about the instance and the database that is needed to operate.

Variable size:
This is combination of shared pool, Java pool and Large Pool

Fixed portion :
The size of the fixed portion is constant for a release and a plattform of Oracle, that is, it cannot be changed through any means
such as altering the initialization parameters.


Subscribe to LAMP, Database and Cloud Technical Information RSS

Main menu 2

by Dr. Radut