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
tasks: | |
- name: set timezone to Asia/Tokyo | |
timezone: | |
name: Asia/Tokyo | |
- name: add epel | |
yum: | |
name: epel-release | |
state: latest | |
- name: add mysql repo | |
yum: |
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
yum install etcd kubernetes flannel | |
vi /etc/etcd/etcd.conf | |
#-------- | |
#ETCD_LISTEN_CLIENT_URLS="http://localhost:2379" | |
ETCD_LISTEN_CLIENT_URLS="http://master01:2379,http://localhost:2379" | |
#-------- | |
systemctl start etcd |
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
mysql> CREATE ROLE super_user_role; | |
Query OK, 0 rows affected (0.11 sec) | |
mysql> GRANT ALL ON srockstyle.* TO super_user_role; | |
Query OK, 0 rows affected (0.15 sec) | |
mysql> CREATE USER 'srockstyle'@'%' IDENTIFIED BY "aaaaaaaaa" DEFAULT ROLE super_user_role; | |
Query OK, 0 rows affected (0.02 sec) |
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
# インストール | |
$ yum -y install yum-utils | |
$ yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional | |
$ sudo yum install python2-certbot-nginx | |
# 始める | |
$ sudo certbot --nginx | |
# ワイルドカード | |
$ sudo certbot -a dns-plugin -i nginx -d "*.example.com" -d example.com --server https://acme-v02.api.letsencrypt.org/directory |
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
rvm get latest |
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
GRANT ALL PRIVILEGES ON *.* TO root@'%'; | |
FLUSH PRIVILEGES; |
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
# songテーブルとalbamテーブルに | |
$ rails g migration AddIdsToSong | |
$ rails g migration AddIdsToAlbum |
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
## scope | |
# scopeさんはよくつかうであろう検索条件を書いておくことができます。これをやることで毎回同じこと書かずに済みます。 | |
scope :rock_artist_search,where(genre: "rock") | |
Artist.rock_artist_search | |
## ids | |
# レコードのidだけをとってきます | |
Artist.ids |
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
##------------------------- | |
# where | |
##------------------------- | |
## 基本 | |
@artsts = Artist.where(genre: 'Rock') | |
## 配列で指定もできます。この場合は探したい文字列のところに「?」を入れて、次の配列にでていた順番に探したい文字列を順番にいれていけば大丈夫です。 | |
@artsts = Artist.where("name = ? and genre = ?","Oasis","Rock") | |
# 値がnullをすべて取得とかできます。 |