Archive

Posts Tagged ‘disable’

RANCID for interfaces err-disable

December 30, 2016 Leave a comment

*This script is for RANCID only.

  1. Edit the file /usr/local/rancid/bin/rancid
  2. Add the following line
     	{'show variables boot'		=> 'ShowBoot'},
     	{'show flash'			=> 'ShowFlash'},
     	{'show cdp neighbors detail'	=> 'ShowCDPNeighborsDetail'},
    +	{'show interfaces status err-disabled'	=> 'ShowStatErrDis'},
     	{'dir /all nvram:'		=> 'DirSlotN'},
     	{'dir /all bootflash:'		=> 'DirSlotN'},
     	{'dir /all slot0:'		=> 'DirSlotN'},
  3. Add the sub routine
    # A test routine for parsing the output of "show interfaces status err-disabled"
    +sub ShowStatErrDis {
    +    print STDERR "    In ShowStatErrDis: $_" if ($debug);	
    +
    +    while (<INPUT>) {
    +        tr/\015//d;
    +        last if (/^$prompt/);
    +        next if (/^(\s*|\s*$cmd\s*)$/);
    +        return(1) if /^\s*\^\s*$/;
    +        return(1) if /Line has invalid autocommand /;
    +        return(1) if /(Invalid input detected|Type help or )/;
    +        return(-1) if (/command authorization failed/i);
    +        # the pager can not be disabled per-session on the PIX
    +        if (/^(<-+ More -+>)/) {
    +            my($len) = length($1);
    +            s/^$1\s{$len}//;
    +        }
    +        ProcessHistory("COMMENTS","keysort","IO","!SISED: $_");
    +    }
    +    ProcessHistory("COMMENTS","keysort","IO","!\n");
    +    return(0);
    +}
Advertisements

Disable startup items for Mac

March 15, 2010 Leave a comment

Not all services/applications can be disabled through Preferences in your Mac. These startup items is defined in scripts. You can find them in StartupItems folder:

  • /Library/StartupItems
  • /System/Library/StartupItems

You should see some folders which contains the startup script. To disable to specific service, perform these steps in the Terminal and replace <appfolder> with the name of the folder/service:

  1. cd /Library/StartupItems/<appfolder>
  2. sudo touch .disabled

This will create an empty file named “disabled”. To confirm this, open up System Profiler and go to Startup Items and notice that the service is disabled.

Thanks JJ for this useful information 🙂

Categories: Mac, OS X Tags: , , ,