Posts

Showing posts from June, 2014

Add some specific word to some files using For Loop

We Need to add the line/change it from unlimited to 500 for MAX_EMAIL_PER_HOUR=500 for all packages/files under the folder. Step 1 --------- cp -rpf /var/cpanel/packages /var/cpanel/packages_org Step 2 -------- 2).ls /var/cpanel/packages > test.txt  #but we need to remove some files which have spaces[in between] from the list test.txt, then need to add the entry MAX_EMAIL_PER_HOUR=500 for that files manually. Because it does not recognize the spaces b/w single file. E.G:  johnhe3_WebFarm Beef(single file) For loop consider it as two files johnhe3_WebFarm,Beef. Step 3 -------- 3).for i in `cat test.txt`; do if [ -z `grep -w 'MAX_EMAIL_PER_HOUR' "$i" | cut -d = -f1` ]; then echo -e 'MAX_EMAIL_PER_HOUR=500' >> "$i"; else sed -i 's/MAX_EMAIL_PER_HOUR=unlimited/MAX_EMAIL_PER_HOUR=500/g' "$i"; fi; done

Kernel Compile

Kernel compilation: ------------------- cd /usr/src wget ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-3.13.6.tar.gz tar xvf linux-3.13.6.tar.gz cd linux-3.13.6 make menuconfig -------------------------------- This for xen virtualiaztion support Go into Processor type and features Statically enable all XEN features Go back to the  main menu and enter Device Drivers menu, then enter block devices menu Statically enable the 2 XEN options Go back to the Device Drivers menu and go down to XEN driver suppport Statically enable all features Go back to Device Drivers, go into Network device support and statically enable the 2 XEN options at the bottom Exit out and save. ----------------------------------- But you run directly " make menuconfig " & save, it creates new .config file. But if you copied the config-`uname -r` file to /usr/src/linux-3.13.6 and run " make menuconfig ". Now it included the new entries[e.g xen support] in t...