- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Tips & Tricks
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2003 10:16 PM
01-23-2003 10:16 PM
Unix is a thrilling experience and everyday we discover new tips and tricks for problem solving.
Please post your discoveries here, for they shall throw light for others and reach eternity.
regards,
U.SivaKumar
"Expert is one who learns more and more about less and less" - forgot author's name :-)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2003 11:47 PM
01-23-2003 11:47 PM
Solutionlast week we had a build to be performed by our developement team on Tru64 V5.0(particularly)
In our lab we have implemented AFS, we are not using NIS due to security reasons.
There is no AFS client s/w for Tru64 5.0
It was a tough task thrown to me. I had installed AFS client s/w for Tru64 v5.1 on Tru64 v 5.0. I could start AFS daemons and able to mount AFS directories, but no users are not able to authenticate using AFS id.
After a long R&D with AFS server and Tru64 i came to a conclusion to craete local users and simulate usesr AFS home directories.
for this in usesr profile file we need to add two lines
klog
cd /
(klog will authenticate user to AFS server)
this solved my problem.
This soultion is implemented across all our Labs at UK and US
( In fact i got appreciation for this)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 12:25 AM
01-24-2003 12:25 AM
Re: Tips & Tricks
time ./string
where number is something like 1000000
Gives you a time in seconds for it to do the 1000000 string manipulations and when you run it on different cpu speed servers, or different flavours of unix you get a nice benchmark. One thing to note - linux runs this a lot faster (on same speed intel cpu) than HP-UX - and any cpu with level3 cache (Mac OS X or Xeon processors) runs it tons faster!
vert interesting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 12:37 AM
01-24-2003 12:37 AM
Re: Tips & Tricks
Now for the tips-n-tricks, I posted a script a few days ago, that shows about everything asked in the FAQ in one single line. I've attached the greatly improved version here. Optimizations can still be done (e.g. use options to uname instead of uname -a)
It gives me great insight in what systems my customers have, because they often don't even know themselves. [ On HP-UX you need root permission to get *all* info ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 02:11 AM
01-24-2003 02:11 AM
Re: Tips & Tricks
trying this perl benchmark module but keep getting an error about a later version of benchmark needed. Even after I downloaded and tried your Perl 5.8.0 same problem;
Benchmark 3 required--this is only version 1.04 (/opt/perl/lib/5.8.0/Benchmark.pm) at /usr/local/bin/b.pl line 3
Where can I get Benchmark 3 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 02:18 AM
01-24-2003 02:18 AM
Re: Tips & Tricks
For myself, this is a small subset of what I've picked up from the Forums since signing up last year (in no particular order)
- various little tweaks to scripting, increasing my sed/awk skills. Too numerous to cover in depth.
- the usage of the -k option on lvreduce (only had to use it once [SO FAR], but it saved me a lot of pain)
- the introduction to perl!! I have to admit that I've only played around with it so far, but I can see the potential in there.
- the telnetd options of -TCP_DELAY, or -s/-z used in combination. This fixed a major performance issue that we had when we started upgrading to HP-UX 11
One suggestion I would offer to others - set up a text document on your Windoze desktop, and just paste anything into it that you see on the Forums and other sources that you think is useful/interesting. I've done this for quite some time (starting in my pre-forums days), and you quite quickly build up a repository of valuable information (that's available even when you can't get onto the web).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 02:33 AM
01-24-2003 02:33 AM
Re: Tips & Tricks
Here's my example script:
--8<--- bench.pl
use Benchmark;
$string = $string = 'all that glitters ';
timethese (-0.40, {
'cont' => ' $foo = $string; ',
'plus' => '($foo = $string) =~ s/\s+$//; ',
'star' => '($foo = $string) =~ s/\s*$//; ',
'^pls' => '($foo = $string) =~ s/^(.*)\s+$//; ',
'^str' => '($foo = $string) =~ s/^(.*)\s*$//; ',
'^*?+' => '($foo = $string) =~ s/^(.*?)\s+$/$1/; ',
'^*?*' => '($foo = $string) =~ s/^(.*?)\s*$/$1/; ',
});
timethese (50_000, {
'cont' => ' $foo = $string; ',
'plus' => '($foo = $string) =~ s/\s+$//; ',
'star' => '($foo = $string) =~ s/\s*$//; ',
'^pls' => '($foo = $string) =~ s/^(.*)\s+$//; ',
'^str' => '($foo = $string) =~ s/^(.*)\s*$//; ',
'^*?+' => '($foo = $string) =~ s/^(.*?)\s+$/$1/; ',
'^*?*' => '($foo = $string) =~ s/^(.*?)\s*$/$1/; ',
});
-->8---
And it's output:
Benchmark: running ^*?*, ^*?+, ^pls, ^str, cont, plus, star for at least 0.4 CPU seconds...
^*?*: 1 wallclock secs ( 0.42 usr + 0.00 sys = 0.42 CPU) @ 27304.76/s (n=11468)
^*?+: 1 wallclock secs ( 0.41 usr + 0.00 sys = 0.41 CPU) @ 32275.61/s (n=13233)
^pls: 0 wallclock secs ( 0.46 usr + 0.00 sys = 0.46 CPU) @ 93493.48/s (n=43007)
^str: 2 wallclock secs ( 0.43 usr + 0.00 sys = 0.43 CPU) @ 100016.28/s (n=43007)
cont: 3 wallclock secs ( 0.43 usr + 0.00 sys = 0.43 CPU) @ 800146.51/s (n=344063)
plus: 1 wallclock secs ( 0.43 usr + 0.00 sys = 0.43 CPU) @ 168451.16/s (n=72434)
star: -1 wallclock secs ( 0.44 usr + 0.00 sys = 0.44 CPU) @ 60150.00/s (n=26466)
Benchmark: timing 50000 iterations of ^*?*, ^*?+, ^pls, ^str, cont, plus, star...
^*?*: 3 wallclock secs ( 1.84 usr + 0.00 sys = 1.84 CPU) @ 27173.91/s (n=50000)
^*?+: 3 wallclock secs ( 1.60 usr + 0.00 sys = 1.60 CPU) @ 31250.00/s (n=50000)
^pls: 1 wallclock secs ( 0.53 usr + 0.00 sys = 0.53 CPU) @ 94339.62/s (n=50000)
^str: 1 wallclock secs ( 0.50 usr + 0.00 sys = 0.50 CPU) @ 100000.00/s (n=50000)
cont: 0 wallclock secs ( 0.06 usr + 0.00 sys = 0.06 CPU) @ 833333.33/s (n=50000)
(warning: too few iterations for a reliable count)
plus: 1 wallclock secs ( 0.30 usr + 0.01 sys = 0.31 CPU) @ 161290.32/s (n=50000)
(warning: too few iterations for a reliable count)
star: 2 wallclock secs ( 0.84 usr + 0.00 sys = 0.84 CPU) @ 59523.81/s (n=50000)
l1:/pro/3gl/CPAN 128 > grep VERSION /pro/lib/perl5/*/Benchmark.pm
/pro/lib/perl5/5.6.1/Benchmark.pm:$VERSION = 1.00;
/pro/lib/perl5/5.8.0/Benchmark.pm:$VERSION = 1.04;
/pro/lib/perl5/5.9.0/Benchmark.pm:$VERSION = 1.0501;
l1:/pro/3gl/CPAN 129 >
Did you (by accident) do something like:
use Benchmark 3;
which would require Benchmark version 3 :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 02:41 AM
01-24-2003 02:41 AM
Re: Tips & Tricks
your example works fine. I was using the example from the manpage which caused the error.
Cheers,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 03:53 AM
01-24-2003 03:53 AM
Re: Tips & Tricks
Pete
"Reality is just an illusion, albeit a rather persistent one"
Albert Einstein
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 05:31 AM
01-24-2003 05:31 AM
Re: Tips & Tricks
?? FAQ script now available on https://www.beepz.com/personal/merijn/ or http://www.cmve.net/~merijn/
?? HP FAQ page is alive again (http://faqs.org/faqs/hp/hpux-faq/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 05:50 AM
01-24-2003 05:50 AM
Re: Tips & Tricks
I.E. I use a functions file on all systems, and have added many other functions to it. By pre-building things, it is a huge shortcut, and saves re-inventing the wheel.
Command monitoring:
Many times using commands you will run them repeatedly to either monitor the system, or to reproduce errors.
Loop in ksh/POSIX/sh
set -i
I=1
while [ $I -lt 2 ] ; do
done
Loop in csh
set I=1
while ( $I < 2 )
end
Alot of sysadmins dont realize you can fill these loops with all kinds of goodies.
Checking for empty AND non-existant variables can be a pain in the butt on some OS's. To check for these variables, use a descriptive attachment which catches both.
if [ "${somevar}x" = "x" ] ; then
echo "it's empty or not set"
fi
One of the biggest things I teach people is that most Unices are very much alike. I.E. HP-UX uses /sbin/init.d for boot/init scripts. This is also true for Irix. Solaris, and Linux use /etc/init.d. Other than the directory difference, the scripts work just the same.
In my opinion, the more you can use UNIX and not a "SAM", "Smit", "Admintool", etc.. the more you can walk to another type of Unix and do a job. You will always be specialized in 1 or 2 flavors, but Admins should be able to perform basic tasts in any Unix.
I.E. use "useradd" over Sam. While Solaris uses a shadow file, and does things a bit differently "useradd" works as it should on any Unix.
Regards,
Shannon
ps. Steffan, you made the comment that linux runs your program faster. This will be true for most non-floating point operations, of which string manipulation is. RISC shines most brightly in I/O performance, Floating point, and Multitasking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 05:59 AM
01-24-2003 05:59 AM
Re: Tips & Tricks
I have found two problem solving techniques quite useful. One is the search itrc forums for the error message method. I used it twice yesterday to refresh my memory on how to use some commands I use only once or twice a year.
The second is what I call "playing computer"
That involves getting away from the computer and mapping out how a complex process works. How does the system do the job. You sometimes need to look at scripts for reference, but it helps fill in the gaps.
Example: We couldn't figure out why a connection via a wan was dropping out during the middle of the day.
Everybody else was staying connected to our system so we knew it was solid. So we got in a room with a whiteboard and basically pretended to be an IP packet. We did a virtual traceroute and someone in Network administration pointed out we were missing a step.
An old, forgotten Cisco router that hadn't had an ios update in four or five years. We also discovered that that very same router was not on an unprotected circuit and was suffering low voltage when some part of the external LAN's heating and cooling plant kicked on.
The router was replaced, put on a UPS and the problem went away.
P
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com