Skip to main content

Posts

CLI Mac OS X Version

A simple "1-liner" that I use quite a bit to get the OS version, makes it easy to create a single script that can be deployed universally. /usr/bin/sw_vers | /usr/bin/grep 'ProductVersion:' | /usr/bin/grep -o '[0-9]*\.[0-9]*\.[0-9]*' | /usr/bin/cut -c 1-4

How to enable TFTP and Telnet in Windows 7 programmatically?

A powerful tool to get familiar with in Windows 7....dism (Deployment Image Servicing and Management Technical) allows command line control of services, I do it via a DOS script. This is a nice one to start with so you have some tools to use with your Cisco infrastructure. dism /online /Enable-Feature /FeatureName:TelnetClient dism /online /Enable-Feature /FeatureName:TFTP

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 0x2102 router> 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 0x2142 router> 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 met...

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/tftp...

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