SSH connection inside while Bash loop

Published on Author admin

When using SSH connection inside while Bash loop, there is need to redirect SSH input to /dev/null, as SSH reads standard input by default: #!/bin/bash while read IP; do echo $IP; ssh root@$IP -C hostname < /dev/null; echo "" done < ip.txt Contnet of ip.txt file: 192.168.0.10 192.168.0.11 192.168.0.12

Creating AWS EC2 instances from CLI

Published on Author admin

Install Python PIP: yum install python-pip or yum install python3-pip Install AWS CLI using PIP: pip install awscli --user or pip3 install awscli --user PIP installs aws inside $HOME/.local/bin/ directory. Configure $PATH inside ~/.bash_profile PATH=$PATH:$HOME/bin:$HOME/.local/bin Configure AWS client: $ aws configure AWS Access Key ID [None]: AWSACCESSKEYID AWS Secret Access Key [None]: AWSSECRETACCESSKEY Default region… Continue reading Creating AWS EC2 instances from CLI

Running KVM hypervisor on VPS server

Published on Author admin

Running KVM (Kernel-based Virtual Machine) hypervisor on VPS servers. Some of current VPS servers are OpenStack KVM virtual machines with nested virtualization enable, so you are able to run a nested KVM virtual machine. Check whether VPS CPU supports Intel virtualization instruction set. You should see 'vmx' string in returned value. grep vmx /proc/cpuinfo Install… Continue reading Running KVM hypervisor on VPS server

Running speedtest from CLI

Published on Author admin

Download speedtest script from GitHub: wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py Make it executable: chmod +x speedtest-cli Run test: ./speedtest-cli To get link with results of test as PNG image: ./speedtest-cli --share To specify to which server connect: ./speedtest-cli --list ./speedtest-cli --server 4166