View deregister_all_tasks_filtered_by_family_prefix.sh
#!/bin/sh
PROFILE=$1
TASK_DEFINITION=$2
r=$(aws ecs --profile $PROFILE list-task-definitions --family-prefix $TASK_DEFINITION --query 'taskDefinitionArns[]')
echo $r | jq -r '.[]' | while read task
do
rev=$(echo $task | sed -e's|^.*task-definition\/\(.*\)$|\1|g')
aws ecs --profile $PROFILE deregister-task-definition --task-definition $rev
View hubot-github-comment.coffee
# Description:
# hubot monitoring git comments mention and slack DM
#
# Dependencies:
# "hubot-slack": "^4.4.0"
# "hubot-slack-attachement": "^1.0.1"
#
# Commands:
# None
#
View slack.sh
slack() {
curl -X POST "https://hooks.slack.com/services/xxxxxxx/xxxxxxx/xxxxxxxxxxxxxxxx" -d "payload={
\"username\": \"<user_name>\",
\"icon_emoji\": \":outbox_tray:\",
\"attachments\": [{
\"color\": \"$1\",
\"title\": \"$2\",
\"text\": \"$3\"
}]
}"
View peco-git-atom.sh
function peco-git-atom() {
local dir=$(ghq list -p | peco)
if [ -n "$dir" ]; then
atom "$dir"
fi
}
alias opg='peco-git-atom'
View peco-sshconfig-ssh.sh
function peco-sshconfig-ssh() {
local host=$(grep 'Host ' ~/.ssh/config | awk '{print $2}' | peco)
if [ -n "$host" ]; then
echo "ssh -F ~/.ssh/config $host"
ssh -F ~/.ssh/config $host
fi
}
alias sshc='peco-sshconfig-ssh'
View stop_and_start_ec2_instance.sh
#!/bin/bash
#
# Action
# stop and start instance.
#
# Precondition
# - Install aws cli
# - aws configured and create ~/.aws/config.
# - Install jq
#
View check_aws_events.sh
#!/bin/bash
#
# Action
# checks AWS events and show lists of events.
#
# Precondition
# - Install aws cli
# - aws configured and create .aws/config.
# - Install jq
#
View hubot
#!/bin/sh
#FOREVER=/usr/bin/forever
HUBOT_HOME=/home/hu/mybot
FOREVER=$HUBOT_HOME/node_modules/forever/bin/forever
who=$(whoami)
if [ "${who}" != "root" ]; then
echo "Usage: sudo bin/hubot (start|stop|restart|status). 'sudo' is requied ! Please again.\n"
exit 1;
View cron_adagea_maxim.coffee
# Description:
# Example scripts for you to examine and try out.
#
# Notes:
# They are commented out by default, because most of them are pretty silly and
# wouldn't be useful and amusing enough for day to day huboting.
# Uncomment the ones you want to try and experiment with.
#
# These are from the scripting documentation: https://github.com/github/hubot/blob/master/docs/scripting.md
View vagrant-rancher.md
$ git clone https://github.com/rancher/os-vagrant.git
$ cd os-vagrant

// Vagrantfile 編集
$ vi Vagrantfile
$ vagrant up
  • Vagrantfile