Using ntpdate command
The ntpdate command will sync your clock with an NTP server
The ntpdate command will not run when the NTP server is running, if you run then it says the NTP socket is in use, exiting.
[centos@centos ~]$ grep ^server /etc/ntp.conf
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
[centos@centos ~]$ sudo ntpdate 0.rhel.pool.ntp.org
[sudo] password for centos:
13 Nov 19:15:42 ntpdate[10611]: the NTP socket is in use, exiting
[centos@centos ~]$
Stop NTP and then run ntpdate
centos@centos ~]$ sudo /etc/init.d/ntpd stop
Shutting down ntpd: [ OK ]
[centos@centos ~]$ sudo ntpdate 0.rhel.pool.ntp.org
13 Nov 19:16:58 ntpdate[10636]: adjust time server 123.108.200.163 offset -0.285447 sec
[centos@centos ~]$ sudo /etc/init.d/ntpd start
Starting ntpd: [ OK ]
[centos@centos ~]$ pgrep ntp
10643
[centos@centos ~]$
Reference: http://support.ntp.org/bin/view/Support/GettingStarted
htpasswd - Manage user files for basic authentication
htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users. If htpasswd cannot access a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no changes.
Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by htpasswd. This program can only manage usernames and passwords stored in a flat-file. It can encrypt and display password information for use in other types of data stores, though. To use a DBM database see dbmmanage.
htpasswd encrypts passwords using either a version of MD5 modified for Apache, or the system’s crypt() routine. Files managed by htpasswd may contain both types of passwords; some user records may have MD5-encrypted passwords while others in the same file may have passwords encrypted with crypt().
-m Use MD5 encryption for passwords.
-c Create the passwdfile. If passwdfile already exists, it is rewritten and truncated.
EXAMPLES
htpasswd /usr/local/etc/apache/.htpasswd-users jsmith
Adds or modifies the password for user jsmith. The user is prompted for the password.
Dynamic Kernel Module Support (DKMS) is a framework used to generate Linux kernel modules whose sources do not generally reside in the Linux kernel source tree. DKMS enables kernel device drivers to be automatically rebuilt when a new kernel is installed.
An essential feature of DKMS is that it automatically recompiles all DKMS modules if a new kernel version is installed. This allows drivers and devices outside of the mainline kernel to continue working after a Linux kernel upgrade.
Another benefit of DKMS is that it allows one to install a new driver on an existing system, running an arbitrary kernel version, without any need for manual compilation or precompiled packages provided by the vendor.
DKMS was written by the Linux Engineering Team at Dell in 2003. It is included in many distributions, such as Ubuntu, Debian, Red Hat Enterprise Linux, Fedora, SuSE and CentOS. DKMS is free software released under the terms of the GNU General Public License (GPL) v2 or later.
DKMS supports both the RPM and DEB package formats out-of-the-box.
Reference: http://linux.dell.com/dkms/
Using hashlimit in iptables
iptables -I INPUT -m hashlimit -m tcp -p tcp –dport 23032 –hashlimit 1/min –hashlimit-mode srcip –hashlimit-name ssh -m state –state NEW -j ACCEPT
This rule limits one connection to the SSH port from one IP address per minute.
hashlimit match options
--hashlimit-upto max average match rate
[Packets per second unless followed by
/sec /minute /hour /day postfixes]
–hashlimit-above min average match rate
–hashlimit-mode mode is a comma-separated list of
dstip,srcip,dstport,srcport (or none)
–hashlimit-srcmask source address grouping prefix length
–hashlimit-dstmask destination address grouping prefix length
–hashlimit-name name for /proc/net/ipt_hashlimit
–hashlimit-burst number to match in a burst, default 5
–hashlimit-htable-size number of hashtable buckets
–hashlimit-htable-max number of hashtable entries
–hashlimit-htable-gcinterval interval between garbage collection runs
–hashlimit-htable-expire after which time are idle entries expired?
fsck - how much % fsck is completed
-C [ "fd" ]
Display completion/progress bars for those filesystem checkers (currently only for ext2 and ext3) which support them. Fsck will manage the filesystem checkers so that only one of them will display a progress bar at a time. GUI front-ends may specify a file descriptor fd, in which case the progress bar information will be sent to that file descriptor.
Note : Make sure that partition is not mounted while running fsck.
Many time due to big partition size ,we have to wait for the long time at that time we think fsck process is stuck at that time we can use the following fsck command because its showing the % for the fsck process, so that we are able to see how much % fsck is completed and remaining.