$ wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
$ tar xvf Python-3.6.3.tgz
$ cd Python-3.6.3
$ ./configure --enable-optimizations
$ make -j8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get some values from all instances | |
aws ec2 describe-instances \ | |
| jq '.Reservations[].Instances[] \ | |
| {PublicDnsName, InstanceId, SecurityGroups}' | |
Get instance screenshoot | |
aws ec2 get-console-screenshot --instance-id instance_id \ | |
| jq -r '.ImageData' | base64 --decode | open -f -a /Applications/Preview.app | |
# Example de select by tag name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using configuration file in kubectl | |
kubectl --kubeconfig kubectl.config cluster-info | |
# kubectl.config file example | |
current-context: default-context | |
apiVersion: v1 | |
clusters: | |
- cluster: | |
api-version: v1 | |
server: https://172.31.53.107:443/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s -w "\n" http://169.254.169.254/latest/meta-data/placement/availability-zone | |
REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region) | |
aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=$KEY" --region=$REGION --output=json | jq -r .Tags[0].Value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_data = <<-EOF | |
#!/bin/bash | |
sudo service apache2 start | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
csshX --host hostfile.txt -l username --ssh_args " -i path/to/ssh_keys/key.pem" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global credential.helper '!aws codecommit credential-helper $@' | |
git config --global credential.UseHttpPath true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Go to Sublime Text to: Tools -> Build System -> New Build System | |
and put the next lines: | |
{ | |
"cmd": ["python3", "-i", "-u", "$file"], | |
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", | |
"selector": "source.python" | |
} | |
Then save it with a meaningful name like: python3.sublime-build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
START=$(date +%s) | |
this_instance=`aws ec2 run-instances --image-id $ami-id --key-name $key_name --instance-type t2.micro --security-groups $SG-Name --count 1 | jq -r '.Instances[] | ."InstanceId"'` | |
while true | |
do | |
# save the output of the line starting with INSTANCE, 6th field, to "status" | |
status=`aws ec2 describe-instance-status --instance-ids $this_instance| jq -r '.InstanceStatuses[].InstanceState.Name'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-pip | |
sudo pip install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz |
OlderNewer