start new:
tmux
start new with session name:
tmux new -s myname
| function increment_ipv4 { | |
| local ip_base=$1 | |
| local incr_amount=$2 | |
| local -a ip_components | |
| local ip_regex="([0-9]+).([0-9]+).([0-9]+).([0-9]+)" | |
| [[ $ip_base =~ $ip_regex ]] | |
| ip_components=("${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}" "${BASH_REMATCH[4]}") | |
| ip_dec=0 | |
| local comp | |
| for comp in "${ip_components[@]}"; do |
| # Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM | |
| # AND install 7-zip, curl and .NET 4 if its missing. | |
| # Then use the EC2 tools to create a new AMI from the result, and you have a system | |
| # that will execute user-data as a PowerShell script after the instance fires up! | |
| # This has been tested on Windows 2008 SP2 64bits AMIs provided by Amazon | |
| # | |
| # Inject this as user-data of a Windows 2008 AMI, like this (edit the adminPassword to your needs): | |
| # | |
| # <powershell> | |
| # Set-ExecutionPolicy Unrestricted |