This file contains 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 -xv | |
profile=$1 # determine aws account to deploy. | |
eb_user_key=$2 # set environment variable to configuration of eb. | |
[ "${profile}" = "" ] && profile=default | |
[ "${eb_user_key}" = "" ] && eb_role_key=default-eb | |
if [ "${eb_user_key}" != "" ];then | |
AWS_EB_KEY_INFO=$(php -r '$credentials = parse_ini_file("'${HOME}'/.aws/credentials", true);echo $credentials["'${eb_user_key}'"]["aws_access_key_id"] . " " . $credentials["'${eb_user_key}'"]["aws_secret_access_key"];') | |
set -- ${AWS_EB_KEY_INFO} |
This file contains 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 -xv | |
# Initialize Amazon Linux AMI 2015.09 for PHP7 Web Application | |
# yum | |
# update default | |
sudo yum upgrade --enablerepo="*" -y | |
# install php | |
for i in $(seq 3) | |
do | |
[ ! -s remi-release-6.rpm ] && curl --connect-timeout 3 http://remi.kazukioishi.net/enterprise/remi-release-6.rpm > remi-release-6.rpm |
This file contains 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
; Start a new pool named 'www'. | |
; the variable $pool can we used in any directive and will be replaced by the | |
; pool name ('www' here) | |
[www] | |
; Per pool prefix | |
; It only applies on the following directives: | |
; - 'slowlog' | |
; - 'listen' (unixsocket) | |
; - 'chroot' |
This file contains 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
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user www; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
#error_log /var/log/nginx/error.log notice; | |
#error_log /var/log/nginx/error.log info; |
This file contains 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 -xv | |
# Initialize Amazon Linux AMI 2015.03 for PHP5 Web Application | |
# yum | |
# update default | |
sudo yum upgrade --enablerepo="*" -y | |
# install php | |
for i in $(seq 3) | |
do | |
[ ! -s remi-release-6.rpm ] && curl --connect-timeout 3 http://remi.kazukioishi.net/enterprise/remi-release-6.rpm > remi-release-6.rpm |
This file contains 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 | |
# Initialize Amazon Linux AMI 2015.03 for PHP7 Web Application | |
# yum | |
# update default | |
sudo yum upgrade --enablerepo="*" -y | |
# install php7 | |
[ ! -s remi-release-6.rpm ] && curl http://remi.kazukioishi.net/enterprise/remi-release-6.rpm > remi-release-6.rpm | |
sudo yum localinstall -y remi-release-6.rpm | |
sudo yum install scl-utils --enablerepo="*" -y |
This file contains 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
$ [ a = b ] && echo true || echo false | |
false | |
$ [ a == a ] && echo true || echo false | |
true |
This file contains 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 'http://realtime.search.yahoo.co.jp/search?p=%E3%83%92%E3%83%A5%E3%83%BC%E3%82%B6&ei=UTF-8' | | |
sed -e 's/\\n//g' | | |
egrep -o '<em>ヒューザ<\/em> .+<\/a><\/dd>' | | |
sed -e 's/[a-zA-Z\/<>]//g' | | |
awk '{print ($2 != "") ? $2 : "Hyuza not found.";}' |
This file contains 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
# Check version of bash each AWS EC2 instances written in /etc/hosts. | |
# As for tomahawk options, see http://tomahawk.readthedocs.org/en/latest/tomahawk.html | |
# logged in as a user which has the same password in each server. | |
echo YOUR_COMMON_PASSWORD | | |
# execute tomahawk. | |
# yarr is one of a utility command in OpenUsp-Tukubai (https://github.com/usp-engineers-community/Open-usp-Tukubai) | |
tomahawk --login-password-stdin -c -h -t 10 \ | |
"$(awk '$0~/^(10|192|172)\./{print $1}' /etc/hosts|yarr|tr " " ",")" \ | |
'echo ${HOSTNAME} $(LANG=C yum info bash|grep amzn1|head -1)' |
This file contains 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
// For printout https://gist.github.com | |
// DOM | |
$('#header').remove(); | |
$('#repos').remove(); | |
$('.secondary').remove(); | |
$('.meta').remove(); | |
$('#footer').remove(); | |
$('.push').remove(); | |
$('#comments').remove(); |