Skip to content

hihats/dotfiles

Repository files navigation

Creation of an Environment 環境構築

Mac OSX

XCode Install

$ sudo xcodebuild -license
# install homebrew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# enable brew-bundle
$ brew tap homebrew/bundle

⚠️brewdlerはbundleにReplaceされたようです

$ mkdir -p ~/github/hihats && cd ~/github/hihats
$ git clone https://github.com/hihats/dotfiles.git

ここではMacOS標準搭載のgitを使い、以後はbrew installしたgitを使う

Applications can be in Brewfile

$ cd dotfiles
$ brew bundle

bashrc,vimrcなど

$ sh makesymlink.sh

⚠️ssh/configは公開可能なものだけかチェック

Ruby Env

基本はDockerで開発するが、ローカルでちょっとしたスクリプトを動かすケースなど

rbenv global 2.2.0
rbenv rehash

rbenv exec gem install bundler

Python Env

pip install pylama pylama-pylint

atom

sync settingで設定を同期

  • Copy the access token to Sync Settings configuration.(別保管)
  • Gist ID (username/******部)を設定する

ローカルは以上

aws EC2 instance setup

$ sudo vim /etc/hosts
$ sudo vim /etc/sysconfig/network
$ sudo ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
$ sudo vim /etc/sysconfig/clock
ZONE="Asia/Tokyo"

create user

$ sudo useradd hihats
$ sudo passwd hihats
$ sudo visudo
$ sudo gpasswd -a hihats wheel

install middleware

$ sudo vim /etc/sysconfig/i18n
sudo yum update
sudo yum install ruby-devel gcc sqlite-devel gcc-c++
sudo yum install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel
sudo yum list
sudo yum list | grep mysql
sudo yum install patch
yum repolist
sudo yum install mysql-server mysql-devel
sudo yum install httpd httpd-devel
sudo yum install graphviz
sudo yum install memcached
sudo yum install make bzip2 autoconf automake libtool bison git
sudo yum install libffi
sudo yum install libffi-devel

LinuxにRails環境構築

Linux環境へrbenv install rbenvをシステムワイドにインストールする CentOSでsystem wideなrbenv+ruby-build環境を構築する

root

cd /usr/local/
git clone https://github.com/sstephenson/rbenv.git
echo 'export RBENV_ROOT="/usr/local/rbenv"' >> /etc/profile
echo 'export PATH="${RBENV_ROOT}/bin:${PATH}"' >> /etc/profile
echo 'eval "$(rbenv init -)"' >> /etc/profile
cat /etc/profile

mkdir rbenv/plugins
cd rbenv/plugins/
git clone git://github.com/sstephenson/ruby-build.git
. /etc/profile
rbenv install -l
rbenv install 2.0.0-p643
rbenv global 2.0.0-p643
ruby -v
exit
grep 'secure_path' /etc/sudoers
grep -n 'secure_path' /etc/sudoers
vim /etc/sudoers
exit
cd /usr/local/
mkdir rbenv/shims rbenv/versions
groupadd rbenv
chgrp -R rbenv rbenv
chmod -R g+rwxXs rbenv =>  Seccurity Error!!

SGID権限はRuby2.0以降でErrorとなる :warning:システムワイドな rbenv の SecurityError

sudo visudo
bash -c 'cat <<\__EOT__ >> ~/.bash_profile
export RBENV_ROOT="/usr/local/rbenv"
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
__EOT__'

sudo gem install passenger

root

passenger-install-apache2-module

LinuxにPython環境構築

pyenv install

$ cd /usr/local/
$ git clone https://github.com/yyuu/pyenv.git
$ echo 'export PYENV_ROOT="/usr/local/pyenv"' >> /etc/profile
$ echo 'export PATH="${PYENV_ROOT}/bin:${PATH}"' >> /etc/profile
$ echo 'eval "$(pyenv init -)"' >> /etc/profile

python install (e.g. 3.5.0)

$ pyenv install 3.5.0
$ pyenv global 3.5.0
$ pyenv local 3.5.0
$ sudo pip install --upgrade pip

LinuxにPHP環境構築

phpenv使用

$ cd /usr/local/
$ git clone https://github.com/CHH/phpenv
$ cd phpenv/bin
$ ./phpenv-install.sh
$ echo 'export PHPENV_ROOT="/usr/local/phpenv"' >> /etc/profile

$ yum install bison re2c
$ yum install libxml2 libxml2-devel
$ yum install jpeglib.h
$ yum install libpng-devel libjpeg-devel
$ yum install libmcrypt-devel.x86_64
$ yum install libtidy libtidy-devel
$ yum install autoconf.noarch
$ export PHPENV_APACHE_MODULE_PATH="/etc/httpd/modules"
$ vim plugins/php-build/share/php-build/default_configure_options
$ phpenv install 5.6.14
$ phpenv rehash
$ phpenv global 5.6.14
$ cp /usr/lib64/httpd/modules/libphp5.so versions/5.6.14/

20+ common PHP compilation errors and fix – Unix
Apache phpenvをシステムワイドにインストールする方法
phpenv+php-build環境によるphpバージョン管理Mac(Yosemite)編
ubuntuにphp-buildでphp5.5を入れるためにシェルスクリプトと格闘した記録
rbenv: version \2.2.3' is not installed (set by RBENV_VERSION environment variable)`とRBENV_VERSIONについて怒られる場合がある。phpenvがRBENV_VERSION変数を見に行ってしまっている。

Passenger install

EC2のt2.microではメモリが足りなくてコンパイル出来ませんでした。t2.small以上を選択する必要があります。 Virtual Memory Exhausted: Cannot Allocate Memory While Install Passenger on AWS

apacehグループにgpasswdで追加できない問題発生

/etc/groupにはある

MySQL起動

CREATE USER
SET PASSWORD for hihats = PASSWORD('******');
GRANT ALL PRIVILEGES ON *.* TO
CREATE DATABASE itbee_development DEFAULT CHARACTER SET utf8;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published