Skip to content

Instantly share code, notes, and snippets.

View ysaotome's full-sized avatar

Yuichi Saotome ysaotome

View GitHub Profile
@ysaotome
ysaotome / wordpress_automatic_install_script_with_centos63_setup_for_niftycloud.sh
Last active December 16, 2015 12:28
ニフティクラウド(NiftyCloud)向けWordpress自動セットアップスクリプト(https://gist.github.com/ysaotome/2235302)とOSのセットアップスクリプトを合体。起動スクリプトとして実行すると http://[サーバIP]/wordpress にWordpressがセットアップされる。
#!/bin/bash
# CentOS 6.3 64bit Plain setup script for NiftyCloud
# 2013/04/22 @ysaotome
#===============================================
# Settings
#===============================================
##rootのパスワード
ROOT_PASSWORD='hoge##123'
##追加する管理ユーザ名
@ysaotome
ysaotome / centos66_64bit_Plain_setup_script_for_niftycloud.sh
Last active May 13, 2016 01:29
CentOS 6.6 64bit Plain setup script for NiftyCloud (http://cloud.nifty.com/)
#!/bin/bash
# Description:CentOS 6.6 64bit Plain setup script for NiftyCloud (http://cloud.nifty.com/)
# File:centos66_64bit_Plain_setup_script_for_niftycloud.sh
# 2016/05/01 @ysaotome
(
#===============================================
# Settings
#===============================================
##rootのパスワード
#!/bin/bash
# File:chef-solo_automatic_install_with_centos63_64bit_Plain_for_niftycloud.sh
# 2013/06/16 @ysaotome
#===============================================
# Settings
#===============================================
##ニフティクラウドのAPIキーを埋め込むと便利
NIFTY_CLOUD_ACCESS_KEY='Your NIFTY Cloud Access Key'
NIFTY_CLOUD_SECRET_KEY='Your NIFTY Cloud Secret Key'
@ysaotome
ysaotome / serverspec_install_with_centos64_x86_64.sh
Created June 21, 2013 11:57
CentOS 6.4 x86_64 にserverspecセットアップするスクリプトー
#!/bin/bash
# File:serverspec_install_with_centos64_x86_64.sh
# 2013/06/21 @ysaotome
## セットアップに必要なライブラリのインストール
/usr/bin/yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison
## rbenvセットアップ
/usr/bin/git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
/bin/mkdir /usr/local/rbenv/{shims,versions}
@ysaotome
ysaotome / wordpress_setup_cheatsheet.sh
Last active December 19, 2015 17:39
2台構成(Web/APPサーバ1台、DBサーバ1台)のWordpressをセットアップする時のチートシート Japan TechFesta 2013 E30: 「ニフティクラウドを使ったインフラオートメーションハンズオン」http://www.techfesta.jp/p/program-2.html#E30の Chef vs 人力対決用
#Wordpress構築チートシート
#元ネタ:https://gist.github.com/ysaotome/2235302
#対決相手:http://tily.github.io/jtf2013/
###############################################
# 環境変数を定義 WEB/APPサーバおよびDBサーバの双方で実行
###############################################
## MySQL管理ユーザのパスワード
export MYSQL_ROOT_PASS='mysql##123'
## Wordpressデータベース名
@ysaotome
ysaotome / update_motd_by_screenfetch.sh
Last active March 4, 2021 13:29
/etc/motdにサーバ情報を書き込むスクリプト。cronとかで回しておくと便利。#Ubuntu(http://manpages.ubuntu.com/manpages/lucid/man5/update-motd.5.html) やAmazonLinuxみたいなupdate-motdがCentOSにも欲しい。
#!/bin/bash
# Description:UpdateMotd by screenFetch
# References: http://goo.gl/xpWV7L
# 2015/07/08 @ysaotome
FILE_MOTD='/etc/motd'
BIN_DATE='/bin/date'
BIN_FIGLET='/usr/bin/figlet'
BIN_HOSTNAME='/bin/hostname'
#!/bin/bash
# File:change_root_password.sh
# 2013/07/18 @ysaotome
#===============================================
#設定したいrootパスワード「hoge##123」の部分を改変
#===============================================
ROOT_PASSWORD='hoge##123'
#===============================================
SALT=$(/usr/bin/uuidgen| /usr/bin/tr -d '-')
@ysaotome
ysaotome / PPTP_vpn_setup_for_centos64.sh
Last active December 20, 2015 03:59
CentOS 6.4 x86_64 に対してPPTPでVPNを構築するスクリプト。※DoCoMo SPモードではPPTP使えないので注意。
#!/bin/bash -x
# Description:PPTP for CentOS 6.4 64bit
# 2013/07/28 @ysaotome
(
### setting
/bin/cat << _SECRETS_ > /tmp/SECRETS_TMP.txt
#==============================================\n
# username auth_server password auth_ipaddress\n
"hoge001" "pptpd" "hoge##123" *\n
@ysaotome
ysaotome / L2TP_IPSec_vpn_setup_for_centos65.sh
Last active December 26, 2017 23:18
CentOS 6.5 x86_64 に対してL2TP/IPSecでVPNを構築するスクリプト。 参考ページ:https://gist.github.com/CLCL/5742738
#!/bin/bash -x
# Description:L2TP/IPsec for CentOS 6.5 64bit
# 2014/01/06 @ysaotome
(
### setting
/bin/cat << _SECRETS_ > /tmp/SECRETS_TMP.txt
#==============================================
# username auth_server password auth_ipaddress
"hoge001" "xl2tpd" "hoge##123" *
@ysaotome
ysaotome / installing_ricty_on_MacOSX.sh
Last active December 27, 2015 06:59
プログラミング用フォントRitcyをOS X Mavericks (10.9)でセットアップ。要 homebrew https://github.com/yascentur/Ricty
#!/bin/bash
## install fontforge
brew install fontforge
##mkdir work
mkdir ~/.Trash/ricty
cd ~/.Trash/ricty
## get fontfiles