mac 从零开始

1:  mac 下终端  可以使用item2,这个配色不错。

2:  dash: app store中可以安装dash,dash是各种文档的集合,我们可以选择自己需要的文档。

3:   Homebrew 安装:  ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"   这是mac下的包管理工具。

4:   mysql安装:  brew install mysql,  这里切记安装完后会有提示信息,按照提示信息走完,就会安装成功,密码默认为空。  mysql.server start 启动mysql服务。

5:   java 环境变量安装:  http://jdk7.java.net/macportpreview/下载dmg,直接双击安装。

6: mongodb安装 :  brew install mongodb

7: redis 安装 : brew install redis
   cp /usr/local/Cellar/redis/2.8.19/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/.
   launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist


8:  mac下使用locate: http://www.tuicool.com/articles/QNjQRvr, 其中自定义命令的时候,要把bin目录添加进环境变量中,例如在~/.bash_profile 中添加 export PATH=$PATH:/Users/zhangcaiyan/bin

9:    自定义命令:  ~/.bash_profile 中添加以下命令,自定义命令定义在~/.bash_aliases文件中。

if [ -f ~/.bash_aliases ]; then
   . ~/.bash_aliases
fi

10:   mac设置开机启动:  如果是单用户则把plist文件放在~/Library/LaunchAgents/下,如果是多用户则放在 /Library/LaunchAgents 或 /Library/LaunchDaemons 下

11:  mac下安装dnsmasq
 
1)brew install dnsmasq,然后根据提示完成开机启动

2)设置mac dns为127.0.0.1

3)/usr/local/etc/dnsmasq.conf中添加

resolv-file=/usr/local/etc/resolv.dnsmasq.conf
conf-dir=/usr/local/etc/dnsmasq.d # 制定泛域名配置文件目录
4) /usr/local/etc/resolv.dnsmasq.conf 中添加
/usr/local/Cellar/dnsmasq/2.72/CHANGELOG
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 4.4.4.4
5) /usr/local/etc/dnsmasq.d/jobs.conf 中添加具体泛域名配置信息,这里的jobs.conf名称可以随意修改:

address=/.dev/127.0.0.1  # 所有的.dev 后缀的域名全部解析到127.0.0.1

12: mac下安装nginx: brew install nginx,按照提示设置为开机启动。

/usr/local/etc/nginx/nginx.conf文件中的http{...}添加

include /usr/local/etc/nginx/conf.d/*.conf;
include /usr/local/etc/nginx/sites-enabled/*;

在sites-enabled中配置详细信息

13: mac下安装Imagemagick: brew install imagemagick

14: mac下启动和停止服务:  launchctl load(或者unload) ~/Library/LaunchAgents/homebrew.mxcl.squid.plist 

open -e  文件: 使用TextEdit打开文件

猜你喜欢

转载自zhangcaiyanbeyond.iteye.com/blog/2187571