Friday, April 12, 2013

Create Local/Network Repo in Scientific Linux 6.3


mount /dev/sr0 /mnt/ 

install vsftpd package, so that we can use this as a FTP server to share our repository in the client systems.

Change to the directory where you mounted Scientific Linux DVD. In our example we have mounted the DVD

DVD in /mnt directory.

    # cd /mnt/Packages
    # rpm -ivh vsftpd-2.2.2-11.el6.i686.rpm


Start the FTP Service:

    # service vsftpd start

install createrepo package if it is not installed. This is package is used to create our local 

repository.

    # rpm -ivh createrepo-0.9.8-5.el6.noarch.rpm

Oops!! It shows us the dependency problem. Let us the install missing dependencies first:

    # rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm 

Then install the another one:

    # rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm

Now install the createrepo package:

Create a folder called yumserver (You can use your own) in /var/ftp/pub directory to save 

all the packages from the Scientific Linux DVD. Copy all the files in the Packages folder from the DVD to 

/var/ftp/pub/yumserver folder:

    # mkdir /var/ftp/pub/yumserver
    # cp -ar *.* /var/ftp/pub/yumserver


it will take a while to copy all the packages in the DVD. Please be patient. After all packages are copied, create a repo file called yumserver.repo in /etc/yum.repos.d/ directory.

    # nano /etc/yum.repos.d/yumserver.repo

[localyumserver]
name="my local repository"
baseurl=file:///var/ftp/pub/yumserver
gpgcheck=0
enabled=1


Where,
[localyumserver] ==> Name of the Local Repository.
comment ==> Information about the Repository.
baseurl ==> Path of the Repository (i.e where we had copied the contents from Scientific Linux DVD)
gpgcheck ==> Authentication of the Repository, which is disabled in our case.

Now it is time to create our repository. Enter the following command in the Terminal:

    # createrepo -v /var/ftp/pub/yumserver

Now the local YUM repository creation process will begin. 

Note: Delete or rename all the other repo files except the newly created repo file i.e in our 

example it is localyumserver.repo. 
Next update the repository:

        yum clean all
        yum update

You’re done now.

Client side configuration:

Create a repo file in your client system as mentioned above in the /etc/yum.repos.d/ directory 

and remove or rename the existing repositories. Then modify the baseurl as mentioned below:

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://myserver.domain.com/pub/yumserver
gpgcheck=0
enabled=1 

    (or)

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://192.168.10.101/pub/yumserver
gpgcheck=0
enabled=1


source:http://ostechnix.wordpress.com/2013/01/05/setup-local-yum-server-in-centos-6-x-rhel-6-x-scientific-linux-6-x/ 

Two Important chkconfig command



chkconfig --list vsftpd

chkconfig --level 35 vsftpd on

Sunday, March 31, 2013

Learning unix basics on OpenSolaris 2009 part2




You can also use Ctrl +R to search (backward) through the history.

You can capture the output from a c ommand in a n e nv ironment variable using back-ticks:
$ TIME =`date`

$ echo $TIME

Sun Mar 31 21:56:03 IST 2013


As on most UNIX-like systems, each user on OpenSolaris has a home directory. Your home
directory path is stored in the HOME environment variable. You can also use the tilde character
(~) to navigate to your home directory or to another user’s home directory. The tilde alone
implies the current user’s home directory. The following code shows how to navigate to home
directories:

$ cd ~
$ pwd
/export/home/sourav
$ cd ~sougata
$ pwd
/export/home/sougata

This example also demonstrates that the pwd command shows your current working directory.


Wednesday, March 27, 2013

Learning unix basics on OpenSolaris 2009


If you end a command line with a backslash, bash lets you continue the command on the next
line. This feature is useful for entering lengthy commands:

$ touch \

> file1

ctrl+a to take the cursor to the beginning of the line

ctrl+e to take the cursor at the end of the line

Alt+F and Alt+B move forward 

and backward, respectively, on a word-by-word, instead of character-by-character.

from the beginning of the line Ctrl+K will cut the line and at the end of the line Ctrl+Y to 
paste are the same line as in emacs .

to get a list of all the commands in your path
that start with ‘‘fil,’’ type fil and press Tab twice:
$ file

bash first completed the word up to file (because there were no commands starting with fil
that didn’t have an e next), and then provided a list of possibilities with the second Tab.


file file-roller filesync
$ file


$ history

1ls

2ls-a

3 pwd

4 whoami

5 touch testfile

6 which gcc

7 which cc

8 rm testfile

9 history

history an integer argument to see only that number of previous commands:

$ history 2

12 date

13 history 2

To Execute a command in the history, use ! . To execute the previous com-
d, use the !! shortcut:

$ !4

whoami

test

$ date

Thu Mar 28 00:08:13 IST 2013


$ !!

date

Thu Mar 28 00:08:13 IST 2013

you can see the environment variables by the command

declare

or you can use the command

set


You can print the values of the environment variables using the echo or printf commands,
accessing the value of the variable by prefixing it with the usual $ character:

$ echo $SHELL

/bin/bash

$ printf ’’$PATH \n’’

/usr/bin

Set the value of an environment variable with an assignment statement. The following example
sets the shell history size to 1,000:

$ echo $HISTSIZE

500

$ HISTSIZE =1000

$ echo $HISTSIZE

1000

Use the which command to see which version of a command you are executing
based on your path:

$ which grep
/usr/gnu/bin/grep
$ which xterm
/usr/X11/bin/xterm
$ which which
/usr/gnu/bin/which

The user created by the installer is set up with the following path:

$ echo $PATH

/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin


Directory Description

/usr/bin The default directory for commands; contains utilities such as grep and
tr , a pplications such as firefox and thunderbird , shells such as
bash and zsh , and myriad other commands

/usr/ccs/bin Traditionally System V development tools, but these have mostly moved
to /usr/bin

/usr/gnu/bin The GNU versions of commands; slightly different versions of many of
them are also found in /usr/bin

/usr/sbin The system tools, commands, and daemons, such as zfs , dumpadm ,
in.routed , and others. These are generally privileged commands.

/usr/sfw/bin Traditionally the Sun Freeware (mostly GNU) tools, but almost all of
these have been moved to /usr/bin , with symlinks left here; or
symlinks have been added to /usr/bin

/usr/ucb Traditiona lly the BSD tools, but these have been moved to / usr/bin ,
with only a few symlinks left here

/usr/X11/bin X11 commands, such as xterm , xhost , and others
/usr/openwin/bin;
/usr/X/bin;
/usr/X11R6/bin
Aliases for /usr/X11/bin
/usr/xpg4/bin Ve rsions of some of the tools that adhere to the POSIX standard, where
the versions in /usr/bin don’t

/bin Alias for /usr/bin

/sbin System tools and utilities required for booting and possibly recovering
the system if /usr is not mounted. These are generally privileged
commands.


Add a location to your path

$ PATH =$PATH:/export/home/sourav/personal/data
$ echo $PATH

this folder /export/home/sourav/personal/data will be show and any executable file there can be 

invoked directly,the executable permission has to be set though


Install Vmware Tools in OpenSolaris 2009


To install vmware tools successfully

you need to copy the vmware-solaris-tools.tar.gz in a directory(for me it is /tmp/sourav)

then 

cd /tmp/sourav

gunzip -dc vmware-solaris-tools.tar.gz | tar xvf - 

or

Decompress the file using gunzip command. For example:

# gunzip vmware-solaris-tools.tar.gz


Extract the contents of the tar file with the command:

# tar xvf vmware-solaris-tools.tar 

then 

 cd vmware-tools-distrib


To install VMware Tools, run this command from the directory you changed to in step 7:

 ./vmware-install.pl


Check if VMware tools service is running with the command:

 /etc/init.d/vmware-tools status

The output is similar to:

vmtoolsd is running

Add vmware-toolbox to the list of startup commands of your desktop.



for my opensolaris(2009)

it is in 

Preference-Sessions

Click Startup Programs tab and add these entries:

/ usr/bin/vmware-user

/usr/bin/vmware-toolbox 

source:http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1023956