Starting a Console Session with Cisco Switch or Router

I’m using the plugable USB to RS-232 DB9 Serial Adapter here: http://plugable.com/drivers/prolific

Download the Mac OS driver and install it. You will have to restart system when the installation is completed.

Once your system is rebooted, plug in the adapter to your Mac and the RJ-45 connector to the console port of the Cisco router or switch.

Run following command and make sure that the adapter shows up, e.g:

$ ls -ltr /dev/*usb*
crw-rw-rw-  1 root  wheel   18,   2 Mar 19 22:28 /dev/tty.usbserial
crw-rw-rw-  1 root  wheel   18,   3 Mar 19 22:28 /dev/cu.usbserial

Run following command to start a console session:

$ screen /dev/tty.usbserial 9600

To disconnect the session, enter Ctrl+A followed by Ctrl+\.

Cloning disk using Apple’s Disk Utility

I want to clone the disk of my MacBook Pro in case the original disk fail, I can replace it with the one I cloned and have the system up and running again quickly.

Here are the steps:

  1. Start/restart your Mac and hold down the Command and R keys at startup.
  2. Start the “Disk Utility” and click on the “Restore” tab.
  3. Drag your old volume (indented) to the Source field.
  4. Drag your new hard drive to the Destination field.
  5. Click “restore” and it then will start copying over to your new disk.

That’s it!

Flake8 – how to ignore warning

Some warnings are really annoyed. So to ignore them, just create a file ‘~/.config/flake8‘ with settings, for example:

[flake8]
ignore = D101,D102,D105
max-line-length = 100
max-complexity = 10

That’s it!