Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GitHubが落ちた朝は... / github_is_dead

GitHubが落ちた朝は... / github_is_dead

Presented on PHP BLT #3 #phpblt
http://phpblt.connpass.com/event/25341/

6f36ff3943be908c5d2259f4aef09ea6?s=128

Jun Watanabe

March 01, 2016
Tweet

Transcript

  1. GitHub͕ མͪͨே͸... 2016/03/01 PHP BLT #3 Jun Watanabe @rela1470

  2. Jun Watanabe @rela1470 • ΃ͪͺʔ&ࣾձਓ6೥໨ • ORATTA, Inc Chief Engineer

    • http://rela.red/ ʘWe are hiring!ʗ
  3. Έͳ͞Μ GitHub ࢖ΘΕͯ·͔͢!

  4. GitΛ࢖ͬͯΔํͳΒ ໾ʹཱͭ(͔΋) ͸͍ͺʔ΃ͪͺʔ͘Γ͑ʔͨʔ ͷօ༷͓෇͖߹͍͍ͩ͘͞

  5. 2016೥01݄28೔ޕલ9࣌

  6. None
  7. None
  8. ʘUnicorn!ʗ

  9. Ѩඓڣש ͋ͼ͖ΐ͏͔ΜͬͯΑΉΜͩΑ!

  10. όϦόϦίʔυॻ͜͏ͱ ࢥͬͯͨͷʹͳʔ GitHub͕མͪͯΔΜͳΒ ࢓ํͳ͍ͳʔ

  11. None
  12. Ͳ͏͢Ε͹Α͔͔ͬͨ

  13. 3ͭͷબ୒ࢶΛ ఏҊ͠·͢

  14. 1.༗څΛऔΔ

  15. None
  16. 2.όοΫΞοϓΛ࢖͏

  17. None
  18. ORATTA͸ ࢓ࣄͰ͖·ͨ͠ ʘWe are hiring!ʗ

  19. ΋ͪΖΜ ༗څ ී௨ʹऔΕ·͢(স ʘWe are hiring!ʗ

  20. όοΫΞοϓ ͯ͠ͳ͔ͬͨ৔߹

  21. ͦ΋ͦ΋Gitͱ͸

  22. ෼ࢄܕ όʔδϣϯ؅ཧγεςϜ

  23. ෼ࢄܕ

  24. खݩʹ όοΫΞοϓ ͞ΕͯΔ͡ΌΜ

  25. ࠷ۙfetchͯͦ͠͏ͳ ಉ྅Λ୳͢

  26. 3.ಉ྅Λੜ͚ᩴʹ͢Δ

  27. ಉ྅ͷPCΛ ੜ͚ᩴʹ ͠Α͏!

  28. ΈΜͳϋοϐʔ ※ͨͩ͠ಉ྅1໊Λআ͘

  29. None
  30. ಉ྅ͷPC͕ Windowsͷ৔߹

  31. 1. git daemonΛ࢖͏ 2. sshͰؤுΔ

  32. 1. git daemonΛ࢖͏

  33. Step1 ϩʔΧϧͷgitΛ ϕΞϦϙδτϦʹมߋ

  34. ී௨΍Δͱ͖ mkdir php_blt_03.git cd php_blt_03.git git init --bare --shared cd

    ../ cd php_blt_03 git remote add --mirror localbare /Users/rela/php_blt_03.git git push --mirror localbare master
  35. ࠓճ͸ۓٸ࣌ͳͷͰ

  36. ಉ྅PCͷ ϫʔΫίϐʔΛ ݩʹ ϕΞϦϙδτϦ Λ࡞Γ·͢

  37. ϫʔΫίϐʔΛࣺͯΔ

  38. ϫʔΫίϐʔΛࣺͯΔ

  39. ϫʔΫίϐʔΛࣺͯΔ

  40. ϕΞϦϙδτϦʹมߋ

  41. ϕΞϦϙδτϦʹมߋ [core] repositoryformatversion = 0 filemode = true bare =

    false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = git@github.com:rela1470/php_blt_03.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master → true
  42. Step2 git daemon༻ͷ ϑΝΠϧΛ࡞੒ git-daemon-export-ok

  43. None
  44. Step3 git daemonىಈ

  45. git daemonىಈ Git For Windows(msysgit)ͷCUIͰ git daemon --enable=receive-pack --base-path=/C/Users/rela --export-all

    Ͱgit-daemon-export-okΛ࡞Βͳͯ͘΋શެ։ —enable=receive-pack ͰpushڐՄ
  46. ׬ྃʘ(^o^)ʗ

  47. ࢼͯ͠ΈΑ͏! $ cd php_blt_03/ $ git remote add ikenie git://192.168.93.7/php_blt_03.git

    $ git fetch ikenie From git://192.168.93.7/php_blt_03 * [new branch] master -> ikenie/master
  48. ಉ྅ͷPC͕ Macͷ৔߹

  49. 1. git daemonΛ࢖͏ 2. sshͰؤுΔ

  50. 2. sshͰؤுΔ

  51. Step1 ϩʔΧϧͷgitΛ ϕΞϦϙδτϦʹมߋ

  52. ϩʔΧϧͷgitΛ ϕΞϦϙδτϦʹมߋ $ pwd /Users/Watanabe/php_blt_03 $ ll total 520 drwxr-xr-x

    5 Watanabe staff 170 2 26 18:15 . drwxr-xr-x+ 50 Watanabe staff 1700 2 26 18:15 .. drwxr-xr-x 12 Watanabe staff 408 2 26 18:15 .git -rw-r--r-- 1 Watanabe staff 12 2 26 18:15 README.md -rw-r--r-- 1 Watanabe staff 259625 2 26 18:15 abd6e4b427db9a9735b72c035b88f016.png
  53. ϩʔΧϧͷgitΛ ϕΞϦϙδτϦʹมߋ $cd /Users/Watanabe/ $mv php_blt_03/.git/ php_blt_03.git $rm -rf php_blt_03

    $vi php_blt_03.git/config
  54. ϩʔΧϧͷgitΛ ϕΞϦϙδτϦʹมߋ [core] repositoryformatversion = 0 filemode = true bare

    = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = git@github.com:rela1470/php_blt_03.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master → true
  55. Step2 ֎෦͔Β SSH઀ଓग़དྷΔΑ͏ʹ ઃఆมߋ

  56. None
  57. None
  58. ׬ྃʘ(^o^)ʗ

  59. ࢼͯ͠ΈΑ͏! $ cd php_blt_03/ $ git remote add ikenie ssh://Watanabe@192.168.92.18/Users/Watanabe/

    php_blt_03.git $ git fetch ikenie Password: From ssh://192.168.92.18/Users/Watanabe/php_blt_03 * [new branch] master -> ikenie/master
  60. ಉ྅ͷPC͕ Windowsͷ৔߹

  61. 1. git daemonΛ࢖͏ 2. sshͰؤுΔ

  62. 2. sshͰؤுΔ

  63. Windowsʹ
 OpenSSHΛ Πϯετʔϧ͢Δ https://github.com/PowerShell/Win32-OpenSSH

  64. ؤுΕͳ͔ͬͨ

  65. ͕࣌ؒͳ͍ͷͰ εΩοϓ ʘࢿྉͰͲ͏ͧʗ

  66. ్த݁Ռใࠂ

  67. Step1 ϩʔΧϧͷgitΛ ϕΞϦϙδτϦʹมߋ

  68. লུ

  69. Step2 ֎෦͔Β SSH઀ଓग़དྷΔΑ͏ʹ ઃఆมߋ

  70. Windowsʹ͸ SSH ͳ͍Ͱ͢

  71. ͱ͍͏͜ͱͰ

  72. Windowsʹ
 OpenSSHΛ Πϯετʔϧ͢Δ https://github.com/PowerShell/Win32-OpenSSH

  73. Microsoft͕ OpenSSH Ҡ২த

  74. GitHub͔Βμ΢ϯϩʔυ C:\Program Filesʹղౚ

  75. ؅ཧऀݖݶͰ Power Shell

  76. SSHϙʔτΛۭ͚Δ New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound - Action

    Allow -DisplayName SSH
  77. SSHϗετΩʔ࡞੒ cd 'C:\Program Files\OpenSSH-Win32’ .\ssh-keygen.exe -A

  78. None
  79. ΠϯετʔϧεΫϦϓτ࣮ߦ cd 'C:\Program Files\OpenSSH-Win32’ .\install-sshlsa.ps1

  80. Τϥʔ͕ग़ͨ৔߹

  81. None
  82. ࣮ߦϙϦγʔΛ ऑΊΔ

  83. None
  84. Restricted ϩʔΧϧ:࣮ߦෆՄ ϦϞʔτ:࣮ߦෆՄ AllSigned ϩʔΧϧ:ূ໌ॻΛཁٻ ϦϞʔτ:ূ໌ॻΛཁٻ RemoteSigned ϩʔΧϧ:࣮ߦڐՄ ϦϞʔτ:ূ໌ॻΛཁٻ Unrestricted

    ϩʔΧϧ:࣮ߦڐՄ ϦϞʔτ:֬ೝͷޙڐՄ
  85. ऴΘͬͨΒ໭ͦ͏Ͷ

  86. ऴΘͬͨΒ໭ͦ͏Ͷ

  87. ࠶ىಈ

  88. αʔϏεొ࿥

  89. αʔϏεొ࿥ɺىಈ cd 'C:\Program Files\OpenSSH-Win32’ .\sshd.exe install Start-Service sshd

  90. ࢼ͠ʹܨ͍ͰΈΔ

  91. ࢼ͠ʹܨ͍ͰΈΔ Watanabe-no-MacBook-Pro:~ Watanabe$ ssh rela@192.168.93.7 rela@192.168.93.7's password: Microsoft Windows [Version

    10.0.10586] (c) 2015 Microsoft Corporation. All rights reserved. rela@RELA-TABLET C:\Users\rela>
  92. ŝŦᴸᴸᴸᴸ ƅ㱼ƅ)ᴸᴸᴸᴸ!!

  93. gitܨ͕Δ͔ͳ? $ git clone ssh://rela@192.168.93.7/C/Users/rela/php_blt_03.git Cloning into 'php_blt_03'... rela@192.168.93.7's password:

    packet_write_wait: Connection to 192.168.93.7: Broken pipe fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
  94. ͩΊͩͬͨ

  95. ΋͏গ͠Ͱ ߦ͚ͦ͏ͳؾ͕͢Δ

  96. ʘ୭͔͓ئ͍͠·͢ʗ

  97. ݁࿦

  98. GitͳΒ େ఍ ͳΜͱ͔ͳΔ

  99. ୅ସखஈΛ ֬อ͢Δ͜ͱ͕ େࣄ

  100. ಉ྅ͷPCʹ Pushͱ͔ അࣛͳ͜ͱ ͯ͠ͳ͍Ͱ

  101. GitHub͕མͪͨΒ BitBucketΛ࢖͓͏

  102. GitHub Enterprise BitBucket GitLab GitBucket
 Gitorious
 Gitolite Gitosis

  103. GitHub Enterprise BitBucket GitLab GitBucket
 Gitorious
 Gitolite Gitosis Φεεϝ!→

  104. None
  105. ਓੜॳͷόζͬͨهࣄͰ͢:D
 http://rela1470.hatenablog.jp/entry/20140520

  106. ྑ͍GitϥΠϑΛ!