ãã¹ã¯ã¼ãåã渡ãç¨ã® Heroku ã¢ããªã Keydrop ã¨ããã®ãä½ãã¾ãã
Keydrop ã¯ãé éã«ããæ¹ãããã¹ã¯ã¼ãã (æ¯è¼ç) å®å ¨ã«åãåãããã® Heroku ã¢ããªã±ã¼ã·ã§ã³ã§ãã
å¿ è¦ãªæã ãèµ·åãã¦ã使ãçµãã£ããæ¶ããã¨ãã使ãæ¹ãæ³å®ãã¦ãã¾ãã
Keydrop ããããã¨
Keydrop ã¯ãã¹ã¯ã¼ãã®
- æå·å
- ããªãã¼ã·ã§ã³
ãè¡ãã¾ããå®è£ 㯠PHP ã§ãã
æå·å
以ä¸ã使ãã¾ãã
- éä¿¡æ: HTTPS
https://*.herokuapp.com/...
- ä¿åæ: htpasswd apr1 å½¢å¼ã§ããã·ã¥åãããã㯠RSA å ¬ééµã§æå·å
- åä¿¡æ: PostgreSQL SSL æ¥ç¶
ããªãã¼ã·ã§ã³
ããã©ã«ãã§ã¯ããã¹ã¯ã¼ãã«ä»¥ä¸ã®å¶ç´ãè¨ãã¦ãã¾ãã
- 10 æå以ä¸
- æä½ 1 æåã®æ°å (
0 - 9
) - æä½ 1 æåã®åè§å¤§æåã¢ã«ãã¡ããã (
A - Z
) - æä½ 1 æåã®åè§è¨å· (
#$%@&*!...
)
æºå
- Heroku ã®ã¢ã«ã¦ã³ãä½æã2段éèªè¨¼ãå¿ããã«
- Heroku ã®ã³ãã³ãã©ã¤ã³ã¢ããªã±ã¼ã·ã§ã³ãã¤ã³ã¹ãã¼ã«
- PostgreSQL ãã¤ã³ã¹ãã¼ã«ãHeroku ã®ãã¼ã¿ãã¼ã¹ã«æ¥ç¶ããããã¯ã©ã¤ã¢ã³ãã ãã使ç¨ãã¾ãããµã¼ãã®ã»ããã¢ããã¯ä¸è¦ã§ã
- ä¾:
$ brew install postgresql
- ä¾:
- å ¬ééµã§æå·åããå ´å㯠OpenSSL ãã¤ã³ã¹ãã¼ã«
ã»ããã¢ãã
以ä¸ã®ãã¿ã³ãã¯ãªãã¯ãã¦ãã ããã
以ä¸ã®è¨å®ç»é¢ã表示ããã¾ãã
è¨å®: App name
空ã®ã¾ã¾ãããããã§ããã©ã³ãã ãªãã¡ã¤ã³åãè¨å®ããã¾ãã
è¨å®: ACCEPT_PATHS
ã©ã³ãã ãªãã¹åãè¨å®ãã¦ãã ãããã³ã³ãã§åºåã£ã¦è¤æ°ã®ãã¹ãè¨å®ã§ãã¾ãã
ä¾:
/K7FElrHrPmUnmBdw,/Mfj2Wl2YF6rFcMQ6
URL ã¯ä»¥ä¸ã®ãããªå½¢å¼ã«ãªãã¾ãã
https://${app-name}.herokuapp.com${ACCEPT_PATH}
ACCEPT_PATHS ã«åè´ããªã URL 㯠404 ã«ãªãã¾ãã
ã¦ã¼ã¶ã°ã«ã¼ããåºå¥ãããå ´åãªã©ã«ãè¤æ°ã®ãã¹åãè¨å®ãã¦ãããããã® URL ãä¼ãã¦ãã ããã
è¨å®: ENCRYPTION_TYPE
æå·åã®æ¹å¼ãããã©ã«ã㯠htpasswd
ã§ãã
å
¬ééµã§æå·åãããå ´åã¯ãpublickey
ã«è¨å®ãã¦ãã ããã
è¨å®: PUBLICKEY
ENCRYPTION_TYPE ã« htpasswd
ãè¨å®ãã¦ããå ´åã¯ãå¤æ´ããå¿
è¦ã¯ããã¾ããã
ããã©ã«ãå¤ã¯ãGitHub ã«ã³ãããããã¦ããéµã§ãã¹ãç¨ã§ããå ¬ééµæå·ã使ãå ´åã¯ãå¿ ãä¿®æ£ãã¦ãã ããã
å ¬ééµã®çæ
bin/genkey.sh
ã使ããã以ä¸ã®ãããªã³ãã³ãã§çæãã¦ãã ããã
$ openssl genrsa -aes256 -out private.pem 2048 $ openssl rsa -pubout -in private.pem -out public.pem
URL ãä¼ãã
ãã¹ã¯ã¼ããéã£ã¦ã»ããç¸æã«ã以ä¸ãä¼ãã¾ãã
以ä¸ã® URL ã«ã¢ã¯ã»ã¹ãã
xxxxxxx
ã¨ãã ID ã§ãã¹ã¯ã¼ããå ¥åãã¦ãé£çµ¡ãã ããã
https://${app-name}.herokuapp.com${ACCEPT_PATH}
å®éã®ãã°ã¤ã³ ID ã§ã¯ãªããåã渡ãç¨ã®ä»®ã® ID ã使ã£ã¦ãæ§ãã¾ããã
åã ID ã§è¤æ°ã®ãã¹ã¯ã¼ãããã¹ããããå ´åã¯ã2度éä¿¡ãããã©ããã確èªãã¦ãã ãããä»äººãå¥ã®ãã¹ã¯ã¼ããéã£ã¦ããå¯è½æ§ãæ¤è¨ãã¦ãã ãããID ãéè¤ãã¦ããã¦ã¼ã¶ã«ã¯ä½ãç¥ããã¾ããã
çµæãåãåã
./bin/dump.sh
ã使ç¨ãã¾ããçµæããã©ã¦ã¶ã§è¡¨ç¤ºããæ¹æ³ã¯ããã¾ããã
$ ./bin/dump.sh random-appname-12345 --> Connecting to postgresql-dbname-54321 1 2017-08-30 03:06:57+00 htpasswd /vEswu2ech4ta test-1 test-1:$apr1$4.Pz0U/W$TppMU9SjE/W0yg1FAPiMS/ 2 2017-08-30 03:08:19+00 publickey /vEswu2ech4ta test-2 nJ97fbhHIkZAMISp/zXVETvitUl8Qlbi1pyOTtoF3ybI9EDrqenPFb4WMOISrTn8sW+Qu5xvNsjaMEIC3j0Md+hmtEzlLmVK+Nb9bq989I9TnmjgdtFE9klyKkhb5J7r+7SKqBgzfmu7kAoREYBtg05hvNb3mJXGbAruybElbZlxNgf06b5f6W/kkHtGcJaV49oNHKBEmg03ceMip2wP5H6tk/BS6O4FTrEKvpYsn4+Kh6+7JMioCVQEXz3NvpH0BIkmnGncXBZTdtPihju7srb0uEHe0sys66PPBZGZQWbisBdr9knJ5WTfnh2iWLOGv2NgOwfgXQZyMdizINALDw==
å ¬ééµæå·ã®å¾©å·ãã§ãã¾ãã
$ ./bin/dump.sh random-appname-12345 ./keys/insecure-private.pem --> Connecting to postgresql-dbname-54321 1 2017-08-30 03:06:57+00 htpasswd /vEswu2ech4ta test-1 test-1:$apr1$4.Pz0U/W$TppMU9SjE/W0yg1FAPiMS/ 2 2017-08-30 03:08:19+00 publickey /vEswu2ech4ta test-2 testTEST1234!!!
ã¾ãã¯ã heroku pg:sql
ã§ç´æ¥ DB ã«ã¢ã¯ã»ã¹ãã¦ãã ããã
$ heroku pg:psql --app random-appname-12345 --> Connecting to postgresql-dbname-54321 psql (9.6.1, server 9.6.4) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off) Type "help" for help. random-appname-12345::DATABASE=> select * from keys; id | type | path | username | key | created_at ----+-----------+---------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------ 1 | htpasswd | /vEswu2ech4ta | test-1 | test-1:$apr1$4.Pz0U/W$TppMU9SjE/W0yg1FAPiMS/ | 2017-08-30 03:06:57+00 2 | publickey | /vEswu2ech4ta | test-2 | nJ97fbhHIkZAMISp/zXVETvitUl8Qlbi1pyOTtoF3ybI9EDrqenPFb4WMOISrTn8sW+Qu5xvNsjaMEIC3j0Md+hmtEzlLmVK+Nb9bq989I9TnmjgdtFE9klyKkhb5J7r+7SKqBgzfmu7kAoREYBtg05hvNb3mJXGbAruybElbZlxNgf06b5f6W/kkHtGcJaV49oNHKBEmg03ceMip2wP5H6tk/BS6O4FTrEKvpYsn4+Kh6+7JMioCVQEXz3NvpH0BIkmnGncXBZTdtPihju7srb0uEHe0sys66PPBZGZQWbisBdr9knJ5WTfnh2iWLOGv2NgOwfgXQZyMdizINALDw== | 2017-08-30 03:08:19+00 (2 rows)
å ¬ééµæå·ãæåã§å¾©å·ããå ´åã¯ã以ä¸ãè¡ãã¾ãã
- Base64 ãã³ã¼ã
$ base64 -D input_file
- OpenSSL ã§å¾©å·
$ openssl rsautl -decrypt -inkey privatekey_file -in base64decoded_file
çä»ã
åã渡ããçµãã£ãããHeroku ã®ç®¡çç»é¢ããã¢ããªãåé¤ãã¾ãã
Heroku ã®æéä½ç³»
Keydrop ã使ã£ã¦ãã¦ãç¡æã®ç¯å²ãè¶ ãããã¨ã¯æ®éã¯ãªãã¨æãã¾ãã
ç¡æã®ãã©ã³ã§ã¯ã30 åã¢ã¯ã»ã¹ããªãã¨ã¢ããªãã¹ãªã¼ãç¶æ ã«ãªããã¢ã¯ã»ã¹ãæ¥ãã¨èµ·åãã¾ã(表示ã«å°ãæéããããã¾ã)ãæåè¨ã§ 550 æé (22æ¥å) ã¾ã§ãã¯ã¬ã¸ããã«ã¼ããç»é²ãã㨠1,000 æé (41æ¥å) ã¾ã§ç¨¼åããããã¨ãã§ãã¾ãã
(2017å¹´9æç¾å¨)
ãã¤ã³ã¯ã©ããå ã«è¨æ¶ã®å®®æ®¿ã建ã¦ã
ãã¤ã³ã¯ã©ããã使ã£ã¦ãè¨æ¶ã®å®®æ®¿ãä½ã試ã¿ãè¡ã£ã¦ãã¾ãã
ãã¾ã¯ä¸»ã«è±åèªãè¦ãããã¨ãã¦ãã¾ãã
åç»
è¨æ¶ã®å®®æ®¿ã¨ã¯
è¨æ¶ã®å®®æ®¿ã¯ãé常ã«å¤ãããããè¨æ¶è¡ã§ãã
2,500 å¹´ã»ã©åãå¤ä»£ã®ãªã·ã£ã®è©©äººã·ã¢ããã¹ããè¨æ¶ã®å®®æ®¿ãçºæããã¨è¨ããã¦ãã¾ãã
ããå®´ä¼ã§å¤©äºãå´©ãè½ã¡ããã£ãä¸äººçã延ã³ãã·ã¢ããã¹ã¯ãåºå¸è ãã©ãã«åº§ã£ã¦ããããå®ç§ã«æãåºãããã¨ã«æ°ã¥ãã¾ãã
ã·ã¢ããã¹ã¯ç®ãéãã¦ãè¨æ¶ã®ä¸ã§å´©å£ãã建ç©ãåã³çµã¿ç«ã¦ããé©ç°çãªåç¾åã«ãããå½¼ã¯æ²åã®æ©é¤ã§ã©ã®å®¢äººãã©ãã«åº§ã£ã¦ããã®ããæãåºããã¨ãåºæ¥ããé¨å±ã®è¦åãå³ãæèãã¦æ¶ãããã¨ããããã§ã¯ãªãã£ãã®ã«ãè¨æ¶ã®ä¸ã«ãã£ã¨æ®ã£ã¦ããã®ã ããã®ã·ã³ãã«ãªçºè¦ããããããããè¨æ¶è¡ãã®åºç¤ã¨ãªããã¯ããã¯ãç·¨ã¿åºãããã¨è¨ããã¦ããã
ã¨ãã¯ãå®´å¸ã«ä¸¦ãã§ããã®ã客人ã§ã¯ãªãå¥ã®äººãç©ã§ãã£ãã¨ãã¦ããä¾ãã°ã®ãªã·ã£ã®å大ãªåä½å®¶ãçã¾ããé çªã«åº§ã£ã¦ããã¨ãã¦ããèªåã®è©©ã®è¨èã ã£ãã¨ãã¦ãããããã¯ãã®æ¥ã«ãããªããã°ãªããªãä»äºã®å 容ã ã£ãã¨ãã¦ãã空éè¨æ¶ã使ã£ã¦æ¶ããã°ãããã¦ãã®ãã¨ã¯ã並ãã§ããé çªã®ã¾ã¾è³ã«å»ã¿è¾¼ããã¨ãã§ããã¨ç¢ºä¿¡ãã¦ããã(ä¸ç¥)
ãã¸ã§ã·ã¥ãããã£ã¦ã»ããã®ã¯ã人éã¯æ¬å½ã«å ´æãæ¶ãããã¨ã«é·ãã¦ããã£ã¦ãã¨ã ãããå¹³å¡ãªè¨æ¶åã®ç§ã1å¹´ã§å ¨ç±³è¨æ¶åãã£ã³ããªã³ã«ãªããçç±
- ä½è : ã¸ã§ã·ã¥ã¢ã»ãã©ã¢,梶浦çç¾
- åºç社/ã¡ã¼ã«ã¼: ã¨ã¯ã¹ãã¬ãã¸
- çºå£²æ¥: 2011/07/29
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- è³¼å ¥: 29人 ã¯ãªãã¯: 1,964å
- ãã®ååãå«ãããã° (27件) ãè¦ã
詳ãã㯠Wikipedia è¨æ¶è¡ å ´ææ³ãè¦ã¦ãã ãããä¸ã®ãã¬ã¼ã³ãã¼ã·ã§ã³åç»ãããããã§ãã
ããããã¤ã³ã¯ã©ããã使ã£ã¦ããã¨æ¥½ããã®ã§è©¦ãã¦ã¿ã¾ããããã¨ãããèªãããæ¬è¨äºã®å 容ã§ãã
æ¢åã®è©¦ã¿ã¨ã®æ¯è¼
ãããªãã¤ã¹ãªã¢ã¤ãã£ã¢ãæãã¤ãã®ã¯ä¸çã§èªåã ãã ããããªã©ã¨ä¸ç¬æãã¾ããããã°ã°ã£ããå ¨ããããªãã¨ã¯ãªãã¦ãä½å¹´ãåããããããã®äººããã®ã¢ã¤ãã£ã¢ã«ã¤ãã¦æ¸ãããåç»ãä½ã£ãããã¦ãã¾ããã
- 2010/12 Minecraft beta ãªãªã¼ã¹
- 2010/12 Using Minecraft to build a Memory Palace : Minecraft ãã©ã¼ã©ã
- 2011/04 Using a Video Game for a Memory Palace - Art of Memory è¨äº
- 2012/03 Memory Palace Demonstration video ã³ã³ã»ããåç»?
- 2012/12 Minecraft Memory Palace ãã©ã¼ã©ã
- 2012/12 My Memory Palace åç»
- 2013/06 Minecraft Memory Palace è¨äº
- 2014/12 Has anyone used Minecraft to create a Memory Palace? : Mnemonics ãã©ã¼ã©ã
- 2016/02 Minecraft Memory Palace for learning Geography åç»
- https://www.google.co.jp/?gws_rd=ssl#safe=off&q=minecraft+%22memory+palace%22
èªåã®è©¦ãã¦ããæ¹æ³ã«ãå¤å°ãªãã¨ããªãªã¸ããªãã£ãããã¨ãããã
- å±å¤ã使ã
- çæ¿ã使ã
- ãã¿ã¼ã³ã使ã
ã¨ãããªã¨æãã¾ãã
大建ç¯ãä½ãã®ã楽ãããã§ãããåºæ¬çã«ã¯å±å¤ã使ã£ã¦ãã¾ãã å±å¤ã®ããã¨ããã¯ããããã§ãèªåã§çæãããã¨ããã§ãã
PCçã®ãã¤ã³ã¯ã©ããã¯å°çã®ç´8åã®åºãããããããªã®ã§ãå®è³ªãç¡éã«åå°ã使ãã¾ãã ãã¤ã³ã¯ã©ãããçæãã風æ¯ã¯ãå£ã«å²ã¾ããå±å ããããã¤ãããã¯ã§è¨æ¶ã«æ®ããããããã«æãã¾ããå¤ç¼ããé²ã®æµãã天åã®å¤åãæ©ãåãåç©ããå調ã«ãªãã®ãé²ãã§ããã¾ãã
ãã¿ã¼ã³
試è¡é¯èª¤ãã¦ã¿ãä¸ã§ãç¹ã«ãã¾ãæ©è½ãããã ã£ããããã¤ãã®ãã¿ã¼ã³ãç´¹ä»ãã¾ãã
Circle
Circle ãã¿ã¼ã³ã¯ã12åã®åèªã®ã°ã«ã¼ããä½ããåå½¢ã«é ç½®ãã¾ãã
ã¢ã«ãã¡ãããé ãæè¨åãã«ãçæ¿ã§åãä½ãã¾ãã
ä¾ãã°ãconf* ã§å§ã¾ã12åã®åèªã
confection ç ç³èå / confederate é£åå½ã»å ±ç¯è ã»åé¨é£å / confer ç¸è«ãã
confide æã¡æãã / confine éãè¾¼ãã / confiscate 没åãã
conflagration 大ç«äº / conflate ã¾ã¨ãã / confluence å·ã®åæµç¹
conform é©åãã / confound æ··ä¹±ããã / confrontation 対ç«
çæ¿ã®å¾ãã«ãåèªãæãåºãæãããã«ãªããããªãªãã¸ã§ã¯ããé ç½®ãã¾ããã¡ããã©ãã¹ãã¼ã³ãã³ã¸ã®ãããªè¦ãç®ã«ãªãã¾ãã
åèªã¯ã¢ã«ãã¡ãããé ã«ä¸¦ãã§ããã®ã§ãä¸é¨ã®åèªãæãåºããã°ãéã«ããåèªã®ã¹ãã«ã®ç¯å²ããããã¾ãã æ±è¥¿åå4ã¤ã®åèªãæ¶ãã¦ããã°ãé2ã¤ãæãåºãã®ã¯ããããªã«é£ããããã¾ããã
å¯ãåãå ¥æµ´æã«ãé ã®ä¸ã§ãµã¼ã¯ã«ãæ©ãåãã¾ãã
12åã®åèªã§ã¹ãã¼ãªã¼ãä½ãã®ããããã®ã§ã¯ãªããã¨æãã¾ããä¸ã® conf*
ã®åèªã ã£ãããç ç³èåè·äººãå
±ç¯è
ã¨ä¸ç·ã«éåº«ç ´ããè¨ç»ã仲éå²ããã¦ãã話ã¨ãã
8åã16 åã20 åã®ãµã¼ã¯ã«ãä½ã£ã¦ãã¾ããã12 å ã 16 åãã¡ããã©ããæãã§ããã
12å
16å
20å
12 + 8 ã®äºéã®ãµã¼ã¯ã«ãå¤å´ã®åã¨å å´ã®åã§é¢é£ãåºããã®ã¯ãããã§ãããã¡ãã£ã¨è¤éããããã¾ããã
ãµã¼ã¯ã«ã«åèªãå ¥ããããªãå ´åã¯ããã¾ã大äºã§ãªãåèªããµã¼ã¯ã«ã®å¤å´ã«ãæ¾å°ç¶ã«é ç½®ãã¾ããé¢é£ããåèªãå¤å´ã«ç½®ããããã¦ã¿ã¦ãã¾ãã
blunt ã¨åããã¶ã£ããã¼ããªãã¨ããæå³ã®åèª curt ããµã¼ã¯ã«ã®å¤å´ã«è¶³ããããé£ã® blurt ã¨é»ãè¸ãã§ãã¦å¬ããã£ãã®å³ã§ãã
- blunt ãªã¾ãããªãã¶ã£ããã¼ããª
- curt ã¶ã£ããã¼ããª
- blurt å£ãæ»ããã
ããããå°ããçºè¦ãã¤ãªãã§è¨èã®ãããã¯ã¼ã¯ãåºãã¦ããã¨ããããã²ã¼ã ã£ã½ãã
Line
Line ãã¿ã¼ã³ã¯ãæ¬ãæ åãªã©ã®ãããç¨åº¦é·ãã³ã³ãã³ããããç¥ããªãåèªãå«ããã¬ã¼ãºãæãåºãã¦ä¸åã«ä¸¦ã¹ã¾ãã
èªããã¦ããå 容ã®ããããããæå³ãæãåºãå©ãã«ãªãã¾ãã
TVãã©ã glee
å°èª¬
- ä½è : Paul Auster
- åºç社/ã¡ã¼ã«ã¼: Faber & Faber
- çºå£²æ¥: 1990/04/01
- ã¡ãã£ã¢: ãã¹ãã¼ã±ãã
- è³¼å ¥: 1人
- ãã®ååãå«ãããã° (3件) ãè¦ã
TED
å ¨ã¦ã®ãã¬ã¼ãºãå®å ¨ã«æè¨ããã¨ããããã¯ï¼ãããªãã¨ã§ããæ°ãããªãã®ã§ï¼ããã¬ã¼ãºãè¦ãã¨ãã«æå³ãæãæµ®ãã¹ã°ãããã¨ããã¤ããã§ãã£ã¦ãã¾ãã
ã¾ããå¯æ¬¡çãªå©ç¹ã¨ãã¦ãå 容ãé ã«å ¥ããã¨ããã®ãããã¾ãã èªåã¯å°èª¬ãèªãã§ãã¼ãããã¨ããå°è±¡ããæ®ã£ã¦ããªããã¨ãã»ã¨ãã©ã§ããã Line ãæ©ãã¦ããã¨ãããããã説æã§ããç¨åº¦ã«ã¯ç©èªãé ã«å ¥ãã¾ããæ®éã«èªãããããã£ã¨ãç©èªã®æ§é ãææ¡ã§ãããããªæ°ããã¾ã (æ°ã®ããããããã¾ããã)ã
Scene
Scene ãã¿ã¼ã³ã¯ãè¤æ°ã®åèªãçµã¿åããã¦ããã©ãããã¯ãªå ´é¢ãä½ãã¾ãã
preach 説æãã / plead åé¡ãã / heed å¾è´ãã
clout 権å¨ã»ä¸æ / conceal é ãæ㤠/ clot (è¡ãªã©ã®)ã©ãã£ã¨ããåºã¾ã
repulsion revulsion å«æªæ
impulsion è¡å / compulsion è¡åã»ä¸ããã®å¼·å¶å / convulsion çæ£
complaint æè°ã»ä¸å¹³ / composure æ²çã»å¹³é
expulsion æé¤ã»é§é / expel 追ãåºãã»çºå°ãã / compel å¼·å¶ããã»å¼·è¦ãã
plunge into é£ã³è¾¼ã
Circle ãããèªç±ã§ããã®åãæ³ååãå¿ è¦ã«ãªãã¾ãããã¾ããã¾ãã¯ããã¦ãã¾ãããã
Circle ã§ç²çãä½ããå¨å²ã«æ¾å°ç¶ã« Scene ãé ç½®ããç©èªã®ãã£ãã¼ã«ãåãã¦ãããã¿ãããªãã¨ãã§ããããããã¾ããã
è¾æ¸ã«ã¤ãã¦
Spotlight è¾æ¸
åèªã®æå³ã¯ãçæ¿ã«æ¸ãã¦ãã¾ããã
æåã¯ãè£å´ã«ãã1æçæ¿ãè²¼ã£ã¦æå³ãæ¸ãã¦ã¿ããããã®ã§ãããé¢åãããã®ã¨ãMac çã®ãã¤ã³ã¯ã©ããã¯æ¥æ¬èªãæ¸ãããã¾ããç°¡åã« Spotlight è¾æ¸ã§æ¤ç´¢ã§ããã®ã§ããã¦ãã¾ãã¾ããã
Spotlight ã«ã¯ã·ã§ã¼ãã«ãããã¼ãå²ãå½ã¦ã¦(ããã©ã«ã㯠ã³ã³ããã¼ã«ï¼ã¹ãã¼ã¹
)ãã²ã¼ã ä¸ã«ãã¤ã§ãã·ã§ã¼ãã«ãããã¼ã§å¼ã³åºããããã«ãã¦ãã¾ãã
Spotlight ã«åèªãå
¥åããå¾ãè¾æ¸ã§éãã·ã§ã¼ãã«ãã㯠Command + L ã§ãã
ãã¤ã³ã¯ã©ããããã«ã¹ã¯ãªã¼ã³ã ã¨ã·ã§ã¼ãã«ãããå¹ããªãã®ã§ãã¦ã£ã³ãã¦ãæ大ã«ãã¦å®è¡ãã¦ãã¾ãã
Wisdom2 (iOS)
ä»ã«ãç©æ¸å ã® Wisdom2 (iOS)ã使ã£ã¦ãã¾ãã2,900 åã
ç´ ç´ãªã¤ã³ã¿ãã§ã¼ã¹ã§ä½¿ããããã¢ããªã§ãã
Circle ãã¿ã¼ã³ã§åèªã®ã°ã«ã¼ããä½ãããã«ããã¿ã¼ã³æ¤ç´¢ã使ãã¾ãã
ä¾ãã°ãbl ã§å§ã¾ã£ã¦ t ã§çµããåèªã(blast, bleat, bleast, blight...) ã bl*t
ã§æ¤ç´¢ãã¾ããç¥ããªãåèªãã ããã12åãããã«åã¾ããããªãã¿ã¼ã³ãæ¢ãã®ãã楽ãã¿ã«ãªãã¾ãã
ãªã³ã©ã¤ã³ã ã¨ãOneLook dictionary ãããã¾ãããã ãããã ã¨(èªåç¨åº¦ã®èªå½åã§ã¯)ã¡ãã£ã¨ã¬ãã«ãé«ããã§ããã
ã²ã¼ã ã®è©±
å ã ãã¤ã³ã¯ã©ããã¯ãå°ä¸ã®ãã²ã¼ã ããããã«æ¯ã¹ã¦ãå°ä¸ã¯ã好ããªããã«ä½¿ãã°ï¼ã¨æ¾ç½®ããã¦ããæãããã£ã¦ãããã«è¨æ¶ã®å®®æ®¿ããã¾ãã¯ã¾ãæ°ããã¦ãã¾ãã
èªå½ã®ãããã¯ã¼ã¯ãåºãã¦ããä½æ¥ã¯ãå°ä¸ã®æ´çªæ¢æ¤ã«ããä¼¼ã¦ãã¾ããã³ãã³ãã¨æãé²ãã¦ããã¨ãçªç¶è¦çãéãã¦ãããç¥ã£ã¦ããå ´æã«åºããã¨ãããã¾ãããããã®æ´çªã¯ããã«ã¤ãªãã£ã¦ãã®ãï¼ã¨ããçºè¦ãããã¾ãã
ä¾ãã°ãtin*
ã§å§ã¾ãåèªã調ã¹ã¦ãã¦ãtinker é³æå±(ãããã)ã¨ããè¨èãåãã¦ç¥ãã¾ããã
大éªã§ã¯å¤«å©¦ã仲è¯ãåºããããã¨ãé³æå±ã¨è¨ã£ããã¨ããããã ãã§ãååé¢ç½ããã§ãããé³æå±ã«ã¤ãã¦èª¿ã¹ã¦ããä½æ¥ãçµã£ã¦ãæãµã¨ãã®ä¸ã§ã¼ããã tin* ã®ãµã¼ã¯ã«ãæãåºãã¦ãã¦ãçªç¶ tinker ã£ã¦ãã£ã³ã«ã¼ãã«ã® tinker ãªã®ãï¼ã¨æã£ããã§ããã
ããããã°åä¾ã®é ã«ããã£ã³ã«ã¼ãã«ãéãéãç´ãä»äºã¨ããã®ãããªããå¦ç²¾ã®ã¤ã¡ã¼ã¸ã¨åããªãã¦ãã³ãªã®ãã¨æã£ã¦ãã®ãæãåºããã
ãããæãåºããç¬éã tin*
ã®ãµã¼ã¯ã«ã«è¡ãéãæãããã¾ãããtinker ã®é£ã¯ãtinkle é´ãããªã³ããªã³é³´ãããªã©ã®æå³ã§ãTinker Bell ã®ãã¼ãã³ã°ã« tinkle ãã¤ã¡ã¼ã¸ããã¦ããã®ãã¯èª¿ã¹ã¦ãããããªãã®ã§ããããããã®2ã¤ã®åèªã¯æ»ã¬ã¾ã§å¿ããªãã ãããªã¨æãã¾ããã
ä»ãã®è¨äºãæ¸ãã¦ãã¦ããã£ãºãã¼ã®ãã£ã³ã«ã¼ãã«ã«ã¯ååã®å§å¦¹ãããªã¦ã£ã³ã¯ã«ã¨ããã®ãããã®ãç¥ã£ããã§ãããperiwinkle ã¨ããã° glee ã·ã¼ãºã³1第2話åé ã® "Look, we much, periwinkle" (éç´«ã§ãæãã ã) â "Get a room" (é¨å±ã¨ã£ããï¼/ãã¡ãã¤ãã¦ããããã¼ã) ã§ãã
2ã¤ã®åèªã®ä½ç½®é¢ä¿ãæ¶ãã¦ããã®ã§ãtinker ãã periwinkle ã«åãã£ã¦ä¼¸ã³ãã¢ã¼ããæãæããã¨ãã§ãã¾ããããåèªã空éå ã®ä½ç½®ã¨ã»ããã§æãåºãããã¨ããã®ã¯ããã¾ã¾ã§èªåã®è³ã«ã¯ç¡ãã£ãæ©è½ã§ãä¸æè°ãªæ°ã¯ãã¾ãããç¹ã«ç¡çããã¦ããæãã¯ãã¾ããã
ä¸ã§æ¸ãã blunt - curt -blurt ã®è©±ãããã§ãããåã«ãã¤ã³ã¯ã©ãããå¦ç¿ã«ã使ãã¾ãããã¨ãã話ã§ã¯ãªããã²ã¼ã ã¨ãã¦ææ©çã«çµåãã¦ããæè¦ããã£ã¦ãããããä»ãã£ã¦ãããã¨ã®ä¸çªã®é¢ç½ãã ã¨æãã¾ãã
ã¹ãã©ã¯ãã£ã¼ãããã¯ã«ãããã¿ã¼ã³ã®å ±æ
èªåã§ä½ãæ¹ã楽ãããå¹æçãªæ°ã¯ãã¾ãããéãããªããã¨ãèããã¨ã人ãä½ã£ããã¿ã¼ã³ãåãè¾¼ããã»ããããæ°ããã¾ãã
ãã¤ã³ã¯ã©ããã¯æè¿ã®ãªãªã¼ã¹ã§ãç¯å²ãæå®ãã¦æ§é ç©ããã¡ã¤ã«ã«æ¸ãåºããããã«ãªãã¾ãããã¹ãã©ã¯ãã£ã¼ãããã¯ã¨ããæ©è½ã§ãã
ã¹ãã©ã¯ãã£ã¼ãããã¯ã«ã¤ãã¦ã¯ããã¡ãã®è¨äºãããããããã£ãã§ãã
試ãã«ãµã¼ã¯ã«ãã¹ãã©ã¯ãã£ã¼ãã¡ã¤ã«ã«æ¸ãåºãã¦ããã¦ã³ãã¼ãã§ããããã«ãã¦ã¿ããããªã¨æãã¾ãã(æºåã§ããããããã«ãªã³ã¯ãã¯ãã¾ã)
ãã¾ãã® Tips
以ä¸è足ã§ãã
ã¨ã³ãã¼ãã³ã«éã°ãã¦ãã¾ãã®ã§ãåã«é¡ç¸ãè²¼ãã®ã¯ãããæ¹ãããã§ãã ãã¤ã®éã«ãå¸å°ãªã¢ã¤ãã ãæ¶ãã¦ãããã¨ããã£ã¦ãåããµã³ãã¹ãã¼ã³ã«åãæ¿ãã¾ããã
é·é¨ã§ç«ãä»ãã®ã§ãTNT ãå°é¢ã«ç´ã«ç½®ãã®ãé¿ããæ¹ãè¯ãããã§ããé¡ç¸ã«å ¥ãã¦ãã¾ãã ã¾ã大æµå¤§ä¸å¤«ã ã¨æãã¾ãããããé·ãé³´ã£ãããã£ãã¨å¯ã¦ãã¾ãã°ããã®ããããã¾ããã
ãã¬ãã¼ãã³ãã³ããããã¯ãä½ãããã«ããã¼ãã³ãã³ãããªã³ã«ãã¦ãã¾ãããã¬ãã¼ãã¯ãä¸çãããã¯ãã¼ã¯ããæ©è½ã¨ãã¦å¿ è¦ã§ããã²ã¼ã ãã¹ãã¤ã«ããã¤ããã¯ãªããã§ãããç¡æå³ã«é·è·é¢ã移åããã®ã¯ãããã«è¦çãªã®ã§â¦â¦ã
ãã£ããã¾ã¨ã¾ã£ãè¨äºãè¦ã¤ãããªãã£ãã®ã§ã以ä¸ããã¬ãã¼ãã³ãã³ããããã¯ã®ä½ãæ¹ã
- F3 ãã¼ã§ã¯ã¼ããããå ´æã®åº§æ¨ã調ã¹ããééããã¨ãã¬ã®ã§æ éã«
/give @p minecraft:command_block
ã§ã³ãã³ããããã¯ãå¾ã- ã³ãã³ããããã¯ãé©å½ãªå ´æã«è¨ç½®
/gamemode 1
ã§ã¯ãªã¨ã¤ãã£ãã¢ã¼ãã«åãæ¿ã- ã³ãã³ããããã¯ã«ãã¬ãã¼ãã³ãã³ãè¨å®
/tp @p 123 -234 345
/gamemode 0
ã§ãµãã¤ãã«ã¢ã¼ãã«æ»ã- ã³ãã³ããããã¯ã«ã¬ãã¼çãä»ãã
ãã°ã ã¨æããã§ãããæå ã® Mac çã§ã¯ããã¬ãã¼ãå¾ã«ãããã«å ¥ãã¨ãèµ·ããã¨ãã«éç¸ãç¶æ ã«ãªã£ã¦ã²ã¼ã ãä¸æ¦çµäºããããããªããªããã¨ããç¾è±¡ãèµ·ãã¦ãã¾ããç®ãè¦ãã¦ããã®ã«ä½ãã§ããªããã¨ããã®ã¯ããªããªããã£ã¨ããä½é¨ã§é¢ç½ããã§ããç´ãã¦ã»ããã
èªåã¯ãã«ããã¬ã¤ããã£ããã¨ãªããã§ããããµã¼ãä¸ã§å人ã®è¨æ¶ã®å®®æ®¿ãæ··ããã®ãããã£ã¨é¢ç½ãä½é¨ã«ãªãã¨æãã¾ãããããã1ã¤ã® VR 空éã«å ¨ä¸çã®äººã ã®è¨æ¶ã®å®®æ®¿ãæ§ç¯ãããµã¼ãã¹ãªãããçã¾ãã¦ãæ»èªã«ãªãã¤ã¤ããããµã¤ãã¼ã¹ãã¼ã¹ãã®å¾©èãèµ·ããããããªã©ã¨æ³åãã¦ãã¾ãã
Rails, Django, Laravel éçºãµã¼ããããã«ã¯ãªãã¯ã§èµ·åãã vagrant-layout ãã©ã°ã¤ã³ã¨ããã®ãä½ã£ã
vagrant-layout ã¨ããã®ãä½ãã¾ããã
ãã®è¨äºã§æ¸ãã¦ããç°å¢ãçæãã Vagrant ãã©ã°ã¤ã³ï¼è¨å®ãµã³ãã«éã§ãã
ã¤ã³ã¹ãã¼ã«
$ vagrant plugin install vagrant-layout
ã§ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ãã¾ãã
Quickstart
$ mkdir my-project $ cd my-project $ vagrant layout init php
ã§å種ãã¡ã¤ã«ãçæãã¾ããçæãããã
ãããã«ã¯ãªãã¯ãã¦ãã°ããå¾ ã¤ã¨ãCentOS ã«
ãå ¥ã£ã VM ã http://localhost:8080/ ã§èµ·åãã¾ãã
éçºã¯æå
ã®ãã¡ã¤ã«ãç·¨éãããã¨ã§è¡ãã¾ãããã¼ã«ã«ã®ãã©ã«ãã /vagrant
ã«ãã¦ã³ãããã¦ããã VM ã«å³åæ ããã¾ãã
éçºããã¸ã§ã¯ããä¸æ®µè½ãããã
ã§ç°å¢ãã¢ã³ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã
vagrant layout init
ã®å¾ã㯠vagrant-layout ãªãã¸ããªã®ãã©ã³ãåã§ãã
vagrant layout init ruby
(ruby
ãã©ã³ã)vagrant layout init python
(python
ãã©ã³ã)vagrant layout init php
(php
ãã©ã³ã)vagrant layout init
(ããã©ã«ã:master
ãã©ã³ã)
ãæå®ã§ãã¾ãã
Gist ããã¤ã³ã¹ãã¼ã«ãã
Rails
$ mkdir my-project $ cd my-project $ vagrant layout init https://gist.github.com/koseki/37f61d9a02b9a48e6651
ã§çæããã start.{command|bat}
ãããã«ã¯ãªãã¯ãã¦ãã°ããå¾
ã¤ã¨ã http://localhost:8080/ 㧠Rails ãèµ·åãã¾ãã
Django
$ mkdir my-project $ cd my-project $ vagrant layout init https://gist.github.com/koseki/b7670fc1576a3129e4f7
ã§çæããã start.{command|bat}
ãããã«ã¯ãªãã¯ãã¦ãã°ããå¾
ã¤ã¨ã http://localhost:8080/ 㧠Django ãèµ·åãã¾ãã
Laravel
$ mkdir my-project $ cd my-project $ vagrant layout init https://gist.github.com/koseki/efbd631472c932ff2153
ã§çæããã start.{command|bat}
ãããã«ã¯ãªãã¯ãã¦ãã°ããå¾
ã¤ã¨ã http://localhost:8080/ 㧠Laravel ãèµ·åãã¾ãã
Gist ã®ä¸èº«
Gist ã¯ã
- ãã¼ã¹ã«ãªãã³ãããã® URL ãæ¸ããã
README.md
- ããããã¡ã¤ã«
patch
ã§ã§ãã¦ãã¾ãã
- Rails - https://gist.github.com/koseki/37f61d9a02b9a48e6651
- Django - https://gist.github.com/koseki/b7670fc1576a3129e4f7
- Laravel - https://gist.github.com/koseki/efbd631472c932ff2153
vagrant-layout
ãã©ã°ã¤ã³ã¯ãGist ã«æ¸ãããã³ãããããã¦ã³ãã¼ãããgit apply
ã§ãããããã¦ã¾ãã(å®è¡ã«ã¯ Git ãå¿
è¦ã«ãªãã¾ã)
Gist ã®ä½ãæ¹ã¯ãã®è¨äºã®æå¾ã§èª¬æãã¾ãã
ãã¡ã¤ã«æ§æ
ããã¸ã§ã¯ãã®ã«ã¼ããã£ã¬ã¯ããªã« sandbox
ãä½æããããã«éçºç°å¢ç¨ã®å
¨è¨å®ãããã¾ãã
. âââ sandbox/ â  âââ Procfile â  âââ Vagrantfile â  âââ bin/ â  â  âââ boot.sh â¦â¦ ãµã¼ãèµ·åã¹ã¯ãªããæ¬ä½ â  â  âââ nginx.sh â¦â¦ Nginx èµ·åã¹ã¯ãªãã â  â  âââ provision.sh â¦â¦ ãããã¸ã§ãã³ã° â  â  âââ shoreman â¦â¦ foreman ã® shell ç â  â  âââ start.sh â¦â¦ ãµã¼ãèµ·åã¹ã¯ãªãã boot.sh ãå¼ã¶ã ã â  âââ config/ â  â  âââ mime.types â¦â¦ Ngixn MIME-Type è¨å® â  â  âââ nginx.conf.src â¦â¦ Nginx è¨å® â  âââ logs/ â¦â¦ ãã°ãã£ã¬ã¯ã㪠â  âââ osx/ â¦â¦ OSX ç¨ã¹ã¯ãªãã â  â  âââ manage/ â  â  â  âââ init â¦â¦ è¨å® â  â  â  âââ provision.command â¦â¦ ãããã¸ã§ãã³ã°å®è¡ â  â  â  âââ ssh.command â¦â¦ SSH ãã°ã¤ã³ â  â  â  âââ status.command â¦â¦ VM ã¹ãã¼ã¿ã¹ç¢ºèª â  â  â  âââ uninstall.command â¦â¦ ã¢ã³ã¤ã³ã¹ãã¼ã« â  â  â  âââ up.command â¦â¦ VM èµ·åã®ã¿å®è¡ â  â  â  âââ use-proxy.command â¦â¦ ãããã·ä½¿ç¨éå§ â  â  âââ start.command â¦â¦ èµ·å â  â  âââ stop.command â¦â¦ çµäº â  âââ win/ â¦â¦ Windows ç¨ã¹ã¯ãªãã â  âââ manage/ â¦â¦ OSX ã¨åæ§ãªã®ã§çç¥ â  âââ start.bat â¦â¦ èµ·å â  âââ stop.bat â¦â¦ çµäº âââ static/ âââ htdocs/ âââ index.html â¦â¦ ããã¥ã¡ã³ãã«ã¼ããµã³ãã«
sandbox
ã¯éçºç°å¢å°ç¨ã®ãã£ã¬ã¯ããªã§ããããã¸ã§ã¯ã㯠sandbox
ãæ¶ãã¦ãåãããã«ãã¾ãã
sandbox ã¨ã¹ãã¼ã¸ã³ã°ã»æ¬çªç°å¢ã®è¨å®ã«ã¤ãã¦
ã¹ãã¼ã¸ã³ã°ã»æ¬çªç°å¢ã®è¨å®ã¨ããã¼ã«ã«éçºç°å¢ã®è¨å®ã¯åããããã«ãã¦ãã¾ããèªè¨¼ãå¤é¨ãµã¼ãã¹ã¨ã®é£æºããããã°ãã°ãSSLããã¼ããã©ã³ãµã CDN ãªã©ãªã©ãå¤ãã®å ´åãç°å¢ã«å·®ããããããã®ã§ã
ããã¸ã§ã¯ãã®ã«ã¼ããã£ã¬ã¯ããªã« config
ã®ãããªãã£ã¬ã¯ããªãä½ã£ã¦ãããã«ã¹ãã¼ã¸ã³ã°ã»æ¬çªç¨ã® Chef ã¬ã·ããå
¥ããããã¦ãã¾ãã
éçºç°å¢ã§ã¯éçºè ã®ä½æ¥ãããããåªå ããã¹ãã¼ã¸ã³ã°ã»æ¬çªã¯ã³ã¹ãã許ãéãåãæ§æã«ãã¾ãã
ãããã¸ã§ãã³ã°
ãµã¼ãè¨å®ãå¤ããã¨ãã¯ããã¼ã ã¡ã³ãã¼ã«
ãããã«ã¯ãªãã¯ãã¦ãããããã«ä¾é ¼ãã¾ãããã®ã¹ã¯ãªããã¯ãvagrant provision
ãå®è¡ãã¾ãã
Vagrantfile
ã§ãããã¸ã§ãã³ã°ã« sandbox/bin/provisioning.sh
ã使ãããã«è¨å®ããã¦ãããããã¯ãVM ä¸ã®ãã¡ã¤ã« /root/.provisioning_version
ã«æ¸ããããã¼ã¸ã§ã³ãããæ°ããå¦çãå®è¡ãã¾ãã
VERSION=`expr $VERSION + 1` if [ $CURRENT_VERSION -lt $VERSION ]; then echo "--- $VERSION: nginx ---" yum install -y -v nginx --enablerepo=epel # To stop 'could not open error log file' alert when starting nginx. chmod 777 /var/log/nginx echo $VERSION > $VERSION_FILE fi
provisioning.sh
ã«ãä¸è¨ã®ãã㪠if ãããã¯ã追å ãã¦ãããã¨ã§ã追å ã®æ§æãã¡ã³ãã¼å
¨å¡ã® VM ã«å°å
¥ãã¾ãã
ã·ã§ã«ã¹ã¯ãªããã使ã£ããããã¸ã§ãã³ã°ã¯åªçã¨ã¯è¨ãã¾ããããéçºç°å¢ç¨ã¨ãã¦ã¯ã大æ¦ããã§ååãªã®ã§ã¯ã¨æãã¾ãããããã¸ã§ãã³ã°ã®ããã« Ruby ã Python ãå¿ é ã«ãªãã¨ãå°å ¥ã®ãã¼ãã«ãä¸ãã£ã¦ãã¾ãã¾ãã
éçºã¡ã³ãã¼åãç°å¢æ§ç¯æé
以ä¸ã¯éçºã¡ã³ãã¼ (ç¹ã«éã¨ã³ã¸ãã¢) åãã®ã»ããã¢ããæé ã§ããsandbox
å
¥ãã®ããã¸ã§ã¯ããªãã¸ããªãæå
ã« clone ãã¦ããåæã§ããéçºã¡ã³ãã¼ã vagrant-layout
ãã©ã°ã¤ã³ãå
¥ããå¿
è¦ã¯ããã¾ããã
Windows ã®æ¥æ¬èªã¦ã¼ã¶ãã£ã¬ã¯ããªã®åé¡
Windows ãæ®éã«ã»ããã¢ããããã¨ãæ¥æ¬èªã®ãã¼ã ãã£ã¬ã¯ããªãã§ãã¦ãã¾ãã¾ãã
Vagrant ã¯æ¥æ¬èªã®ãã¼ã ãã£ã¬ã¯ããªã§ã¯åãã¾ãããã¾ã ASCII ã§ãç¹æ®ãªæåãæåããã¹ã«å ¥ã£ã¦ããã¨åãã¾ããã以ä¸ã® issue ãåç §ãã¦ãã ããã
以ä¸ã®æé ã§åé¡ãåé¿ãã¾ãã
VAGRANT_HOME
ã¯C:\vagrant
ã«è¨å®ããstart.bat
ããå¼ã°ããinit.bat
ãè¨å®ããã®ã§æ°ã«ããå¿ è¦ã¯ããã¾ããããã£ã¹ã¯å®¹éã足ããªããªã£ãæãªã©ã«æãåºãã¦ãã ãã
- ããã¸ã§ã¯ãã¯
C:\projects\my-project-name
ãªã©ãå®å ¨ãªãã¹ã« clone ãã - VirtualBox ã®
machinefolder
ãC:\vms
ãªã©ãå®å ¨ãªãã¹ã«å¤æ´ãã
æå¾ã®ã¯ãVirtualBox ã®ã¤ã³ã¹ãã¼ã«å¾ãVirtualBox ããã¼ã¸ã£ãèµ·åãã¦ãè¨å® ï¼ ä¸è¬
ã® ããã©ã«ãã®ä»®æ³ãã·ã³ãã©ã«ãã¼
ãæ¸ãæãã¾ãã
ãã®è¨å®ã¯ VirtualBox ä¸ã®å ¨ VM ã§å ±éã§ãããæ¢ã«ã¤ã³ã¹ãã¼ã«æ¸ã¿ã® VM ããã£ã¦ãç¹ã«å½±é¿ããªã(ã¯ã)ã§ããå¤ã VM ã¯ããã®ã¾ã¾åããã£ã¬ã¯ããªãåç §ãç¶ãã¾ããåèã¾ã§ãææ°ã® VirtualBox ãã©ãã«ä½ãä¿åãããã«ã¤ãã¦ã®ã¡ã¢ã以ä¸ã«ããã¾ãã
Vagrant / VirtualBox / Git ã®ã¤ã³ã¹ãã¼ã«
Mac
Mac ã¯ã¤ã³ã¹ãã¼ã©ãå®è¡ããã ãã§ããä½ãèããããããã©ã«ãã®ã¾ã¾ã«ãã¾ãã
Windows
Windows ã¯ä¸ã®2ã¤ã«å ãã¦ãGit ãã¤ã³ã¹ãã¼ã«ãã¦ãã ãããGit ããã±ã¼ã¸ã«å«ã¾ãã ssh.exe
ãå¿
è¦ã§ãã
Windows 㧠Git ãé常ã¨ç°ãªããã¹ã«ã¤ã³ã¹ãã¼ã«ãããå ´å㯠(ãããããã¾ããã)ãinit.bat
ãä¿®æ£ããã¨ããã¦ãã ããã
Windows ã® Git ã¯ã³ã³ããã¹ãã¡ãã¥ã¼ã«å¤§éã®é ç®ã追å ãã¾ããæ®éãããªãã¨æãã®ã§ã
ãã¡ãã®è¨äºãåèã«åé¤ãã¦ãã ããã
Windows ã®æ¹è¡ã³ã¼ãè¨å®
VM ã«ãã¦ã³ããããã·ã§ã«ã¹ã¯ãªãããå®è¡ããã«ã¯ãæ¹è¡ã³ã¼ãã« LF ã使ãå¿ è¦ãããã¾ãã
å
¨ãã¡ã¤ã«ãã³ããããããç¶æ
ã§sandbox/win/convert-eol.bat
ãããã«ã¯ãªãã¯ãã¾ãã
ãã®ã¹ã¯ãªããã¯ã
git config core.eol lf git config core.autocrlf input
ãè¨å®ããä½æ¥ãã£ã¬ã¯ããªããªã»ãããã¾ãã
git rm --cached -r . git reset --hard
ã¡ãªã¿ã«ã*.bat
㯠CRLF ã§ãªãã¨åãã¾ããã.gitattributes
ã§æ¹è¡ã³ã¼ããè¨å®ãã¦ãã¾ãã
*.bat text eol=crlf
start.command ã§èµ·åãã
ä¸è¨ãçµãã£ããã
㧠VM ãèµ·åãã¾ããæåããã¨ã
ã«ã¢ã¯ã»ã¹ã§ãã¾ããéä¸ã
default: Warning: Connection timeout. Retrying...
ã¿ãããªè¡¨ç¤ºãåºã¾ãããããã§æ£å¸¸ã§ããVM ãèµ·åãçµããã¾ã§å¾ ã£ã¦ããç¶æ ã§ãããã®å¾ããããã¸ã§ãã³ã°ã¨å¼ã°ããã»ããã¢ããå¦çãå®è¡ããã¾ãã
ãããã¸ã§ãã³ã°éå§åã«æ¢ã¾ã£ã¦ãã¾ãå ´å
default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period.
ã®ããã«æ¢ã¾ã£ã¦ãã¾ãå ´åã¯ãVM ãèµ·åãã¦ãã¾ããã以ä¸ãã試ãä¸ããã
1. ä¸åº¦ã¢ã³ã¤ã³ã¹ãã¼ã«ãã¦ããä¸åå®è¡ãã¦ã¿ã
sanbox/osx/manage/uninstall.command
ã¾ã㯠uninstall.bat
ã§ã¢ã³ã¤ã³ã¹ãã¼ã«ãã¦ãã start.command
ãå®è¡ãã¦ã¿ã¦ãã ããã
2. DHCP ã®ãã°å¯¾å¿ã試ã
VirtualBox ã®åæè¨å®ãåå ã§ãVagrant ã® DHCP è¨å®ããã¾ãåããªãåé¡ãããã¾ããã(ææ°çã¯èªåã§ä¿®æ£ããããã§ã)
ãã®åé¡ãåé¿ããã«ã¯ã以ä¸ã®æé ã試ãã¾ãã
- VirtualBox ããã¼ã¸ã£ã¼ã§ãå ¨ä»®æ³ç°å¢ã®é»æºãåãã¦ããã®ã確èªã
- ã¿ã¼ããã«ãã次ã®ã³ãã³ããå®è¡ãã表示ãããå 容ãã©ããã«ã¡ã¢ããã(念ã®ãã)
$ VBoxManage list hostonlyifs $ VBoxManage list dhcpservers
- ã¿ã¼ããã«ãã次ã®ã³ãã³ããå®è¡ã
$ VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0
3. GUI 㧠OS ãèµ·åãã¦ããã確èªãã
Vagrantfile ãéãã¦ãvb.gui = true
ã®ã³ã¡ã³ãã¢ã¦ããå¤ãã¨ãGUI ã¦ã£ã³ãã¦ãéãããã«ãªãã¾ãã
ãã㧠OS ãèµ·åãã¦ããªãå ´åã¯ãä½ãæ ¹æ¬çã«åé¡ãããã¾ããVagrantãVirtualBox ãæ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ã§ãã¦ãããã©ããã確èªãã¦ãã ããã
4. ãããã·è¨å®ãå¿ è¦ãªå ´å
ãããã·ãè¨å®ããªã㨠LAN ããå¤ã«åºãããªãå ´åã
Mac 㯠sandbox/osx/manage/use-proxy.command
ãããã«ã¯ãªãã¯ã§å®è¡ãã¦ãã ããããããã·è¨å®ãã¡ã¤ã«ã®ãµã³ãã«ã sandbox/config/vagrant_proxy.conf
ã«çæããã¾ãã
export http_proxy="http://user@passwd:www.example.com:8080" export https_proxy="http://user@passwd:www.example.com:8080" export no_proxy="localhost,127.0.0.1"
Windows ã¯ãuse-proxy.bat
ãå®è¡ãã㨠sandbox/config/vagrant_proxy.bat
ã«åæ§ã®ãã¡ã¤ã«ãçæããã¾ãã
çæããã vagrant_proxy.{conf|bat}
ãã¨ãã£ã¿ã§éããåè¡ãç·¨éãã¦ãã ããã
http_proxy
â¦â¦ HTTP ç¨ãããã·è¨å®https_proxy
â¦â¦ HTTPS ç¨ãããã·è¨å®no_proxy
â¦â¦ ãããã·ã使ç¨ããªããã¡ã¤ã³
ç·¨éå¾ãMac ã¯ãæåã«å®è¡ãã use-proxy.command
ãå度ããã«ã¯ãªãã¯ã§å®è¡ãã¾ããè¨å®ããã¾ããã£ã¦ããã°ããããã·çµç±ã§ vagrant-proxyconf
ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ããã¾ãã
Windows ã¯ãæåã®ã¦ã£ã³ãã¦ã§ä½ããã¼ãæ¼ãã¨ããã©ã°ã¤ã³ã®ã¤ã³ã¹ãã¼ã«ãéå§ãã¾ããã¦ã£ã³ãã¦ãéããå ´åã¯ãããä¸åº¦ use-proxy.bat
ãããã«ã¯ãªãã¯ãã¦ãã ããã
ãã©ã°ã¤ã³ã®ã¤ã³ã¹ãã¼ã«ãçµãã£ããã start.{command|bat}
ã§ã»ããã¢ãããéå§ãã¾ããVM ã«èªåçã«
http_proxy
https_proxy
no_proxy
ç°å¢å¤æ°ãè¨å®ããã¾ããã¾ãã/etc/yum.conf
çã«ãããã·è¨å®ãæ¸ãè¾¼ã¾ãã¾ãã
5. DHCP ã§ã¯ãªãåºå® IP ã使ãããå ´å
sandbox/config/vagrant_ip.conf
ãã¡ã¤ã«ãä½æãã1è¡ç®ã«
192.168.33.10
ã®ããã« IP ãæ¸ãã¦ãã ãããããã©ã«ãã§ã¯ DHCP ã使ãã¾ãã
é常㯠DHCP ãããããã§ããåããããã¯ã¼ã¯å ã§è¤æ°ã®ã¡ã³ãã¼ãä½æ¥ããå ´åã«é¢åãªãã¨ã«ãªãã¾ãã
ãããã¸ã§ãã³ã°ãéä¸ã§æ¢ã¾ã£ã¦ãã¾ãå ´å
--- 1: nginx ---
ã®ãããªã¤ã³ã¹ãã¼ã«å¦çä¸ã«æ¢ã¾ã£ã¦ãã¾ã£ãå ´åã¯ã以ä¸ã試ãã¾ãã
- ä¸åº¦
stop.command
ã¾ãã¯stop.bat
㧠VM ãæ¢ãã manage/provision.{command|bat}
ãããã«ã¯ãªãã¯ã§å®è¡- ç¡äºçµäºããã
start.{command|bat}
ãããã«ã¯ãªãã¯ã§å®è¡
ã¬ã¤ã¢ã¦ãã®ã«ã¹ã¿ãã¤ãºæ¹æ³
vagrant-layout
ãªãã¸ããªã¯ CentOS ã NginxãMySQL ãåºå®ã§ä½¿ã£ã¦ãã¾ãã
è¨å®ãå¤ããã«ã¯ã vagrant layout init
ã³ãã³ãå®è¡å¾ã«ãçæãããã¡ã¤ã«ãç·¨éããã°è¯ãã®ã§ãããå¤æ´ããç°å¢ãåå©ç¨ãããå
±æãããå ´åãããããããã¾ããã(ããã°ãããªã¨æã£ã¦ãã¾ã)
ç¬èªã®ã¬ã¤ã¢ã¦ããå ±æããã«ã¯ãGist ã使ãæ¹æ³ã¨ãªãã¸ããªã fork ããæ¹æ³ãããã¾ãã
Gist ã使ãæ¹æ³
ã¡ãã£ã¨ããå¤æ´ã§ããã° Gist ã使ãã®ãæ軽ã§ãã
1. patch ãä½ã
以ä¸ã®æé 㧠patch
ãã¡ã¤ã«ãä½æãã¾ãã
vagrant-layout
ãªãã¸ããªã clone ãã- ãã¼ã¹ã«ãªããã©ã³ãããã§ãã¯ã¢ã¦ããã¦ãæ°ãããã©ã³ããä½ã
- 好ããªã ãç·¨éãã¦ã³ããã
- ãã¼ã¹ã«ãªãã³ãããã¨ã®
diff
ãpatch
ãã¡ã¤ã«ã«æ¸ãåºã
ä¾ãã°ãRails ã ã¨ä»¥ä¸ã®ãããªæé ã«ãªãã¾ãã
$ git clone https://github.com/koseki/vagrant-layout.git $ cd vagrant-layout $ git checkout ruby $ git checkout -b rails : ãã¡ã¤ã«ãç·¨é $ git add -A . $ git commit -m 'Rails ç¨ã¬ã¤ã¢ã¦ã' $ git diff 'HEAD^' > ../patch
æ´ã«ã³ããããå ããå ´åã¯ã'HEAD^' ãæ£ããã³ããããæãããã«èª¿æ´ãã¦ãã ãããgit commit --amend
ãããªã©ãã¦ããã¼ã¹ããã®å¤æ´ã1ã¤ã®ã³ãããã«ã¾ã¨ãã¦ããã®ãè¯ãã¨æãã¾ãã
ãã¼ã¹ã³ããããå¤æ´ãããæã¯ããªãã¸ããªãã pull
ãããã¨å¤æ´åã®ã³ãããã rebase
ãã¦ãã ããã
2. README.md ãä½ã
README.md
ã®æ«å°¾ã«ã
---
base: ${ãã¼ã¹ã¨ãªãã³ãããã®URL}
ãæ¸ãã¾ããpatch
ãçæããã¨ãã«æå®ããæ¯è¼å
ã®ã³ãããã® URL ã base
ã«æå®ãã¾ãããã® URL ããã¦ã³ãã¼ããã¦ãããããã¦ã¾ãã
README.md
ã¯ããµã³ãã«ã® Gist ãã³ãã¼ããã fork ãã¦ãã ããã
ãããã®ãã¼ã¹ã«ãªãã®ã¯ç¹å®ã®ã³ããããªã®ã§ãå ã®ãã©ã³ããæ´æ°ãããããã§ãããã«å¤±æããããåä½ãå¤ãã£ã¦ãã¾ããããªãã¨ã¯ããã¾ããã
3. Gist ã«ç»é²ãã¦ç¢ºèª
README.md
㨠patch
ã Gist ã«ç»é²ãã¦ã
$ vagrant layout init ${Gist ã® URL}
ã§ãã¾ãåãã確èªãã¾ãã
vagrant-layout ãªãã¸ããªã fork ããæ¹æ³
大ããªä¿®æ£ãè¡ãããå ´åããURL ã§ã¯ãªãåå㧠init
ã§ããããã«ãããå ´åã¯ãvagrant-layout
ãªãã¸ããªããã©ã¼ã¯ãã¦ãã ããã(ã©ãããæ°è»½ã«)
ãã©ã¼ã¯ããã¬ã¤ã¢ã¦ãã¯ã
$ vagrant layout init ${ã¦ã¼ã¶å}/${ãã©ã³ãå} $ vagrant layout init ${ã¦ã¼ã¶å}/${ãªãã¸ããªå}/${ãã©ã³ãå}
ã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ããä¾ãã°ã
$ vagrant layout init koseki/python
ã®ããã«ãã¾ããã¾ããç¹å®ã®ã³ãããã URL ã§æå®ã§ãã¾ãã
$ vagrant layout init https://github.com/koseki/vagrant-layout/commit/80c34e5
ã¨ãã£ãå ·åã§ãã確å®ã«åããã¼ã¸ã§ã³ã使ãããå ´åãªã©ã«ããã¡ãããå©ç¨ãã ããã
Git ã®ä»çµã¿ (2) - ã³ãããã»ãã©ã³ãã»ã¿ã°
Git ã®ä»çµã¿ã·ãªã¼ãºã®2åç®ã§ããç®æ¬¡ãããã«ããã¾ãã
ååã®è¨äºã§ã¯ãGit ãªãã¸ã§ã¯ãã¨ãªãã¡ã¬ã³ã¹ã大ããªããªã¼æ§é ã«ãªã£ã¦ãããã¨ã説æãã¾ããã
ã¾ããGit ãªãã¸ã§ã¯ããã©ã®ããã«è¨é²ããã¦ãããã
ãã¡ã¤ã«ããªã¼ã®å¤æ´ãã«ã¼ã tree ãªãã¸ã§ã¯ãã® ID ã«åæ ãããä»çµã¿ãªã©ãè¦ã¦ãã¾ããã
ä»å㯠commit
ãªãã¸ã§ã¯ãããã©ã³ããã¿ã°ãstash ã®ä»çµã¿ã«ã¤ãã¦èª¬æãã¾ãã
å®éã®ãã¼ã¿ãè¦ããã¨ãã¯ãGit Object Browser ã«ã¢ã¯ã»ã¹ãã¦ã¿ã¦ãã ããã
5. commit ãªãã¸ã§ã¯ã
å ã«èª¬æããéããGit ãªãã¸ã§ã¯ããã¼ã¿ãã¼ã¹ã«ã¯ãè¤æ°ã®ãã¡ã¤ã«ããªã¼ãä¿åã§ãã¾ãã
åã
ã®ãã¡ã¤ã«ããªã¼ã¯ãæä¸ä½ (ã«ã¼ã) ã«ãã tree
ãªãã¸ã§ã¯ãã® ID ã§åºå¥ãããã¨ãã§ãã¾ãããã¡ã¤ã«ããªã¼ã¯ã大æµã®å ´åãéå»ã®ãã¡ã¤ã«ããªã¼ã¨ tree
blob
ãªãã¸ã§ã¯ããå
±æãã¦ãã¾ãã
ããã©ãããããã®ãã¡ã¤ã«ããªã¼ãã©ããªé çªã§ä½ããããã¯ããã¡ã¤ã«ããªã¼ãè¦ã¦ããããã¾ããã
ä¾ãã° A 㨠B ã®2ã¤ã®ãã¡ã¤ã«ããªã¼ããã£ãã¨ãã¦ãA ã«ãã¡ã¤ã«ã追å ã㦠B ã«ãªã£ãã®ããB ãããã¡ã¤ã«ãåé¤ã㦠A ã«ãªã£ãã®ãã¯ããã¡ã¤ã«ããªã¼ããã§ã¯å¤å¥ãä»ãã¾ããã
ããã¤ãã ããããªããã¡ã¤ã«ããªã¼ãå¤ããããã管çããã®ã¯ã commit
ãªãã¸ã§ã¯ãã®å½¹å²ã§ããcommit
ãªãã¸ã§ã¯ãã¯ã次ã®ããã«ããã¹ãã§æ¸ããã¦ãã¾ãã
tree 3db13f863b338b2dbaa12f564a2a63841396e59c parent 44c68b1afc3ae211b248a9385f89b5061cbf2f94 author KOSEKI Kengo <[email protected]> 1370766628 +0900 committer KOSEKI Kengo <[email protected]> 1370766628 +0900 ãã¹ã±ãããå¢ããé大ãªãã°ãä¿®æ£ãã
commit
ãªãã¸ã§ã¯ãã«ã¯ã
tree
â¦â¦ 1ã¤ã®tree
ãªãã¸ã§ã¯ãã® IDparent
â¦â¦ 0å以ä¸ã®è¦ªcommit
ãªãã¸ã§ã¯ãã® IDauthor, committer
â¦â¦ å¤æ´ã»ã³ãããããã¦ã¼ã¶ã®ååãã¡ã¼ã«ã¢ãã¬ã¹ãå¤æ´æ¥æ- ã³ãããã¡ãã»ã¼ã¸
ãªã©ãæ¸ãã¦ããã¾ãã
commit
ãªãã¸ã§ã¯ãã¯ãparent
ã«æ¸ããã ID ã§ã³ãããããªã¼ãå½¢æãã¾ãã
tree
ãªãã¸ã§ã¯ãã¨ã¯éã«ãcommit
ãªãã¸ã§ã¯ãã¯åã親ãåç
§ãã¾ãã親ã¯èªåã®åãç¥ãã¾ããã
Git ã¯ãæ°ããã³ãããããå¤ãã³ãããã¸ã¨ããã®ã¼ãæãããã®éã¯é£ããä»çµã¿ã«ãªã£ã¦ãã¾ããåã親ãè¦ã¤ããã®ã¯ç°¡åã§ãããå ¨ãªãã¸ã§ã¯ããèªã¾ãªãéãã親ãå ¨ã¦ã®åãè¦ã¤ãããã¨ã¯ã§ãã¾ããã
Github ãè¦ãã¨ããåã®ã³ããã (parent)ãã«ã¯ãªã³ã¯ãã¦ãã¦ããã次ã®ã³ããããã¸ã®ãªã³ã¯ã¯è¦å½ãããªããã¨ããããã¾ãã
6. ãªãã¡ã¬ã³ã¹ã¨ãã©ã³ã
Git ãç解ããä¸ã§ãcommit
ãªãã¸ã§ã¯ãã¨ãªãã¡ã¬ã³ã¹ãåºå¥ãããã¨ã¯ãã¨ã¦ã大åã§ãã
commit
ãªãã¸ã§ã¯ãã¯ãã³ãããããªã¼ãå½¢æããä¸åº¦ä½ãããã決ãã¦å¤åãããããç°¡åã«ã¯æ¶ãã¾ããã
ä¸æ¹ããªãã¡ã¬ã³ã¹ã¯ãã³ãããããªã¼ã®ä¸ãåãåãåçãªãã¼ã¿ã§ãé »ç¹ã«æ¸ãæããããä¸è¦ã«ãªã£ããåé¤ããã¾ãã
ãã©ã³ã
Git ã®ãã©ã³ãã¯ããã©ã³ãã®å é ãæããªãã¡ã¬ã³ã¹ã¨ããã®ãªãã¡ã¬ã³ã¹ãã辿ãã Git ãªãã¸ã§ã¯ãã®éåã§åºæ¥ã¦ãã¾ãã
ãªãã¡ã¬ã³ã¹ãæãã®ã¯ãå¿ ãããã³ãããããªã¼ã®æã®å 端ã¨ã¯éãã¾ããããªãã¡ã¬ã³ã¹ã¯ãã³ãããããªã¼ã®ã©ããç¹å®ã®ä½ç½®ãæãã¾ããããªã¼ã®éä¸ãæ ¹å ãæåãããã¦ãããã¨ãããã¾ãã
ãã©ã³ãå é ãæããªãã¡ã¬ã³ã¹
ãã©ã³ãã®å
é ãæããªãã¡ã¬ã³ã¹ã¯ .git/refs/heads
ãã£ã¬ã¯ããªã«ä¿åããã¾ãã
ãã¨ãã° master
ãã©ã³ãã®å
é ãæããªãã¡ã¬ã³ã¹ã¯ã.git/refs/heads/master
ãã¡ã¤ã«ã«ä¿åããã¾ãããªãã¡ã¬ã³ã¹ã«ã¯ commit
ãªãã¸ã§ã¯ãã® ID ããããã¹ãã§æ¸ãã¦ããã¾ãã
20baf26a647734601c3a02e20ee128bc26600c29
ãã©ã³ãå
é ã®ãªãã¡ã¬ã³ã¹ã¯ãcommit
ã pull
ã³ãã³ãã§æ¸ããããã¾ããã¾ããreset
ã³ãã³ãã使ã£ã¦ãèªåã§å¥½ããªä½ç½®ã«æ¸ãæãããã¨ãã§ãã¾ãã
ãªãã¡ã¬ã³ã¹ãããã©ã£ã¦ã
- ãªãã¡ã¬ã³ã¹ â
commit
commit
â 親commit
commit
â ã«ã¼ãtree
- ã«ã¼ã
tree
âtree
blob
ã¨ãã£ãå ·åã«ãèã¥ãå¼ã«ãªãã¸ã§ã¯ããå¼ãåºãã¾ãã
ãªãã¡ã¬ã³ã¹ããªãã¨ã糸å£ã«ãªã commit
ãè¦ã¤ããã®ã¯é£ãããªã£ã¦ãã¾ãã¾ããGit ãªãã¸ã§ã¯ãã¯ãå¤è¦ããã¯åºå¥ãä»ããªãããã§ãã
ãªãã¡ã¬ã³ã¹ãä»ã®ãªãã¸ã§ã¯ãããåç §ãããªããªã£ããªãã¸ã§ã¯ãã¯ã2é±éç¨åº¦ã§åé¤åè£ã«ãªãã¾ãã*1
åç
§ãããªããªã£ããªãã¸ã§ã¯ããåé¤ãããããªãã¸ã§ã¯ãã `Pack` å½¢å¼ã«ã¾ã¨ãç´ãå¦çã gcãã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ (ã´ãåå) ã¨å¼ã³ã¾ãã`gc` ã¯ããªãã¸ããªãä¹±éã«ãªã£ã¦ããã¨èªåã§å®è¡ããã¾ããã¾ãã$ git gc
ã³ãã³ãã使ã£ã¦ãæåã§å®è¡ãããã¨ãã§ãã¾ãã
HEAD ãªãã¡ã¬ã³ã¹
ä»ãã§ãã¯ã¢ã¦ããã¦ãããã©ã³ã㯠.git/HEAD
ã¨ããç¹å¥ãªãªãã¡ã¬ã³ã¹ã«è¨é²ããã¦ãã¾ããHEAD
ãªãã¡ã¬ã³ã¹ã¯ git checkout
ã³ãã³ãã§æ¸ãæããã¾ãã
HEAD
ã¯ãé常ã¯ããªãã¡ã¬ã³ã¹ãåç
§ãããªãã¡ã¬ã³ã¹ã§ãã
ref: refs/heads/master
ãã ãä¾å¤ãããã¾ããHEAD
ããä»ã®ãªãã¡ã¬ã³ã¹ã§ã¯ãªããç´æ¥ commit
ãªãã¸ã§ã¯ããåç
§ãã¦ããç¶æ
ã§ããããããdetached HEAD (åé¢ããã) ã¨å¼ã³ã¾ãã
detached HEAD
detached HEAD ã¯ãgit checkout
æã« commit
ãªãã¸ã§ã¯ãã® ID ãæå®ãããããã¨çºçãã¾ããä¾ãã°ã
$ git checkout 20baf26
ã¨ããã¨ã.git/HEAD
ãã¡ã¤ã«ã«ã¯
20baf26a647734601c3a02e20ee128bc26600c29
㨠ID ãæ¸ãããç¶æ ã«ãªãã¾ããããã detached HEAD ã§ããdetached HEAD ã«å ¥ãã¨ã
Note: checking out '20baf26'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name
ã¨ãã£ãè¦åãã§ã¾ãã
detached HEAD ç¶æ ã§ãã³ãããã¯ã§ãã¾ãããã ããHEAD 以å¤ã«ãã®ã³ããããåç §ãããªãã¡ã¬ã³ã¹ãç¡ãã®ã§ãå¥ã®ãã©ã³ãããã§ãã¯ã¢ã¦ãã㦠HEAD ãæ¸ãæããã¨ãã³ãããã¯ã©ããããåç §ãããªããªãã¾ãã
ã©ããããåç §ãããªããªãã¸ã§ã¯ãã¯ãæ¾ã£ã¦ããã¨ããããã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ã§æ¶ããã¦ãã¾ãã¾ãã
detached HEAD ä¸ã®ã³ããããæ®ãã«ã¯ãä»ã®ãã©ã³ãã«ãã¼ã¸ããããæ°ãã«ãã©ã³ããä½æããå¿
è¦ãããã¾ãã
7. 2種é¡ã®ã¿ã°
Git ã«ã¯2種é¡ã®ã¿ã°ãããã¾ãã軽éã¿ã°ã¨ã¢ããã¼ãã¿ã°ã§ãã
軽éã¿ã°ã¯ãã³ããããç´æ¥åç §ãããªãã¡ã¬ã³ã¹ã§ãããã©ã³ãã¨åãããã ã®ãªãã¡ã¬ã³ã¹ãªã®ã§ãåå以å¤ã®æ å ±ãæã¡ã¾ããã
ã¢ããã¼ãã¿ã°ã¯ãtag
ãªãã¸ã§ã¯ããæããªãã¡ã¬ã³ã¹ã§ããtag
ãªãã¸ã§ã¯ã㯠commit
ãªãã¸ã§ã¯ããåç
§ãã¾ããtag
ãªãã¸ã§ã¯ãã«ã¯ãtag
ãä½ã£ãæ¥ä»ãã¦ã¼ã¶åãã³ã¡ã³ããªã©ãå«ãããã¨ãã§ãã¾ãã
8. ä¸æå¾ é¿ (stash)
Git ã«ã¯ãã¾ã ã³ããããã¦ããªããã¡ã¤ã«ãä¸æçã«éé¿ããã git stash
ã¨ããã³ãã³ããããã¾ãã
git stash
ã¯æ¯å 2ã¤ã® commit
ãªãã¸ã§ã¯ããä½æãã¾ãã
- ç¾å¨ã®
index
ãä¿åããcommit
ãªãã¸ã§ã¯ã (親㯠HEAD) - ä½æ¥ãã£ã¬ã¯ããªãä¿åãã
commit
ãªãã¸ã§ã¯ã (親ã¯ä¸ã®ã³ããã)
ã®2ã¤ã§ãã
stash ã index
ã«åæ ããã«ã¯ git stash pop --index
ã®ããã« --index
ãªãã·ã§ã³ãæå®ãã¾ãã
2ã¤ä½ããã commit
ãªãã¸ã§ã¯ãã®å
ãå¾è
ãæããªãã¡ã¬ã³ã¹ã .git/refs/stash
ãã¡ã¤ã«ã«ä¿åããã¾ãã
.git/refs/stash
ã«è¨é²ãããã®ã¯ãä¸çªæè¿ã® stash ã ãã§ããæã® stash ã¯ããã° .git/logs/refs/stash
ã«è¨é²ããã¦ãã¾ãã
(ç¶ãã¾ã)
*1:è¨äºå ¬éå½åãåç §ãããªããªã£ããªãã¸ã§ã¯ãã¯ã2é±éç¨åº¦çµã¤ã¨ Git ãèªåçã«åé¤ãããã¨ãã風ã«èª¬æãã¦ãã¾ãããããã¯æ£ããããã¾ããã§ãããä¸åº¦ä½ã£ããªãã¸ã§ã¯ãã¯ã大æµã¯ãã£ã¨é·ãæ®ãããã§ãã
GitHub for Mac 㨠Git ã³ãã³ã㧠.gitignore ã®æåãç°ãªã件ã«ã¤ã㦠(èãã¦ã¿ã)
Git ã¯ã1.8.4 ãã .gitignore ã« /**/ ã®ãããªãã¿ã¼ã³ãæ¸ããããã«ãªã£ã¦ãã¾ã (æ£å¼ã«ãµãã¼ããããããã§ã)ã
Uses of the platform fnmatch(3) function (many places in the code,
https://github.com/git/git/blob/maint/Documentation/RelNotes/1.8.4.txt
matching pathspec, .gitignore and .gitattributes to name a few)
have been replaced with wildmatch, allowing "foo/**/bar" that would
match foo/bar, foo/a/bar, foo/a/b/bar, etc.
foo/**/bar
ã¯ã
foo/bar
(â注ç®)foo/a/bar
foo/a/b/bar
ã«ããããã¾ãã
/**/
ã®é¨åãç¡ãå ´å (foo ç´ä¸ã« bar ãããå ´å) ã«ããããããä»æ§ã§ãã
ã¨ããã GitHub for Mac (2014/04/22 ãªãªã¼ã¹ç Your Hogward Eyes) ã ã¨ã
foo/a/bar
foo/a/b/bar
ã«ããããããã¾ãããGitHub for Mac ã«ãã³ãã«ããã¦ãã git ã³ãã³ãã®ãã¼ã¸ã§ã³ã¯ã
$ /Applications/GitHub.app/Contents/Resources/git/bin/git --version git version 1.8.4
㧠1.8.4 ã¨äºææ§ããããããªã®ã§ããâ¦ã
issue ãã©ãã«ã¼ããªãã®ã§ãã¡ã¼ã«ãã©ã¼ã ã§èãã¦ã¿ãã¨ãããå é¨ã§ä½¿ã£ã¦ãã libgit2 ãæªå¯¾å¿ã¨ã®ãã¨ã§ããã
ãã®ãã¡ç´ãããã
Git ã®ä»çµã¿ (1)
ç®æ¬¡
- ã¯ããã«
- Git ã®å ¨ä½å
- Git ãªãã¸ã§ã¯ãã® ID 㨠ä¸èº«
- tree 㨠blob ãªãã¸ã§ã¯ã
- commit ãªãã¸ã§ã¯ã
- ãªãã¡ã¬ã³ã¹ã¨ãã©ã³ã
- 2種é¡ã®ã¿ã°
- ä¸æå¾ é¿ (stash)
- ã¤ã³ããã¯ã¹
- ãã£ãã·ã¥ã¨ãã¦ã®å½¹å²
- ãã¼ã¸
- Fast-Forward ãã¼ã¸
- non Fast-Forward ãã¼ã¸
- rebase
- reset
- 2種é¡ã®ãã©ã³ã
- åãªãã¸ããªãèªåã®ãã©ã³ããæã£ã¦ãã
- ããªã¢ã¼ããã©ã³ããã«ã¤ãã¦
- 追跡ãã©ã³ã
- ãã©ã³ãã®å¤§ä¸è§å½¢
- ãªã¢ã¼ãã¨é¢ä¿ããã³ãã³ããããªãã³ãã³ã
- ãªã¢ã¼ããªãã¸ããªã¨ refspec
- ãªã¢ã¼ããªãã¸ããªæå®
- refspec
- fetch ã® refspec 㯠remotes ããã¼ã«ã«
- ã³ãããããªã¼ã®æ£®ãå¤å ã®ã³ããã
- é¢ä¿ãªã2ã¤ã®ãªãã¸ããªãæ··ãã
- æ··ãããªãã¸ããªãåé¢ãã
- bareãªãã¸ããª
- é bare ãªãã¸ããªã« push ããã¨ä½ãèµ·ããã
- åæ£ãªãã¸ããª
1. ã¯ããã«
Git ã®é£ããã¯ç¬ç¹ã§ãã
Git ã¯ãæ´ç·´ããããªãã¸ã§ã¯ãã¢ãã«ããéå¤ãªã³ãã³ã群ãå ã¿è¾¼ãæ§é ã«ãªã£ã¦ãã¾ãã
ãªãã¸ã§ã¯ãã¢ãã«ã¨ããã®ã¯ããGit ãªãã¸ã§ã¯ãããåä½ã¨ãããã¼ã¿æ§é ã®ãã¨ã§ããã©ã®ããã«ãã¼ã¿ãè¨é²ãã¦ããããã Git ã®æãé åçãªé¨åã§ããGit ã®å é¨ãè¦ã¦ããã¨ãå®ã«ã·ã³ãã«ãªä»çµã¿ã§åãã¦ãããã¨ã«é©ãã¾ãã
ä¸æ¹ãGit ã³ãã³ãã«ã¯ç¾å®ã®è¤éãããã®ã¾ã¾åæ ãã¦ãããããªé¨åããã£ã¦ãå¦ãã§ãã¦ããã¾ã楽ããããã¾ããã
Git ã¯ãæ ¸ã¨ãªããªãã¸ã§ã¯ãã¢ãã«ã«ãããããã®æä½ãå ããããã¨ããé åºã§çºå±ãã¦ãã¦ãããã³ãã³ãããå¦ã³å§ããã®ã¯ãããããæ¹åãéãªã®ã§ãã
ãªãã¸ã§ã¯ãã¢ãã«ãã¹ã¿ã¼ãå°ç¹ã§ãã´ã¼ã«ã¨ãã¦éå¤ãªã³ãã³ããããã®ã«ã使ãå§ããã¨ãã¯ã©ããã¦ãã³ãã³ãããå ¥éããããå¾ãªããã³ãã³ãã¯æ³¥èãé¨åããã£ã¦ããã¾ã楽ãããªãã
ããã§ãåºæ¬çãªä½¿ãæ¹ãããç¨åº¦ããã£ãããå
é¨ã®ãªãã¸ã§ã¯ãã¢ãã«ããå
¥éãç´ããã¨ããããããã¾ãããªãã¸ã§ã¯ãã¢ãã«ããããã¨ãèªç¶ãªæµãã§ã³ãã³ããç解ã§ããããã«ãªãã¾ãã
å é¨åä½ã¨å®è£ ãå¦ã¶ãã¨ã¯ãGit ãã©ããã¦ãããªã«ä¾¿å©ã§æå¹ãªã®ããæ ¹æ¬çã«ç解ããã®ã«éè¦ã§ãããããåå¿è ã«ã¨ã£ã¦ã¯ä¸å¿ è¦ã«è¤éã§æ··ä¹±ãæãã¦ãã¾ãã¨ãã人ããã¾ããããã®ãããé ããæ©ããå¦ç¿ã®ä»æ¹ã«åããã¦èªããããã«ããã®è©±é¡ãæå¾ã®ç« ã«é ç½®ãã¾ããããã¤èªããã£ã¦ï¼ãããã¯èªè ã®å¤æã«ãä»»ããã¾ãã
Git - Gitの内側
ç§ã Git ãç解ãããã¨èª¿æ»ããæãé«ç´ãªã³ãã³ãã®è¦ç¹ããçºããããããã ã¢ããå¼ã«ç解ãããã¨ãå½¹ç«ã£ããããã¦ããã ã¢ããè¦ç¹ã§è¦ã Git ããããªã«ãç¾ããã·ã³ãã«ã§ãããªããç§ã調ã¹ããã¨ãä»ã®äººãèå³ãæã£ã¦èªãã§ãããã®ã§ã¯ãªããããããã¦ç§ãçµé¨ããè¦å´ãé¿ããããã®ã§ã¯ã¨èããã
見えないチカラ: 【翻訳】Gitをボトムアップから理解する
ãããã®åªããè¨äºãé ¼ãã«ããã®è¨äºãã¾ããããã ã¢ããã®å
¥ãå£ããè¡ããã¨ããã¾ã§è¡ããã¨ãç®æ¨ã¨ãã¦ãã¾ãã
æè¡çãªåæç¥èãå¿
è¦ãªè©±ã¯ã»ã¨ãã©ããã¾ãããã¨ã³ã¸ãã¢ã§ãªãã¦ãååã«ç解ã§ããå
容ã ã¨æãã¾ã (é£ããã£ããèªåã®æç« åã®ããã§ã)ã
Git ã使ã£ããã¨ããªãæ¹ã¸
Git ãå ¨ã使ã£ããã¨ããªãæ¹ã¯ãä¸åº¦ä½¿ã£ã¦ã¿ããã¨ããããããã¾ãããããããã¥ã¼ããªã¢ã«ãå ¥éè¨äºãããããããã¾ãã
çã®ãã¼ã¿ãè¦ããæ¹ã¸
ã¨ã³ã¸ãã¢ã®æ¹ã®ä¸ã«ã¯ãæ¥æ¬èªã®èª¬æãããã¼ã¿ãè¦ãæ¹ãæ©ããã¨ããæ¹ãããããããã¾ããã
ãã®è¨äºã¨ã¯å¥ã« Git Object Browser ã¨ãã Git ã®å é¨ããã©ã¦ãºããã¢ããªã±ã¼ã·ã§ã³ãä½æãã¾ãããããã«ãã®ã¢ããªããæ¸ãåºãããã¼ã¿ã«æ³¨éãå ãããµã¤ãã以ä¸ã§å ¬éãã¦ãã¾ãã
- Part1 http://koseki.github.io/git-object-browser/ja/#/step1/.git/
- Part2 http://koseki.github.io/git-object-browser/ja-bare/#/step1/.git/
Part1 ã¯ãã©ã® Git ã³ãã³ã㧠.git
ãã£ã¬ã¯ããªã®ã©ããå¤ãããã«ã¤ãã¦ã30ã®ã¹ãããã§èª¬æãã¾ãããPart2 ã¯è¤æ°ã®ãªãã¸ããªãè¡ãæ¥ããªããããªãã¸ããªããäºãã«ãªãã¸ã§ã¯ããããåãããæ§åã観å¯ã§ããããã«ãã¦ããã¾ãã
ãã®ãµã¤ãã¯ãæ¬è¨äºã¨ã¯ç¬ç«ããå
容ã§ããè¨äºãèªãã§ãã¦ããããããªããªã£ãããå®éã®ãã¼ã¿ãè¦ãã¨ã¤ã¡ã¼ã¸ãããããããã¾ããã
2. Git ã®å ¨ä½å
Git ãªãã¸ããªã¯ã大ããåããã¨ã
- ä½æ¥ãã£ã¬ã¯ããª
.git
ãã£ã¬ã¯ããª
ã® 2 ã¤ã®ãã£ã¬ã¯ããªã§ã§ãã¦ãã¾ãã
ä½æ¥ãã£ã¬ã¯ããªã«ã¯ãGit ã§ç®¡çããããã¡ã¤ã«ãå ¥ã£ã¦ãã¾ããç§ãã¡ãç´æ¥ç·¨éããã®ã¯ãä½æ¥ãã£ã¬ã¯ããªã®ãã¡ã¤ã«ã§ãã
ä½æ¥ãã£ã¬ã¯ããªã®ä¸çªä¸ã®é層㫠.git
ãã£ã¬ã¯ã㪠ãããã¾ãã.git
ãã£ã¬ã¯ããªããªãã¸ããªã®æ¬ä½ã§ããã¾ãã.git
ãã£ã¬ã¯ããªã¯ãããããä¸ã Git ã§ç®¡çããã¦ãããã¨ã®ç®å°ã«ããªã£ã¦ãã¾ãã
ãªãã¸ããªããå¥ã®ãªãã¸ããªãä½ãã¨ããæ®é㯠git clone
ã³ãã³ãã使ãã¾ãããåã« .git
ãã£ã¬ã¯ããªãå¥ã®ãã£ã¬ã¯ããªã«ã³ãã¼ããã ãã§ããæ°ãããªãã¸ããªãä½ããã¨ãã§ãã¾ãã
.git ã®ä¸èº«
.git
ã«å«ã¾ããè¦ç´ ã§å¤§åãªã®ã¯ã
- Git ãªãã¸ã§ã¯ã
- ãªãã¡ã¬ã³ã¹
- ã¤ã³ããã¯ã¹
ã®3ã¤ã§ããã»ãã«è£å©çãªè¦ç´ ã¨ãã¦ã
- ãã°
- è¨å®
ãããã¾ãã
- Gitãªãã¸ã§ã¯ãã¯
.git/objects
ãã£ã¬ã¯ããªã«ã - ãªãã¡ã¬ã³ã¹ã¯
.git/refs
ãã£ã¬ã¯ããªã«ã - ã¤ã³ããã¯ã¹ã¯
.git/index
ãã¡ã¤ã«ã«ã
ããããæ ¼ç´ããã¦ãã¾ãã
Git ãªãã¸ã§ã¯ããã¼ã¿ãã¼ã¹
Git ãªãã¸ã§ã¯ãã®éåã Git ãªãã¸ã§ã¯ããã¼ã¿ãã¼ã¹ã¨å¼ã³ã¾ãã
æåã®ãã¡ã1 åã® Git ãªãã¸ã§ã¯ã㯠1 åã®ãã¡ã¤ã«ã«æ¸ãã¦ããã¾ãããã¨ãã°ã
.git/objects/30/3ff981c488b812b6215f7db7920dedb3b59d9a
ã¨ãããã¡ã¤ã«ã« Git ãªãã¸ã§ã¯ããæ ¼ç´ããã¦ãã¾ãã
ãªãã¸ã§ã¯ãã®æ°ãå¢ãã¦ããã¨ãè¤æ°ã®ãªãã¸ã§ã¯ãã pack å½¢å¼ã¨å¼ã°ãããã¡ã¤ã«ã«ã¾ã¨ãããããã¨ãããã¾ãã
1 ãªãã¸ã§ã¯ã 1 ãã¡ã¤ã«ã®å½¢å¼ã§ã pack å½¢å¼ã§ãã Git ãªãã¸ã§ã¯ãã®ä¸èº«ã¯ä¸ç·ã§ããè¨é²æ¹å¼ãéãã ãã§ãã
4種é¡ã®ãªãã¸ã§ã¯ã
Git ãªãã¸ã§ã¯ã㯠4 種é¡ããã¾ããtree
ã blob
ã commit
ã tag
ã®4種é¡ã§ãã
tree
ã¯ãã£ã¬ã¯ããªãblob
ã¯ãã¡ã¤ã«ã«ç¸å½ãã¾ããcommit
ã¯ã³ããããtag
ã¯ã¿ã°ã§ãã
Git ãªãã¸ã§ã¯ãã¯ãID (ãªãã¸ã§ã¯ãå) ã§åºå¥ã§ãã¾ããID 㯠40 æåã® 16 é²æ° (0ã9 㨠aãf) ã§è¡¨ç¾ããã¾ããä¾ãã°ã
0b48b1325567ae55dbfaefb250e7460e4fbb7d6d
ã¨ãã£ãå ·åã§ãã
ID ã ãè¦ã¦ãããªãã¸ã§ã¯ãã®ç¨®é¡ (tree
ã blob
ã commit
ã tag
ã®ã©ãã) ã¯åºå¥ãã¤ãã¾ããã4種é¡ã®ãªãã¸ã§ã¯ãããã¡ãæ··ãã« .git/objects
ãã£ã¬ã¯ããªã«å
¥ã£ã¦ãã¾ãã
ãªãã¡ã¬ã³ã¹
ãªãã¸ã§ã¯ãã®ä»ã«ããªãã¡ã¬ã³ã¹ã¨å¼ã°ããéè¦ãªãã¡ã¤ã«ãããã¾ãã
ãªãã¡ã¬ã³ã¹ã¯ãç¹å®ã® commit
ãªãã¸ã§ã¯ã (ã¾ã㯠tag
ãªãã¸ã§ã¯ã) ãæã示ãããã¯ãã¼ã¯ã®ãããªãã®ã§ãã
ãªãã¡ã¬ã³ã¹ãæã示ã commit
ãªãã¸ã§ã¯ããããã©ã£ã¦ãèã¥ãå¼ã«ä»ã®ãªãã¸ã§ã¯ããå¼ãåºããã¨ãã§ãã¾ãã
ãªãã¡ã¬ã³ã¹ã¯ .git/refs
ãã£ã¬ã¯ããªä»¥ä¸ã«ä¿åããã¦ãã¾ãã
ãªãã¡ã¬ã³ã¹ã«ã¯ Git ãªãã¸ã§ã¯ãã® ID ãããã¹ãã§æ¸ãã¦ããã¾ãããã¨ãã° .git/refs/heads/master
ã¨ãããªãã¡ã¬ã³ã¹ã«ã
0b48b1325567ae55dbfaefb250e7460e4fbb7d6d
ã¨æ¸ãã¦ãã£ãã¨ãã¾ãããã® 40 æåã commit
ãªãã¸ã§ã¯ãã® ID ã§ãããã® ID ãæã¤ãªãã¸ã§ã¯ãã¯ã
.git/objects/0b/48b1325567ae55dbfaefb250e7460e4fbb7d6d
ã¨ãããã¡ã¤ã«ã«ä¿åããã¦ãã¾ããID ã®å
é 2 æååã®ãã£ã¬ã¯ããªããã£ã¦ãã®ãã 38 æåããã¡ã¤ã«åã§ãã
ãªãã¡ã¬ã³ã¹ã®ãªãã¡ã¬ã³ã¹
ã¾ãããªãã¡ã¬ã³ã¹ã«ã¯ãããä¸ã¤å¥ã®å½¢å¼ãããã¾ããä»ã®ãªãã¡ã¬ã³ã¹ãæã示ããªãã¡ã¬ã³ã¹ã§ãã
ãã¨ãã°ã.git/HEAD
ãªãã¡ã¬ã³ã¹ã«ã¯ã
ref: refs/heads/master
ã®ããã«æ¸ãã¦ããã¾ãããã®å½¢å¼ã®ãªãã¡ã¬ã³ã¹ã¯ã commit
ãªãã¸ã§ã¯ããæã示ãã®ã§ã¯ãªããå¥ã®ãªãã¡ã¬ã³ã¹ .git/refs/heads/master
ãæã示ãã¦ãã¾ãã
HEAD ã¯ç¹å¥ãªãªãã¡ã¬ã³ã¹ãã¡ã¤ã«ã§ããã¾ãã§ãã¯ã¢ã¦ããã¦ãããã©ã³ãã示ãã¾ããHEAD ã« ref: refs/heads/master
ã¨æ¸ãã¦ããå ´åã master ãã©ã³ãããã§ãã¯ã¢ã¦ãããã¦ãã¾ãã
å¥ã®ååã®ãã©ã³ã (ä¾ãã° example) ããã§ãã¯ã¢ã¦ãããã¨ãHEAD 㯠ref: refs/heads/example
ã¨æ¸ãæããã¾ãã
大ããªããªã¼
ãªãã¡ã¬ã³ã¹ã¨ Git ãªãã¸ã§ã¯ãã®åç §é¢ä¿ã¯ãå ¨ä½ã§å¤§ããªããªã¼æ§é ã«ãªã£ã¦ãã¾ãã
ãã®å¤§ããªããªã¼æ§é ã¯ã4層ã«æ´çãããã¨ãã§ãã¾ã (å層ã®ååã¯åæã«ã¤ãããã®ã§ããå ¬å¼ãªå¼ã³æ¹ã§ã¯ããã¾ãã)ã
Git ã«ã³ããããããã¡ã¤ã«ããã£ã¬ã¯ããªã¯ãâ ãã¡ã¤ã«ããªã¼ã«ä¿åããã¾ãããã¡ã¤ã«ããªã¼ã«ã¯ tree
ãªãã¸ã§ã¯ã㨠blob
ãªãã¸ã§ã¯ãã§ã§ãã¦ãã¾ãã
ã³ãããã®ãã³ããã¡ã¤ã«ããªã¼ã1ã¤ã¶ãä¸ãã commit
ãªãã¸ã§ã¯ãã â¡ ã³ãããããªã¼ ã«è¿½å ããã¾ããcommit
ãªãã¸ã§ã¯ããããã¡ã¤ã«ããªã¼ã¨åæ§ã«ããªã¼æ§é ãå½¢æãã¾ãã
ã³ãããããªã¼ã®ç¹å®ã®ä½ç½®ã ⢠ãªãã¡ã¬ã³ã¹ãæã示ãã¾ããã¾ãã⣠ãªãã¡ã¬ã³ã¹ã®ãªãã¡ã¬ã³ã¹ ãç¹å®ã®ãªãã¡ã¬ã³ã¹ãæã示ãã¾ãã
MacOSX ã®ã¿ã¤ã ãã·ã³ã® UI ãã¤ã¡ã¼ã¸ããããããããã¾ããã
Mac OS X 10.5 Leopard feature video - Time ...
ãã¡ã¤ã«ããªã¼ãåç´æ¹åã«æé·ããã¨ããããã³ãããããªã¼ã¯å¥¥ããæåã«æé·ãã¾ããã³ãããããªã¼ã®ããå°ç¹ãæãã®ããªãã¡ã¬ã³ã¹ã§ãã
æ´å²ãä¸ç´ç·ã«ãªã㶠Mac ã®ã¿ã¤ã ãã·ã³ã¨ã¯ç°ãªããGit ã®ã³ãããããªã¼ã¯æåãããããåæµããªããæé·ãã¦ããã¾ãã
3. Git ãªãã¸ã§ã¯ãã® ID 㨠ä¸èº«
Git ãªãã¸ã§ã¯ãã® ID ã¯ãSHA1 ã¨ããããã·ã¥é¢æ°ã§çæããã¾ãã
Git ãªãã¸ã§ã¯ãã®ä¸èº«ã¯ã Zlib ã¨ããå§ç¸®ã©ã¤ãã©ãªã§çæããã¾ãã
ä¸å³ã®ããã«ããªãã¸ã§ã¯ãã®ç¨®é¡ + (ã¹ãã¼ã¹) + ãã¼ã¿ã®ãµã¤ãº + (\0) + ãã¼ã¿
ã SHA1 é¢æ°ã«å
¥åããçµæã ID ã«ãªããZlib ã«å
¥åããçµæãä¸èº«ã«ãªãã¾ãã
ããã·ã¥é¢æ°ã¯ãåãå ¥åã«ã¯åãããã·ã¥å¤ãéãå ¥åã«ã¯éãããã·ã¥å¤ãè¿ãã¾ããGit ãªãã¸ã§ã¯ãã®ä¸èº«ãåããªã ID ãåããä¸èº«ãéãã° ID ãç°ãªãã¾ãã
ä¸çä¸ã誰ãä½ã£ãã©ã®ãªãã¸ããªã§ããåããªãã¸ã§ã¯ãã«ã¯åã ID ãä»ãã¦ãã¾ãã
ãã¨ãã°ã空㮠blob
ã® ID ã Google ã§æ¤ç´¢ããã¨ããããªé¢¨ã« ããããã¿ã¤ããã¾ãã
空㮠.gitignore ãã¡ã¤ã«ãå
¥ã£ã tree
ãªãã¸ã§ã¯ãã® ID ãæ¤ç´¢ããã¨ããããªæãã§ãã
Git ãªãã¸ã§ã¯ãã® ID ã¨ä¸èº«ã¯ä¸å¯åã§ãããã ID ãä»ãããªãã¸ã§ã¯ãã®ä¸èº«ã ãæ¸ãæãããã¨ãããããªæä½ã¯ããå¾ã¾ãããä¸èº«ãå¤ããã¨ãå¥ã® ID ãä»ããå¥ã®ãªãã¸ã§ã¯ãã«ãªãã¾ããGit ãªãã¸ã§ã¯ãã«ã¯ãå¤æ´ãã«å½ããæä½ã¯ç¡ãããæ°è¦ä½æãã¨ãåé¤ãã ããå¯è½ã§ãã
- åèï¼ Git - Gitオブジェクト
ããã·ã¥é¢æ° SHA1 ã®ç°¡åãªèª¬æ
Git ãªãã¸ã§ã¯ãã® ID ãä½ãããã·ã¥é¢æ°ã«ã¤ãã¦ãããç°¡åã«è¦ã¦ããã¾ãããã
Git ã§ä½¿ãããããã·ã¥é¢æ° SHA1 ã¯ãå ¥åããããã¼ã¿ã 40 æåã«ãã¦è¿ãã¾ãã *1
ãã® 40 æåãããã·ã¥å¤ã¨å¼ã³ã¾ãã
ããã·ã¥é¢æ°ã¯ãåãå ¥åã«å¯¾ãã¦å¸¸ã«åãããã·ã¥å¤ãè¿ãã¾ããä¾ãã°ã
å ¥å | SHA1 ããã·ã¥å¤ |
---|---|
(空æåå) | da39a3ee5e6b4b0d3255bfef95601890afd80709 |
a | 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 |
b | e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98 |
c | 84a516841ba77a5b4648de2cd0dfcb30ea46dbb4 |
git | 46f1a0bd5592a2f9244ca321b129902a06b53e03 |
å¤ç®æ¼±ç³ åã¡ãã (é空æ庫 XHTMLç) | adf63acaf3cff383174e95477b9a37b7296afccb |
ã¨ãã£ãå ·åã§ããä½ç¾ãã©ããããããªå·¨å¤§ãªãã¼ã¿ã§ããSHA1 ã®ããã·ã¥å¤ã¯ 40 æåã«ãªãã¾ãã *2
ããã¦ããã®ããã·ã¥å¤ã¯ãé常ã«éè¤ãã«ãããªã£ã¦ãã¾ããããªãã¨ç§ãåå§ååã§ãªããã°ãããªãã®æ°åã® SHA1 ã¨ãç§ã®æ°åã® SHA1 ã¯ç¢ºå®ã«ç°ãªãã¾ãã
ä»®ã«ã 2 ã¤ã®ç°ãªã blob
ãªãã¸ã§ã¯ãã«åã SHA1 ããã·ã¥å¤ãå²ãå½ã¦ãããå ´åã2ã¤ã®ãã¡ã¤ã«ã®å
1 ã¤ãæ¶å¤±ãã¦ãã¾ãã¾ããããã©ãããã®ãããªãã¨ãå¿é
ããå¿
è¦ã¯ããã¾ããã
SHA1 ããã·ã¥ã®éè¤ (è¡çª) ãã«ããã«ã¤ãã¦ããPro Gitãã¯æ¬¡ã®ããã«èª¬æãã¦ãã¾ãã
ãã£ãä¸ã¤ã®è¡çªã 50% ã®ç¢ºçã§çºçããããã«å¿ è¦ãªãªãã¸ã§ã¯ãã®æ°ã¯ç´ 2^80 ã¨ãªãã¾ã (ä¸ç¥)ãã¤ã¾ãä¸å äºååã®ãã®ã¾ãä¸å åã§ããããã¯ãå°çä¸ã«ãããã¹ã¦ã®ç ç²ã®æ°ã®åäºç¾åã«ãããã¾ãã
å°çä¸ã®äººé¡ 65 å人ãå ¨å¡ããã°ã©ã ãæ¸ãã¦ããã¨ãã¾ããããã¦ãã®å ¨å¡ããLinux ã«ã¼ãã«ã®ããã¾ã§ã®éçºå±¥æ´ (100 ä¸ã® Git ãªãã¸ã§ã¯ã) ã¨åçã®ã³ã¼ããä¸ç§ã§æ¸ãä¸ãã馬鹿ã§ããåä¸ã® Git ãªãã¸ããªã«ããã·ã¥ãã¦ããã¨ãã¾ãããããäºå¹´éç¶ããã¨ãã¦ãSHA-1 ãªãã¸ã§ã¯ãã®è¡çªãã²ã¨ã¤ã§ãçºçããå¯è½æ§ããã£ã¨ 50% ã«ãªãã¾ããããããããããªãã®æå±ããéçºãã¼ã ã®å ¨ã¡ã³ãã¼ããåãå¤ã«ããããã¾ã£ããç¡é¢ä¿ã®äºä»¶ã§å ¨å¡ãªãªã«ãã«æ®ºããã¦ãã¾ããå¯è½æ§ã®ã»ãããã£ã½ã©é«ããã¨ã§ãããã
Git - リビジョンの選択
SHA1 ããã·ã¥é¢æ°ã«ã¤ãã¦ã¯ã
- 40 æåã®ããã·ã¥å¤ãè¿ã
- åãå ¥åã¯å¿ ãåãããã·ã¥å¤ã«ãªã
- 2 ã¤ã®å ¥åãå¶ç¶åãããã·ã¥å¤ãçæãã確çã¯ãèããå¿ è¦ããªãã»ã©ä½ã
ã¨ãã 3 ç¹ã ãè¦ãã¦ããã¦ãã ããã
4. tree 㨠blob ãªãã¸ã§ã¯ã
Git ã«è¿½å ãããã£ã¬ã¯ããªããã¡ã¤ã«ã¯ãtree
ãªãã¸ã§ã¯ãã blob
ãªãã¸ã§ã¯ãã¨ãã¦ããªãã¸ã§ã¯ããã¼ã¿ãã¼ã¹ã«ä¿åããã¾ãã
tree
ã¯ãã£ã¬ã¯ããªãblob
ã¯ãã¡ã¤ã«ã«ç¸å½ãã¾ãã
ãã ããtree
ã¯èªåã®ãã£ã¬ã¯ããªåãç¥ãã¾ãããblob
ã¯èªåã®ãã¡ã¤ã«åãç¥ãã¾ããã
blob
ãªãã¸ã§ã¯ãã«ã¯ããã¡ã¤ã«ã®ä¸èº«ããã®ã¾ã¾æ¸ãã¦ããã¾ãã
tree
ãªãã¸ã§ã¯ãã«ã¯ã次ã®ããã«ããããã£ã¬ã¯ããªã«å«ã¾ãããã¡ã¤ã«åã»ãµããã£ã¬ã¯ããªåã¨ããã®ãªãã¸ã§ã¯ã ID ãä¸è¦§ã§æ¸ããã¦ãã¾ãã
100644 aaa.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34 100644 bbb.txt \0 f761ec192d9f0dca3329044b96ebdb12839dbff6 100644 ccc.txt \0 b2a7546679fdf79ca0eb7bfbee1e1bb342487380 40000 ddd \0 0d546c66a969f7b205bf2fd450ef5e4b9efb70bf 100755 eee.sh \0 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 120000 fff-symlink \0 35a6b12323dd0e2f9a2a3e5abe291920151ede4a
å é ã®æ°åã¯ã
- ãã¡ã¤ã«ã®ç¨®é¡
- 40:ãã£ã¬ã¯ããª
- 100:ãã¡ã¤ã«
- 120:ã·ã³ããªãã¯ãªã³ã¯
- 160:ãµãã¢ã¸ã¥ã¼ã«
- å®è¡å¯è½ãã¡ã¤ã«ãã©ãã
- 644 å®è¡ä¸å¯
- 755 å®è¡å¯
ã示ãã¦ãã¾ãã
空ç½ã®å¾ã«ãã¡ã¤ã«åãããããã«ãã¤ã(\0
)ãæã¾ã£ãå¾ãæå¾ã« blob
ã¾ã㯠tree
ãªãã¸ã§ã¯ãã® ID ã (æ¬å½ã¯ãã¤ããªã§) æ¸ãã¦ããã¾ãã
tree
ã«è¨é²ããã¦ããæ
å ±ã¯ããã ãã§ãããã¡ã¤ã«ã®ã¿ã¤ã ã¹ã¿ã³ããææè
ã®ãããªæ
å ±ã¯ãblob
ã«ã tree
ã«ãæ¸ããã¦ãã¾ããããããã¡ã¤ã«ã誰ããã¤ä½ã£ããã¯ãtree
ã blob
ãè¦ã¦ããããã¾ããã
blob
ã¯ãã¡ã¤ã«ã git add
ããã¨ãã«ä½æããã¾ããä¸æ¹ãtree
㯠git commit
ããæã«ä½æããã¾ãããã®ã¿ã¤ãã³ã°ã®éãã«ã¤ãã¦ã¯ãå¾ã§ã¤ã³ããã¯ã¹ã«ã¤ãã¦èª¬æããæã«è©³ããè¦ã¾ãã
tree 㨠blob ã®åç §é¢ä¿
ãããã£ã¬ã¯ããªã«åãä¸èº«ã®ãã¡ã¤ã« A.txt 㨠B.txt ããã£ãå ´åãblob
ãªãã¸ã§ã¯ãã¯1åã ãä½æããã¾ãã
tree
ãªãã¸ã§ã¯ãã¯ä»¥ä¸ã®ãããªãã¼ã¿ã«ãªãã¾ãããã¡ã¤ã«ã®ä¸èº«ãåããªã®ã§ blob ã¯åã 72943a1...
ãåç
§ãã¦ãã¾ãã
100644 A.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34 100644 B.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34
ãã¡ã¤ã« B.txt ãå¥ã®ãã£ã¬ã¯ããªã«ç§»åããã¨ã移åå
ã¨ç§»åå
ã® tree
ãæ´æ°ããã¾ããblob
ã¯å
ã®ã¾ã¾ã§ãã
tree 1
100644 A.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34
tree 2
100644 B.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34
ã«ã¼ãããªã¼ã® ID ã§ããªã¼å ¨ä½ãèå¥ãã
tree
ã blob
ãå¤æ´ããã¨ãæ°ãããªãã¸ã§ã¯ããä½ããã¾ãã
ä¾ãã°ããããã¡ã¤ã«ãæ¸ãæãã¦ãgit add
ããã¨ãæ°ãã blob
ãªãã¸ã§ã¯ãããGit ãªãã¸ã§ã¯ããã¼ã¿ãã¼ã¹ã«è¿½å ããã¾ãã
ããã«ãblob
ãæ´æ°ãããã¨ããã®ãªãã¸ã§ã¯ããå«ã親 tree
ãªãã¸ã§ã¯ããæ´æ°ããã¾ããtree ãªãã¸ã§ã¯ãã«ã¯ãåã® ID ãæ¸ãè¾¼ã¾ãã¦ããããã§ãã
ä¾ãã°ã次ã®ãã㪠tree ãªãã¸ã§ã¯ãããã£ãã¨ãã¦ã
100644 A.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34 100644 B.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34
A.txt ã®å
容ãæ¸ããã blob
ãå
¥ãæ¿ããã¨ã
100644 A.txt \0 f761ec192d9f0dca3329044b96ebdb12839dbff6 100644 B.txt \0 72943a16fb2c8f38f9dde202b7a70ccc19c52f34
㨠tree
ãå¤åãã¾ããåæ§ã«ãåã® tree
ãå¤ããã¨ã親 tree
ãå¤ããã¾ãã
å¤åã¯è¦ªã¸è¦ªã¸ã¨ä¼æãã¦ãæçµçã«ãä¸çªä¸ã®ã«ã¼ã tree
ãªãã¸ã§ã¯ããå
¥ãæ¿ããã¾ãã
ã©ãã»ã©å·¨å¤§ãªãã¡ã¤ã«ããªã¼ã§ãã£ã¦ããæ«ç«¯ã®ã©ããä¸ç®æãã¡ã¤ã«ãæ¸ãæããã¨ãå¤åã¯è¦ªãããã®ã¼ã£ã¦ã«ã¼ãã® tree
ID ã«åæ ããã¾ããã¤ã¾ããã«ã¼ã tree
ID ã¯ããã¡ã¤ã«ããªã¼å
¨ä½ãä¸æã«èå¥ãã ID ã«ãªã£ã¦ãã¾ãã
ã«ã¼ã tree
ãªãã¸ã§ã¯ãã® ID ããããã°ãä»ã®ãã¡ã¤ã«ããªã¼ã¨æ··åãããã¨ãªããã¡ã¤ã«ããªã¼å
¨ä½ãåãåºããã¨ãã§ãã¾ãã
æ°ãããã¡ã¤ã«ããªã¼ã«ãã£ã¦ãå¤ããã¡ã¤ã«ããªã¼ãå½±é¿ãåãããã¨ã¯ããã¾ãããæ°ãããã¡ã¤ã«ããªã¼ã追å ãããå¾ã§ããå¤ãã«ã¼ã tree
ãªãã¸ã§ã¯ããããã©ã£ã¦ãå¤ããã¡ã¤ã«ããªã¼ãåãåºããã¨ãã§ãã¾ãã
ãã¡ã¤ã«ããªã¼ã¯ãéå»ã®ãã¡ã¤ã«ããªã¼ã¨ tree
blob
ãªãã¸ã§ã¯ãã®å¤§åãå
±æãã¤ã¤ãå·®åã ããæ°ãããªãã¸ã§ã¯ãã§ç½®ãæãã¦ãå¢ãã¦ããä»çµã¿ã«ãªã£ã¦ãã¾ãã
*1:æ£ç¢ºã«ã¯ 16 é²æ°æååã§40æåã160ãããã®å¤ã§ãã
*2: SHA1 ã¯æ大㧠2 ^ 64 - 1 = ç´ 16 ã¨ã¯ãµãã¤ãã¾ã§ã®å ¥åãè¨ç®ã§ããããã§ãã http://ja.wikipedia.org/wiki/Secure_Hash_Algorithm
Vagrant ã使ã£ã¦ Mac ããããã«ã¯ãªãã¯ã§æä½ã§ããä»®æ³ç°å¢ãä½ã
ãã®è¨äºãå ¬éããç´åã« Vagrant Cloud ãã¯ã¦ãã«ä¸ãã£ã¦ãã®ãè¦ã¦ãä»ããã¦ã¦è¿½è¨ãã¦ãã¾ããããã楽ãããã¨ã«ãªã£ã¦ã¾ããã¼ã
ããã°è¨äºããã£ã¨èªãã æãã ã¨ãVagrant 1.5 ã®æ°æ©è½ã¯ã
- VagrantShare - ã¾ãã§å ¬éããã¦ããµã¤ãã¿ããã« VM ã® URL ããã¼ã ã¡ã³ãã¼ã«è¦ãã
- Box ã koseki/centos ã¿ãããªçãååã§æå®ã§ããããã«ããã¼ã¸ã§ã³ç®¡ç
- rsync 㨠SMB ã§ãã©ã«ãåæ
- Hyper-V - MS ã®ä»®æ³ç°å¢ã«å¯¾å¿
- insecure-private-key ã®ä»£ããã« SSH ã§ãã¹ã¯ã¼ãã使ããããã«
- ãã©ã°ã¤ã³ç®¡ç
- Funtoo, NetBSD, TinyCore Linux ã®ã²ã¹ãã«å¯¾å¿ããããã¯ã¼ã¯è¨å®ãªã©ãã§ããããã«
ç¹ã«ã¦ã§ãéçºããã£ã¦ããã¨ãVagrantShare ã大ãããã使ã£ã¦ã¿ãã®ã楽ãã¿ã§ãã
VagrantCloud ã¯ãBox ã®ãªãã¸ããªã¨ãVagrantShare ã®ä»²ä»ããã£ã¦ãããã¿ãããã³ãã¥ããã£åãã«ã¯ç¡æãã¨ãããã¨ãªã®ã§ããããªãã¯ãª Box ã®ãã¹ãã£ã³ã°ã¯ç¡æã¨ãããã¨ãªãã§ããããããã°ãããã
ã¨ããããã§æ¬é¡ãã¡ã¸ã£ã¼ãªãªã¼ã¹ã® 1.5 ã§ãå¾æ¹äºæã¯ä¿ããã¦ããã¨ãããã¨ãªã®ã§ãæ¸ãã¦ãè¨äºããã®ã¾ã¾å
¬éã§ããã½ã¡ãã
ãã¦ã¹æä½ã§ä»®æ³ç°å¢
ãµã¼ãä¸ã§å®è¡ãããå種ã¿ã¹ã¯ã Mac ããããã«ã¯ãªãã¯ã§èµ·åã§ãããä»®æ³ç°å¢ã®ãµã³ãã«ãä½ãã¾ãããVirtualBox + Vagrant ã使ãã¾ãã
ãã¶ã¤ããããã³ãã¨ã³ãã¨ã³ã¸ãã¢ããæ¬çªã¨åæ§ã®ã¬ã¹ãã³ã¹ã確èªããªããéçºã§ããããã«ãæ軽ãªä»®æ³ç°å¢ã®ã»ããã¢ããæ¹æ³ãã»ãããã¨ããã®ãããããã®åæ©ã§ãã
Vagrant ã§ãããããäºã¯ã»ã¨ãã©å®ç¾ã§ãã¦ãã¾ããããã¿ã¼ããã«ã§ã³ãã³ããæããã«æ¸ãããã«ãããã¤ã工夫ãã¦ãã¾ãã
ãã¢
- VirtualBox 㨠Vagrant ãã¤ã³ã¹ãã¼ã«
(ã¤ã³ã¹ãã¼ã©ã§ç°¡åã«å ¥ãã¾ããRuby ãå ¥ãããããå¿ è¦ã¯ããã¾ãã) - ãªãã¸ããªã
git clone
ã¾ãã¯ãã¦ã³ãã¼ã start.command
ãããã«ã¯ãªãã¯ãã¦ãã°ããå¾ ã¤ã¨ãVirtualBox ã® CentOS ä¸ã§ Nginx, Rails, MySQL ãèµ·åãã¾ã- http://192.168.33.10:8080/ ã«ã¢ã¯ã»ã¹ã㦠Rails ãèµ·åãã¦ããã®ã確èªãã¾ã
VM ããapp/sample
以ä¸ã« Rails ã¢ããªã±ã¼ã·ã§ã³ãçæãã¾ããMac ã§ãã¡ã¤ã«ãæ¸ãæãã¦ãVM ã§ç¢ºèªã§ãã¾ããDB 㯠VM ä¸ã§åãã¦ãã¾ãã
æ§æ
ãããªæãã«ãªã£ã¦ãã¾ãã
ãµã¼ãã®è©³ç´°ãç¥ãå¿ è¦ããªãéçºã¡ã³ãã¼ã«ã¯ã以ä¸ã®ããã«è¦ãã¦ã»ãããVM ããããã¸ã§ã¯ãã®ãã¡ã¤ã«ãèªãã§ãã©ã¦ã¶ã«å¿çããä¸åã®ã¢ããªã±ã¼ã·ã§ã³ã¨ãã¦æ¯ãèãããã«ãã¾ãã
ããã¸ã§ã¯ãã®åä½ç°å¢ã VM ã«ã«ãã»ã«åããã¨ãå¥ã®ããã¸ã§ã¯ãã«å¹²æ¸ããå¿é ããªããªãã¾ããéçºãçµãã£ãã VM ãæ¨ã¦ãã°å éãã§ãã
ã¾ããVM ã¨åãè¨å®ã§ãã¼ã«ã«ã§ããµã¼ããåãããã«ãã¾ããã¨ã³ã¸ãã¢ã¯ Mac ã§ç´æ¥ãµã¼ããåãããæ¹ã便å©ããã§ãã
ã¨ã³ã¸ãã¢ãèªåã使ã£ã¦ããªãè¨å®ã¯ã¡ã³ããããªããªã£ã¦ãã¾ãã®ã§ãVM ã§ããã¼ã«ã«ã§ããªãã¹ãåãè¨å®ã使ãã¾ãã
ãã£ã¬ã¯ããªæ§æ
. âââ LICENSE âââ README.md âââ app â âââ sample â¦â¦ VM ã Rails ãçæãã空ã®ãã£ã¬ã¯ã㪠âââ htdocs â âââ index.html â âââ static â âââ index.html âââ sandbox â¦â¦ è¨å®ã®æ¬ä½ãããã¸ã§ã¯ãã®ã«ã¼ãã«ããã® sandbox ã足ãã¦ä½¿ãã¤ã¡ã¼ã¸ã§ã âââ Procfile â¦â¦foreman ã®è¨å®ãNginx 㨠Rails ãã¾ã¨ãã¦èµ·å âââ bin â âââ halt.command â¦â¦ VM ãã·ã£ãããã¦ã³ãã¾ã â âââ reset_db.command â¦â¦ VM ã« SSH ã㦠local/reset_db.command ãèµ·å â âââ sample.command â¦â¦ VM ã« SSH ã㦠local/sample.command ãèµ·å â âââ ssh.command â¦â¦ VM ã« SSH ãã¾ã â âââ start.command â¦â¦ VM ã« SSH ã㦠local/start.command ãèµ·å â âââ status.command â¦â¦ VM ã®èµ·åç¶æ ã表示ãã¾ã â âââ up.command â¦â¦ VM ãèµ·åãã¾ã â âââ local â¦â¦ VM ã¾ãã¯ãã¼ã«ã«ã§å®è¡ããã·ã§ã«ã¹ã¯ãªãã â â âââ reset_db.command â¦â¦ DB ããªã»ãããã¾ããrake db:setup ãå®è¡ â â âââ sample.command â¦â¦ rails server ãå®è¡ â â âââ start.command â¦â¦ foreman start ãå®è¡ â âââ provision.command â¦â¦ ãããã¸ã§ãã³ã°ãå®è¡ âââ conf â¦â¦ ãµã¼ãè¨å®ããã®ãµã³ãã«ã§ã¯ Nginx ã®è¨å®ãå ¥ã£ã¦ãã¾ã â âââ mime.types â âââ nginx.conf âââ logs âââ tmp âââ vm âââ Vagrantfile â¦â¦ Vagrant è¨å® âââ provision.sh â¦â¦ ãããã¸ã§ãã³ã°ã¹ã¯ãªãããMac ä¸ã§å®è¡ããããã¨ã¯ãªãã®ã§ .sh ã§ã âââ uninstall.command â¦â¦ VM ãã¢ã³ã¤ã³ã¹ãã¼ã«ãã¾ã
ã³ãã³ããã¡ã¤ã«
OSX ã§ãã·ã§ã«ã¹ã¯ãªããã®æ¡å¼µåã .command
ã«ãã¦å®è¡æ¨©éãä»ããã¨ãããã«ã¯ãªãã¯ã§å®è¡ã§ããããã«ãªãã¾ãã
*.command
ãã¡ã¤ã«ã使ã£ã¦ãvagrant
ã³ãã³ããå®è¡ãã¾ãããã¨ãã° VM ãèµ·åãã up.command
ã¯ã
#! /bin/sh DIR=`dirname $0` cd $DIR/../vm vagrant up
ã®ããã«ãªã£ã¦ãã¾ãã
VM ã« SSH æ¥ç¶ãã¦ã·ã§ã«ã¹ã¯ãªãããèµ·åããã³ãã³ã
vagrant ssh -c 'ã³ãã³ã'
ã§ãVM ã« SSH ãã¦ã³ãã³ããå®è¡ãããã¨ãã§ãã¾ããVagrant Box ããã¹ãã¬ã¼ãºç¡ãã§ãã°ã¤ã³ã§ãã sshd ãèµ·åãã¦ããããããã§ãSSH çµç±ã§ç°¡åã« VM ãæä½ã§ãã¾ãã*1
ãã®ä»çµã¿ã使ã£ã¦ãããã«ã¯ãªãã¯ã§ VM ä¸ã®ã·ã§ã«ã¹ã¯ãªãããèµ·åããã³ãã³ããä½ãã¾ãã
ãã¨ãã°ã
- Rails ã nginx ãã¾ã¨ãã¦èµ·åãã
start.command
- Rails ãåä½ã§èµ·åãã
sample.command
- DB ãã»ããã¢ããããªãã
reset_db.command
ã¯ãå ¨ã¦åãä¸èº«ã«ãªã£ã¦ãã¾ãã
#! /bin/sh DIR=`dirname $0` NAME=`basename $0` echo "--- VM ---" cd $DIR/../vm vagrant up vagrant ssh -c "/vagrant/sandbox/bin/local/$NAME"
vagrant up
㧠VM ã(èµ·åãã¦ããªãã£ãã)èµ·åããlocal ãã£ã¬ã¯ããªä»¥ä¸ã®ååã®ã¹ã¯ãªãããå®è¡ãã¾ãã
æå¾ã®è¡ã§ SSH ãã¦ã·ã§ã«ã¹ã¯ãªãããå®è¡ãã¦ãã¾ããããã¸ã§ã¯ãã®ã«ã¼ãã /vagrant ã«ãã¦ã³ããã¦ããã®ã§ã/vagrant/sandbox/bin/local
ã¯ããã®ãã£ã¬ã¯ããªãè¦ãã¦ãã¾ãã
local
以ä¸ã® *.command
ãã¡ã¤ã«ãã¹ã¯ãªããã®æ¬ä½ã§ãããã¨ãã° local/start.command
ã¯ã
#! /bin/sh set -e DIR=`dirname $0` cd $DIR/../.. foreman start
ã®ããã«ãªã£ã¦ãã¾ãã
Foreman ã§ãµã¼ããã¾ã¨ãã¦èµ·åã»çµäºãã
Foreman ã¯æè¿æãã¦ããã£ã¦ç¥ã£ãã®ã§ãããç°¡æ½ã§ãããããã¢ããªã±ã¼ã·ã§ã³ã§ãããOSã«æ¨æºã§ã¤ãã¦ã¦ã»ããã
Foreman ã Procfile ãèªãã§ãNginx 㨠Rails ãèµ·åãã¾ãã
nginx: nginx -p . -c conf/nginx.conf rails_sample: bin/local/sample.command
start.command
ãããã«ã¯ãªãã¯ããã¨ãNginx 㨠Rails ãèµ·åããã¿ã¼ããã«ã«ãã°ãæµãã¾ããCtrl-C
ã§èµ·åãããµã¼ããã¾ã¨ãã¦åæ¢ãã¾ãã
ãµã¼ãã®è¨å®ãèªã¿è¾¼ã¿ç´ãã¨ãã¯ãCtrl-C
ã§æ¢ãã¦ããã«ã¯ãªãã¯ã§åèµ·åã§ãã
Procfile
ã¯ãMac ä¸ã§ãµã¼ããèµ·åããæã«ã使ãã¾ãã
$ cd sandbox $ foreman start
ãããã¸ã§ãã³ã°
ãµã¼ãã®æ§æã¯ãéçºãé²ãã«ã¤ãã¦å¤åãã¦ããã¾ããç°å¢ãå¤ãããã³ã« VM ãã»ããã¢ãããç´ãã«ãªã£ã¦ã¯å°ãã¾ãã
ãã®ãµã³ãã«ã§ã¯ãã·ã§ã«ã¹ã¯ãªããã§ãããã¸ã§ãã³ã°ãã Vagrant ã®æ©è½ã使ã£ã¦ãã¾ãã
config.vm.provision :shell, :path => 'provision.sh'
ããã§ãååã®èµ·åæã¨ãprovisioning.command
ãããã«ã¯ãªãã¯ããéã«ãVM 㧠provision.sh ãå®è¡ããã¾ãã
Vagrant 㯠path ã§æå®ããããã¡ã¤ã«ã VM ã«ã¢ãããã¼ããã¦å®è¡ããã ãã®ããã§ãã
ãããã¸ã§ãã³ã°ã®ãã³ã«æ¯ååãã¹ã¯ãªãããå®è¡ãããã®ã§ã¯ä½¿ãã«ããã®ã§ãèªåã§ç°¡åãªãã¼ã¸ã§ã³ç®¡çãå®è£ ãã¾ãã
# ãã¼ã¸ã§ã³çªå·ãè¨é²ãããã¡ã¤ã« VERSION_FILE=/root/.provisioning_version # ãã¼ã¸ã§ã³ãã¡ã¤ã«ããã£ãã CURRENT_VERSION ã«èªã¿è¾¼ãããªãã£ãã 0 if [ -f $VERSION_FILE ]; then CURRENT_VERSION=`cat $VERSION_FILE` else CURRENT_VERSION='0' fi
ã®ããã«ãã¦ãæå¾ã«å®è¡ãããããã¸ã§ãã³ã°ã®ãã¼ã¸ã§ã³ãèªã¿è¾¼ã¿ã¾ãããã¨ã¯ä»¥ä¸ã®ããã«ãã¦ããã¼ã¸ã§ã³çªå·ãä»ãããããã¯ã足ãã¦ããã¾ãã
VERSION=1 if [ $CURRENT_VERSION -lt $VERSION ]; then echo "--- $VERSION ---" # ä½ãããã # ãã¼ã¸ã§ã³ãã¡ã¤ã«ã« $VERSION ãæ¸ã込㿠echo $VERSION > $VERSION_FILE fi
ãã¡ã¤ã«ã«è¨é²ããã $CURRENT_VERSION ãã $VERSION ã®æ¹ãæ°åã大ããã£ããå¦çãå®è¡ãã¾ãã
åå§çã§ãããéçºãµã¼ãåãã«ã¯ãã®ç¨åº¦ã§ãè¯ãã®ããªã¨ããæ°ããã¾ãããã»ãã¥ãªãã£ã®è¦ä»¶ãªã©ãå ¨ç¶éãã®ã§ãChef ãªã©ã使ã£ã¦æ¬çªã¨åæ§ã®ãããã¸ã§ãã³ã°ãå®è¡ããã®ã¯å¤§å¤ããã§ãã
ãããã¯ãä¸è¬çãªæ§æãªã Vagrant Box ãå
¬éãã¦ãããããããã¾ãããããã¸ã§ã¯ãã /vagrant
ã«ãã¦ã³ããã¦ä½¿ããããVM ã«ã¯ããã¸ã§ã¯ãã«é¢ãããã¡ã¤ã«ãä¸åå«ããªããã¨ãå¯è½ã§ãã
Nginx
Nginx 㯠sandbox/conf/nginx.conf ãç´æ¥èªãã§èµ·åãã¾ãã
nginx -p . -c conf/nginx.conf
daemon off;
ã§ãã¼ã¢ã³åãããã¿ã¼ããã«ã«ãã°ãæ¸ããªããå®è¡ãã¾ãã
sendfile off;
ãè¨å®ããªãã¨ãå ±æãã©ã«ãã®ãã¡ã¤ã«ãå£ãã¦è¦ããå ´åãããããã§ãã
- http://httpd.apache.org/docs/2.2/mod/core.html#EnableSendfile
- http://docs-v1.vagrantup.com/v1/docs/config/vm/share_folder.html
Nginx ã«éããããµã¼ãã¯ã§ããã ãããã¸ã§ã¯ãã«å
¥ã£ã¦ããè¨å®ãã¡ã¤ã«ãç´æ¥èªãã§èµ·åããæ¹ãããã¨æãã¾ãã/etc
ã«ã³ãã¼ãªã©ãã¦ãã¾ãã¨ãè¨å®ãããããã³ã«æ¯åãããã¸ã§ãã³ã°ã®å®è¡ãå¿
è¦ã«ãªã£ã¦ãã¾ãã¾ããè¨å®ãã¡ã¤ã«ãããã¸ã§ã¯ãã«å
¥ã£ã¦ããã°ãåèµ·åããã ãã§æ¸ã¿ã¾ãã
VM ã使ããã« Mac ä¸ã§ãµã¼ããèµ·åãã
VM 㧠foreman ãèµ·åãã代ããã«ãMac ä¸ã§
$ cd sandbox $ foreman start
ã§ãµã¼ãä¸å¼ãèµ·åãããã¨ãã§ãã¾ããã¾ããsandbox/bin/local/*command
ãã¡ã¤ã«ãããã«ã¯ãªãã¯ãã¦ãã¼ã«ã«ã§å®è¡ã§ãã¾ãã
Docker
ãã®æ§æã§ããå㯠Docker ã試ãã¦ãã¾ããã0.8 ãã Mac ããµãã¼ãããã¦ãã¾ãããã¾ã ãã¡ã¤ã«å ±æãã¹ã ã¼ãºã«ãããªãããã§ãã
VirtualBox (boot2docker) + Docker ã®2é建ã¦ã¯ãã¾ã ã¡ãã£ã¨ãã¼ã«ã«ããç´ã«è§¦ãã¦ããªãå°è±¡ã§ãããå°æ¥çã«ã¯ Docker ã«åãæ¿ããã®ããããã¨æãã¾ãã
Windows
ãã¼ã«ã«ã¨ VM ã§åãã¹ã¯ãªãããåãå©ç¹ã¯å¤±ããã¦ãã¾ãã¾ããã Windows ã§ãããããã¡ã¤ã«ã足ãã°åãããã«æä½ã§ããã ããã¨æãã¾ãã
*1:ã¡ãªã¿ã«ãssh ã®ç§å¯éµã¯ãã®ãã¡ã¤ã«ã§ããVagrant ãã¤ã³ã¹ãã¼ã«ããã¨ã~/.vagrant/insecure-private-key
ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã