Skip to main content

Posts

Showing posts from May, 2012

Cisco Router Factory Reset

A simple one, don't do it often so thought I'd add it in a post so if I ever forget I know where to look. Theres two ways of doing it.Method 1, Using the config-register 0x2102router> enable router# configure terminal router(config)# config-register 0x2102 router(config)# end router# write erase router# reload router# System configuration has been modified. Save? [yes/no]: n Proceed with reload? [confirm] Method 2, Using the config-register 0x2142router> enable router# configure terminal router(config)# config-register 0x2142 router(config)# end router# reload router# System configuration has been modified. Save? [yes/no]: n Proceed with reload? [confirm] router> enable router# configure terminal router(config)# config-register 0x2102 router(config)# end router# write memory router# reload router# System configuration has been modified. Save? [yes/no]: n Proceed with reload? [confirm] Note: the following configs are not reset to factory defaults using these methods as…

TFTP on Mac OS X 10.7 shell script

I've just started getting into Cisco support a little more. It's my goal to eventually specialise (its probably the first time I've found something in I.T. support that I don't eventually get bored with ). Since I've got about 1 of each OS I need make sure I can perform my job on anything. Was working on my macbook pro and needed to download some router configs. Give tftp a kick on Mac OS X 10.7 #!/bin/bash #* TFTP.sh #+ A quick script to enable/disable tftp (for use with cisco devices). #+ Usage: TFTP.sh on NO_ARGS=0 if [ $# -eq "$NO_ARGS" ] # no arguments? then /bin/echo "Disabling tftp." #+ Always unload, just to be on the safe side. sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist #+ Cleanup any files so they aren't floating around ;) /bin/echo "Removing default tftp files." sudo /bin/rm -f /private/tftpboot/running-config sudo /bin/rm -f /private/tftpboot/startup-config sudo /bin/rm -f /private/tft…

Repair VSS Corruption

Internal DEV team still using VSS? Just a little snippet you may need to know every now and then when coming across database corruptions. Analyze.exe is your friend :) analyze -f -c -d %PATH_TO_VSS_ANALYZE_LOG% %PATH_TO_VSS_DATA% Analyze Report: ------------------ %PATH_TO_VSS_ANALYZE_LOG%d= Analyze log of corrupted files -f =Automatically repairs inconsistencies and corruption that are detected -c=Cleans up and compresses unused space in the database -d=Deletes any unused files

Code Snippet (Mac OSX Encryption)

Need to encrypt a file? Don't have any budget to buy software? You don't need to really, there is plenty of opensource stuff out there and some built-in stuff to. Give openssl a try on Mac OS X. Encrypt
#!/bin/sh in="$1" out="$2" openssl des3 -in "$1" -out "$2" exit 0 Decrypt #!/bin/sh in="$1" out="$2" openssl des3 -d -in "$1" -out "$2" exit 0

Portable TextWrangler (kinda)

Terminal is great, but sometimes I'm too lazy to use vi and editing lots of shell scripts is waaaayyyyy more efficient with TextWrangler. I use this small dropbox hack so I can sync my stationery and settings across multiple macs. #!/bin/bash #+ Portable TextWrangler #* Formatted date & time string. FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"` #+ Remove it from /Applications (optional, just so you can replace it with a ln to your dropbox) sudo /bin/mv -f /Applications/TextWrangler.app ~/.Trash/ #* Add a link in /Applications to your DropBox copy sudo /bin/ln -Fs ~/DropBox/TextWrangler.app /Applications/TextWrangler.app #* Archive existing folder /bin/mv -f ~/Library/Application\ Support/TextWrangler{,.$FORMATTED_DATE} #+ Create cloud app support folder /bin/mkdir -p ~/DropBox/TextWrangler #+ Link cloud app support folder to your local workstation (this contains your stationery etc etc) sudo /bin/ln -Fs ~/DropBox/TextWrangler ~/Library/Application\ Support/TextWra…

Script Utility for my "SOE"

This is a really old one, just re-hashing it here as I forgot to add it to my 10.7 SOE.

We use Lotus Notes in some of our offices. The default font size on larger resolutions is small enough to send people blind. Unfortunately there is no UI for changing the size. This simply applescript gives end users the option to do so.

Please note the values should range from 1-5 with 1 being the default size and 5 being the largest (not really the largest but the maximum you should go to, try it... you'll see what I mean).

set _prompt to display dialog "Lotus Notes Default Font Size?" & return & return & "Please ensure Lotus Notes is not running before proceeding." buttons {"Continue", "Quit", "Reset"} default button 1 with icon stop set _response to button returned of _prompt if _response is equal to "Continue" then set _sizes to display dialog "Lotus Notes Default Font Size?" & return buttons {"L…