Tuesday, June 30, 2009
Park wrapper error
/etc/usrdomains
/etc/localdomains
/etc/named.conf
/etc/valiases
/etc/vdomainaliases
http.conf
/var/named/
Important Directories in Linux
* /bin - essential UNIX commands such as ls, etc. Should contain all binaries needed to boot the system or run it in single-user mode
* /boot - files used during booting and possibly the kernel itself are stored here
* /dev - contains device files for various devices on system
* /etc - files used by subsystems such as networking, NFS, and mail. Includes tables of disks to mount, processes to run on startup, etc.
* /etc/profile.d - contains scripts that are run by /etc/profile upon login.
* /etc/rc.d - contains a number of shell scripts that are run on bootup at different run levels. There is also typically an rc.inet1 script to set up networking (in Slackwar), an rc.modules script to load modular device drivers, and an rc.local script that can be edited to run commands desired by the administrator, along the lines of autoexec.bat in DOS.
* /etc/rc.d/init.d - contains most of the initialization scripts themselves on an rpm-based system.
* /etc/rc.d/rc*.d - where ``*'' is a number corresponding to the default run level. Contains files for services to be started and stopped at that run level. On rpm-based systems, these files are symbolic links to the initialization scripts themselves, which are in /etc/rc.d/init.d.
* /etc/skel - directory containing several example or skeleton initialization shells. Often contains subdirectories and files used to populate a new user's home directory.
* /etc/X11 - configuration files for the X Window system
* /home - home directories of individual users
* /lib - standard shared library files
* /lib/modules - modular device driver files, most with .o extensions
* /mnt - typical mount point for many user-mountable devices such as floppy drives, cd-rom readers, etc. Each device is mounted on a subdirectory of /mnt.
* /proc - virtual file system that provides a number of system statistics
* /root - home directory for root
* /sbin - location of binaries used for system administration, configuration, and monitoring
* /tmp - directory specifically designed for programs and users to store temporary files.
* /usr - directory containing a number of subdirectory with programs, libraries, documentation, etc.
* /usr/bin - contains most user commands. Should not contain binaries necessary for booting the system, which go in /bin. The /bin directory is generally located on the same disk partition as /, which is mounted in read-only mode during the boot process. Other filesystems are only mounted at a later stage during startup, so putting binaries essential for boot here is not a good idea.
* /usr/bin/X11 - most often a symbolic link to /usr/X11R6/bin, which contains executable binaries related to the X Window system
* /usr/doc - location of miscellaneous documentation, and the main location of program documentation files under Slackware
* /usr/include - standard location of include files used in C programs such as stdio.h
* /usr/info - primary location of the GNU info system files
* /usr/lib - standard library files such as libc.a. Searched by the linker when programs are compiled.
* /usr/lib/X11 - X Window system distribution
* /usr/local/bin - yet another place to look for comon executables
* /usr/man - location of manual page files
* /usr/sbin - other commands used by superuser for system administration
* /usr/share - contains subdirectories where many installed programs have configuration, setup and auxiliary files
* /usr/share/doc - location of program documentation files under Mandrake and Red Hat
* /usr/src - location of source programs used to build system. Source code for programs of all types are often unpacked in this directory.
* /usr/src/linux - often a symbolic link to a subdirectory whose name corresponds to the exact version of the Linux kernel that is running. Contains the kernel sources.
* /var - administrative files such as log files, used by various utilities
* /var/log/packages - contains files, each of which has detailed information on an installed package in Slackware. The same file can also be found at /var/adm/packages, since the adm subdirectory is a symbolic link to log. Each package file contains a short description plus a list of all installed files.
* /var/log/scripts - package installation scripts in Slackware are stored here. You can inspect these scripts to see what special features are included in individual packages.
* /var/spool - temporary storage for files being printed, mail that has not yet been picked up, etc
Linux-Overview
Back in August of 1991, a student from Finland began a post to the comp.os.minix newsgroup with the words
Hello everybody out there using minix -I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.
The student was Linus Torvalds, and the "hobby" he spoke of eventually became what we know today as Linux.
A full-featured POSIX-like operating system, Linux has been developed not just by Linus, but by hundreds of programmers around the world.
Wednesday, June 24, 2009
Script For DNS forwarding of all accounts under a RESELLER Account
Written By Nazeem S
Copy the bellow content and put it in file called "updateResellerDNS.sh" and give permission 755(executable) then run it (sh updateResellerDNS.sh or ./updateResellerDNS.sh)
############# Starting ########################
###############NAZEEM S####################
#############################################
#! /bin/bash
>/var/log/updateResellerDNS.log
>user
>domains
echo -n "Enter Reseller Account Name:--- "
read a
echo -n "Enter IP to be Changed (Source IP):--- "
read b
echo -n "Enter the New IP (Destination IP):--- "
read c
grep $a /etc/trueuserowners |cut -d ':' -f1|sort >user
for i in `cat user`
do
cat /etc/userdomains|grep $i |cut -d: -f1|sort >>domains;
done
for x in `cat domains`
do
ls /var/named/ |grep $x|sort >>updateResellerDNS.log;
done
for y in `cat updateResellerDNS.log`
do
#replace '$b' '$c' --/var/named/$y;
sed -i 's/$b/$c/g' /var/named/$y;
echo "$y---------------- converted"
done
export c=`cat updateResellerDNS.log | wc -l`
echo "Total count of zone files has been updated = $c"
echo "log file on /var/log/updateResellerDNS.log"
#############################################
###############NAZEEM S####################
############### Ending #######################
Monday, June 22, 2009
GREP _ the most useful command
grep command syntax
grep 'word' filename
grep 'string1 string2' filename
cat otherfile | grep 'something'
command | grep 'something'
Use grep to search file
Search /etc/passwd for boo user:
$ grep boo /etc/passwd
You can force grep to ignore word case i.e match boo, Boo, BOO and all other combination with -i option:
$ grep -i "boo" /etc/passwd
Use grep recursively
You can search recursively i.e. read all files under each directory for a string "192.168.1.5"
$ grep -r "192.168.1.5" /etc/
Use grep to search 2 different words
use egrep as follows:
$ egrep -w 'word1|word2' /path/to/file
Count line when words has been matched
grep can report the number of times that the pattern has been matched for each file using -c (count) option:
$ grep -c 'word' /path/to/file
Also note that you can use -n option, which causes grep to precede each line of output with the number of the line in the text file from which it was obtained:
$ grep -n 'word' /path/to/file
Grep invert match
You can use -v option to print inverts the match; that is, it matches only those lines that do not contain the given word. For example print all line that do not contain the word bar:
$ grep -v bar /path/to/file
Colour
Finally, you can force grep to display output in colors:
$ grep --color vivek /etc/passwd
list file name
Use the -l option to list file name whose contents mention main():
$ grep -l 'main' *.c