Get shell command return status / return code

Hello,

for everyone who wanted to know how to get the return code or status from an executed command in unix:

# for example use the ls command on a directory
ls -l /home

# get return code
echo $?

This returns an integer code as 0 or 1 or 127. Normally 0 means OK, 1 means ERROR and 127 means COMMAND NOT FOUND. Every command has its own return code but the 3 mentionned before are general.

Hide Windows Server from networkbrowsing

Hi everyone,

if you ever asked yourself how to hide a windows server on the network (e.g. from network browsing), it's quite easy. Open the terminal and enter following command:

# hide server
net config server /hidden:yes

# unhide server
net config server /hidden:no

Note: it can take some time before the server disappears or shows up.

(source)

Windows 2K/XP and network master browsers

Hi,

if you encounter problems when trying to browse the network neighbourhood in windows, it's often because of a windows machine which claims to be the master browser on the net, although it's not. So how do you see if there's a problem or not? Well, if you have one of the following symptoms you can be almost sure that there's a problem:

When you open My Network Places, the computer list you see is obtained from the master browser of your network.

  1. If you can ping a computer name, you can search it, you can map it,  but that computer doesn't show or take long time to show up on My Network Places.
  2. Net view command shows no lists or shows "System error 6118 has occurred. The list of servers for this workgroup is not currently available". 
  3. when clicking on Computers Near Me in My Network Places or workgroup name in Entire Network, the following error message may appear: "Cannot Access 'Computers Near Me' " or "Workgroup is not accessible" errors. 
  4. when click workgroup name under Entire Network Places, you get "Workgroup is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permission.  The list server for this workgroup is not currently available."
  5. Windows Explorer or My Network Places take a long time to open.
  6. Event logs on servers show many master browser election messages.

To prevent a machine from becoming master browser for the network you can do:

  1. go to "Administrative Tools > Services > the  Properties of Computer Browser" and then click "Manual"
  2. use Registry Editor (Regedt32.exe) to edit the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters\MaintainServerList
    and change the value of this key to false in NT and  no in 2k/XP.

(source)