Archive for the tag 'Number'

SBDavid

cPanel & WHM Version Number

cPanel & WHM Version Number

The version number:

The first and second segments still represent the parent and major values. (These are unchanged.)
The third segment no longer consists of an auto-incremented build ID number. It now represents a milestone—a group of changes to cPanel & WHM that will include new features and bug fixes.
The fourth segment is the auto-incrementing build ID. This value is relative to the milestone. When the milestone is achieved, the third segment will be incremented and the build ID will reset to 0.

For example, in version 11.29.1.4:

11” is the parent number.
29” is the major version number.
1” is the cPanel & WHM milestone.
4” is the build ID leading up to the completion of the milestone.

This version number would be reported in the cPanel & WHM user interfaces as “11.29.1 (build 4).”

SBDavid

Changing the SSH Port Number

Changing the SSH Port Number

To change the SSH port number login as root, and edit /etc/ssh/sshd_config

Find the line that says Port 22 and change 22 to any number between 1024->65535 (above 30000 is best) and save the file.

Once done, run:

/etc/init.d/sshd restart

Now start a new SSH session (don’t close your existing one), to make sure that you can get in.

-p port
Port to connect to on the remote host. This can be specified on a per-host basis in the configuration file.

Using netstat to find largest number of established connections

To find out the largest number of established connections you can simply use something like

netstat -an | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | cut -d: -f1 | uniq -c | sort -rn | head -n 1
3 192.168.1.2

To see the list of the top 10

netstat -an | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | cut -d: -f1 | uniq -c | sort -rn | head -n 10
2 192.168.1.2

How to view all

netstat -an | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | cut -d: -f1 | uniq -c | sort -rn
3 192.168.1.2

You can also view all but have pages so you can view each in detail

netstat -an | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | cut -d: -f1 | uniq -c | sort -rn | more
8 192.168.1.2

You can show the port with:

netstat -an | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | uniq -c | sort -rn
1 192.168.1.2:58632
1 192.168.1.2:58631
1 192.168.1.2:58629
1 192.168.1.2:58628
1 192.168.1.2:58627
1 192.168.1.2:58613
1 192.168.1.2:55154
1 192.168.1.2:48673

Limit the number of Rails applications in Cpanel Server

You can limit the number of Rails applications your customers can install.

To do this in WHM, go to Modify an Account, click the domain name you wish to limit, and in the Max Mongrel Instances (Ruby on Rails) box, specify the desired maximum number of applications.

Using cat command to number nonempty output lines

-b, –number-nonblank
number nonempty output lines

root@dell:/etc# cat -b inittab
1 # /etc/inittab: init(8) configuration.
2 # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

3 # The default runlevel.
4 id:2:initdefault:

-n, –number
number all output lines

root@dell:/etc# cat -n inittab
1 # /etc/inittab: init(8) configuration.
2 # $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
3
4 # The default runlevel.
5 id:2:initdefault:

Next »