- Include explanation about both Intel and arm
- japanese ref here
zsh
: in general usezshrc
equivalent tobash_profile
ls -la /Applications/ > InstalledAppsTerminal.txt
- List of brew installed stuff
brew leaves > brew_leaves.txt
brew list > brew_list.txt
- Export URLs
- Install the newest version of macOS if necessary
- Restart with recovery mode
- Intel: Command + R
- Apple:
- Open disk utility
- Erase "Macintosh HD" WITHOUT Data, which includes both "Macintosh HD" and "MAcintosh HD - Data" and reformat it
- Click Erase. However, if you see an Erase Volume Group button, click that button instead.
- (maybe not needed) Erase "Macintosh HD - Data" using the minus button
- Erase "Macintosh HD" WITHOUT Data, which includes both "Macintosh HD" and "MAcintosh HD - Data" and reformat it
- Reintall macOS
- Reference here
- Follow the instruction
- Google Chrome: use google account to sync
- Firefox: install AdBlocker for YouTube (maybe not Enhancer for YouTube)
- Google日本語入力
- Finderpath
- Do not download from Apple Store
- Download it from https://developer.apple.com/download/all/. Choose the newest version for your macOS
- Unpack with
xip -x Xcode.xxx.xip
- Drag the unpacked application to Application folder
- Install xcode command line tools from the same URL
- Install following their website
- Export brew installed packages (here):
brew leaves > brew_leaves.txt
andbrew list > brew_list.txt
- Install exported brew installed packages (here):
for i in $(cat brew_leaves); do; brew install "$i"; done
homebrew-cask
might be useful but won't use for now (here or here)
- Check my Evernote note
- What to install:
$ brew install zsh-completions
$ brew install zsh-autosuggestions
- Download "Backup and Sync"
- Sync
- Change the local folder name to "GoogleDrive"
- Pause "Backup and Sync"
- Change file name "GoogleDrive"
- Restart "Backup and Sync"
- Relocate the file to "GoogleDrive"
- MIT VPN
- Portal address:
gpvpn.mit.edu
- Sync with existing account
- Make sure to check Google drive setup and the path is corrects
- The folder name should be "GoogleDrive"
- Misc settings:
- Under "General": Uncheck "Automatically attach associated PDFs and ..." to avoid downloading PDF files
- Under "General": Check linked files
- Under "Sync": Uncheck "Sync fill-text context"
- Install better bibtex (citation key format:
[auth:lower][year]
) - Refresh citation key
- Install XQuartz
- Install gfortran
https://github.com/fxcoudert/gfortran-for-macOS/releases
- Install xz (and maybe pcre2) with brew
- Find binariles of R builds for macOS
- Intel:
https://cloud.r-project.org/bin/macosx/base/
- Apple silicon:
https://cran.r-project.org/bin/macosx/big-sur-arm64/base/
- Intel:
- To change language setting, write
export LC_ALL=en_US.UTF-8
in~/.bash_profile
and $source ~/.bash_profile
or in~./.zshrc
. - For trouble shooting, Step 1 to 4 of this guidance solved in M2 Mac here
- For
data.table
, check Shusei's tips or here
# modified from http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows
# from https://gist.github.com/florianhartig/10527319
# run on old computer / r version
setwd("/Users/tomoyasasaki/GoogleDrive/admin/computer/") # or any other existing temp directory
packages <- installed.packages()[,"Package"]
save(packages, file = "Rpackages")
# run on new computer / r version
# setwd("/Users/Florian/Dropbox/temp") # or any other existing temp directory
setwd("/Users/tomoyasasaki/GoogleDrive/admin/computer/") # or any other existing temp directory
load("Rpackages")
for (p in setdiff(packages, installed.packages()[,"Package"]))
install.packages(p)
https://mpopov.com/blog/2021/10/10/even-faster-matrix-math-in-r-on-macos-with-m1/
https://groups.google.com/g/r-sig-mac/c/YN6uNYCIZK0
https://thomasmcrow.com/blog/2021-08-optimized-blas-in-r/
- After installed Python
- Check here
- Set PATH for
radian
export PATH=/Users/tomoyasasaki/Library/Python/3.9/bin:$PATH
- Set
r
forradian
andR
will be stay as it is
alias r="radian"
- Fast matrix calculation here
- Install
pyenv
- Install python with
pyenv
- Install
pyenv-virtualenv
- Install
pip
in one of your environment
- Check here
- Thanks to Shusei (here)
- Also check here
- Install with
brew install pyenv
- In
.bash_profile
or.zshrc
PS1="%1~ \$ "
#export PYENV_ROOT="/User/tomoyasasaki/.pyenv"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
#eval "$(pyenv init -)"
- In
.zshrc
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
- Install available python version
pyenv install -l
- Install python version with
pyenv install [ver]
- More convenient to control multiple versions
- You can also use
pyenv-virtualenv
:brew install pyenv-virtualenv
- New environment:
pyenv virtualenv [ver] [envname]
- Activate environment:
pyenv activate [envname]
- Deactivate environment:
pyenv deactivate
- New environment:
- Check here
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# In one of your pyenv-virutalenv environments,
python get-pip.py
- Save and reinstall pip installed package (here, here)
- Problem of
freeze
(here) - (Probably) no need to check for each enviornment
pip freeze > /path/to/requirements.txt
pip install -r /path/to/requirements.txt
- Old procedure (still works though)
- Install ghostscript with brew
brew install ghostscript
- Download MacTex and custom install without ghostscript
- Install ghostscript with brew
- Updated
- Download MacTex with brew
brew install --cask mactex
- Update packages with
sudo tlmgr update --self --all
- Reference here
- Download MacTex with brew
- Download from here
- Setup connection for databases
- Setup extensions
Remote SSH
extension can connect various remote machines via VS Code
- Use git from brew (here):
brew install git
- If on Intel, add
export PATH="/usr/local/bin:${PATH}"
- If on ARM/M1, add
export PATH="/opt/homebrew/bin:${PATH}"
- Setup email for commit:
git config --global user.email "[email protected]"
- Connect github with new credential or ssh
- Not compatible in general
- Main computer: sync everything
- Sub computer: sync only gitignored folders
- Make sure to update gitignore when you re-sync and re-initialize the git
- Make sure not to delete online smart-sync files
- Move some files if necessary. Some files might not be synced from the remote github repo because they are ignored
- This method should work
- Make sure that the Dropbox is perfectly synced
- Check remote with
git remote -v
- You don't need
git init
- (old) When there is huge, smart-synced files
- Make sure that every update is already available in the online repo
- Delete non-gitignored folders
- Re-clone the github repo to non-Dropbox folder
- Move files in the cloned folder to the existing corresponding folder in Dropbox
- Re-init as github repo
- (old) When there is no smart-synced files
- Make sure that every update is already available in the online repo
- Move gitignored folders file to non-Dropbox folder
- Delete the github Dropbox folder
- Re-clone the github repo to Dropbox
- Put back files moved in Step 2 to the github repo
- Setup Git and Github
- Java is required for some packages:
- Python
tabula-py
- R
tabulizer
- Python
$ brew install java
$ java --version
If java --version
does not show the Java version, create a symlink for the system Java wrappers to find this JDK link
$ sudo ln -sfn /usr/local/Cellar/openjdk/18.0.2.1/libexec/openjdk.jdk \ /Library/Java/JavaVirtualMachines/openjdk.jdk
- notion
- Slack
- Zoom
- Github
- Spotify
- Follow the instruction here
- Make sure to use the token in the password form
- Once you finish authentication, specify the author name and email for commit in the setting of the plugin