home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8291 < prev    next >
Encoding:
Text File  |  1992-07-29  |  15.0 KB  |  441 lines

  1. Xref: sparky comp.unix.aix:8291 bit.listserv.aix-l:1273
  2. Path: sparky!uunet!mcsun!Germany.EU.net!unido!gate!g6150e!afx
  3. From: afx@muc.ibm.de (Andreas Siegert)
  4. Newsgroups: comp.unix.aix,bit.listserv.aix-l
  5. Subject: AIXTIPS NEWS 92221
  6. Message-ID: <1992Jul29.115025.15564@muc.ibm.de>
  7. Date: 29 Jul 92 11:50:25 GMT
  8. Sender: news@muc.ibm.de (Newsagent-g6150)
  9. Reply-To: aixtips@ibm.de
  10. Followup-To: comp.unix.aix
  11. Organization: IBM AIX Field Support Center, Munich
  12. Lines: 428
  13.  
  14. Sorry for the late delivery but I was far away from my Internet connection
  15. for a while.
  16.  
  17. This is AIXTIPS NEWS for customers released at Fri the 03. Jul 1992.
  18.  
  19. Table of contents:
  20. 92221. How do you find out if you run on a diskless machine?
  21. 92224. Using HP DeskJet 500C with RISC/6000
  22. 92226. What caused the system to 888/crash?   Use:  ERRDEAD
  23. 92227. Using Xterm on AIX 3.2 without clobbering /etc/utmp
  24. 92228. Automounter fixes for 3.2.1
  25. 92231. To which lpp belongs this file? (AIX 3.2 version)
  26. 92232. How-To read/decode ARP output
  27. 92233. Useful info on re-sizing primary paging space
  28. 92236. A more colorfoul directory listing
  29. 92239. HOTW: Is the 'pg' (page) command too plain?
  30. ======================================================================
  31.  
  32. Note:
  33. The information in this document has not been submitted to any formal IBM test
  34. or review and is distributed on an "as is" basis without any warranty either
  35. expressed or implied. The use of this information is a customer responsibility
  36. and customers attempting to adapt these techniques to their own environment
  37. do so at their own risk.
  38.  
  39. Some of the tips might reference internal TOOLS disks for more information.
  40. Please contact your IBM representative if you need those documents.
  41.  
  42. Your AIXTIPS Team                       Internet: aixtips@ibm.de
  43. ======================================================================
  44. >92221. How do you find out if you run on a diskless machine?
  45.  
  46. I think the best way to determine if you're a diskless machine or not is to
  47. execute the "bootinfo" command.  "bootinfo" will look in the ipl control block
  48. and echo to stdout a number which corresponds to the type of device which was
  49. used to obtain the boot image from (ie., which device was booted off of).  In
  50. order to get this information from "bootinfo", use the "-t" flag :
  51.  
  52.         bootinfo -t
  53.  
  54. I don't know if there is a .h file which relates what is returned from
  55. bootinfo with a type of device, but here are what the returned numbers mean :
  56.  
  57.         1 = disk boot
  58.         2 = diskette boot
  59.         3 = cdrom boot
  60.         4 = tape boot
  61.         5 = network boot
  62.  
  63. In order to execute bootinfo, however, you must have root authority.
  64. --
  65. Donald Long
  66. ======================================================================
  67. >92224. Using HP DeskJet 500C with RISC/6000
  68.  
  69. Turning your HP 500C into a Color PostScript printer.
  70.  
  71. Here are the steps to be able to use the HP500C for color PostScript
  72. on a RS6K.
  73.  
  74. 1) Connect your HP500C to the parallel printer port.
  75.  
  76. 2) Configure your printer as a HP LaserJet II using SMIT.
  77.  
  78. 3) Get the GhostScript (GS) 2.4.1 package from your favorite Free Software
  79.    Foundation (FSF) source.
  80.  
  81. 4) Compile GS with the RS6K options specified in the Makefile.
  82.    Be sure to include the HP500C device support in the options.
  83.  
  84. 5) run GS as shown
  85.  
  86.       gs -sDEVICE=djet500c -sOUTPUTFILE=outputfilename inputfile.ps
  87.  
  88.     where "outputfilename" is the file you want for the 500C printer
  89.     commands and inputfile.ps is the color PostScript source.
  90.  
  91. 6) issue the AIX command
  92.  
  93.        qprt -d p outputfilename
  94.  
  95.     where "outputfilename" is the 500C printer command file.
  96.     This will send the 500C printer commands to the printer
  97.     that you've specified with your environment variable PRINTENV.
  98.     It also bypasses any default printer driver or translation
  99.     tables used for the default printers.
  100.  
  101.   Documentation that comes with GS 2.4.1 tells you how to use the "gs"
  102.   command to send your output directly to the printer, go figure.
  103.  
  104.          John
  105. ======================================================================
  106. >92226. What caused the system to 888/crash?   Use:  ERRDEAD
  107.  
  108.    Ever wonder what caused your system  to  888/crash?  The  ERRDEAD
  109.    command  extracts  error  records that were in memory and had not
  110.    yet been written to the error log when the system dumped.
  111.  
  112.    Note:  The ERRDEAD command REQUIRES that you have a  dump  device
  113.         enabled.  Typically this is /dev/rhd7.
  114.  
  115.    Example:
  116.  
  117.         #errpt -a | pg                #  what do we find in the error log ?
  118.  
  119.         #/usr/lib/errdead /dev/hd7    #  any error records in the dump ?
  120.  
  121.         #errpt -a | pg                #  browse the error log - whatznew ?
  122.  
  123.    For additional information checkout the pub:
  124.  
  125.         DIAGNOSTIC PROGRAMS:  SERVICE GUIDE;
  126.  
  127.              Chapter 2, "Reading Flashing 888 Numbers" ...... 2-2
  128.  
  129.  
  130.  inspired by:  jk
  131. ======================================================================
  132. >92227. Using Xterm on AIX 3.2 without clobbering /etc/utmp
  133.  
  134. Xterm has a severe bug which will clobber /etc/utmp.
  135. I have added the following lines of code to main.c:
  136.  
  137. 1. include near the top of the file:
  138.  
  139. #ifdef AIXV3
  140. #define HAS_UTMP_UT_HOST
  141. #define HAS_BSD_GROUPS
  142. #endif /* AIXV3 */
  143.  
  144. 2. now search for CLOCAL, there is only one occurrence and add the lines
  145. I have marked with a >>: (and keep in mind, the | should be a pipe-sign)
  146.  
  147.         /* set some flags that should be on */
  148.         terminal_modes.c_oflag |= OPOST;
  149.         /* set some flags that should be on */
  150.  
  151. >>      /* set some flags that should be on */
  152. >>      terminal_modes.c_lflag |= ECHO;
  153. >>      /* set some flags that should be on */
  154.  
  155.         /* set some flags that should be off */
  156.         terminal_modes.c_cflag &= ~( CLOCAL ); <<< and this ~ remains a tilde
  157.         /* set some flags that should be off */
  158.  
  159. 3. now recompile and xterm nomore clobbers utmp and allows input even if
  160. started in the background :-).
  161. It works for me; enjoy.
  162. regards,
  163. uwe untermarzoner
  164. ======================================================================
  165. >92228. Automounter fixes for 3.2.1
  166.  
  167. Get this ptf for the latest sun 4.1.1 automounter
  168. U404456 nfs320  IX26018 51189   9222    bosnet
  169.  
  170. ======================================================================
  171. >92231. To which lpp belongs this file? (AIX 3.2 version)
  172.  
  173. #!/bin/ksh
  174. #
  175. # shell script to tell you which "lpp" contains a particular file or directory
  176. # syntax:  whichlpp [path1] [path2] [path3] ... [pathN]
  177. #
  178. # All the spaces below are VERY important....
  179. #
  180. # Parentheses       - ()
  181. # Square brackets   - []
  182. # Curly  brackets   - {}
  183. # Double quote      - "
  184. # Single quote      - '
  185. # Back single quote - `
  186. # Forward slash     - /  
  187. # Back slash        - \  
  188. #
  189. # For more information, see InfoExplorer and odmget, inventory, and lpp.
  190. #         -Mickey Coggins,
  191. #              with TONS of help from the *amazing* Stephan Langenfeld
  192.  
  193. ODMDIR=/usr/lib/objrepos
  194. for FILENAME ; do
  195.     if [[ `basename $FILENAME` != $FILENAME ]] ; then
  196.         stanza=`odmget -q"loc0 = $FILENAME" inventory`
  197.             if [[ -z "$stanza" ]] ; then                               
  198.                echo "Couldn't find "$FILENAME" with an exact search."  
  199.                echo "Try entering simply "\"`basename $FILENAME`\"     
  200.             fi
  201.     else
  202.         stanza=`odmget -q"loc0 like */$FILENAME" inventory`
  203.     fi
  204.     stanza=`echo $stanza` # converts all newlines to spaces
  205.     # do it while some chars to process
  206.     while (( ${#stanza} > 1 )) ; do
  207.  
  208.         # get right part of string,
  209.         # which is the last stanza in the list
  210.         tmpstanza=${stanza##*inventory:}
  211.  
  212.         lpp_ids=${tmpstanza#*lpp_id = }
  213.         lpp_ids=${lpp_ids%% *}
  214.         names0=${tmpstanza#*loc0 = \"}
  215.         names0=${names0%%\"*}
  216.         names1=${tmpstanza#*loc1 = \"}
  217.         names1=${names1%%\"*}
  218.         names2=${tmpstanza#*loc2 = \"}
  219.         names2=${names2%%\"*}
  220.  
  221.         for id in $lpp_ids ; do
  222.             name=`odmget -q"lpp_id = $id" lpp | grep name`
  223.             name=${name#*name = \"}
  224.             name=${name%%\"*}
  225.             echo lppname: $name
  226.             echo -n "location: $names0"
  227.             if [[ x$names1 != x ]] ; then
  228.                 echo -n "  hard links: $names1"
  229.             fi
  230.             if [[ x$names2 != x ]] ; then
  231.                 echo -n "  soft links: $names2"
  232.             fi
  233.             echo
  234.         done
  235.  
  236.         # chop off the last entry in the list
  237.         stanza=${stanza%inventory:*}
  238.     done
  239. done
  240.                     
  241. ======================================================================
  242. >92232. How-To read/decode ARP output
  243.  
  244.  Need the IP ADDRESS of a remote host?  Use ARP.
  245.  Curious if another system is on the local segment or remote?  Use ARP.
  246.  
  247.  ARP (address resolution protocol) is one of the lesser known
  248.  protocols that makes up the TCP/IP protocol stack.
  249.  
  250.  Example:
  251.  
  252.          $arp pippi
  253.          pippi (19.21.4.YYY) at 50:00:xx:xx:xx:xx [token ring] rt=6b0:321:40
  254.  
  255.          $arp syclone
  256.          syclone (19.21.4.ZZZ) at 50:00:xx:xx:xx:xx [token ring] rt=630:321:40
  257.  
  258.  Explanation:
  259.  
  260.          The RT field is the route (i.e. rings/bridges).  The first byte is
  261.          the routing control field.  The rest is the rings and bridges used.
  262.  
  263.          Routing Control = BBBLLLLL DFFFrrrr
  264.  
  265.                        B = Broadcast indicators
  266.                        L = Length bits
  267.                        D = Direction bits (0=left to right; 1=right to left)
  268.                        F = Larges Frame bits
  269.                        r = reserved bits
  270.  
  271.               06B0 decodes:
  272.  
  273.                    Non-Broadcast
  274.                    6 bytes of routing info
  275.                    route is from right to left
  276.                    largest frame = 4472
  277.  
  278.               321:40 decodes:
  279.  
  280.                    From ring 032, bridge 1 to ring 040
  281.  
  282.  Thanx to ST.
  283. ======================================================================
  284. >92233. Useful info on re-sizing primary paging space
  285.  
  286.  ENTER AT YOUR OWN RISC!
  287.  
  288.  Scenario: You have an RS/6000 on which you want to install a large
  289.            application or the Munich TMSC demos.
  290.  
  291.            The primary paging space (hd6) is 80Mb. The secondary paging
  292.            space (hd61) is 32Mb. The machine has 32Mb of system memory.
  293.  
  294.            The available free disk space is 20Mb less than you need.
  295.  
  296.  Every been in this situation (Mike Hall - raise your hand).
  297.  
  298.  The following info will let you re-define the primary paging space to the
  299.  correct size and regain all that valuable disk space.
  300.  
  301.  This is only applicable on 3.2 systems.
  302.  
  303.  Follow these instructions carefully - especially the rebuilding of the
  304.  boot logical volume image and make sure that this command completes
  305.  before re-booting or it's re-install time!
  306.  
  307.  o Comment out the line in /sbin/rc.boot that activates /dev/hd6.Search for
  308.    hd6.
  309.  o Disable use of hd6 at IPL either through SMIT or using -
  310.        chps -a 'n' hd6.
  311.  o Rebuild the boot logical volume image with -
  312.        bosboot -d/dev/hdisk# -a
  313.    (where # is the boot disk number on the machine - usually 0).
  314.  o Reboot the system using -
  315.        shutdown -Fr
  316.  o Remove the old hd6 paging space through SMIT or using -
  317.        rmps hd6
  318.  o Create a new paging space of the correct size through SMIT or using -
  319.        mkps -s'#' -a'' rootvg hdisk##
  320.    (where # is the size of the new primary paging space in 4Mb partitions
  321.          ## is the disk number where the primary paging space should be located
  322.             - usually on hdisk0).
  323.    If you use SMIT select activation on boot but not active now or you will
  324.    not be able to do the next operation.
  325.  o Rename this new paging space to be hd6 using -
  326.        chlv -n hd6 paging##
  327.    (where ## is the number of the paging space created - usually 00 if this
  328.     is the first manually created paging space).
  329.  o Edit out the reference to the old paging00 in /etc/swapspaces
  330.  o Remove the comment from the "swapon" command in /sbin/rc.boot
  331.  o Rebuild the boot logical volume image again as above.
  332.  o Reboot the system using -
  333.        shutdown -Fr
  334.  
  335.  These instructions are based on an append to the ISTHERE forum on IBMUNIX.
  336.  I've modified them to a) remove typos b) provide AIX commands for all
  337.  operations - you needn't use SMIT at all if you don't want to and c) provide
  338.  a more orderly and definite series of instructions - the append was a bit
  339.  conversational.
  340.  
  341.  From start to finish it took approx 12mins on a 320H - most of it is due to
  342.  the two shutdowns.
  343.  
  344.  This method will also work on boxes with only 1 hard disk and therefore
  345.  usually only one paging space, the primary one. Contrary to popular belief
  346.  an RS/6000 will boot up without any paging space - no guarantees about
  347.  running X and InfoExplorer though!
  348.  
  349.  Regards,
  350.  Chris Thomas
  351. ======================================================================
  352. >92236. A more colorfoul directory listing
  353.  
  354. Using this awk filter on a hft or aixterm will diplay executables, directories
  355. and ordinary files in different colors.
  356.  
  357. #!/bin/awk -f colordir
  358. #@(#) COLORDIR Version 1.0;  Doug Ranz Wednesday, July 01, 1992  09:28:06 EDT
  359. #
  360. #  Simple color directory listing program by John Duglosz
  361. #
  362. #  Modified By:  Doug Ranz Wednesday, July 01, 1992  09:28:06 EDT
  363. #  Modified By:  afx       Friday,    July 03, 1992  14:58:00 EDT
  364. #
  365. #
  366. #  Usage:        ls -F | cdir
  367. #
  368. #  Hint:         use a bsh/ksh function or a csh alias
  369. #                For example in your ~/.kshrc file:  
  370. #                lc () { 
  371. #                       ls -F $* | colordir 
  372. #                }
  373. #
  374. # [ = open squere bracket
  375. # ] = close squere bracket
  376. # | = vertical bar
  377. #
  378. function lastchar() { return substr($0,length(),1); }
  379.  
  380. # test code
  381. #      { print $1 " ends in " lastchar(); }
  382.  
  383. BEGIN  {
  384.        ESC="\033"                                       # define escape
  385.        color["*"]= ESC "[32m";                          # executable: green
  386.        color["/"]= ESC "[31m";                          # directory:  red
  387.        color["normal"]= ESC "[37m" ESC "[11m";
  388. }
  389.  
  390.        { print color[lastchar()] $0 color["normal"] }
  391.  
  392. # the end
  393. ======================================================================
  394. >92239. HOTW: Is the 'pg' (page) command too plain?
  395.  
  396.  The 'pg' command seems to have many underutilized options.  These
  397.  options permit you to alter the behaviour and appearance.  I hide my
  398.  favourite options 'pg -secp" Page: %d. "  options using ksh aliasing.
  399.  
  400.  Example:  pg -c
  401.  
  402.            Moves the cursor home and clears the screen before painting
  403.            each screen/page.
  404.  
  405.  Example:  pg -e
  406.  
  407.            Tired of 'pg' pausing on the last screen?  This option
  408.            causes 'pg' to exit after painting the last screen.
  409.  
  410.  Example:  pg -f
  411.  
  412.            Do not wrap (long) lines.
  413.  
  414.  Example:  pg -p" Page: %d "
  415.  
  416.            Changes the dull ":" prompt to the something a bit
  417.            fancier that displays the page number.
  418.  
  419.  Example:  pg -s
  420.  
  421.            All messages and prompts will be highlighted.
  422.            (Using the terminfo database entry for your terminal.)
  423.  
  424.  Example:  pg +/RegularExpression/
  425.  
  426.            Starts at the first line matched by RegularExpression.
  427.  
  428.  Within the 'pg' program you have a variety of search and scrolling
  429.  options.  Forward one line, forward one-half screen, backward one-half
  430.  screen, etc ... checkout the man page for more details
  431.  
  432. dr
  433.  
  434. ======================================================================
  435.  
  436. -- 
  437. Andreas Siegert / Postmaster   IBM Deutschland GmbH   |   Never grep a yacc
  438. AIX Field Support Center       Pocci Strasse 11       |   by the i-node!
  439. afx@ibm.de                     D-8000 Muenchen 2      |   Opinions are my own,
  440. siegert@munivm4.vnet.ibm.com   Voice: (49)-(89)-7670-509  not IBM's.
  441.