HomeBrew
安装brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
使用brew安装软件:
brew install wget
使用brew卸载软件:
brew uninstall wget
使用brew检索软件:
brew search /apache*/ //正则
更新所有软件:
brew update
更新具体软件
brew upgrade git
from: https://brew.sh/index_zh-cn.html
iterm
安装iTerm2:
http://www.iterm2.com/
主题
安装zsh
brew install zsh zsh-completions
from: https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
安装oh-my-zsh
wget安装命令
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
主题
vim ~/.zshrc
ZSH_THEME="cloud"
配置: ~/.zshrc
自动更新不提醒:DISABLE_UPDATE_PROMPT=true
关闭自动更新:DISABLE_AUTO_UPDATE=true
手动更新:upgrade_oh_my_zsh
from: https://github.com/robbyrussell/oh-my-zsh
命令行自动提示
1. git clone git://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
2. source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
###### from: https://github.com/zsh-users/zsh-autosuggestions
报错
安装完 zsh和oh-my-zsh后,使用vim编辑文件时,自动补全会出现错误 _vim_files: function definition file not found
解决方法:
rm -rf ~/.zcompdump-* # 删除以.zcompdump-开头的文件
exec zsh
tig
安装
brew install tig
ccat
安装
brew install ccat
alias cat="ccat"
phpstorm
破解安装
官方下载
https://www.jetbrains.com/phpstorm/
百度云/php/软件/
破解方法
打开 http://idea.lanyus.com/ 获取注册码,粘贴到第二步的“Activation code”中完成注册;
报错license has been cancelled
添加 0.0.0.0 account.jetbrains.com 到hosts文件;
配置less
1.安装node
2.安装npm
brew install npm
3.安装lessc
sudo npm install less -g
查看路径
which lessc
4.配置file wathcers
打开 PhpStorm > Preferences > Tools > File Watchers
新增‘less’模板
Program:配置为lessc的路径
Output paths to refresh:
$FileParentDir(less)$/css/$FileDirPathFromParent(less)$/$FileNameWithoutExtension$.css或者:../css/$FileNameWithoutExtension$.css
在这里简单解释下这个路径的意思。
例如项目名为 project,less文件我们放置在 project/public/less/manage/style.less
$FileParentDir(less)$ 是获取 less 目录的路径,也就是 project/public
$FileDirPathFromParent(less)$ 是获取 less 文件到 less 目录的路径,也就是 manage
$FileNameWithoutExtension$ 是获取 less 文件不带后缀的名字,也就是 style
经过如上拼接,生成的内容为 project/public/css/manage/style.css
配置snippets
PhpStorm > Preferences > Live Templates > 添加
注意事项
- 变量大写
- default value 加 ""
nginx
安装
brew install nginx
访问localhost:8080
配置
1.打开 nginx.config 文件
cd /usr/local/etc/nginx/nginx.conf
2.找到 server 的 location 配置,给 index 加一个 index.php
location / {
root html;
index index.html index.htm index.php;
}
3.打开 server 下被注释的
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
4.修改 fastcgi_param 参数
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改为
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
mysql5.7
下载地址:https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-macos10.12-x86_64.dmg
navicat: https://pan.baidu.com/s/1jHAhyYy (百度网盘有备份)
php7
查看所有扩展 brew install php7
安装 brew install fullname
redis
安装redis扩展
- 官网http://redis.io/ 下载最新的稳定版本
- sudo mv redis-3.2.8.tar.gz /usr/local
sudo tar -zxf redis-3.2.8.tar.gz - cd redis-3.2.8
sudo make test
sudo make install - sudo mkdir /usr/local/redis
cd /usr/local/redis
sudo mkdir bin
sudo mkdir etc
sudo mkdir db - sudo cp /usr/local/bin/* /usr/local/redis/bin
sudo cp /usr/local/redis3.2.8/src/mkreleasehdr.sh /usr/local/redis/
sudo cp /usr/local/redis-3.2.8/redis.conf /usr/local/redis/etc/ -
vim redis.conf
//修改为守护模式
daemonize yes
//设置进程锁文件
pidfile /usr/local/redis/redis.pid
//端口
port 6379
//客户端超时时间
timeout 300
//日志级别
loglevel debug
//日志文件位置
logfile /usr/local/redis/log-redis.log
//设置数据库的数量,默认数据库为0,可以使用SELECT命令在连接上指定数据库id
databases 8
//指定在多长时间内,有多少次更新操作,就将数据同步到数据文件,可以多个条件配合
//save
//Redis默认配置文件中提供了三个条件:
save 900 1
save 300 10
save 60 10000
//指定存储至本地数据库时是否压缩数据,默认为yes,Redis采用LZF压缩,如果为了节省CPU时间,
//可以关闭该选项,但会导致数据库文件变的巨大
rdbcompression yes
//指定本地数据库文件名
dbfilename dump.rdb
//指定本地数据库路径
dir /usr/local/redis/db/
//指定是否在每次更新操作后进行日志记录,Redis在默认情况下是异步的把数据写入磁盘,如果不开启,可能
//会在断电时导致一段时间内的数据丢失。因为 redis本身同步数据文件是按上面save条件来同步的,所以有
//的数据会在一段时间内只存在于内存中
appendonly no
//指定更新日志条件,共有3个可选值:
//no:表示等操作系统进行数据缓存同步到磁盘(快)
//always:表示每次更新操作后手动调用fsync()将数据写到磁盘(慢,安全)
//everysec:表示每秒同步一次(折衷,默认值)
appendfsync everysec - 修改权限为当前使用者
chown -R xxxx /usr/local/redis - 启动服务
cd /usr/local/redis/
./bin/redis-server ./etc/redis.conf - 访问服务
cd /usr/local/redis
./bin/redis-cli
from: http://www.cnblogs.com/chinesern/p/5580665.html
Charles
到百度云盘下载软件后 在终端执行命令:
charles=/Applications/Charles.app/Contents/Java/charles.jar
dir=charleshack
mkdir $dir
cd $dir
cat >> License.java <<EOF
package com.xk72.charles;
public final class License {
public static boolean a() { return true; }
public static String b() { return "http://www.gfzj.us";}
public static String a(String name, String key) { return null; }
}
EOF
javac -encoding UTF-8 License.java -d .&& jar -uvf $charles com/xk72/charles/License.class
cd .. && rm -rf $dir
其他
在命令行打开sublime配置
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
☁ ~ subl
{{ comment.username }}