Posts

Showing posts from November, 2013

Searching Files with grep

grep prints lines from files which match a pattern For example, to find an entry in the password file /etc/passwd relating to the user ‘nancy’: $ grep nancy /etc/passwd  grep has a few useful options: - i stands for upper/lower case (optional in your case) -r searches through files in specified directories, recursively -l prints just the names of files which contain matching lines(  stands for "show the file name, not the result itself`. ) -c prints the count of matches in each file -n numbers the matching lines in the output -v reverses the test, printing lines which don’t match R stands for recursive. Patter  Matching Use grep to fid patters, as we as simple  strings   Patters are expressed as reguar expressios grep -Ril "text-to-find-here" /   Certain punctuation characters have special  meaning   For example this might be a better way to search for acy’s etry i the password fie: $ grep ’ˆacy’ /etc/passwd   Th

How to enable TUN/TAP for OpenVZ server

SolusVM requires the TUN/TAP kernel module to be loaded for the TUN/TAP feature to work properly. To enable the TUN/TAP kernel module run this on the host node: Code: Select all #modprobe tun To check if it’s loaded run: Code: Select all # lsmod | grep tun If you see an output the module is loaded i.e: Code: Select all tun                    17536  0 Too automatically load the module on boot run these commands on the host node: Code: Select all echo modprobe tun >> /etc/rc.modules chmod +x /etc/rc.modules OpenVZ supports VPN inside a container via kernel TUN/TAP module and device.  To allow VPS #205 to use the TUN/TAP device the following should be done: #205 – VPS id. Replace 205 with your VPS id. Make sure the tun module has already loaded on the Node. [root@Node /]#  lsmod | grep tun If not listed, then load the tun module with the below command [root@Node /]# modprobe tun [root@Node /]#  lsmod | grep tun   tun