Port forwarding using HAproxy

Published on Author admin

HAproxy can be used not only for complex load-balancing scenarios, but also for simple port forwarding. Useful for forwarding packets originating from both local and external hosts. listen postgresql 0.0.0.0:5432     mode tcp     stats enable     balance roundrobin     server postgresql-db 192.168.0.1:5432 check

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