16 September 2017

setup

SageMath: use .dmg instead of app.dmg macOS pre-installs Ruby and Python which should not be messed up.

brew install nginx --with-gunzip
brew install bash
brew install tree
brew install cmake
brew install ag
brew install ack
brew install cscope
brew install ctags
brew install nmap
brew install moreutils
brew install python3
brew install postgres
brew install node

brew cask install java
brew cask install mactex
➜  github brew install --HEAD valgrind
Updating Homebrew...
==> Cloning https://sourceware.org/git/valgrind.git
Cloning into '/Users/jing/Library/Caches/Homebrew/valgrind--git'...
==> Checking out branch master
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/valgrind/HEAD-f19a956 --enable-only64bit --build=amd64-darwin
==> make
==> make install
🍺  /usr/local/Cellar/valgrind/HEAD-f19a956: 280 files, 32.3MB, built in 15 minutes 44 seconds
"Docker for Mac" from www.docker.com.
OmniGraffle
Acrobat Reader
Chrome Browser
SketchBook
MS Office
Atom
iTerm2
Dropbox
MacVim
Eclipse
Beyond Compare
QQ
Weixin
Shadowsocks
Proxifier
Baidu Pan

Remove all installed brew packages:

brew remove --force $(brew list) --ignore-dependencies  
brew cleanup

Reset macOS

  1. Reset SMC
  2. Reset NVRAM

VPN

NTP

Java

After using brew cask install java to install Java, Java updater will update Java. But Java updater will only update Java in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin whose version can be checked with System Preferences->Java Control Panel. It will not touch Java in /Library/Java/JavaVirtualMachines.

Video Player

Redis

brew install redis:

==> Pouring redis-4.0.8.high_sierra.bottle.tar.gz
==> Caveats
To have launchd start redis now and restart at login:
  brew services start redis
Or, if you don't want/need a background service you can just run:
  redis-server /usr/local/etc/redis.conf
==> Summary
🍺  /usr/local/Cellar/redis/4.0.8: 13 files, 2.8MB

MySQL

Start MySQL without make it automatic start.

mysql.server start

Clang

iTerm2

OpenSSL

which openssl produces:

/usr/bin/openssl

openssl version -a produces:

LibreSSL 2.2.7
built on: date not available
platform: information not available
options:  bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) blowfish(idx)
compiler: information not available
OPENSSLDIR: "/private/etc/ssl"

brew upgrade openssl produces:

==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2o_1: 1,791 files, 12.3MB

Adding export PATH="/usr/local/opt/openssl/bin:$PATH" makes which openssl produce /usr/local/opt/openssl/bin/openssl and makes man openssl work.

Jekyll

$ cd yaojingguo.github.com
$ gem install --user-install bundler jekyll
$ bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/include/libxml2
$ bundle install
$ bundle exec jekyll serve --watch --incremental
$ cd articles
$ bundle install
$ bundle exec jekyll serve --watch --incremental

Jekyll gives a lot of nonsense warnings. Just ignore them.

有线网

卸载使用安装包里面的AX88179_178A_Uninstall_v150.command

Brew

Redis:

To have launchd start redis now and restart at login:
  brew services start redis
Or, if you don't want/need a background service you can just run:
  redis-server /usr/local/etc/redis.conf

MySQL 5.7:

We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

mysql@5.7 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have mysql@5.7 first in your PATH run:
  echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:
  export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
  export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"

For pkg-config to find mysql@5.7 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/mysql@5.7/lib/pkgconfig"


To have launchd start mysql@5.7 now and restart at login:
  brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mysql@5.7/bin/mysql.server start
==> Summary
🍺  /usr/local/Cellar/mysql@5.7/5.7.23: 317 files, 234.4MB
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Putting non-prefixed coreutils in your path can cause gmp builds to fail.

Warning: Putting non-prefixed findutils in your path can cause python builds to fail.

Atom

To add syntax highlighting for LaTex, install language-latex package.

Add the following text to ~/.atom/keymap.cson:

'atom-text-editor:not([mini])':
  'cmd-d': 'editor:delete-line'

This adds a user key binding to Atom. There is already a built-in key binding for cmd-d. The above user key bindings should override the built-in key bindings.

Font settings:

Font: monospace 17

To hide .DS_Store, check Packages -> Tree View -> Hide Ignored names.

Xcode

sudo xcode-select -s /Applications/Xcode.app. sudo is needed.

LaCie

Mac OS Extended (Journaled)

Shortcut

  • Move: Option+Command+V.
  • Show hidden files in Finder: Command+Shift+..
  • Finder open new Finder tab in the same directory: Command+Control+o.