Lars' Sysadmin Notes (not exactly Frequently Asked Questions)

I put together this FAQ rather quickly, as a container for various notes to myself which might also prove useful to others. The questions and answers are geared mainly toward sysadmin-types.

Note: Some of this is very old stuff, and may no longer be meaningful, even to me!


FAQBuilder

Q1: How was this FAQ generated?
Q2: Cool. Where can I get this faqbuilder script?
Q3: I tried it; wassup with the formatting of my answers?

General

Q4: How can I disable those annoying "pop-under" X10 ad windows when I browse certain web pages?
Q5: How can I send a text FAX via email?
Q6: When I try to run matlab now, I get "License Manager Error -39".
Q7: How can I determine what kind of web server is running on a remote host?

Unix

Q8: How do I boot a HP-UX machine single-user?
Q9: How can I boot an SGI box directly into single-user mode?
Q10: How do I mount a CD on a unix box, e.g. to export elsewhere?
Q11: How can I tell how much disk space I'm using on coeus? That .snapshot directory gets in the way of using 'du'.
Q12: How do I add missing packages to my Sun?
Q13: When patching a Solaris machine, what do the different Return Codes indicate?
Q14: I've just had the port speed settings changed for a solaris host (e.g. from autonegotiate to 100/full-duplex, or from 10/half to autonegotiate). I'd like to force the host to do 100/full. How?
Q15: But do I have to reboot it? Can't I change those values on the fly?
Q16: How do I setup SSH so I don't have to type my passwd in for every damn machine I connect to?

Windows

Q17: How can I easily open any file using Notepad?
Q18: Yes, but can I just add Notepad to the right-click menu for any file instead?
Q19: How can I force locally-cached profiles to be deleted at logout, so the C: drive doesn't fill up?
Q20: How do I remove the Hummingbird Neighborhood icon from my desktop?
Q21: How do I remove Internet Explorer from the desktop?
Q22: How do I remove the My Documents icon from the desktop?
Q23: How do I remove the Outlook or "My Network Places" icons from the desktop?
Q24: How do I remove ALL the icons from the desktop?
Q25: Where are the bitmaps located for Windows startup/shutdown screens, so I can change them?
Q26: How do I add all the Control Panels to the Start menu?
Q27: In Windows 2000 Server, how can I replace a failing system disk?

FAQBuilder

Q1: How was this FAQ generated?

With the help of faqbuilder, a script I wrote for the task. :-) Individual text files, each containing a question and an answer (separated by a blank line), are put together in html form. Here is the text file used for this very question.
The script takes a directory as an argument, and creates an index.html out of all the files it finds there, using the first part of the filename as a category. Optionally, you may have .title, .intro, .background, .header, and .footer files ready in that directory (.header and .footer should be html-formatted already). The file .FAQBUILDER must exist in the directory, as an indication that it's safe to build there.

Q2: Cool. Where can I get this faqbuilder script?

Click here. Mazeltov. Yeah, I know it's in csh. So sue me.

Q3: I tried it; wassup with the formatting of my answers?

The faqbuilder script assumes (for now) normal text for both question and answer. If you want some newlines/blanklines, you can use <br>. Likewise, any other html tag (such as a link) in your answer will be passed through to the final output.

General

Q4: How can I disable those annoying "pop-under" X10 ad windows when I browse certain web pages?

One way is to turn off Javascript, except for when you need it. That's a pain.
Another way is to visit http://www.x10.com/x10ads.htm, where they have a link to click that will give you a cookie designed to prevent such ads for the next 30 days. Do so every month.
Of course, you can purchase Ad-blocking software such as AdSubtract.
Last, but not least, you can use a browser based on the Mozilla codebase, such as Netscape 6 or newer, and add the following to your prefs.js:
user_pref("dom.disable_open_during_load", true);

Q5: How can I send a text FAX via email?

To Fax to Lars Rohrbach at (208) 441-2973, email to:
remote-printer.Lars_Rohrbach/thanks@12084412973.iddd.tpc.int
or to:
remote-printer.Lars_Rohrbach/thanks@3.7.9.2.1.4.4.8.0.2.1.tpc.int
Fax says "Please deliver this facsimile to:
LARS ROHRBACH
THANKS"
email "tpc-faq@town.hall.org" for more info on email-to-fax gateway.

Q6: When I try to run matlab now, I get "License Manager Error -39".

We are now implementing the licensing restrictions that were announced 11/15/2000 (See http://www.cs.berkeley.edu/idsg/newsflash/matlab.html). Your login name must be listed in the license file viewable here, or you will get an error like:
License Manager Error -39.
User/host not on INCLUDE list for feature
Feature:       MATLAB
License path:  /usr/sww/pkg/matlab-6.0/etc/license.dat:/usr/sww/pkg -
   /matlab-6.0/etc/*.lic
FLEXlm error:  -39,147
Your professor or sysadmin may need to send IDSG an updated list of members in your group; additional charges may be required to add new users.

Q7: How can I determine what kind of web server is running on a remote host?

Try using: lynx -dump -head http://foo/

Unix

Q8: How do I boot a HP-UX machine single-user?

Hold <esc> during boot to stop autoboot sequence,
at the boot prompt, type 'boot isl' (or 'boot pri'; if asked whether to interact with IPL, answer 'yes'),
at the ISL/IPL prompt, type 'hpux -is'.

Q9: How can I boot an SGI box directly into single-user mode?

Use the PROM monitor's 'single' command. For machines earlier than 4D35s, whose PROMs don't have that command, first boot into sash from the PROM monitor with "boot", then type "boot initstate=s".

Q10: How do I mount a CD on a unix box, e.g. to export elsewhere?

On Solaris boxes, volume management will automatically mount it. On apiary, use:
mount -o ro,nodev,rrip,defperm -t cdfs /dev/rz4a /mnt
On Solaris boxes, exports are listed in /etc/dfs/dfstab, and shared with "shareall" (the machine will run '/etc/init.d/nfs.server start' if there's an entry in dfstab at boot; run it manually before sharing if not). Most other unix boxes use /etc/exports, and 'exportfs -a'.

Q11: How can I tell how much disk space I'm using on coeus? That .snapshot directory gets in the way of using 'du'.

IDSG publishes nightly the real usage from the previous day, in /usr/sww/adm/du/coeus-user. I wrote the script mydu to quickly check my most recent usage, or anyone else's, for that matter. Usage is: mydu [user1 user2 ...]; with no arguments, you get your own.

Q12: How do I add missing packages to my Sun?

For man pages:
pkgadd -d /mnt/Solaris_2.7/Product SUNWman SUNWdtmad SUNWdtmaz SUNWdtma SUNWjvman SUNWpmowm SUNWolman SUNWtltkm SUNWxwman SUNWxwpmn

For ccs stuff:
pkgadd -d /mnt/Solaris_2.7/Product SUNWsprot SUNWbtool SUNWbtoox

For header files:
pkgadd -d /mnt/Solaris_2.7/Product SUNWhea

Q13: When patching a Solaris machine, what do the different Return Codes indicate?

Found near the top of any installpatch script:
# Exit Codes:
#               0       No error
#               1       Usage error
#               2       Attempt to apply a patch that's already been applied
#               3       Effective UID is not root
#               4       Attempt to save original files failed
#               5       pkgadd failed
#               6       Patch is obsoleted
#               7       Invalid package directory
#               8       Attempting to patch a package that is not installed
#               9       Cannot access /usr/sbin/pkgadd (client problem)
#               10      Package validation errors
#               11      Error adding patch to root template
#               12      Patch script terminated due to signal
#               13      Symbolic link included in patch
#               14      NOT USED
#               15      The prepatch script had a return code other than 0.
#               16      The postpatch script had a return code other than 0.
#               17      Mismatch of the -d option between a previous patch
#                       install and the current one.
#               18      Not enough space in the file systems that are targets
#                       of the patch.
#               19      $SOFTINFO/INST_RELEASE file not found
#               20      A direct instance patch was required but not found
#               21      The required patches have not been installed on the mana ger
#               22      A progressive instance patch was required but not found
#               23      A restricted patch is already applied to the package
#               24      An incompatible patch is applied
#               25      A required patch is not applied
#               26      The user specified backout data can't be found
#               27      The relative directory supplied can't be found
#               28      A pkginfo file is corrupt or missing
#               29      Bad patch ID format
#               30      Dryrun failure(s)
#               31      Path given for -C option is invalid
#               32      Must be running Solaris 2.6 or greater
#               33      Bad formatted patch file or patch file not found
#               34      The appropriate kernel jumbo patch needs to be installed


Q14: I've just had the port speed settings changed for a solaris host (e.g. from autonegotiate to 100/full-duplex, or from 10/half to autonegotiate). I'd like to force the host to do 100/full. How?

If your network interface is capable of 100/full (hme0 can do it, le0 cannot), you can insert these lines into /etc/system and reboot:
set hme:hme_adv_autoneg_cap = 0
set hme:hme_adv_100T4_cap = 0
set hme:hme_adv_100fdx_cap = 1
set hme:hme_adv_100hdx_cap = 0
set hme:hme_adv_10fdx_cap = 0
set hme:hme_adv_10hdx_cap = 0


Q15: But do I have to reboot it? Can't I change those values on the fly?

You can try resetting the corresponding values with ndd. For instance, if your host came up 100/half because of poor autonegotiation, and you've just re-config'd the switch to be 100/full, the following may be sufficient:
ndd -set /dev/hme adv_autoneg_cap 0


Q16: How do I setup SSH so I don't have to type my passwd in for every damn machine I connect to?

On unix, you can use an ssh-agent to manage ssh connections to other unix machines. Add this to your .login (NOTE -- this assumes a login shell of csh/tcsh):
eval `ssh-agent -c`
ssh-add


You probably should also add:
#test for additional (maybe leftover) ssh-agent processes:
set strays = `/bin/ps -eaf|grep ${USER}'.*ssh-agent'|grep -v grep|grep -v $SSH_AGENT_PID |awk '{print $2}'`
if ( `echo $strays | wc -m` > 0 ) echo Other ssh-agent processes owned by ${USER}: $strays


Of course, you still have to have your identity.pub in the remote machine's authorized_keys file.
You'll also want to add the following to your .logout:
eval `ssh-agent -k`

Here is a close approximation of what I really have in my .login, to start agents for both ssh1 and ssh2.

Windows

Q17: How can I easily open any file using Notepad?

Well, you can start by adding a shorcut to notepad (C:\winnt\notepad.exe) to your "SendTo" folder in your profile. I would also recommend adding wordpad.exe, which handles unix-created text files better. The SendTo folder may be hidden; you can make it visible using the Folder Options Control Panel.

Q18: Yes, but can I just add Notepad to the right-click menu for any file instead?

Sure. The following tip will set Notepad as the default application for any extensions that are not associated with another application. It will also add Notepad to the right-click menu for every file.
Using regedit (or regedt32), go to HKEY_CLASSES_ROOT\*. A key called "shellex" should already be here. Add a new key called "Shell" at the same tree level as "shellex." Under the "Shell" key, create another key called "Notepad." Create another key under the "Notepad" key called "Command." You'll see a string value named Default when you highlight the "Command" key. Double-click Default and enter "NOTEPAD %1" (without the quotes). Click OK.

Q19: How can I force locally-cached profiles to be deleted at logout, so the C: drive doesn't fill up?

Add a REG_DWORD value named DeleteRoamingCache to HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon. Give it a value of 1 to enable removal, or 0 to allow cached profiles to stay around. Note that if a user doesn't complete a standard logoff (e.g. if the machine crashes), the profile doesn't have a chance to be deleted.

Q20: How do I remove the Hummingbird Neighborhood icon from my desktop?

Run HNTUNE.exe (probably at C:\Program Files\Exceed.nt\HNTUNE.exe for Exceed 6.x, or C:\Program Files\Hummingbird\Connectivity\7.00\HostExplorer\Ftp\HNTUNE.exe for Exceed 7.0). This will let you choose to have the Hummingbird Neighborhood displayed only in My Computer, rather than on the desktop. You'll have to reboot immediately, unfortunately.

Q21: How do I remove Internet Explorer from the desktop?

Internet Options Control Panel, Advanced Tab. Uncheck "Show Internet Explorer on the desktop".

Q22: How do I remove the My Documents icon from the desktop?

Folder Options Control Panel, View Tab. Uncheck "Show My Documents on the desktop". Note that this also removes the My Documents listing from Explorer, so be sure that you don't really use the folder much. Personally, I've removed the My Documents icon on my desktop machine, but have left it on my laptop since I do use that folder on the laptop.

Q23: How do I remove the Outlook or "My Network Places" icons from the desktop?

Get TweakUI (from e.g. http://www.microsoft.com/NTWorkstation/downloads/PowerToys/Networking/NTTweakUI.asp). Then use TweakUI Control Panel, Desktop Tab. Uncheck "Microsoft Outlook" or "My Network Places". NOTE: Removing "My Network Places" from the desktop may prevent Explorer (but not cmd.exe or other applications) from being able to resolve UNCs. Heck, you can always put it back if you have problems.

Q24: How do I remove ALL the icons from the desktop?

You really like your background, don't you?
In Windows 2000, you can hide all the desktop icons if you first enable Web content on the desktop -- don't worry, you don't have to have webpage backgrounds or use single clicks instead of double clicks. Use the Folder Options Control Panel, General tab -- select "Enable Web content on my desktop". You may then have to close a default MicroSoft webpage backdrop to see your normal background again. Now if you right-click your desktop, under "Active Desktop" you'll see a checkmark next to "Show Desktop Icons" -- just uncheck it, and enjoy your picture.

Q25: Where are the bitmaps located for Windows startup/shutdown screens, so I can change them?

For Windows 9x, you need a 320x400x256-color image, saved in .bmp format. You could start with 640x480x16-million-colors, then "resample" the image to 320x400, convert color depth to 256 colors. Rename it to replace one of these:
C:\LOGO.SYS -- startup screen
C:\LOGOW.SYS -- waiting to shutdown screen
C:\LOGOS.SYS -- safe to shutdown screen

For WindowsNT, different resolutions are okay. The files are:
C:\winnt\winnt256.bmp -- startup (NT workstation only)
C:\winnt\lanma256.bmp -- startup (NT server)
C:\winnt\lanmannt.bmp -- same bitmap as lanma256.bmp on a default NT server setup

Q26: How do I add all the Control Panels to the Start menu?

md %systemroot%\profiles\"all users"\"start menu"\"Control Panels".{21ec2020-3aea-1069-a2dd-08002b30309d} (can change "all users" to specific username)

Q27: In Windows 2000 Server, how can I replace a failing system disk?

I have had Win2k servers report that the system disk is beginning to fail, both in the System Event logs and during boot before Windows comes up.

If the current disk is still okay for the time being, you can take advantage of software mirroring to replace the disk. Add your new second disk, and use Disk Management -- convert your current system disk to Dynamic if it isn't already (it won't hurt), leave second disk as unallocated space, and right-click on the system disk to add a mirror. Eventually, you'll have a healthy mirror setup. Now comes the fun part.

With the mirror setup still in place, shutdown and disconnect or remove the failing disk. Re-connect the new disk to the cable connection the old disk was using -- it'll be the new master disk. No need to edit boot.ini. Cross your fingers, boot your machine, and login. You may then get the following message:
Windows 2000 has finished installing new devices.  You must restart your computer 
before the new settings will take effect.  Do you want to restart your computer now?
Go ahead and reboot. Once logged in again, you'll see in Disk Manager that your new disk is now a perfectly fine system disk, but is flagged as Failed Redundancy. If you don't intend to add another good mirror disk, you can right-click the Missing disk to Remove Mirror; the system disk will then be flagged as healthy. Then you may right-click the Missing disk and Remove it completely.


Additional FAQs may be found at:
The HelpDesk Documentation Project
IDSG's Windows 2000-related Frequently Asked Questions

Last modified


Computer User Support Group
395 Cory Hall #1770, Berkeley CA 94720-1770
Voice: (510) 642-7777, FAX: (510) 642-2916
cusg@eecs