Skip to content

Instantly share code, notes, and snippets.

View ysaotome's full-sized avatar

Yuichi Saotome ysaotome

View GitHub Profile
@ysaotome
ysaotome / install_pyenv.sh
Last active August 7, 2021 13:27
pyenv install for CentOS 6.5 x86_64
#!/bin/zsh
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@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'
@ysaotome
ysaotome / niftycloud-api-tools-installer.sh
Last active December 7, 2019 15:52
ニフティクラウドのCLIツール( http://cloud.nifty.com/api/cli/ )を自動セットアップするスクリプトと使用例
#!/bin/bash
# setup NIFTY Cloud API Tools
(
USER=${USER}
HOME=${HOME}
ARC=$(/bin/uname -m)
## OpenJDKセットアップ
/usr/bin/yum -y install java-1.6.0-openjdk.${ARC}
@ysaotome
ysaotome / CentOS6_rbenv_setup.sh
Created March 20, 2013 09:26
CentOS 6 rbenv setup
yum --enablerepo=rpmforge,epel,remi -y install gcc make zlib zlib-devel openssl-devel zsh
cd /usr/local
git clone git://github.com/sstephenson/rbenv.git rbenv
mkdir rbenv/shims rbenv/versions
chgrp -R groupname rbenv
chmod -R g+rwxXs rbenv
git clone git://github.com/sstephenson/ruby-build.git ruby-build
cd ruby-build
./install.sh
@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 / Ubuntu1404_64bit_Plain_setup_script_for_niftycloud.sh
Last active August 14, 2017 20:25
Ubuntu 14.04 64bit Plain setup script for NiftyCloud (http://cloud.nifty.com/)
#!/bin/bash
# Description:Ubuntu 14.04 64bit Plain setup script for NiftyCloud (http://cloud.nifty.com/)
# File:Ubuntu1404_64bit_Plain_setup_script_for_niftycloud.sh
# 2014/07/10 @ysaotome
(
#===============================================
# Settings
#===============================================
##rootのパスワード
@ysaotome
ysaotome / capture.sh
Last active August 14, 2017 20:22
バッチ処理でURL一覧ファイルから順次Chroniumでのレンダリング結果をキャプチャして保存していくスクリプト(サムネイル作成機能付き)
#!/bin/bash
LOGS_DIR='/var/www/html/logs'
THUMBNAIL_BIG_DIR='/var/www/html/thumbnail_big'
THUMBNAIL_SMALL_DIR='/var/www/html/thumbnail_small'
SCREEN_NUM=${2}
for i in `awk '{print $1}' < $1`
do
@ysaotome
ysaotome / gist:a2e18e98bf3c5cd60a73
Last active August 14, 2017 20:20
LXC環境セットアップ時のメモ
LXC環境セットアップ時のメモ
Ubuntu 14.04ホストセットアップ
下記を設定
https://gist.github.com/ysaotome/cdc02c05425e01abc500
LXCセットアップ
http://www.server-world.info/query?os=Ubuntu_14.04&p=lxc&f=1
@ysaotome
ysaotome / eccube3_db_install_with_centos71_for_niftycloud.sh
Created June 4, 2016 17:23
演習用:ニフティクラウド(NiftyCloud)向けEC-CUBE3セットアップスクリプト。http://[サーバIP]/ にEC-CUBE3がセットアップされる
#!/bin/bash
# Description:EC-CUBE3 Setup with CentOS 7.1 64bit Plain for NiftyCloud (http://cloud.nifty.com/)
# DBサーバ用ファイル
# 2016/06/01 @ysaotome
(
#===============================================
# Settings
#===============================================
##追加する管理ユーザ名
#!/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 '-')