Introduction To C Language | part 2



Introduction To C Language | part 1



Overview of C Language | Theory 1




Structure of a rpm package and rpm commands




RPM stands for RED-HAT Package Manager.


1. Structure of a .rpm packages:-



2. Arctecture type:-
a) x86 = i386 for 32 bit of motherboards.
b) x64_x86 = i686 for 64 bit of motherboards.


3.Working with RPM packages :-
rpm –ivh telnet.2.5.6-i386.rpm
options
      1. –i [install pkgs]
      2. –h [it generate hash while installation of pkgs]
      3. –v [verbose{means it show the output}]
      4. –V [verifying pkgs ]
      5. –e or --replacepkgs [uninstall or remove]
      6. –q [to check]
      7. –Urh [upgrade]
      8. –K [check sing. Of the pkgs]
      9. –F [sometimes –U install the pkgs ,if you want to upgrade use –F ]
      10. --test [to check pkgs]
     11. --nodeps [install or upgrade the pkgs without checking dependencies]
     12. --noscripts [do not executes any of the script before or after installation,upgrade or removal]
     13. --excludedocs [do not install pkgs marked as docs ,file such as man pages]
     14. –oldpackage [allow a pkg to be replaced with old one]


4. RPM verification codes:-
1. S - file size has changed
2. M - mode change include file perm & type.
3. 5 - MD5 sum has changed.
4. D - device major or minor no. has changed.
5. L - the path of symbolic link has changed.
6. U - owner of file has changed.
7. G - group of file has changed.
8. T - last modified time has changed


5. More options:-
1. -qc [to see conf.files]
2. -qd [to see doc. Files]
            3. -q --changelog [each time pkg is change : to see pkg log files]
          
            4. --q –changelog –p full structure of .rpm [-p shows the full path or relative path to the pkg file]
           
            5. -qF or –freshen [only upgrade]



Use Red Hat Enterprise Linux Installation DVD as a Software Repository in RHEL-5x & 6x



Use a Red Hat Enterprise Linux installation DVD as a base software repository in RHEL-5x & 6x, either in the form of a physical disc, or in the form of an ISO image file.

  • If you are using a physical DVD, insert the disc into your computer.
  • Create a mount point for the repository:

[root@yum6 ~]# mkdir /home/repo

  • where /home/repo is a location for the repository, for example,
  • Mount the DVD on the mount point that you just created.

[root@yum6 ~]# mount /dev/cdrom /home/repo/

  • If you are using an ISO image file of a disc, mount the image file like this:

[root@yum6 ~]# mount -o loop /var/ftp/pub/rhel6.iso /home/repo/

  • If you are not sure whether a storage device is mounted, run the mount command to obtain a list of current mounts. If you are not sure of the device name or partition number of a storage device, run fdisk -l and try to identify it in the output.
  • Create a new repo file in the /etc/yum.repos.d/ directory. The name of the file is not important, as long as it ends in .repo.

[root@yum6 ~]# vi /etc/yum.repos.d/ser.repo 


[server]
name=pkgs
baseurl=file:///home/repo/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


  •  save the file
  • Now check your base repository with following command.


[root@yum6 ~]# yum list | grep bind*

[root@yum6 ~]# yum install bind -y



How to fix “GNOME 3 Failed to Load” Error in FEDORA 16




  • when I Install & start fedora first time, I see this error.




Step to fix this error.

  • open terminal  >> Create a directory


[Yogesh@client ~]$ mkdir .config/autostart/

  • Now create a file in .config/autostart/ directory.

[Yogesh@client ~]$ vi .config/autostart/gnome3.desktop


[Desktop Entry]
Type=Application
Exec=gnome-shell --replace
Hidden=false
NoDisplay=false
X-Gnome-Autostart-enabled=true
Name[en_US]=Gnome Shell
Name=Gnome Shell
Comment[en_US]=
Comment=

  • Save & exit from file.

  • Now logout & then login again, U will see your cool gnome3 desktop.


DNS-SERVER & DNS-RECORDS



DNS is the Domain Name System. DNS converts machine names to the IP addresses that
 all machines on the net have. It translates (or "maps") from name to address and from address
 to name, and some other things. A mapping is simply an association between two things,
 in this case a machine name, like ftp.domainname.org, and the machine's IP number
 (or address) 192.168.X.X. DNS also contains mappings the other way, from the IP number
 to the machine name; this is called a "reverse mapping".  DNS is a directory of resource
 records organized as a tree.



DNS Records



Records Description
1.A {Address} records
DNS A resource records map host names to their 32 bit IPv4 address.
The A record mainly associate a hostname with an IP address,
 It also used for storing subnet mask.
2.AAAA records
DNS AAAA resource records map hostnames to their
128 bit IPv6 address.
3.PTR
{pointer} records
DNS PTR resource records map IP address to their
corresponding hostname. The most common use is for
implementing reverse DNS lookups.
4.CNAME
{canonical name} records
DNS CNAME resource records denote the “canonical name”.
It create an Alias of one name to another which maps a name
to another hostname which has an A or AAAA records.
 This helps when running multiple services {like a FTP
 server & a web server, each running on different posts}
 from a single IP address. Each service can have its own entry in
DNS server {like ftp.domainname.com.& www.domainname.com .}.
 Network administrators also use CNAMEs when running
multiple HTTP servers on the same port, with different names,
on the same physical host. The DNS lookup will continue
by retrying the lookup with the new name.
5.DNAME
{delegation name} records
DNAME creates an alias for a name and all its sub-names,
unlike CNAME, which aliases only the exact name in its
 label. Like the CNAME record, the DNS lookup will continue
 by retrying the lookup with the new name.
5.MX records
DNS MX resource records denote the “MAIL EXCHANGER”.
 It used to maps a domain name to a list of message transfer agents
 {MTAs} for that domain. The MX records specifies a
 mail server responsible for accepting email messages on
 behalf of a recipient’s domain and a preference value used to
 prioritize mail delivery if multiple mail servers are available. 
The set of MX records of a domain name specifies how
 email should be routed with the Simple Mail Transfer Protocol
 {SMTP}.
6.NS records
DNS NS resource records denote the authoritative name
 server for a domain. All public masters & slave servers 
should have a NS record for the domains zones they manage.
7.SOA records
{start of authority record}
Specifies authoritative information about a DNS zone, including
 the primary name server, the email of the domain administrator
, the domain serial number, and several timers relating to refreshing
 the zone.





SAMBA PASSWORD {smbpasswd}





    The smbpasswd program has several different functions, depending on whether it is run by the root user or not. When run as a normal user it allows the user to change the password used for their SMB sessions on any machines that store SMB passwords.

     By default (when run with no arguments) it will attempt to change the current user´s SMB password on the local machine. This is similar to the way the passwd program works. smbpasswd differs from how the passwd program works however in that it is not setuid root but works in a client-server mode and communicates with a locally running smbd. As a consequence in order for this to succeed the smbd daemon must be running on the local machine. On a UNIX machine the encrypted SMB passwords are usually stored in the smbpasswd file.

     When run by an ordinary user with no options, smbpasswd will prompt them for their old SMB password and then ask them for their new password twice, to ensure that the new password was typed correctly. No passwords will be echoed {seen} on the screen whilst being typed. If you have a blank SMB password (specified by the string "NO PASSWORD" in the smbpasswd file) then just press the <Enter> key when asked for your old passwd.

     smbpasswd can also be used by a normal user to change their SMB password on remote machines, such as Windows NT Primary Domain Controllers.

     When run by root, smbpasswd allows new users to be added and deleted in the smbpasswd file, as well as allows changes to the attributes of the user in this file to be made. When run by root, smbpasswd accesses the local smbpasswd file directly, thus enabling changes to be made even if smbd is not running.


Smbpasswd Options



No. Options Description
1. -a This option specifies that the username should be added to the local
 smbpasswd file, with the new password typed
 (type <Enter> for the old password).
2. -x This option specifies that the username should be deleted from
 the local smbpasswd file.
3. -d This option specifies that the username should be disabled in the
 local smbpasswd file.
4. -e This option specifies that the username should be enabled in the
 local smbpasswd file, if the account was previously disabled.
 If the account was not disabled this option has no effect.
5. -n This option specifies that the username should have their password
 set to null (i.e. a blank password) in the local smbpasswd file.
6. -L This specifies the username for all of the root only options to operate on.
 Only root can specify this parameter as only root has the permission
 needed to modify attributes directly in the local smbpasswd file.



Some examples



     Deepti now needs to be allocated a password for accessing the Samba server. Remember, this is a separate password to her UNIX account any may be different if necessary.

[root@lan ~]# smbpasswd -a deepti
New SMB password:
Retype new SMB password:
Added user deepti.
[root@lan ~]#



The above command adds (-a) an entry into the "smb password file" and encrypts the password. Type "smbpasswd deepti" to simply change passwords.



     deepti can now access the server over the network, however there are still no shares defined.



[root@lan ~]# grep deepti /etc/samba/smbpasswd
deepti:501:96E0D1709FC223FAAAD3B435B51404EE:D27916F620BA786CE3EF222565D6F691:[U          ]:LCT-4F4E7754:
[root@lan ~]#



###################################################