Saturday, February 12, 2011
Find command details
find / -xdev -size +1000 -exec ls -s {} \;|sort -rn | awk '{size=$1/1024; printf("%dMb %s\n", size,$2);}' | head -n 100 | grep -i home
Monday, April 19, 2010
change eth0 autoneg to full duplex
You may want to try resetting the ports on any slow servers you have. This can be done by using the commands:
ethtool -s eth0 autoneg on
mii-tool -r
ethtool -s eth0 speed 100 duplex full
-----------------------
To set the interface speed, duplex or auto negotiation on Linux system boot up (make settings permanent), you need edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for eth0 interface. This file used by Red Hat enterprise Linux, Fedora core, Cent Os etc.
Open the file:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append following line or add the following line
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”
Save and close the file.
Finally restart the network service
# /etc/init.d/network restart
You can check the current network interface speed using the below command
# /usr/sbin/ethtool eth0 |grep Speed
----------
Linux Force or restart network card auto-negotiation with ethtool
by Vivek Gite · 0 comments
ethtool or mii-tool utility checks or sets the status of a network interface’s Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting.
Due to software or hardware (network switch or Ethernet card ) error it may be possible that you need to restarts auto-negotiation on the specified ethernet device.
Restart autonegotiation
You don’t have to reboot Linux box, all you have to do is type the following command :
# ethtool -r eth0
Or you can use mii-tool (outdated, use ethtool only)
# mii-tool -r eth0
Output:
# tail -f /var/log/messages
Jul 16 09:34:25 smtp1 kernel: e1000: eth0: e1000_watchdog_task: NIC Link is Up 10 Mbps Full Duplex
Jul 16 09:34:25 smtp1 kernel: e1000: eth0: e1000_watchdog_task: 10/100 speed: disabling
ethtool -s eth0 autoneg on
mii-tool -r
ethtool -s eth0 speed 100 duplex full
-----------------------
To set the interface speed, duplex or auto negotiation on Linux system boot up (make settings permanent), you need edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for eth0 interface. This file used by Red Hat enterprise Linux, Fedora core, Cent Os etc.
Open the file:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append following line or add the following line
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”
Save and close the file.
Finally restart the network service
# /etc/init.d/network restart
You can check the current network interface speed using the below command
# /usr/sbin/ethtool eth0 |grep Speed
----------
Linux Force or restart network card auto-negotiation with ethtool
by Vivek Gite · 0 comments
ethtool or mii-tool utility checks or sets the status of a network interface’s Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting.
Due to software or hardware (network switch or Ethernet card ) error it may be possible that you need to restarts auto-negotiation on the specified ethernet device.
Restart autonegotiation
You don’t have to reboot Linux box, all you have to do is type the following command :
# ethtool -r eth0
Or you can use mii-tool (outdated, use ethtool only)
# mii-tool -r eth0
Output:
# tail -f /var/log/messages
Jul 16 09:34:25 smtp1 kernel: e1000: eth0: e1000_watchdog_task: NIC Link is Up 10 Mbps Full Duplex
Jul 16 09:34:25 smtp1 kernel: e1000: eth0: e1000_watchdog_task: 10/100 speed: disabling
Monday, February 15, 2010
kill command usage
Howto: Linux kill and logout users
by Vivek Gite · 18 comments
Yet another newbie question that suggests people love to kill and show their power to rest of the world ;)
There is a package called procps. It includes various useful (read as nifty) utilities. One of such utility is skill which is responsible to send a signal to users and process such as:
* Halt user terminal
* Kill user and logout
Also note that these are utilities to browse the /proc filesystem, which is not a real file system but a way for the kernel to provide information about the status of entries in its process table.
Task: How to halt/stop user called didi
Type the skill command as follows:
# skill -STOP -u didi
You muse be root to stop other users.
Task: How to resume already halted user called didi
Send CONT single to user didi, type the following command:
# skill -CONT -u didi
Task: How to kill and logout user called didi
You can send KILL single, type the following command:
# skill -KILL -u didi
Task: Kill and logout all users
The ultimate command to kill and logout all users, type the following command:
# skill -KILL -v /dev/pts/*
Please note that send users warning message or logout notice using wall command to avoid data loss.
Reference from
http://www.cyberciti.biz/tips/howto-linux-kill-and-logout-users.html
by Vivek Gite · 18 comments
Yet another newbie question that suggests people love to kill and show their power to rest of the world ;)
There is a package called procps. It includes various useful (read as nifty) utilities. One of such utility is skill which is responsible to send a signal to users and process such as:
* Halt user terminal
* Kill user and logout
Also note that these are utilities to browse the /proc filesystem, which is not a real file system but a way for the kernel to provide information about the status of entries in its process table.
Task: How to halt/stop user called didi
Type the skill command as follows:
# skill -STOP -u didi
You muse be root to stop other users.
Task: How to resume already halted user called didi
Send CONT single to user didi, type the following command:
# skill -CONT -u didi
Task: How to kill and logout user called didi
You can send KILL single, type the following command:
# skill -KILL -u didi
Task: Kill and logout all users
The ultimate command to kill and logout all users, type the following command:
# skill -KILL -v /dev/pts/*
Please note that send users warning message or logout notice using wall command to avoid data loss.
Reference from
http://www.cyberciti.biz/tips/howto-linux-kill-and-logout-users.html
Thursday, January 21, 2010
Thursday, January 14, 2010
LOG details.
Here are some basic log files, their locations & a brief description which can be found in Linux distros [mostly in cPanel ]:
General:
Quote:
cPanel/WHM Initial Installation Errors:
Location : /var/log/cpanel*install*
Description : These log files contain cPanel installation logs & should be referenced first for any issues resulting from new cPanel installations..
Quote:
Cpanel/WHM Service Status Logs:
Location : /var/log/chkservd.log
Description :The service monitoring demon (chkservd) logs all service checks here. Failed service are represented with a [-] and active services are represented by [+].
Quote:
Cpanel/WHM Accounting Logs:
Location : /var/cpanel/accounting.log
Description : Contains a list of accounting functions performed through WHM, including account removal and creation..
cPanel/WHM Specific Requests and Errors:
Quote:
cPanel error logs:
Location : /usr/local/cpanel/logs/error_log
Description : cPanel logs any error it incurs here. This should be checked when you encounter errors or strange behavior in cPanel/WHM…
Quote:
cPanel License Error Logs:
Location : /usr/local/cpanel/logs/license_log
Description : All license update attempts are logged here. If you run into any errors related to license when logging in, check here.
Quote:
Stats Daemon Logs:
Location : /usr/local/cpanel/logs/stats_log
Description : The stats daemon (cpanellogd) logs the output from all stats generators (Awstats, Webalizer, Analog) here.
Quote:
Client Information, Requested URL Logs:
Location : /usr/local/cpanel/logs/access_log
Description : General information related to access cPanel requests is logged here.
Quote:
cPanel/WHM Update Logs:
Location : /var/cpanel/updatelogs/update-[TIMESTAMP].log
Description : Contains all output from each cPanel update [upcp]. It’s named with the timestamp at which the upcp process was initiated..
Quote:
Bandwidth Logs:
Location : /var/cpanel/bandwidth
Description : Files contain a list of the bandwidth history for each account. Each named after their respective user.
Quote:
Tailwatchd [New]:
Location : /usr/local/cpanel/logs/tailwatchd_log
Description : Logs for daemon configuired under tailwatchd ie. cPBandwd, Eximstats, Antirelayd.
Apache Logs:
Quote:
General Error and Auditing Logs:
Location : /usr/local/apache/logs/error_log
Description : All exceptions caught by httpd along with standard error output from CGI applications are logged here..
The first place you should look when httpd crashes or you incur errors when accessing website.
Quote:
Apache SuExec Logs:
Location : /usr/local/apache/logs/suexec_log
Description : Auditing information reported by suexec each time a CGI application is executed. Useful for debugging internal server errors, with no relevant information being reported to the Apache error_log, check here for potential suexec policy violations…
Quote:
Domain Access Logs:
Location : /usr/local/apache/domlogs/domain.com
Description : General access log file for each domain configured with cPanel.
Quote:
Apache Access Logs:
Location : /usr/local/apache/logs/access_log
Description : Complete web server access log records all requests processed by the server.
Exim :
Quote:
Message Reception and Delivery:
Location : /var/log/exim_mainlog or /var/log/exim/mainlog
Description : Receives an entry every time a message is received or delivered.
Quote:
Exim ACLs/Policies based RejectLog :
Location : /var/log/exim_rejectlog
Description : An entry is written to this log every time a message is rejected based on either ACLs or other policies eg: aliases configured to :fail
Quote:
Unexpected or Fatal Errors:
Location : /var/log/exim_paniclog
Description : Logs any entries exim doesn’t know how to handle. It’s generally a really bad thing when log entries are being written here, and they should be properly investigated..
Quote:
IMAP/POP/SpamAssassin General Logging and Errors:
Location : /var/log/maillog & /var/log/messages
Description : The IMAP, POP, and SpamAssassin services all log here. This includes all general logging information (login attempts, transactions, spam scoring), along with fatal errors.
FTP:
Quote:
FTP Logins and General Errors:
Location : /var/log/messages
Description : General information and login attempts are logged here..
Quote:
FTP Transactions logging:
Location : /var/log/xferlog or /var/log/messages
Description : Is a symbolic link in most cases to /usr/local/apache/domlogs/ftpxferlog, which contains a history of the transactions made by FTP users…
MySQL:
Quote:
MySQL General Information and Errors :
Location : /var/lib/mysql/$(hostname).err
Description : This path could vary, but is generally located in /var/lib/mysql. Could also be located at /var/log/mysqld.log
Security:
Quote:
Authentication attempts:
Location : /var/log/secure
Description : Logs all daemons which requires PAM Authentication.
Quote:
Tracking all Bad Logins and Logouts:
Location : /var/log/btmp
Description : Log of all attempted bad logins to the system. Accessed via the lastb command..
Quote:
Tracking all Logins and Logouts:
Location : /var/log/wtmp
Description : The wtmp file records all logins and logouts.
Quote:
Last Logins:
Location : /var/log/lastlog
Description : Database times of previous user logins. The lastlog file is a database which contains info on the last login of each user.
Quote:
WebDav or WebDisk Log :
Location : /usr/local/cpanel/logs/cpdavd_error_log
Description : The cpdavd daemon is “WebDav” (better known as “WebDisk”) which was introduced in cPanel 11 to allow users to mount their home directory on their personal computer, always having access to the files and content…
Quote:
Cphulkd Logs:
Location : /usr/local/cpanel/logs/cphulkd_errors.log
Description : cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service….
It blacklists IPs that it thinks are trying to run a brute force attack.
Quote:
Failure Logging:
Location : /var/log/faillog
Description : Faillog formats the contents of the failure log from /var/log/faillog database. It also can be used for maintains failure counters and limits. Run faillog without arguments display only list of user faillog records who have ever had a login failure.
Quote:
Startup/Boot, Kernel & Hardware error messages :
Location : /var/log/dmesg
Description : dmesg is a “window” into the kernels ring-buffer. It’s a message buffer of the kernel. The content of this file is referred to by the dmesg command. It shows bootlog and the hardware errors..
General:
Quote:
cPanel/WHM Initial Installation Errors:
Location : /var/log/cpanel*install*
Description : These log files contain cPanel installation logs & should be referenced first for any issues resulting from new cPanel installations..
Quote:
Cpanel/WHM Service Status Logs:
Location : /var/log/chkservd.log
Description :The service monitoring demon (chkservd) logs all service checks here. Failed service are represented with a [-] and active services are represented by [+].
Quote:
Cpanel/WHM Accounting Logs:
Location : /var/cpanel/accounting.log
Description : Contains a list of accounting functions performed through WHM, including account removal and creation..
cPanel/WHM Specific Requests and Errors:
Quote:
cPanel error logs:
Location : /usr/local/cpanel/logs/error_log
Description : cPanel logs any error it incurs here. This should be checked when you encounter errors or strange behavior in cPanel/WHM…
Quote:
cPanel License Error Logs:
Location : /usr/local/cpanel/logs/license_log
Description : All license update attempts are logged here. If you run into any errors related to license when logging in, check here.
Quote:
Stats Daemon Logs:
Location : /usr/local/cpanel/logs/stats_log
Description : The stats daemon (cpanellogd) logs the output from all stats generators (Awstats, Webalizer, Analog) here.
Quote:
Client Information, Requested URL Logs:
Location : /usr/local/cpanel/logs/access_log
Description : General information related to access cPanel requests is logged here.
Quote:
cPanel/WHM Update Logs:
Location : /var/cpanel/updatelogs/update-[TIMESTAMP].log
Description : Contains all output from each cPanel update [upcp]. It’s named with the timestamp at which the upcp process was initiated..
Quote:
Bandwidth Logs:
Location : /var/cpanel/bandwidth
Description : Files contain a list of the bandwidth history for each account. Each named after their respective user.
Quote:
Tailwatchd [New]:
Location : /usr/local/cpanel/logs/tailwatchd_log
Description : Logs for daemon configuired under tailwatchd ie. cPBandwd, Eximstats, Antirelayd.
Apache Logs:
Quote:
General Error and Auditing Logs:
Location : /usr/local/apache/logs/error_log
Description : All exceptions caught by httpd along with standard error output from CGI applications are logged here..
The first place you should look when httpd crashes or you incur errors when accessing website.
Quote:
Apache SuExec Logs:
Location : /usr/local/apache/logs/suexec_log
Description : Auditing information reported by suexec each time a CGI application is executed. Useful for debugging internal server errors, with no relevant information being reported to the Apache error_log, check here for potential suexec policy violations…
Quote:
Domain Access Logs:
Location : /usr/local/apache/domlogs/domain.com
Description : General access log file for each domain configured with cPanel.
Quote:
Apache Access Logs:
Location : /usr/local/apache/logs/access_log
Description : Complete web server access log records all requests processed by the server.
Exim :
Quote:
Message Reception and Delivery:
Location : /var/log/exim_mainlog or /var/log/exim/mainlog
Description : Receives an entry every time a message is received or delivered.
Quote:
Exim ACLs/Policies based RejectLog :
Location : /var/log/exim_rejectlog
Description : An entry is written to this log every time a message is rejected based on either ACLs or other policies eg: aliases configured to :fail
Quote:
Unexpected or Fatal Errors:
Location : /var/log/exim_paniclog
Description : Logs any entries exim doesn’t know how to handle. It’s generally a really bad thing when log entries are being written here, and they should be properly investigated..
Quote:
IMAP/POP/SpamAssassin General Logging and Errors:
Location : /var/log/maillog & /var/log/messages
Description : The IMAP, POP, and SpamAssassin services all log here. This includes all general logging information (login attempts, transactions, spam scoring), along with fatal errors.
FTP:
Quote:
FTP Logins and General Errors:
Location : /var/log/messages
Description : General information and login attempts are logged here..
Quote:
FTP Transactions logging:
Location : /var/log/xferlog or /var/log/messages
Description : Is a symbolic link in most cases to /usr/local/apache/domlogs/ftpxferlog, which contains a history of the transactions made by FTP users…
MySQL:
Quote:
MySQL General Information and Errors :
Location : /var/lib/mysql/$(hostname).err
Description : This path could vary, but is generally located in /var/lib/mysql. Could also be located at /var/log/mysqld.log
Security:
Quote:
Authentication attempts:
Location : /var/log/secure
Description : Logs all daemons which requires PAM Authentication.
Quote:
Tracking all Bad Logins and Logouts:
Location : /var/log/btmp
Description : Log of all attempted bad logins to the system. Accessed via the lastb command..
Quote:
Tracking all Logins and Logouts:
Location : /var/log/wtmp
Description : The wtmp file records all logins and logouts.
Quote:
Last Logins:
Location : /var/log/lastlog
Description : Database times of previous user logins. The lastlog file is a database which contains info on the last login of each user.
Quote:
WebDav or WebDisk Log :
Location : /usr/local/cpanel/logs/cpdavd_error_log
Description : The cpdavd daemon is “WebDav” (better known as “WebDisk”) which was introduced in cPanel 11 to allow users to mount their home directory on their personal computer, always having access to the files and content…
Quote:
Cphulkd Logs:
Location : /usr/local/cpanel/logs/cphulkd_errors.log
Description : cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service….
It blacklists IPs that it thinks are trying to run a brute force attack.
Quote:
Failure Logging:
Location : /var/log/faillog
Description : Faillog formats the contents of the failure log from /var/log/faillog database. It also can be used for maintains failure counters and limits. Run faillog without arguments display only list of user faillog records who have ever had a login failure.
Quote:
Startup/Boot, Kernel & Hardware error messages :
Location : /var/log/dmesg
Description : dmesg is a “window” into the kernels ring-buffer. It’s a message buffer of the kernel. The content of this file is referred to by the dmesg command. It shows bootlog and the hardware errors..
Sunday, January 10, 2010
kernel compile details
http://www.linuxchix.org/content/courses/kernel_hacking/lesson9
http://www.linuxdocs.org/HOWTOs/Kernel-HOWTO-7.html
refer it from 1 page
http://www.linuxdocs.org/HOWTOs/Kernel-HOWTO-7.html
refer it from 1 page
Saturday, January 2, 2010
web server +site speed up
http://www.catswhocode.com/blog/speed-up-your-website-quick
http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html
http://www.serverwatch.com/tutorials/article.php/3436911/Optimizing-Apache-Server-Performance.htm
https://calomel.org/save_web_bandwidth.html
http://www.webpagetest.org/
http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html
http://www.serverwatch.com/tutorials/article.php/3436911/Optimizing-Apache-Server-Performance.htm
https://calomel.org/save_web_bandwidth.html
http://www.webpagetest.org/
Subscribe to:
Posts (Atom)