Skip to main content

Posts

Showing posts with the label cli

Don't use the GUI, use Robo.

https://gist.github.com/4108167 I use this every week to copy files on WiFs shares internationally. Copy a directory and its contents verbosely (skipping items that exist in the destination, retry upon failure up to 3 times, wait 3 seconds between retries.) Great way to avoid GUI copy errors.

USB to Serial Mac OS X for console connections

Download the 32bit driver here or the 64bit driver here  to be used with the PL2303 adapter that can be purchased cheap online. To initiate an console connection find your device: bash-3.2$ ls -la /dev/tty.* crw-rw-rw- 1 root wheel 18, 2 26 Oct 08:32 /dev/tty.Bluetooth-Modem crw-rw-rw- 1 root wheel 18, 0 26 Oct 08:32 /dev/tty.Bluetooth-PDA-Sync crw-rw-rw- 1 root wheel 18, 6 26 Oct 14:40 /dev/tty.PL2303-000013FA Execute: screen /dev/tty.PL2303-000013FA 9600 If it doesn't work for you uninstall it this way; kextunload /System/Library/Extensions/osx-pl2303.kext/ sudo rm -r /System/Library/Extensions/osx-pl2303.kext/ sudo rm -r /Library/Receipts/osx-pl2303.pkg

FAT32 file size limit

Don't forget about the cli utility, convert convert E: /FS:NTFS You can perform this on a device that has files on it such as a USB disk but probably best to take a backup beforehand ;). Just make sure that you have sufficient free space on the partition, so that there’s room for temporary files that are created during the process; note that Windows will warn you if there is not enough space on the partition.

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

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