Send history of current host to some other host over ssh

Sometimes I want to save the history of current host on another host. This is to ensure that I can use copy/paste on other host to run the commands. To this, I found a simple solution –

history| ssh <user>@<host> 'cat - > /tmp/history'

And on the new host, you can find the history in file “/tmp/history”, cool :). Now I can quick edit this file to create this as shell script as well if required. How cool is that.

Quick screen sharing and meeting without any software

Wanted to share this as this seems to be good option:

Add ova file as VM on Linux with libvirt (Qemu)

Although the commands are very simple and just 2-3 steps but I keep forgetting them and hence wrote the following script:

The script takes input as “ova” filename and then creates the qcow2 image and finally a VM for you.

#!/bin/bash - 
#          FILE:
#         USAGE: ./ 
#       OPTIONS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka), 
#       CREATED: 12/28/2017 13:59
# Last modified: Thu Dec 28, 2017  02:17PM
#      REVISION:  ---

set -o nounset                              # Treat unset variables as an error

if [[ $# == 0 ]]
    echo "You need to provide ova/vmdk filename"
if [[ $1 == *ova ]]
    tmp=$(mktemp -d /tmp/amitXXXXXXX)
    cd  $tmp
    tar xvf $1
    file=$(echo $PWD/*vmdk)
    echo "Not a OVA file"
dfile="$dest/$(basename $file)"

read -p "Enter the name for VM" vmname
qemu-img convert $file $dfile -p -c -O qcow2
virt-install --disk $dfile --ram 512 \
    --virt-type kvm --vcpus 1 --name "$vmname" --import