Skip to content

Instantly share code, notes, and snippets.

@ogelacinyc
Last active May 25, 2023 11:12
Show Gist options
  • Save ogelacinyc/8f58f9dd39706484ecdb08c98acbe783 to your computer and use it in GitHub Desktop.
Save ogelacinyc/8f58f9dd39706484ecdb08c98acbe783 to your computer and use it in GitHub Desktop.
Automatic installation bootstrapping with Homebrew for Nodejs development

Machine info

macOS Big Sur v11.6 MacBook Pro 13-inch, M1, 2020

사전조건 Pre-requirement

터미널에서 쉘스크립트를 실행할 수 있어야 함

spotlight에서 terminal.app 검색 후 실행

설정되는 것들

ssh-agent와 키젠 Brewfile의 패키지들 깃 설정(이메일, 사용자명, 기본 에디터) iterm2 및 기본 프로파일 홈 디렉토리에 프로젝트 디렉토리 생성 vscode 설정 및 확장 추가 zsh 확장커스텀 oh-my-zsh 설치

Installation

스크립트 실행

$ sh -c "$(curl -fsSL https://gist.githubusercontent.com/ogelacinyc/8f58f9dd39706484ecdb08c98acbe783/raw/416c9159742671d7a2272fb01f3374e545637e7d/install.sh)"

스크립트 시작 후 깃에서 사용할 username and email을 넣어야 함. 아무거나 상관없음

설치가 완료되면 iterm2 Preferences / Profiles 메뉴에서 추가된 CopyOfItermProfile 프로필을 선택 후 기본값으로 설정

깃허브에서 사용할 ssh key를 클립보드에 복사되어 있으니 Settings / SSH and GPG keys 메뉴에서 New SSH key 버튼 누르고 붙여넣고 저장

# tap "adoptopenjdk/openjdk"
# tap "dkanejs/aws-session-manager-plugin"
# tap "hashicorp/tap"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
brew "curl"
brew "git"
# brew "git-flow-avh"
# brew "git-secrets"
brew "node"
brew "yarn"
# brew "hashicorp/tap/terraform"
# cask "dbeaver-community"
# cask "firefox"
cask "google-chrome"
cask "iterm2"
cask "notion"
cask "postman"
cask "slack"
cask "visual-studio-code"
{
"Profiles": [
{
"Right Option Key Sends": 0,
"Tags": [],
"Ansi 12 Color": {
"Green Component": 0.3333333432674408,
"Red Component": 0.3333333432674408,
"Blue Component": 1
},
"Right Option Key Changeable": true,
"Use Non-ASCII Font": false,
"Bold Color": {
"Green Component": 1,
"Red Component": 1,
"Blue Component": 1
},
"Ansi 7 Color": {
"Green Component": 0.73333334922790527,
"Red Component": 0.73333334922790527,
"Blue Component": 0.73333334922790527
},
"Ansi 8 Color": {
"Green Component": 0.3333333432674408,
"Red Component": 0.3333333432674408,
"Blue Component": 0.3333333432674408
},
"Ansi 9 Color": {
"Green Component": 0.3333333432674408,
"Red Component": 1,
"Blue Component": 0.3333333432674408
},
"Rows": 25,
"Default Bookmark": "No",
"Ansi 6 Color": {
"Green Component": 0.73333334922790527,
"Red Component": 0,
"Blue Component": 0.73333334922790527
},
"Ansi 5 Color": {
"Green Component": 0,
"Red Component": 0.73333334922790527,
"Blue Component": 0.73333334922790527
},
"AWDS Tab Option": "Yes",
"Non-ASCII Anti Aliased": true,
"Use Bright Bold": true,
"Ansi 10 Color": {
"Green Component": 1,
"Red Component": 0.3333333432674408,
"Blue Component": 0.3333333432674408
},
"Ambiguous Double Width": false,
"AWDS Pane Option": "Recycle",
"Jobs to Ignore": [
"rlogin",
"ssh",
"slogin",
"telnet"
],
"Ansi 15 Color": {
"Green Component": 1,
"Red Component": 1,
"Blue Component": 1
},
"Foreground Color": {
"Green Component": 0.73333334922790527,
"Red Component": 0.73333334922790527,
"Blue Component": 0.73333334922790527
},
"Bound Hosts": [],
"Working Directory": "\/Users\/",
"Blinking Cursor": false,
"AWDS Window Option": "Yes",
"Sync Title": false,
"Prompt Before Closing 2": false,
"BM Growl": true,
"Command": "",
"Description": "Default",
"AWDS Pane Directory": "",
"Disable Window Resizing": true,
"Screen": -1,
"Selection Color": {
"Green Component": 0.8353000283241272,
"Red Component": 0.70980000495910645,
"Blue Component": 1
},
"Mouse Reporting": true,
"AWDS Window Directory": "~\/Projects",
"Columns": 80,
"Idle Code": 0,
"Ansi 13 Color": {
"Green Component": 0.3333333432674408,
"Red Component": 1,
"Blue Component": 1
},
"Custom Command": "No",
"ASCII Anti Aliased": true,
"Non Ascii Font": "Monaco 12",
"Vertical Spacing": 1,
"Use Bold Font": true,
"Option Key Sends": 0,
"Selected Text Color": {
"Green Component": 0,
"Red Component": 0,
"Blue Component": 0
},
"Background Color": {
"Green Component": 0,
"Red Component": 0,
"Blue Component": 0
},
"Character Encoding": 4,
"Ansi 11 Color": {
"Green Component": 1,
"Red Component": 1,
"Blue Component": 0.3333333432674408
},
"Use Italic Font": true,
"Unlimited Scrollback": false,
"Keyboard Map": {
"0x33-0x200000-0x0": {
"Text": "3",
"Action": 12
},
"0x2f-0x200000-0x0": {
"Text": "\/",
"Action": 12
},
"0x3-0x200000-0x0": {
"Text": "0xd",
"Action": 11
},
"0x38-0x200000-0x0": {
"Text": "8",
"Action": 12
},
"0xf728-0x80000-0x0": {
"Text": "d",
"Action": 10
},
"0xf70e-0x20000-0x0": {
"Text": "[23;2~",
"Action": 10
},
"0xf701-0x220000-0x0": {
"Text": "[1;2B",
"Action": 10
},
"0x32-0x40000-0x0": {
"Text": "0x00",
"Action": 11
},
"0xf700-0x240000-0x0": {
"Text": "[1;5A",
"Action": 10
},
"0xf703-0x220000-0x0": {
"Text": "[1;2C",
"Action": 10
},
"0xf70b-0x20000-0x0": {
"Text": "[19;2~",
"Action": 10
},
"0xf702-0x240000-0x0": {
"Text": "[1;5D",
"Action": 10
},
"0xf701-0x280000": {
"Text": "0x1b 0x1b 0x5b 0x42",
"Action": 11
},
"0xf701-0x260000-0x0": {
"Text": "[1;6B",
"Action": 10
},
"0xf72b-0x40000-0x0": {
"Text": "[1;5F",
"Action": 10
},
"0xf703-0x260000-0x0": {
"Text": "[1;6C",
"Action": 10
},
"0x31-0x200000-0x0": {
"Text": "1",
"Action": 12
},
"0xf702-0x280000-0x0": {
"Text": "b",
"Action": 10
},
"0x2d-0x200000-0x0": {
"Text": "-",
"Action": 12
},
"0xf709-0x20000-0x0": {
"Text": "[17;2~",
"Action": 10
},
"0xf700-0x280000": {
"Text": "0x1b 0x1b 0x5b 0x41",
"Action": 11
},
"0x36-0x200000-0x0": {
"Text": "6",
"Action": 12
},
"0xf706-0x20000-0x0": {
"Text": "[1;2R",
"Action": 10
},
"0x36-0x40000-0x0": {
"Text": "0x1e",
"Action": 11
},
"0xf729-0x40000-0x0": {
"Text": "[1;5H",
"Action": 10
},
"0x2d-0x40000-0x0": {
"Text": "0x1f",
"Action": 11
},
"0xf702-0x300000-0x0": {
"Text": "0x1",
"Action": 11
},
"0x7f-0x80000-0x0": {
"Text": "0x1b 0x7f",
"Action": 11
},
"0x33-0x40000-0x0": {
"Text": "0x1b",
"Action": 11
},
"0x2b-0x200000-0x0": {
"Text": "+",
"Action": 12
},
"0x34-0x200000-0x0": {
"Text": "4",
"Action": 12
},
"0xf70d-0x20000-0x0": {
"Text": "[21;2~",
"Action": 10
},
"0xf72b-0x20000-0x0": {
"Text": "[1;2F",
"Action": 10
},
"0x39-0x200000-0x0": {
"Text": "9",
"Action": 12
},
"0xf70a-0x20000-0x0": {
"Text": "[18;2~",
"Action": 10
},
"0x37-0x40000-0x0": {
"Text": "0x1f",
"Action": 11
},
"0xf708-0x20000-0x0": {
"Text": "[15;2~",
"Action": 10
},
"0xf729-0x20000-0x0": {
"Text": "[1;2H",
"Action": 10
},
"0xf700-0x220000-0x0": {
"Text": "[1;2A",
"Action": 10
},
"0xf705-0x20000-0x0": {
"Text": "[1;2Q",
"Action": 10
},
"0xf702-0x220000-0x0": {
"Text": "[1;2D",
"Action": 10
},
"0x2e-0x200000-0x0": {
"Text": ".",
"Action": 12
},
"0x32-0x200000-0x0": {
"Text": "2",
"Action": 12
},
"0xf701-0x240000-0x0": {
"Text": "[1;5B",
"Action": 10
},
"0xf700-0x260000-0x0": {
"Text": "[1;6A",
"Action": 10
},
"0x37-0x200000-0x0": {
"Text": "7",
"Action": 12
},
"0xf703-0x240000-0x0": {
"Text": "[1;5C",
"Action": 10
},
"0x34-0x40000-0x0": {
"Text": "0x1c",
"Action": 11
},
"0xf702-0x260000-0x0": {
"Text": "[1;6D",
"Action": 10
},
"0xf703-0x280000-0x0": {
"Text": "f",
"Action": 10
},
"0xf70f-0x20000-0x0": {
"Text": "[24;2~",
"Action": 10
},
"0x7f-0x100000-0x0": {
"Text": "0x15",
"Action": 11
},
"0xf70c-0x20000-0x0": {
"Text": "[20;2~",
"Action": 10
},
"0xf703-0x300000-0x0": {
"Text": "0x5",
"Action": 11
},
"0x30-0x200000-0x0": {
"Text": "0",
"Action": 12
},
"0x38-0x40000-0x0": {
"Text": "0x7f",
"Action": 11
},
"0x35-0x200000-0x0": {
"Text": "5",
"Action": 12
},
"0xf739-0x0-0x0": {
"Text": "",
"Action": 13
},
"0xf707-0x20000-0x0": {
"Text": "[1;2S",
"Action": 10
},
"0xf704-0x20000-0x0": {
"Text": "[1;2P",
"Action": 10
},
"0x35-0x40000-0x0": {
"Text": "0x1d",
"Action": 11
},
"0xf728-0x0-0x0": {
"Text": "0x4",
"Action": 11
},
"0x2a-0x200000-0x0": {
"Text": "*",
"Action": 12
}
},
"Window Type": 0,
"Background Image Location": "",
"Blur": false,
"Scrollback Lines": 1000,
"Send Code When Idle": false,
"Close Sessions On End": true,
"Terminal Type": "xterm-256color",
"Visual Bell": true,
"Flashing Bell": false,
"Silence Bell": false,
"Ansi 14 Color": {
"Green Component": 1,
"Red Component": 0.3333333432674408,
"Blue Component": 1
},
"Name": "Copy of Default",
"Cursor Text Color": {
"Green Component": 1,
"Red Component": 1,
"Blue Component": 1
},
"Shortcut": "",
"Cursor Color": {
"Green Component": 0.73333334922790527,
"Red Component": 0.73333334922790527,
"Blue Component": 0.73333334922790527
},
"Ansi 0 Color": {
"Green Component": 0,
"Red Component": 0,
"Blue Component": 0
},
"Guid": "2ABDE79C-8129-4EF8-8EF4-45B2DD3137B9",
"Ansi 2 Color": {
"Green Component": 0.73333334922790527,
"Red Component": 0,
"Blue Component": 0
},
"Ansi 3 Color": {
"Green Component": 0.73333334922790527,
"Red Component": 0.73333334922790527,
"Blue Component": 0
},
"Ansi 1 Color": {
"Green Component": 0,
"Red Component": 0.73333334922790527,
"Blue Component": 0
},
"Transparency": 0,
"Has Hotkey": false,
"Horizontal Spacing": 1,
"AWDS Tab Directory": "~\/Projects",
"Normal Font": "Monaco 12",
"Custom Directory": "Advanced",
"Ansi 4 Color": {
"Green Component": 0,
"Red Component": 0,
"Blue Component": 0.73333334922790527
}
}
]
}
#!/bin/bash
read -p "username for gitconfig: " username
read -p "email for gitconfig: " useremail
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "🎉brew install completed"
# set up PATH and ssh-agent
export PATH=/opt/homebrew/bin:$PATH
# run brew bundle
curl -O https://gist.githubusercontent.com/ogelacinyc/8f58f9dd39706484ecdb08c98acbe783/raw/8b6d2cc4446aac7083f20cc065e1a8b0a9cd8022/Brewfile
brew bundle --verbose --no-lock
echo "🎉brew bundle completed"
# set up git config
git config --global user.name $username
git config --global user.email $useremail
git config --global core.editor "code --wait"
# add ssh-agent to zprofile for booting
ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa <<<y >/dev/null 2>&1
ssh-add -K ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub
echo "🎉sshkey copied in your clipboard!"
# set up iterm2 profile
curl -O https://gist.githubusercontent.com/ogelacinyc/8f58f9dd39706484ecdb08c98acbe783/raw/8b6d2cc4446aac7083f20cc065e1a8b0a9cd8022/CopyOfItermProfile.json
cp CopyOfItermProfile.json ~/Library/Application\ Support/iTerm2/DynamicProfiles
echo "🎉copied Iterm Profile. Check your iterm's preferences"
# create project directory
mkdir ~/Projects
echo "🎉create ~/Projects directory"
# set up vscode preferences and extensions
curl -o ~/Library/Application\ Support/Code/User/settings.json https://gist.githubusercontent.com/ogelacinyc/8f58f9dd39706484ecdb08c98acbe783/raw/8b6d2cc4446aac7083f20cc065e1a8b0a9cd8022/vscode_settings.json
curl -o ~/Projects/extensions.json https://gist.githubusercontent.com/ogelacinyc/8f58f9dd39706484ecdb08c98acbe783/raw/8b6d2cc4446aac7083f20cc065e1a8b0a9cd8022/vscode_extensions.json
echo "🎉vscode preferences and install extensions"
# open app and stick to dock
open /Applications/Notion.app
open /Applications/Postman.app
open /Applications/Firefox.app
open /Applications/Google\ Chrome.app
open /Applications/iTerm.app
open /Applications/Slack.app
open /Applications/Visual\ Studio\ Code.app
# install oh-my-zsh
echo 'eval `ssh-agent -s`' >> ~/.zprofile
echo 'export PATH=/opt/homebrew/bin:$PATH'
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "🎉oh-my-zsh install completed. Don't be surprize~"
echo "🎉🎉🎉Mission completed"
{
"recommendations": [
"apollographql.vscode-apollo",
"dkundel.vscode-new-file",
"aliariff.auto-add-brackets"
"aaron-bond.better-comments",
"ms-azuretools.vscode-docker",
"mikestead.dotenv",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"me-dutour-mathieu.vscode-github-actions",
"eamodio.gitlens",
"hashicorp.terraform",
"DavidAnson.vscode-markdownlint",
"zhuangtongfa.material-theme",
"esbenp.prettier-vscode",
"Prisma.prisma",
"Tyriar.sort-lines",
"BriteSnow.vscode-toggle-quotes",
"pflannery.vscode-versionlens",
"vscode-icons-team.vscode-icons",
"redhat.vscode-yaml"
]
}
{
"breadcrumbs.enabled": true,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.acceptSuggestionOnEnter": "on",
"editor.fontSize": 14,
"editor.minimap.showSlider": "always",
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
"editor.renderWhitespace": "all",
"editor.showFoldingControls": "always",
"editor.snippetSuggestions": "top",
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.tabCompletion": "onlySnippets",
"editor.tabSize": 2,
"editor.wordWrap": "wordWrapColumn",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"files.associations": {
"*.js": "javascriptreact",
"*.sql": "sql"
},
"files.exclude": {
"**/.bowerrc": true,
"**/.keep": true,
"**/.rspec": true
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"git.confirmSync": false,
"git.autoRepositoryDetection": false,
"gitlens.hovers.currentLine.over": "line",
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.check.npmIsInstalled": false,
"workbench.colorTheme": "One Dark Pro",
"workbench.startupEditor": "newUntitledFile",
"workbench.statusBar.visible": true,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"search.exclude": {
"**/*.lock": true,
"**/*.tsbuildinfo": true,
"**/data_backup": true
},
"eslint.alwaysShowStatus": true,
"eslint.probe": ["javascript", "javascriptreact"],
"editor.wordWrapColumn": 100,
"typescript.tsserver.log": "verbose",
"extensions.ignoreRecommendations": true,
"editor.minimap.renderCharacters": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.bracketPairColorization.enabled": true,
"redhat.telemetry.enabled": true,
"editor.guides.bracketPairs": "active",
"tabnine.experimentalAutoImports": true,
"editor.formatOnSave": true,
"terminal.external.osxExec": "Iterm.app",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.fontSize": 14,
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.allowChords": false,
"terminal.integrated.fontFamily": "MesloLGS NF",
"terminal.integrated.cwd": "${fileDirname}",
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"security.workspace.trust.untrustedFiles": "open",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.disableAutomaticTypeAcquisition": true,
"editor.foldingMaximumRegions": 10000,
"typescript.updateImportsOnFileMove.enabled": "always",
"yaml.customTags": [
"!And",
"!And sequence",
"!If",
"!If sequence",
"!Not",
"!Not sequence",
"!Equals",
"!Equals sequence",
"!Or",
"!Or sequence",
"!FindInMap",
"!FindInMap sequence",
"!Base64",
"!Join",
"!Join sequence",
"!Cidr",
"!Ref",
"!Sub",
"!Sub sequence",
"!GetAtt",
"!GetAZs",
"!ImportValue",
"!ImportValue sequence",
"!Select",
"!Select sequence",
"!Split",
"!Split sequence"
],
"editor.inlineSuggest.enabled": true,
"editor.suggest.showMethods": true,
"editor.suggest.preview": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment