Splitting a CSV file

I was a little reluctant to push out a change that would affect nearly 600 Access Points, so I wanted to do it in batches of 100. As the method of input was CSV, I needed to break this up.

The Split command from the GNU coreutils was the perfect solution for my needs.

split -l 100 list.csv –additional-suffix=.csv output/test -d

The output of that command produces the following files, each with 100 lines of data and places them inside the directory named output.


Without the –additional-suffice and -d options the files would not have the extension I was looking for, and it would have been ordered alphabetically instead of numerically.

[LAB] Secure Copy


2.1.e Use SCP for file transfer.

For this lab session I’ll be using:

Ubuntu Desktop 19.04
Cisco 7200 series Router


Out of the box the 7200 series Router that I’m using doesn’t have any flash or disk space available, but you can add them. Under ‘Configuration’ >  ‘Memories and disks’ an option to add PCMCIA disks is available.

Here they are on boot-up:

Router config:

R1(config)# ip domain-name layerunknown.com
R1(config)# crypto key generate rsa general-keys modulus 2048
R1(config)# username admin privilege 15 secret cisco
R1(config)# aaa new-model
R1(config)# aaa authentication login default local
R1(config)# aaa authorization exec default local
R1(config)# ip scp server enable

Host machines are getting IP addresses via DHCP from the Router. The Router’s address is

Testing and verifying SSH.

You might be wondering why I’m specifying the cipher. If I don’t I’ll receive the following error:

Unable to negotiate with port 22: no matching cipher found. Their offer: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc

Lets actually check the fingerprint. On the Router enter the following command:  show ip ssh

Copy from ssh-rsa to the end of the string and put it into a file. Remove any unnecessary white space and newlines and save the file, I saved it as test.pub.

Then execute the following command: ssh-keygen -lf test.pub

-f filename
Specifies the filename of the key file.

-l Show fingerprint of specified public key file. For RSA and DSA keys
ssh-keygen tries to find the matching public key file and prints its fin‐
gerprint. If combined with -v, a visual ASCII art representation of the
key is supplied with the fingerprint.

Comparing the output from that command to the RSA fingerprint we received when making the initial SSH connection we can see they match.

We’ve verified we’re connecting to the right device and that SSH is working. Lets test the PCMCIA disks work.

copy running-config disk0:

dir disk0:

Now for SCP.

I’ll first copy the running-config we just saved to disk0 from the router to my local machine. The following commands are being executed from the Ubuntu host.

scp -c aes256-cbc admin@ /home/admin/Desktop

This command is logging into the remote host at with the username admin then copying the file ‘running-config’ from disk0 and placing it onto my Desktop.

Then I’ll test the other direction by uploading test.pub from my local machine to disk0 on the router.

scp -c aes256-cbc ~/Desktop/test.pub admin@

See the results in the screenshot below:

Using the dir and more commands on the router we can verify this.

SCP lab complete.


GNS3 QEMU SPICE – Enabling copy and paste

The following needs to be added in the QEMU VM template (or node) additional settings/options:

-device virtio-serial -chardev spicevmc,id=vdagent,debug=0,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spiceport,name=org.spice-space.webdav.0,id=charchannel0 -device virtserialport,chardev=charchannel0,id=channel0,name=org.spice-space.webdav.0


** Adding “-usb -usbdevice tablet” will fix strange mouse behaviour on Windows guest machines.

*** To copy from a Windows guest to a Linux host install the spice-guest-tools for Windows from http://spice-space.org. Source.