0524 - 0530


# 0524 - 0530

# 0524 - ํด๋ผ์šฐ๋“œ์— ๋„์ปค์ด๋ฏธ์ง€ ๋ฐฐํฌํ•˜๊ธฐ

# ์š”๊ตฌ์‚ฌํ•ญ

  • 15๋ถ„
  • JDK 1.8 ์ด์ƒ
  • Gradle 4+ ๋˜๋Š” Maven 3.2+
  • Spring Toll Suite ๋˜๋Š” IntelliJ IDEA

# ๋„์ปค ํŒŒ์ผ ์ƒ์„ฑ

FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

# docker command

// ๋นŒ๋“œ
docker build -t sung431/spring-boot-cpu-bound .

// ๋กœ์ปฌ ์‹คํ–‰
docker run -p 80:80 sung431/spring-boot-cpu-bound

// ๋„์ปค ๋กœ๊ทธ์ธ
docker login

// ์›๊ฒฉ์ €์žฅ์†Œ์— ๋“ฑ๋ก
docker push sung431/spring-boot-cpu-bound

# ๋„์ปค ์„ค์น˜ ๋ฐ ์‹คํ–‰

// ์„ค์น˜
sudo yum install docker

// ์‹คํ–‰
sudo systemctl start docker

// ์ด๋ฏธ์ง€ ๋ฐ›์•„์˜ค๊ธฐ
sudo docker pull sung431/spring-boot-cpu-bound

// ๋„์ปค ์ด๋ฏธ์ง€ ์‹คํ–‰
sudo docker run -p 80:80 sung431/spring-boot-cpu-bound

# 0525 - (Mac) Node ์™„์ „ํžˆ ์‚ญ์ œ

  1. shell์„ ์—ด์–ด ๋‘ ์ค„์˜ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•œ๋‹ค.
 lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do  sudo rm /usr/local/${f}; done
 sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
  1. /usr/local/lib ์— ์žˆ๋Š” node๋กœ ์‹œ์ž‘ํ•˜๋Š” directory๋ฅผ ์‚ญ์ œํ•œ๋‹ค.
 cd /usr/local/lib
 sudo rm -rf node*

 sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
 sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp

 /usr/local/lib ๋กœ ์ด๋™ํ•˜์—ฌ node ๋ฐ node_modules๋ฅผ ์‚ญ์ œ
 /usr/local/include ๋กœ ์ด๋™ํ•˜์—ฌ node ๋ฐ node_modules ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์‚ญ์ œ
 brew install node๋กœ ์„ค์น˜ ํ•œ ๊ฒฝ์šฐ ํ„ฐ๋ฏธ๋„์—์„œ brew uninstall node ๋ฅผ ์‹คํ–‰
 ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์— ๋กœ์ปฌ ๋˜๋Š” lib ๋˜๋Š” ํฌํ•จ ํด๋”๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธ ํ•˜๊ณ  ๊ฑฐ๊ธฐ์—์„œ node ๋˜๋Š” node_modules ๋ฅผ ์‚ญ์ œ
 /usr/local/bin์œผ๋กœ ์ด๋™ํ•˜์—ฌ ๋ชจ๋“  ๋…ธ๋“œ ์‹คํ–‰ ํŒŒ์ผ์„ ์‚ญ์ œ

 sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
 sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.d
  1. /usr/local/include์— ์žˆ๋Š” node๋กœ ์‹œ์ž‘ํ•˜๋Š” directory๋ฅผ ์‚ญ์ œํ•œ๋‹ค.
cd /usr/local/include
sudo rm -rf node*
  1. brew์— ์„ค์น˜๋œ node๋ฅผ ์‚ญ์ œํ•œ๋‹ค.
brew uninstall node
  1. /usr/local/bin ์— ์žˆ๋Š” node ๋˜๋Š” node_modules๋ฅผ ์‚ญ์ œํ•œ๋‹ค.
sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/bin/node
ls -las
  1. ์ถ”๊ฐ€์ ์ธ ๊ฒƒ๋“ค์„ ์‚ญ์ œํ•œ๋‹ค.
sudo rm -rf /usr/local/share/man/man1/node.1
sudo rm -rf /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
sudo rm -rf ~/.nvm
rm -rf ~/.node-gyp

# 0526 - nvm(Node Version Manager)

# nvm ์„ค์น˜

  • git

    • https://github.com/nvm-sh/nvm
  • ์„ค์น˜

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
  • ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

์ ์šฉ

bash: source ~/.bashrc
      source ~/.bash_profile  

zsh: source ~/.zshrc

ksh: . ~/.profile

# ์˜ต์…˜ ๋ฐ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

  • node.js ์„ค์น˜
nvm install {version}
nvm install 12.13.1
  • node ๋ชฉ๋ก ํ™•์ธ
nvm ls
  • ์‚ฌ์šฉ ๋ฒ„์ „ ์ง€์ •
nvm use 12.13.1

# 0527 - bash, zsh ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋”ฐ๋กœ ๋“ฑ๋ก๋˜์–ด ์žˆ์„๋•Œ

  • ๊ฐ ํ™˜๊ฒฝ๋ณ„ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •
~/.bash_profile
~/.zshrc

๋”ฐ๋ผ์„œ bash ํ™˜๊ฒฝ์„ค์ •์— ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•˜๊ณ  zsh ํ™˜๊ฒฝ์—์„œ ์‹คํ–‰ํ–ˆ์„๊ฒฝ์šฐ ๋‹น์—ฐํžˆ ์‹คํ–‰ํ•˜๊ณ ์žํ•˜๋Š” ์ปค๋งจ๋“œ๋Š” zsh: command not found ๊ฐ€ ๋จ

  • zshrc์—์„œ bash๊ฐ€ ์ž‘๋™ํ•˜๋„๋ก ๋“ฑ๋ก
if [ -f ~/.bash_profile ]; then source ~/.bash_profile; fi

# 0528 - postgres data_directory ๋ณ€๊ฒฝ

  1. ํ˜„์žฌ data directory ํ™•์ธ
$ psql
postgres=# show data_directory;
  1. ๊ธฐ์กด ๋ฐ์ดํ„ฐ ๋ณต์‚ฌ
 mv ํ˜„์žฌ๋””๋ ‰ํ† ๋ฆฌ ์˜ฎ๊ธธ๋””๋ ‰ํ† ๋ฆฌ
  1. ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋˜๋Š” ์„ค์ •ํŒŒ์ผ ๋ณ€๊ฒฝ
    • PGDATA ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋ณ€๊ฒฝ
    • postgres configํŒŒ์ผ ๋ณ€๊ฒฝ
Last update: July 22, 2021 19:09
Contributors: jaesungahn91