aws autoscaling describe-auto-scaling-instances \
| jq '.AutoScalingInstances[] | {AutoScalingGroupName, InstanceId}'
list instance IDs for a particular ASG
| " _ _ " | |
| " _ /|| . . ||\ _ " | |
| " ( } \||D ' ' ' C||/ { % " | |
| " | /\__,=_[_] ' . . ' [_]_=,__/\ |" | |
| " |_\_ |----| |----| _/_|" | |
| " | |/ | | | | \| |" | |
| " | /_ | | | | _\ |" | |
| It is all fun and games until someone gets hacked! |
| openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem | |
| chmod 600 id_rsa.pem |
| #!/usr/bin/env php -n | |
| <?php | |
| function apache_vhosts($binary='/usr/sbin/apache2ctl') | |
| { | |
| $command = " -S 2>&1 | grep 'port ' | awk {'print $2,$4'} | sort -u -t' ' -k2,2 | grep -v 'localhost'"; | |
| $vhosts = shell_exec(sprintf("%s %s", $binary, $command)); | |
| $vhosts = explode("\n", trim($vhosts)); | |
| $results = array(); | |
| foreach($vhosts as $vhost) |
| # read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
| # latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
| # security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
| # your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
| # $ nginx -c /etc/nginx/nginx.conf -t | |
| server { | |
| # public key, contains your public key and class 1 certificate, to create: | |
| # (example for startssl) | |
| # $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
| # Download the legacy format for NGINX compatibility | |
| wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
| wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
| # Unzip | |
| gunzip Geo*.gz | |
| # Copy to /usr/share/GeoIP/ | |
| cp Geo*.dat /usr/share/GeoIP/ |
| --- | |
| sockets: | |
| - id: 'one' | |
| address: '127.0.0.1' | |
| port: '8001' | |
| - id: 'two' | |
| address: '127.0.0.2' | |
| port: '8002' |
| wget http://stedolan.github.io/jq/download/linux64/jq | |
| aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
| "Name=instance-state-name,Values=running" \ | |
| | jq -r \ | |
| ".Reservations[] | .Instances[] | .InstanceId" \ | |
| aws ec2 describe-volumes --filters \ | |
| "Name=status,Values=available" \ | |
| | jq -r ".Volumes[] | .VolumeId" \ |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.