Friday, November 28, 2008

How to give sudo permissions

Login to unix box
Use sudo –l to see what sudo commands you have access to.. just for a check.
Then do visudo OR vi /etc/sudoers .You will need root access to edit the files. either you have sudo all access Or you know the root password Or you can su to root with sudo or normal.

Edit the file with correct syntax.
E.g
Add the below line for sudo all access
ALL=ALL
Add the below line for giving sudo access to apachectl binary without asking for password
ALL=NOPASSWD: /apps/apache/bin/apachectl
Save and quit.
Now test your sudo permissions.

Sunday, November 9, 2008

force perl to use gcc

As my USB Disk got lost ...and all my pics ...everything got missed..
And now  I have decided to put all my tips and tricks on my blog..and Thank god ..this site is not restricted in my company's network..
(uname prtconf)

Force perl Makefile.pl to use gcc to get rid of the message "Optional software packages not installed" while using cc
$ sudo find . -name perlgcc
Password:
./usr/perl5/5.8.4/bin/perlgcc./usr/perl5/5.6.1/bin/perlgcc
$echo $PATH
/bin:/usr/bin:/usr/sbin:/etc:/usr/local/bin:/usr/local/sbin:/sbin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/vnc:/usr/sfw/lib:/usr/sfw/bin:/bin:/opt/app/oracle/bin:.:/opt/app/oracle:/opt/app/oracle/bin:/opt/app/oracle/lib
$ perl -v
This is perl, v5.8.4 built for sun4-solaris-64int(with 29 registered patches, see perl -V for more detail)
Copyright 1987-2004, Larry Wall
Perl may be copied only under the terms of either the Artistic License or theGNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found onthis system using `man perl' or `perldoc perl'. If you have access to theInternet, point your browser at http://www.perl.com/, the Perl Home Page.
$ export PATH=$PATH:/usr/perl5/5.8.4/bin
$ which perlgcc
/usr/perl5/5.8.4/bin/perlgcc
$cd
$ cd DBI-1.607
$ rm Makefile
perlgcc Makefile.pl
make OR sudo make
make test OR sudo make test
make test TEST_VERBOSE=1 (if any of the t/* tests fail)
make install (if the tests look okay) OR sudo make install

Do the following to resolve the error "Can't locate loadable object for module DBI"
$ sudo chmod -R 755 *
Password:
/usr/perl5/5.8.4 >
$ pwd
/usr/perl5/5.8.4

/usr/perl5/site_perl/5.8.4 >
$ sudo chmod -R 755 sun4-solaris-64int
/usr/perl5/site_perl/5.8.4 >