'OSX'에 해당되는 글 7건

  1. 2021.09.07 [ZSH] oh-my-zsh 설정 on Macbook.
  2. 2020.08.27 [Docker] 맥북에 우분투 올리기
  3. 2018.08.17 [Java] OpenJDK 설치 on OSX
  4. 2017.11.18 [Spark] Spark installation on osx
  5. 2017.08.02 [Tensorflow] tensorflow source build & install on osx 10.12
  6. 2017.02.10 [OSX El Capitan] ulimit 수정
  7. 2016.11.23 [Nginx] osx 에 nginx 설치 하기 - brew install

[ZSH] oh-my-zsh 설정 on Macbook.

ITWeb/개발일반 2021. 9. 7. 10:47

또 뭔가 찾기 귀찮아서 기록해 봅니다.

 

[oh-my-zsh 설치]
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

 

[iTerm2 Color Schemes]
https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/schemes

 

[d2font 설치] (서체관리자 추가 및 iTerm 추가)
https://github.com/naver/d2codingfont

 

[highlighting]
$ brew install zsh-syntax-highlighting

$ vi .zshrc 하단에 추가
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

 

[Insecure Directory Skip]

$ vi .zshrc 제일 윗줄에 추가

 ZSH_DISABLE_COMPFIX=true

 

[Theme 수정]

$ vi .zshrc 수정 및 추가

ZSH_THEME="agnoster"
...중략...
prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]];
  then
  	prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
  fi
}

 

[newline 추가]

$ vi ~/.oh-my-zsh/themes/agnoster.zsh-theme

build_prompt() {
  RETVAL=$?
  prompt_status
  prompt_virtualenv
  prompt_aws
  prompt_context
  prompt_dir
  prompt_git
  prompt_bzr
  prompt_hg
  prompt_newline # <-- 추가
  prompt_end
}

 

[newline & multiline 적용]

PROMPT='%{%f%b%k%}$(build_prompt) '

# 아래 6, 7번 라인은 아래와 같이 작성을 하셔야 정상적으로 나옵니다.
prompt_newline() {
  if [[ -n $CURRENT_BG ]]; then
    echo -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR
%{%k%F{blue}%}$SEGMENT_SEPARATOR"
  else
    echo -n "%{%k%}"
  fi

  echo -n "%{%f%}"
  CURRENT_BG=''
}

 

[plugin 적용]

- zsh-syntax-highlighting

$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

 

- zsh-autosuggestions

$ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

 

$ vi .zshrc

plugins=(
  git
  zsh-syntax-highlighting
  zsh-autosuggestions
  web-search
  jsontools
  macports
  node
  osx
  sudo
  docker
  iterm2
)
:

[Docker] 맥북에 우분투 올리기

Cloud&Container/IaC 2020. 8. 27. 18:32

가끔 필요 할 때가 있습니다.

 

docker-compose.yml)

version: '3.7'
services:
  ubuntu-mac:
    image: ubuntu:18.04
    container_name: ubuntu-mac
    stdin_open: true
    tty: true
    command: [/bin/bash]

 

:

[Java] OpenJDK 설치 on OSX

ITWeb/개발일반 2018. 8. 17. 09:10

OSX 에 OpenJDK 설치 하기)


https://github.com/AdoptOpenJDK/homebrew-openjdk


$ brew tap AdoptOpenJDK/openjdk

$ brew install adoptopenjdk-openjdk8

:

[Spark] Spark installation on osx

ITWeb/개발일반 2017. 11. 18. 21:54

기본 설치 입니다.

제가 brew install 보다는 직접 binary 받아서 설치 하는걸 더 선호해서 올려 봅니다.

[Spark installation on osx]

Ref. https://isaacchanghau.github.io/2017/06/28/Spark-Installation-on-Mac-OS-X/


1. scala

https://www.scala-lang.org/download/


$ tar -xvzf scala-2.12.4.tgz

$ vi .bash_profile

export SCALA_HOME=/Users/henry/Work/apps/scala-2.12.4

PATH=$SCALA_HOME/bin:$PATH

2. spark

https://spark.apache.org/downloads.html


$ tar -xvzf spark-2.2.0-bin-hadoop2.7.tgz

$ vi .bash_profile

export SPARK_HOME=/Users/henry/Work/apps/spark-2.2.0-bin-hadoop2.7

PATH=$SPARK_HOME/bin:$PATH

$ cd /Users/henry/Work/apps/spark-2.2.0-bin-hadoop2.7

$ cp spark-env.sh.template spark-env.sh

$ vim spark-env.sh

export SCALA_HOME=/Users/henry/Work/apps/scala-2.12.4

export SPARK_MASTER_IP=localhost

export SPARK_WORKER_MEMORY=1g

$ spark-shell


scala 와 spark 이 설치가 되어야 합니다.

보시면 아시겠지만 .bash_profile 에 환경 설정 해주시고 실행하시면 됩니다.

PATH=$SCALA_HOME/bin:$SPARK_HOME/bin:$PATH

$ source .bash_profile

$ spark-shell

Spark context Web UI available at http://127.0.0.1:4040

Spark context available as 'sc' (master = local[*], app id = local-1511009262380).

Spark session available as 'spark'.

Welcome to

      ____              __

     / __/__  ___ _____/ /__

    _\ \/ _ \/ _ `/ __/  '_/

   /___/ .__/\_,_/_/ /_/\_\   version 2.2.0

      /_/


Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_72)

Type in expressions to have them evaluated.

Type :help for more information.


scala>


:

[Tensorflow] tensorflow source build & install on osx 10.12

ITWeb/개발일반 2017. 8. 2. 09:54

설치 하면서 참고 문서니 순서를 정리 하지 않아서 그냥 raw data 만 일단 투척해 봅니다.

그냥 brew install 해서 설치를 해도 되지만 아래와 같은 오류가 발생을 해서 소스 빌드 했습니다.


[오류]

$ python helloworld.py

2017-08-01 17:04:11.721245: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.

2017-08-01 17:04:11.721266: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.

2017-08-01 17:04:11.721270: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.

2017-08-01 17:04:11.721274: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

Hello, TensorFlow!

(tensorflow) imac-2:src henry$ deactivate


[참고문서들]


tensorflow)


bazel)


nvidia)

- cudnn 다운로드를 받기 위해서는 로그인을 하셔야 합니다.


기본 설치 가이드)


$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

$ sudo pip install /tmp/tensorflow_pkg/tensorflow-1.2.1-py2-none-any.whl


# 아래는 six-1.4.1 패키지로 인해서 설치 오류가 발생을 합니다. 이를 회피 하기 위한 옵션 추가 입니다.

$ sudo pip install --ignore-installed six


#!/usr/bin/python

import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')

sess = tf.Session()

print(sess.run(hello))


:

[OSX El Capitan] ulimit 수정

ITWeb/개발일반 2017. 2. 10. 18:53

아래와 같이 수정 하시면 됩니다.

파일이 없으면 만드시면 됩니다.


$ sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

<?xml version="1.0" encoding="UTF-8"?>  

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"  

        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">  

  <dict>

    <key>Label</key>

    <string>limit.maxfiles</string>

    <key>ProgramArguments</key>

    <array>

      <string>launchctl</string>

      <string>limit</string>

      <string>maxfiles</string>

      <string>524288</string>

      <string>524288</string>

    </array>

    <key>RunAtLoad</key>

    <true/>

    <key>ServiceIPC</key>

    <false/>

  </dict>

</plist>  


$ sudo vi /Library/LaunchDaemons/limit.maxproc.plist

<?xml version="1.0" encoding="UTF-8"?>  

<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  

  <plist version="1.0">

    <dict>

      <key>Label</key>

        <string>limit.maxproc</string>

      <key>ProgramArguments</key>

        <array>

          <string>launchctl</string>

          <string>limit</string>

          <string>maxproc</string>

          <string>2048</string>

          <string>2048</string>

        </array>

      <key>RunAtLoad</key>

        <true />

      <key>ServiceIPC</key>

        <false />

    </dict>

  </plist>


:

[Nginx] osx 에 nginx 설치 하기 - brew install

ITWeb/개발일반 2016. 11. 23. 10:02

mac osx 에 설치 할 일이 있어서 작성해 봅니다.


$ sudo chown -R '사용자계정' /usr/local/lib/pkgconfig

$ brew install pcre

$ brew link --overwrite pcre

$ brew update

$ sudo chown -R '사용자계정' /usr/local

$ brew install nginx

$ sudo chown root:wheel /usr/local


'사용자계정' 에는 user account 넣어 주시면 됩니다.

예를 들어 henry 라는 계정을 사용하시면)

$ sudo chown -R henry /usr/local/lib/pkgconfig


저는 설치 하다 몇 가지 에러가 발생을 해서 위 순서대로 구성을 하였습니다.

아래는 발생한 에러 입니다.


Error case 1)

Error: The `brew link` step did not complete successfully

The formula built, but is not symlinked into /usr/local

Could not symlink lib/pkgconfig/libpcre.pc

/usr/local/lib/pkgconfig is not writable.


Error case 2)

mkdir: /usr/local/var/run: Permission denied

make[1]: *** [install] Error 1

make: *** [install] Error 2


READ THIS: https://git.io/brew-troubleshooting


/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:353:in `open_http': 422 Unprocessable Entity (GitHub::Error)

Validation Failed


Error case 3)

Error: The /usr/local directory is not writable.

Even if this directory was writable when you installed Homebrew, other

software may change permissions on this directory. For example, upgrading

to OS X El Capitan has been known to do this. Some versions of the

"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations

are known to do this as well.


You should probably change the ownership and permissions of /usr/local

back to your user account.

  sudo chown -R $(whoami):admin /usr/local


: