How to connect to a Cisco Device using USB Console

This article was written using instructions for Ubuntu, but was actually tested on a Raspberry Pi. Cool, eh?

Install minicom

$ sudo apt-get install minicom

Find the device

$ dmesg | grep ttyUSB
[    5.494345] usb 1-1.2: Moschip 2 port adapter converter now attached to ttyUSB0

Note the device: In this case it is ttyUSB0

Configure Minicom

Run minicom in setup mode

$ sudo minicom -s
| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |

Configure the Serial Device

Select ‘Serial port setup’ and press [ Enter ]

| A -    Serial Device      : /dev/tty8                                 |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |

At the ‘Change which setting?’ prompt, press [A]

There is no need to press [ Enter ], your cursor will be moved to the end of the Serial Device Path

Change the setting to match the setting found from the dmesg command.

In this example, we’ll change /dev/tty8 to /dev/ttyUSB0.

After the setting has been changed, press [ Enter ] to return to the ‘Change which setting’ prompt.
| A -    Serial Device      : /dev/ttyUSB0                              |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |

Press [E] to edit the Bps/Par/Bits setting

+---------[Comm Parameters]----------+
|                                    |
|     Current: 115200 8N1            |
| Speed            Parity      Data  |
| A: <next>        L: None     S: 5  |
| B: <prev>        M: Even     T: 6  |
| C:   9600        N: Odd      U: 7  |
| D:  38400        O: Mark     V: 8  |
| E: 115200        P: Space          |
|                                    |
| Stopbits                           |
| W: 1             Q: 8-N-1          |
| X: 2             R: 7-E-1          |
|                                    |
|                                    |
| Choice, or <Enter> to exit?        |

Press [C], then [Q]

The ‘Current: ‘ setting at the top of the menu will change to ‘9600 8N1’

+---------[Comm Parameters]----------+
|                                    |
|     Current: 9600 8N1              |
| Speed            Parity      Data  |

Press [ Enter ] to return to the Serial port settings menu.

You will see the new setting on the ‘Bps/Par/Bits’ section.

| E -    Bps/Par/Bits       : 115200 8N1                                |

Press [ Enter ] to return to the ‘configuration’ menu.

| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |

Select ‘Save setup as..’ then press [ Enter ]

| Save setup as..          |

At the ‘Give name to this configuration?’ prompt, enter a short name for these settings then press [ Enter ].

For this example, I’m using ‘cisco’

|Give name to save this configuration?    |
|> cisco                                  |
After pressing [ Enter ] you'll see a brief pop-up letting you know the configuration was saved.

Select ‘Exit from Minicom’ and press [ Enter ]


Run Minicom


Back at the Linux command prompt, run minicom with the name of the configuration you saved.


$ sudo minicom cisco
Welcome to minicom 2.7.1

Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyUSB0, 11:06:34

Press CTRL-A Z for help on special keys

Press [ Enter ] to see the prompt for the device you are now consoled into.

By admin on August 1, 2019 | Cisco, Linux, Linux, Raspberry Pi

Linux TOP command

1st Row – top

top - 11:37:19 up 30 min,  3 users,  load average: 0.02, 0.01, 0.06
  • current time (11:37:19)
  • uptime of the machine (up 30 min)
  • users sessions logged in (3 users)
  • average load on the system (load average: 0.02, 0.01, 0.06) the 3 values refer to the last minute, five minutes and 15 minutes.

2nd Row – task

Tasks:  131 total,   1 running,  129 sleeping,   0 stopped,   1 zombie
  • Processes running in totals (131 total)
  • Processes running (1 running)
  • Processes sleeping (129 sleeping)
  • Processes stopped (0 stopped)
  • Processes waiting to be stopped from the parent process (1 zombie)

3rd Row – cpu

Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%si,  0.0%st

The sum of all the percentages will equal 100% of the cpu.

  • Percentage of the CPU for user processes (0.2%us)
  • Percentage of the CPU for system processes (0.3%sy)
  • Percentage of the CPU processes with priority upgrade nice (0.0%ni)
  • Percentage of the CPU not used (99.5%id)
  • Percentage of the CPU processes waiting for I/O operations(0.0%wa)
  • Percentage of the CPU serving hardware interrupts (0.0% hi — Hardware IRQ
  • Percentage of the CPU serving software interrupts (0.0% si — Software Interrupts
  • The amount of CPU ‘stolen’ from this virtual machine by the hypervisor for other tasks (such as running another virtual machine) this will be 0 on desktop and server without Virtual machine. (0.0%st — Steal Time)

4th and 5th Rows – memory

KiB Mem :  3920076 total,   564520 free,  1498724 used,   1855940 buffers
KiB Swap:  4071932 total,  4071932 free,        0 used,   1893112 avail Mem
  • Total available memory in KiB (3920076)
  • Total free memory in KiB (564520)
  • Used memory in KiB (1498724)
  • Buffers (aka cached)
    • Temporary memory that has been used, but is available if a system needs it.
    • It is often used when a file has been accessed to prevent re-reading from that file from the disk.
      • Any re-reads will come from this memory and will significantly improve system performance.
    • To know how much actual ram is available, add the free and buffers values together.

Processes List

 2372 joe      20   0 390384 237936  91792 S  4.6  6.1  37:47.11 gnome-shell
13505 root     20   0  41908   3772   3132 R  1.6  0.1   0:50.88 top
  • PID – Process ID of the process(2372)
  • USER – The user that is the owner of the process ( joe)
  • PR – priority of the process (20)
  • NI – The “NICE” value of the process (0)
  • VIRT – virtual memory used by the process (390384)
  • RES – physical memory used from the process (237936)
  • SHR – shared memory of the process (91792)
  • S – indicates the status of the process: S=sleep R=running Z=zombie (S)
  • %CPU – This is the percentage of CPU used by this process (4.6)
  • %MEM – This is the percentage of RAM used by the process (6.1)
  • TIME+ –This is the total time of activity of this process (37:47.11)
  • COMMAND – And this is the name of the process (gnome-shell)


By admin on | Linux

Linux Basic CPU and OS information Commands

Get the Operating System

cat /etc/*eles*

Check the bit count (32 or 64)

getconf LONG_BIT

Find your Raspberry Pi model via CLI

cat /proc/device-tree/model
By admin on July 30, 2019 | Linux

Install PHP 5.3 on Ubuntu 17.10

I know, I know, I know, I know! I need to update my code! If I haven’t said it already, I know! But… I don’t have time to updated hundreds upon hundreds of lines of code, so I’m taking the easy way out.

I found the steps to do it here:

The system I’m installing from is a fresh install of Ubuntu 17.10, so I’m assuming NOTHING has been pre-installed with these instructions.

Install PHP

sudo apt install php -y

Download and configure phpbrew

sudo apt install -y curl
curl -L -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   130  100   130    0     0     43      0  0:00:03  0:00:03 --:--:--    42
100 1792k  100 1792k    0     0   224k      0  0:00:08  0:00:08 --:--:--  460k
chmod +x phpbrew
sudo mv phpbrew /usr/bin/phpbrew
sudo nano /root/.bashrc
# Added this line to install PHP 5.3 per instructions found here:
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc

Initialize phpbrew

phpbrew init
Using root: /home/thomasr/.phpbrew
Initialization successfully finished!
Phpbrew environment is initialized, required directories are created under


Paste the following line(s) to the end of your ~/.bashrc and start a
new shell, phpbrew should be up and fully functional from there:

    source /home/thomasr/.phpbrew/bashrc

To enable PHP version info in your shell prompt, please set PHPBREW_SET_PROMPT=1
in your `~/.bashrc` before you source `~/.phpbrew/bashrc`


To enable .phpbrewrc file searching, please export the following variable:

    export PHPBREW_RC_ENABLE=1

For further instructions, simply run `phpbrew` to see the help message.

Enjoy phpbrew at $HOME!!


Update for old versions and display

phpbrew update --old
===> Fetching release list...
Downloading via php stream
Downloading via php stream
7.2: 4 releases
7.1: 16 releases
7.0: 29 releases
5.6: 35 releases
5.5: 39 releases
5.4: 46 releases
5.3: 30 releases
5.2: 17 releases
5.1: 7 releases
5.0: 6 releases
===> Done

phpbrew known

By admin on March 2, 2018 | Debian / Ubuntu, Linux, PHP

How to test and patch your server for the Shellshock exploit

To test your system to see if it is vulnerable to the ShellShock exploit, run the following command from the command line:

env check='Not vulnerable' x='() { :;}; check=Vulnerable' bash -c 'echo $check'

If the reply from the command says “Vulnerable”, you should patch it immediately! The fix is actually quite simple and only takes a minute or so.


CentOS, Fedora, Redhat

Log into your server as root

yum update -y


Debian, Ubuntu, Mint

sudo apt-get update && sudo apt-get install --only-upgrade bash

That’s it! You can re-run the test command to verify your server has been successfully patched.


By admin on September 26, 2014 | Linux, Security | A comment?

How to create a CSR (Certificate Signing Request) in Linux using OpenSSL

Before you can purchase or create your own self signed SSL certificate, you must first create a CSR (Certificate Signing Request) and a Private Key. These two files much be created simultaneously or the resulting SSL certificate will not work.

As root, run the following command:

openssl req -nodes -newkey rsa:2048 -keyout -out
Generating a 2048 bit RSA private key
writing new private key to ''
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [XX]:US
State or Province Name (full name) []:State
Locality Name (eg, city) [Default City]:City
Organization Name (eg, company) [Default Company Ltd]:Business Name or
Organizational Unit Name (eg, section) []:optional
Common Name (eg, your name or your server's hostname) []
Email Address []:optional

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:Enter
An optional company name []:Enter

With the above command, both the CSR ( and Private Key ( files are created.

It is important to note in the above example to use the fully qualified domain name (FQDN) for the “Common Name”. If you are going to use the certificate with, enter “”. If you are using an alternate subdomain, such as orders, type “”.

Some SSL providers may create certificates that work for both and, but there is no guarantee this will work for you.

By admin on September 16, 2014 | Apache | A comment?

How to Resize a Linux Cloud Disk Size After an Upgrade


This article was written to outline the steps required to resize the disk space on a Codero Cloud instance that had previously been upgraded to a larger size.



A Codero Cloud account
A running Codero Cloud instance that had previously been upgraded to a larger size.




Log In

Log into your cloud instance as root using SSH


Verify upgraded size

You can verify the size of the drive had been upgraded by running the following command:

# fdisk -l /dev/xvda
Sample Output:

Disk /dev/xvda: 39.7 GB, 39728447488 bytes
255 heads, 63 sectors/track, 4830 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c1698

The available disk is 39.7GB


Verify current disk size

Check the current size of the disk by running the df (disk free) command

df -h
Sample Output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda3       19G  1.1G   17G   6% /
tmpfs           497M     0  497M   0% /dev/shm
/dev/xvda1      485M   64M  396M  14% /boot

In this example the current usable disk size is 19G


Resize the disk

Resize the disk using the resize2fs command

# resize2fs /dev/xvda3
Sample Output

By admin on July 18, 2014 | Cloud, Linux | A comment?

How to use the nano command line editor in Linux

This article is designed to provide a few basic instructions for using the Linux nano command line editor. While nano does not offer the power of editors such as vi or vim, it works great for day to day editing where advanced features are not required.

Install nano

CentOS, Fedora, Redhat

sudo yum install nano

Ubuntu, Debian

sudo apt-get install nano


Start nano

nano /path/to/file/filename


Basic Editing

Using the nano editor is similar to most graphical editors you have used. Use the arrow keys to navigate the file, and type text as required. You can even use the Delete and Backspace buttons.

The keyboard is always in “insert” mode. You cannot de-select this to change to “over-strike” mode.


Keyboard shortcuts

Cancel: If you accidentally enter a command, you can cancel it anytime by pressing Ctrl+c to return to the editor.

Exit: Ctrl+x
If you have not saved your work, you will be promted to before exiting the program.

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?

Press y to save or n to exit without saving.

Save: Ctrl+o
To continue using the current file name, simply press Enter
To save to a new file name, enter the new name, then press Enter

Search: Ctrl+w
Enter the text you are searching for and press Enter
To search for additional instances of the same text, simply press Ctrl+w again followed by Enter

Search and Replace: Ctrl+\ (backslash)
Type the text to search for and press Enter.
Next type the text you are going to replace it with, then press Enter.
Before any text is replaced, the program will highlight the next intance it finds of the text to replace and will prompt you with the following question:

Replace this instance?

Press y to replace the displayed instance and move to the next.
Press n to skip and move to the next instance.
Press a to replace all instances found in the file.

By admin on July 5, 2014 | Linux | A comment?

How to use a2ensite and a2dissite with rpm based apache systems

One thing this author prefers, it is the Debian (apt-get) style use of a2ensite and a2dissite to enable and disable hosted domains. This guide will show you how to set up a similar system in rpm based (Redhat, Fedora, CentOS, etc) systems.

Set up instructions

To setup a similar system on your rpm based server, simply follow the steps outlined below.

Create the folder structure

As root, run the following commands:

mkdir /etc/httpd/sites-available
mkdir /etc/httpd/sites-enabled

Edit httpd.conf

The first step is to include the sites-enabled folder in your httpd.conf file.

nano /etc/httpd/conf/httpd.conf

Now add the following line at the bottom of the file and save the file.

Include sites-enabled/*.*

Restart apache to use the new setting

service httpd restart

Create the a2ensite and a2dissite commands

Create the following files and add the content displayed.


nano /usr/local/bin/a2ensite
#! /bin/bash

# bash script to use debian style vhosts
# vhost file must be in /etc/httpd/sites-available
# script will make a softlink to /etc/httpd/site-enabled
# and restart httpd
# use a2dissite to remove the link


if [ -f $AVAILABLE/$FILE ]
    	if [ -s $AVAILABLE/$FILE ]
            	ln -s $AVAILABLE/$FILE $ENABLED/$FILE
                service httpd restart
            	echo "File $FILE is empty. No action taken"
    	echo "File $FILE does not exist. No action taken"


nano /usr/local/bin/a2dissite
#! /bin/bash

# bash script to use debian style vhosts
# vhost file must be in /etc/httpd/sites-available
# script will delete a softlink from /etc/httpd/site-enabled
# and restart httpd
# use a2ensite to restore the link


if [ -f $ENABLED/$FILE ]
    	rm -f $ENABLED/$FILE
        service httpd restart
    	echo "File $FILE does not exist. No action taken"

Set the files as executable

chmod 744 /usr/local/bin/a2ensite
chmod 744 /usr/local/bin/a2dissite

How to use

The examples below assume you named the domain virtual configuration files after the domain name.

These versions of a2ensite and a2dissite differ from the Debian (apt-get) system by automatically restarting apache upon success. With apt-get based systems, you need to manually restart apache.

Create the virtual host configuration file

This can be used as a very basic, yet functioning virtual host configuration file:

nano /etc/httpd/sites-available/
<VirtualHost *:80>
        DocumentRoot    /var/www/vhosts/
        ErrorLog        /var/www/vhosts/log/error_log
        TransferLog     /var/www/vhosts/log/access_log
        LogLevel warn

Enable a site


Disable a site

By admin on April 28, 2014 | Apache | A comment?

How to add an additional IP in Debian or Ubuntu

View Current Network Settings

Before we start, lets take a look at the current settings.

cat /etc/network/interfaces
auto eth0
iface eth0 inet static
hwaddress 00:12:34:56:78:9A

auto lo
iface lo inet loopback


Configure Updated Settings

Before proceeding, a couple of variables need to be defined.

EthX:1 = The interface your IP is connected to. If your current IP is set with auto eth0, you will use eth0:1. If your current IP is set with auto eth1, you will need to use eth1:1.
IpAddress = The IP address you are adding to your server.
GatewayIP = The IP address you are adding to your server, but replace the last octet with 1. Example: if your IP address is, then gatewayIP =

Using the variable defined above, you are ready to configure the network adaptor to use your new IP and gateway. Use the nano editor which comes installed by default with Ubuntu and add the following lines underneath dns-nameservers.

sudo nano /etc/network/interfaces
auto EthX:1
iface EthX:1 inet static 
address IpAddress
gateway GatewayIP

Once you have entered the values correctly, press Ctrl+Enter to save it with the current filename, then press Ctrl+X to exit the editor.

Provided you entered your values correctly, verify the new settings by retyping the cat command:

cat /etc/network/interfaces
auto eth0
iface eth0 inet static 

auto eth0:1
iface eth0:1 inet static 

auto lo
iface lo inet loopback


Apply setting to Interface

After you have determined the values entered are correct, restart networking with the following command:

sudo service networking restart
stop: Unknown instance: 
networking stop/waiting



Your IP should now be working correctly.

By admin on March 6, 2014 | Debian / Ubuntu, Linux | A comment?