aws linux partition resize

http://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux 1、AWS console EC2 resizse 2、login EC2 2.1、 lsblk get info to disk size. Is resize ok? 2.2 resize2fs /dev/xvda1 If 2.2 finish, then resize faild. follow 2.3 2.3 parted /dev/xvda 2.3.1 parted> print all -> get disk real size 2.3.2 parted> resizepart 2.3.3 parted> 1 2.3.4 parted End?>put size is 2.3.1 2.3.5 parted>exit then 2.2 again. If ok then 2.1 check age. PS: 2.3.4 End?> -1 -1 最大磁碟空間

2017-08-01 · 1 min · 69 words · Me

go aws ec2 control

package main import ( “fmt” “log” “net/http” “io/ioutil” “github.com/gorilla/mux” “github.com/smartystreets/go-aws-auth” ) func stopEC2InstanceHandler(w http.ResponseWriter, req *http.Request) { vars := mux.Vars(req) w.Write([]byte(fmt.Sprintf(“stopEC2InstanceHandler: %v \n\n”, vars[“id”]))) var Action = “StopInstances” //check aws website var Version = “2016-11-15” //need to check api version from aws website //regoin need to check url from aws website. ex: ap-northeast-2 //some region no support some action apiUrl := “https://ec2.ap-northeast-2.amazonaws.com/?Action=" + Action + “&Version=” + Version + “&InstanceId.1=” + vars[“id”] client := new(http.Client) ...

2017-07-25 · 1 min · 202 words · Me

aws ami snapshot 備份

參考網路上的修改過 https://simplyopensource.blogspot.tw/2014/04/script-to-create-daily-ami-of-aws.html https://github.com/colinbjohnson/aws-missing-tools/blob/master/ec2-automate-backup/ec2-automate-backup.sh 使用指令 amibackup.sh -i i-0102e3b13418794d4 -r ap-northeast-2 -d 1 » /root/ami_backup/AmiBackupLog.log 2>&1 #!/bin/bash # ReadMe - How to use this script # cyfbackup.sh -r [region] -i [instance name] # -d [How may days ago to delete] -t [emulate today is how many days ago] #Define TextColor Varible to use #TextRedBgYellow="\e[0;31;43m" TextGreen="\e[0;32m" TextRed="\e[0;31m" TextYellow="\e[0;33m" TextBlue="\e[0;36m" EndText="\e[0m" #Define test_day for Emulate Today is some days ago. declare -i test_day=0 #get Paramenter -d beforeDay2Del, -i InstanceID, -r Region while getopts :d:i:r:t:end opt; do case $opt in d) remainDay=$OPTARG;; i) instance_id=$OPTARG;; r) region=$OPTARG;; t) test_day=$OPTARG;; *) echo “Option is invalid, Please check.”; exit 1;; esac done ...

2017-05-23 · 5 min · 877 words · Me

Schedule daily AMI of AWS [轉]Automate EBS Volume Backups – AWS Cli+Bash

https://www.linuxtutorial.co.uk/automate-ebs-volume-backups-bash/ https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup https://simplyopensource.blogspot.tw/2014/04/script-to-create-daily-ami-of-aws.html https://simplyopensource.blogspot.tw/2016/02/script-to-delete-ami-with-attached.html https://www.flynsarmy.com/2015/06/how-to-schedule-daily-rolling-ebs-snapshots/

2017-05-09 · 1 min · 5 words · Me

T2 instance CPU Credit Usage & Balance

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html CPUCreditUsage (Only valid for T2 instances) The number of CPU credits consumed during the specified period. consumed 消耗 CPUCreditBalance (Only valid for T2 instances) The number of CPU credits that an instance has accumulated. accumulated 累積

2016-11-28 · 1 min · 37 words · Me