aws autoscaling describe-auto-scaling-instances \
| jq '.AutoScalingInstances[] | {AutoScalingGroupName, InstanceId}'
list instance IDs for a particular ASG
| import logging | |
| import boto3 | |
| import datetime | |
| from botocore.exceptions import ClientError | |
| def lambda_handler(event, context): | |
| # Set up logging | |
| logging.basicConfig(level=logging.DEBUG, | |
| format='%(levelname)s: %(asctime)s: %(message)s') | |
| # get current ec2 AutoScaling group name | |
| # note: change region option as yours | |
| aws autoscaling describe-auto-scaling-instances --region us-east-1 --output text --query=AutoScalingInstances[].AutoScalingGroupName --instance-ids=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) |
| ''' | |
| This is an example of the server-side logic to handle slash commands in | |
| Python with Flask. | |
| Detailed documentation of Slack slash commands: | |
| https://api.slack.com/slash-commands | |
| Slash commands style guide: | |
| https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c | |
| ''' |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "net" | |
| "os" | |
| "strings" |
There is so much documentation online from RedHat and CentOS about this topic - it's sad that I am writing this. But the real state of documentation on this topic (CentOS 7 + KS + ISO = Bootable DVD) is almost non-existent.
I found this: http://smorgasbork.com/component/content/article/35-linux/151-building-a-custom-centos-7-kickstart-disc-part-1
Which I greatly appreciate and +1, but the documentation is half-baked and there are numerous errors.
Finally... FINALLY! After four days of banging my head, I got this to work. Hopefully someone else will be able to do this in a few hours, instead of blowing their weekend like me. :(
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| 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" \ |
| import sys | |
| """ | |
| Resolve the DNS/IP address of a given domain | |
| data returned is in the format: | |
| (name, aliaslist, addresslist) | |
| @filename resolveDNS.py | |
| @version 1.01 (python ver 2.7.3) | |
| @author LoanWolffe | |
| """ |