mavericks ã« boxen (...ç²ããã®ã§å°å ¥ã¾ã§ã®è©±)
macbook pro ã« mavericks ãã¯ãªã¼ã³ã¤ã³ã¹ãã¼ã«ãã¾ããï¼
ããã¦ä»åº¦ã¯ï¼è¨å®ï¼
ãã®è¨å®ä½æ¥ã«ã¤ãã¦ã¯ï¼ä»¥åï¼defaults ã³ãã³ããªã plistbuddy ã³ãã³ãã使ã£ã¦ã®ã¢ã¯ã»ã¹ï¼æ¹æ³ã«ã¤ãã¦æ¤è¨ãã¦ã¿ã¾ããï¼
ãï¼
å®ã¯ï¼ãã®ä½æ¥çæï¼éååãããã£ã¨æ¨ªç®ã«æãã¦ããã®ã boxen ã¨ï¼
boxe ã¨ã¯ä½ããï¼ã«ã¤ãã¦ã¯ï¼ä»ã®åªããåç §å ãããã®ã§ï¼è©³ç´°ã¯ãã¡ãã«ãä»»ãããã¨ãã¦...
å©ç¨ã·ã¼ã³ã¯ï¼ãã¯ãï¼ãã·ã³ãæ°ããããã¨ã os æ°ããããï¼ãªãã¬ã¤ã¹ããã£ã¦æï¼ãã®åº¦ç¹°ãè¿ãã¦ãã "é¢åã§ä½æ°ã¹ãã¬ã¹ãã«ãªå²ã«ç²æã®ãªã" è¨å®/æ§ç¯ä½æ¥ã楽ã«ãã¦ãããã®ã boxen ãã¨ï¼
å
æ¥ os ãå
¥ãæ¿ãããã¨ã¯ï¼
ã¡ããã©ããåã£æããªã®ã§ï¼è¦ã¦ããã ãã§ãªãï¼å®éã« boxen ãå°å
¥ãã¦ã¿ããã¨ã«ï¼
ãªãï¼ç¾å¨ã®ãã·ã³ã®ç¶æ ã¨ãã¦ã¯ï¼;
- macos x 10.9 mavericks ã®ã¯ãªã¼ã³ã¤ã³ã¹ãã¼ã«ç´å¾ *1
- github ã®ã¢ã«ã¦ã³ããæã£ã¦ãã
- å¿è«ï¼apple ã® idï¼developper id æã£ã¦ãã
ã¨ãªã£ã¦ãã¾ãï¼
step 01: xcode/command line tools ã®æºå
ã¾ã xcode ã®ãã¦ã³ãã¼ãããã³ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãï¼
boxen èªèº«ã®ã話ãã«ããã°ï¼command line tools ãããã°è¯ãã¨ãªã£ã¦ã¾ããï¼åæã« xcode ã®ãã«ã¤ã³ã¹ãã¼ã«æ¨å¥¨ã¨ãã£ãã®ã§ï¼ä¸å¿ï¼ããã§ã¯ããã«å¾ã£ã¦ãã«ã§ã¤ã³ã¹ãã¼ã«ãããã¨ã«ãã¾ããï¼
ãã®ä½æ¥ã¯ï¼ã¿ã¼ããã«ä¸ã§åºæ¥ãããã§ãï¼
ããã«æ¸ãã¦ããã¾ããï¼*2
xcode-select --install
ãã¦ã³ãã¼ãããè¡ããã¾ãã®ã§æéã¯æããã¾ãï¼ã注æãï¼
æ®å¿µãªããï¼ãã§ã«ããã§ã¿ã¼ããã«ãé¢ãã¾ãï¼finder ä¸ã§ã®ä½æ¥ã¨ãªãã¾ãï¼
å¦çãçµããã¨ï¼ç¢ºèªãã¤ã¢ãã°ãç¾ãã¾ãï¼
ããã§ã¯ [Xcode ãå
¥æ] ãé¸æï¼
ããã«ï¼ããã§ãããä¸ã¤æ³¨æãªã®ã§ããï¼
ãã®ã¹ãããï¼å®çµã§ãªãã£ãããã¾ãï¼
æ®å¿µãªãã¨ã« apple store ãéãï¼çµå± apple store ã® ui ä¸ã§ [ã¤ã³ã¹ãã¼ã«] ãã¯ãªãã¯ï¼ã¨ãã¦ã¹ã«æã伸ã°ãæ®éã«æ®éã®æä½ããããã¨ã«ãªãã¾ã(ç¬
ããã«ï¼ ã©ãããæåã«ä¸åº¦ xcode ãèµ·åãã¦ãããæ¹ãè¯ãã¿ããã§ãï¼*3
ãããªãã¤ã¢ãã°ã表示ããã¾ããï¼
ããè¨ãäºãããã§ãï¼
...ãã¼ãï¼
step 02: github ã¸æ°è¦ãªãã¸ããªã®æºå
ããã¯ãã©ã¦ã¶ã§ã®ä½æ¥ã¨ãªãã¾ãï¼
ãã©ã¦ã¶ã§ github ã¸ã¢ã¯ã»ã¹ãï¼æ°è¦ãªãã¸ããªãä½æï¼
ãªãã¸ããªã®ååã¯ï¼ä»»æï¼å¥½ããªã®ãä»ãã¦è¯ãã¯ãã§ãï¼ããã§ã¯ "my-boxen" ã¨ãã¾ããï¼
ãã®æç¶ãã®éï¼[Initialize this repository with a README] ã®ãã§ãã¯ããã¯ã¹ã¯ï¼ããã©ã«ãã®ã¾ã¾ï¼"ãªã" ã®æ¹ãè¯ããã¨æãã¾ãï¼
ãããªã¨ã©ã¼ã«ééãããã¨ï¼
error: failed to push some refs to 'https://github.com/my_username/my-boxen.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first merge the remote changes (e.g., hint: 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
"Note about fast-forwards" ã¨ãããã¨ãããã§ãï¼
ä¸å¿ï¼ãªãã¸ããªãä½æãããå¾ã«é·ç§»ãããã¼ã¸ã«ç¾ãã¦ãã clone url ã¯è¦ãã¦ããã¨è¯ãã¨æã£ããã¯ãã¾ãï¼
step 03: github æ¥ç¶è¨å®
ãã®æç¶ãã¯ï¼ã¯ãªã¼ã³ã¤ã³ã¹ãã¼ã«çã«ããçã£æ°ã®ç¶æ ã§ãããï¼ãã¶ãå¿ è¦ã«ãªããã¨æãã¾ãï¼*4
ããã§ä¸æ¦ï¼ã¿ã¼ããã«ã¸æ»ãã¾ãï¼
ããã¦ã¿ã¼ããã«ã¨ãã©ã¦ã¶ä¸ã® github éãè¡ã£ããæ¥ãããããã¨ã«ãªãã¨æãã¾ãï¼
åºæ¬çãªããã¼ã¯ï¼æ¬å®¶ github ã®èª¬æã«æ²¿ã£ã¦ãã¾ãï¼ã®ã§ï¼ãã¡ããåç §ãã¦é ãã®ãæ£è§£ã ã¨æã£ã¦ãã¾ãï¼;
» Generating SSH Keys · GitHub Help
ããã¦ããã§ã¯ï¼å®éãã£ã¦ããä¸ã§ä¸é¨ï¼
èªåã®ç°å¢ã«åããæå³çã«å¤ãããï¼ãã?ãã¨æã£ãã¨ããã«ã¤ãã¦ã®ã¿ã¡ã¢ãã¦ããããã¨æãã¾ãï¼
ãªãï¼ãã?ãã®ã¤ã¾ã¥ãã§ã¯ä»¥ä¸ã®ãµã¤ããåèã«ããã¦é ãã¾ããï¼æè¬ã§ãï¼;
» ãã¦ãªã¤ã³ã°ã®ããã®githubå
¥éè¬åº§ åºæ¬æ©è½ããdotfiles管çã¾ã§ 馬鹿ã¨å¤©æã¯ç´ä¸é
» Gitã®ã»ããã¢ãã - homebrewããã©ã¼ã¯ããããã®Git&GitHubå
¥é åç·¨ - A Way of Code
ã¡ãªã¿ã«ï¼
ãã®æ®µéã§ã¯ .ssh ã®ä¸ã«å
¥ã£ã¦ãã¾ãï¼$cd ~/.ssh
ã§ãï¼
éµãã¼ã¿ã®ãã¡ã¤ã«å(ãã¹)ã¯ããã©ã«ãããå¤ãã¾ãã
ããã©ã«ãã¯ï¼ãããã id_rsa
ã§ï¼github ã® help ã§ã¯ Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
ã¨ããã®ã¾ã¾ enterï¼ããªèª¬æã«ãªã£ã¦ããã¾ããï¼ããã§ã¯ github_rsa
ã¨ãã¾ããï¼
çç±ã¯ï¼ç¹ã«æ·±ããã®ã¯ãªãã§ãï¼ãã åã«ï¼ãã®æ¹ãå¾ã§èªåèªèº«ãåããæããã¨æã£ãï¼ããã ãã§ãï¼
$ ssh-keygen -t rsa -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/Users/my_home/.ssh/id_rsa): /Users/my_home/.ssh/github_rsa Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again] Your identification has been saved in /Users/my_home/.ssh/github_rsa. Your public key has been saved in /Users/my_home/.ssh/github_rsa.pub. *snip* $ ls github_rsa github_rsa.pub known_hosts
å ¬ééµã®ãã¼ããã·ã§ã³ãå¤æ´ãã¦ããã
github ã®ãã«ãã§ã¯ãªãæç¶ãã§ï¼å¿ è¦ãªãã®ããããã¾ãããï¼
$ sudo chmod 600 github_rsa.pub
.ssh/config ãä½ã£ã¦ããã
ããã github ã®ãã«ãã§ã¯ãªãæç¶ãã§ï¼å¿ è¦ãªãã®ããããã¾ããã...
æ¥ç¶ã®ãã¹ãããããä½ã¨ã¨ã©ã¼ãï¼*5
$ pbcopy < ~/.ssh/github_rsa.pub # ãã®å¾ä¸æ¦ï¼github ã§å ¬ééµãè¨å®ãã¦ãã¾ã $ ssh -T [email protected] Permission denied (publickey).
軽ã調ã¹ã¦ã¿ãã¨ï¼~/.ssh ã® config ãã¡ã¤ã«ã«ãã IdentityFile
ã®å¤ã®æ§åï¼
ãã®å¤ãé©åã§ãªãã£ããããã®ãåå ã ã£ãï¼ã¨ããã¬ãã¼ããå¹¾ã¤ãç®ã«ãã¾ãï¼
ããã§èªåã® config ãã¡ã¤ã«ãè¦ãã¦ã¿ãã㨠.ssh
ãã£ã¬ã¯ããªãæã£ã¦ã¿ããï¼... config ç¡ãï¼
ãµã¨ï¼å
ã«ãæããåç
§å
㧠config ãã¡ã¤ã«ãä½ã£ãæç¶ãããã£ããã¨ãæãåºããã®ã§ï¼~/.ssh/config
ãèµ·ããã¦ã¿ããã¨ã«ï¼
Host github.com Hostname github.com Identityfile ~/.ssh/github_rsa
å度ãã§ãã¯ï¼
éä¸ï¼ãã¹ã¯ã¼ããå
¥ãããã¤ã¢ãã°ãåºã¦ãã¾ãï¼
ããã§ã¯å
ã®éµãã¼ã¿çæã®æç¶ãã® Enter passphrase (empty for no passphrase):
ã§å
¥ããã®ã¨åããã¬ã¼ãºãã»ããï¼
ããã§ãã¼ã¿ããã§ãï¼
$ ssh -T [email protected] Saving password to keychain failed Identity added: /Users/my_home/.ssh/github_rsa (/Users/my_home/.ssh/github_rsa) Hi me! You've successfully authenticated, but GitHub does not provide shell access.
step 04: github ãªã¢ã¼ããªãã¸ããªã¸
ããããã¯ï¼ã¿ã¼ããã«ã®ã¿ã§ã®ä½æ¥ã¨ãªãã¾ãï¼
ããã§è§¦ããæç¶ãã¯ï¼Our Boxen ã® readme ã«ãã [Bootstrapping] ã® "Once you've done that, you can run the following to bootstrap your boxen:" ã«ããå
容ã¨ä½ã²ã¨ã¤å¤ããã¾ããï¼
ã§ãã®ã§ãã¡ããåç
§ãã ããï¼
ã¡ãªã¿ã«ï¼add ãã¦ãããã®æç¶ãï¼git remote add origin <the location of my new git repository>
ã® "git remote add origin [email protected]:your_username/my-boxen
ã¨ãªãã¾ãï¼*6
å¥ã«ä½ã£ã myâboxen ã®ãã¼ã¸ã«ããï¼ããã§ãè¯ãã§ããï¼
ã¨ãããã¨ã§ï¼boxen ã®ç°å¢ã¯æãã¾ãã
æ¬å½ã¯ï¼ãã£ã¨å ã¾ã§è§¦ããããã¨æã£ãã®ã§ããï¼....ã¤ãããã®ã§ï¼ãããªã¨ããã¨ãã¾ãï¼
ã¨è¨ãäºã§ï¼ä»åã¯ããã¾ãã§ãï¼
*1:æ¬å½ã«ä½ãæãå ãã¦ããªãã£ãããã¾ãï¼
*2:ãã®ä»ã«ï¼
ãã©ã¦ã¶èµ·ããã¦ï¼Apple èªèº«ã® Downloads for Apple Developers ããæã£ã¦ããæ¹æ³ã¨ãï¼
gcc ãã git ãããå©ãã¦èµ·ããç·ã£ã½ãããæ¹ãããã¿ããã§ãï¼
*3:apple app ããã®ã¤ã³ã¹ãã¼ã«å¾ï¼ä½ãããï¼ããã¿ã¼ããã«è¡ã£ã¦ã³ãã³ããçºè¡ãããã¨ã©ã¼ãåãã...ï¼ãããã¨æã xcode ã¸ï¼è©³ç´°ã«ã¤ãã¦é²ã£ã¦ããã®å¿ãã¾ããã...
*4:ãã®æ®µéã§ãã¨ï¼"~/.ssh" ã¯æªã åå¨ããªãã§ããããï¼ããä½ããã£ã¡ãã£ã¦ ".ssh" ãã£ã¬ã¯ããªãã£ãã¨ãã¦ãéµãã¼ã¿ã®ãã¡ã¤ã«ï¼ä¾ãã° id_rsa.pub ã¿ãããªãã¡ã¤ã«çï¼ã¯ç¡ãã£ããããã®ã§ã¯ã¨æãã¾ãï¼
*5:å®ã¯ããã¾ã§ã«ãä½åº¦ãåã ssh æ¥ç¶è¨å®ãçµé¨ãã¦ããã®ã§ããï¼èºãããã¨ãªãç®æãªã®ã§ï¼ã¡ãã£ã¨ç¦ãï¼åå ã¯ä½ã§ããã? ...ããã(ç¬
*6:ãã¡ãã "https://github.com/your_username/my-boxen.git" ã§ãï¼