/effective-macbook

A list of effective ways to use a Macbook

MIT LicenseMIT

effective-macbook

A list of effective ways to use a Macbook

Manage your apps

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask

Use a more friendly command line

Install neccessary command line tools

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
brew install coreutils git openssl tree autojump dos2unix parquet-tools \
  libcouchbase proxychains-ng jenv httpie unrar tabset the_silver_searcher \
  nmap

Prevent running commands on an incorrent machine

We may make mistakes by running commands on an incorrent machine. Especially when you work on a multi-tab window.

iterm4panel

  1. Open iterm2's preference(⌘ + i)
  2. Add a badge, this would help you distinguish tabs

tabset

Automatically add badges

Create a tabset config

#~/.tabset
{
  "colors": {
    "pro": "red"
  }
}

Modify ssh config

#~/.ssh/config
PermitLocalCommand yes

Host pro-machine
    hostname 10.1.1.1
    user root
    localcommand tabset pro
ssh pro-machine
# A badge added automatically

Command line tips

Use aliases when you can

alias sha1='openssl sha1'
alias sha256='openssl sha1 -a 256'

Example

Handy script functions

mkdircd () {
    mkdir -p "$@" && eval cd "\"\$$#\"";
}

Example

Copy text from command line

alias pbc='pbcopy'

#eg. copy current path
pwd|pbc

Edit copied text from command line

alias pbp='pbpaste'

#eg. convert copied text to uppercase
pbp|sed "s/./\U&/g"

#eg. use pbc with pbp
pbp|sed "s/./\U&/g"|pbc

Use cd aliases

alias ..='cd ..'
alias ...='cd ../../'
alias _='cd -'

Use autojump

Use git aliases

alias gitp='git pull --rebase'
alias gitst='git status'
alias gitcl='git clone'
alias git1diff='git diff HEAD~1 HEAD'
alias gitcmt='git commit'
alias gitpo='git push origin'

Nice HTTP API development tools

Track web requests

Shadowsocks

Nice file preview tools

brew cask install quicklook-json quicklook-csv

Powerful mind mapping tools

Screen capture tools

Make a presentation with markdown

Try something quickly