1.) stdout to a file
The output of a command will redirect to another file.
Eg: ls -l > list.txt
2.) stderr to a file
The following command will redirect the stderr ouput of a program to a new file.
Eg: grep sibu * 2> grep-errors.txt
Here, a file called ‘grep-errors.txt’ will be created and it will contain what you [...]
Using this Options directive controls we can set server features for a particular directory.
Options can be set to None, in which case none of the extra features are enabled.
All :
All options except for MultiViews. (Default Settings).
ExecCGI :
Execution of CGI scripts using mod_cgi is permitted.
FollowSymLinks :
The server will follow symbolic links in this directory.
Includes :
Server-side includes [...]
SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. Its use to add dynamically generated content to an existing HTML page.
SSI configurations
We must have mod_include module installed and enabled on apache. Also need to have the following directive either in [...]
While executing the mysqldump command you may have experienced following errors.
mysqldump: Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’ when using LOCK TABLES
To quickly fix this problem use the following switch when running mysqldump for MySQL database backups.
mysqldump -u root -p -all-databases -single-transaction > all.sql
VPS Creation
# vzctl create VEID –ostemplate osname
# vzctl set VEID –ipadd a.b.c.d –save
# vzctl start VEID
Here VEID is the numeric ID for the VPS;
osname is the name of the OS template for the VE,
and a.b.c.d is the IP address to be assigned to the VE.
Example:
# vzctl create 101 –ostemplate fedora-core-5-minimal
# vzctl set 101 –ipadd 10.1.2.5 [...]
Find Out The Top 10 Memory Consuming Process
# ps -auxf | sort -nr -k 4 | head -10
Find Out top 10 CPU Consuming Process
# ps -auxf | sort -nr -k 3 | head -10
Max cpu resource usage
# ps -eo pcpu,pid,user,args | sort -r -k1 | more
To get the long list of a process, if [...]
If the linux box protected with root password only.
Do a hard reboot on the machine and click on ‘e’ button to edit the boot like when you get the grub menu. Scrol down to the line which starts with kernel and hit ‘e’ again to edit and add ‘single’ (with out quotes) at the [...]
History with Time and Date
The command history will give you the list of command which you executed earlier. By default you won’t get the the command execution time and date.
If you wish to have a history details with time and date please do the following.
Open /etc/bashrc file and add the following line.
Export HISTTIMEFORMAT=”%h%d [...]
According to man page:
Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user defined chains.
By default, Iptables log message to a /var/log/messages file. However you [...]
Zombie process is an inactive computer process, according to wikipedia article, “…On Unix operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status. In the term’s colorful metaphor, the child [...]