Skip to main content

Posts

Showing posts from November, 2014

Multiple variable using array in for loop; cPanel user IP address change

I always wonder how to assign multiple variables in for loop. Suppose I want to change the IP address of some users listed. [root@server4 ~]# cat test1 user1 user2 user3 user4 user5 [root@server4 ~]# cat test2 190.10.20.1 20.1.1.2 30.12.13.13 13.23.23.12 32.12.12.1 test1 are my users and test2 contains IP address that I want to assign [root@server4 ~]# xargs < test1 user1 user2 user3 user4 user5 [root@server4 ~]# xargs < test2 190.10.20.1 20.1.1.2 30.12.13.13 13.23.23.12 32.12.12.1 Now I am going define array [root@server4 ~]# a=(user1 user2 user3 user4 user5) [root@server4 ~]# b=(190.10.20.1 20.1.1.2 30.12.13.13 13.23.23.12 32.12.12.1) [root@server4 ~]# c=${#a[@]}  #length of array Lets see if it works [root@server4 ~]# for ((i=0;i<c;i++));do echo "${a[i]} ${b[i]}"; done user1 190.10.20.1 user2 20.1.1.2 user3 30.12.13.13 user4 13.23.23.12 user5 32.12.12.1 what if we implement

Adding new php module through EA

Adding a new module(mhash added here) through EA wget  http://mhash.sourceforge.net/  select and download unbunzip2 downloaded file ./configure --prefix=/opt/mhash make make install vi /etc/ld.so.conf.d/mhash.conf /opt/mhash/lib add this touch and add --with-mhash=/opt/mhash in /var/cpanel/easy/apache/rawopts/all_php5 /scripts/easyapache --build