我用 mac

近来换了工作,办公机是高大上的 mac,用起来相当舒服(装B感十足)。这里记录一下使用过程的点点滴滴。(可能定期更新)

多桌面

mac 的触摸板是非常强大的。用三个手指操作由多钟手势。其中一个 多个桌面切换,我非常喜欢。这个让工作空间大大增强。

刚用 mac,很多东西都要初始化一遍。因为我使用它,是当做 server机/开发机来用,以下安装步骤变少不了了。

install

brew install mysql
brew install nginx
brew tap homebrew/dupes
brew install homebrew/nginx/nginx-full --with-upload-module --with-echo-module
brew install protobuf
brew install composer
brew install homebrew/php/php70
brew install httpd24
brew tap homebrew/apache
cp /usr/local/opt/php70/homebrew.mxcl.php70.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
brew install homebrew/php/php70-amqp
brew install homebrew/php/php70-oauth
brew install --HEAD homebrew/php/php70-redis
brew install homebrew/php/php70-apcu
brew install homebrew/php/php70-opcache
brew install homebrew/php/php70-xdebug
brew install homebrew/php/php70-imagick
brew install homebrew/php/php70-mcrypt
brew install homebrew/php/php70-kafka
brew install homebrew/php/php70-mongodb
brew install homebrew/php/php70-msgpack
brew install homebrew/php/php70-uuid
brew install homebrew/nginx/openresty
brew install maven
brew install elasticsearch
breww install mobile-shell
brew install pcre openssl
brew install hadoop
brew install jmeter --with-plugins
brew install node
sudo easy_install pip

start

brew services start mysql
brew services start nginx
brew services start php70
brew services start redis
brew services list
brew services start homebrew/nginx/openresty
npm install -g webpack

vimrc

git clone https://github.com/myersguo/vim.myersguo.git
./vim.myersguo/build.sh

maven

wget http://mirror.reverse.net/pub/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz
unzip apache-maven-3.5.0-bin.tar.gz

#maven M2_HOME=/Users/guoliangyong/apache-maven-3.5.0 export PATH=$PATH:$M2_HOME/bin

bash profile

alias vi='/usr/local/bin/vim'
alias vim='/usr/local/bin/vim'
alias mosh='ssh'
#other alias is private
alias hstart="/usr/local/Cellar/hadoop/2.8.1/sbin/start-dfs.sh;/usr/local/Cellar/hadoop/2.8.1/sbin/start-yarn.sh"
alias hstop="/usr/local/Cellar/hadoop/2.8.1/sbin/stop-yarn.sh;/usr/local/Cellar/hadoop/2.8.1/sbin/stop-dfs.sh"
###
export PATH=$PATH:/usr/local/go/bin

#maven
M2_HOME=~/apache-maven-3.5.0
export PATH=$PATH:$M2_HOME/bin

export PATH="/usr/local/sbin:$PATH"
#set termianl promt
export PS1="\a\n\e[31;1m\u@\h on \d at \@\n\e[34;1m\w\e[0m\n$ "

#other shell
ssh-add ~/.ssh/id_rsa_github

phpmyadmin

phpmyadmin 是我钟爱的 mysql client,下载文件解压到 /Users/guoliangyong/work/phpmyadmin 。编辑 nginx config:

vi /usr/local/etc/nginx/servers/phpmyadmin.conf
server {
	listen	8081;
	server_name phpmyadmin;
	root /Users/guoliangyong/work/www/phpmyadmin;
	index index.php;

	location ~* \.(ico|css|js)(\?[0-9]+)?$ {
			expires max;
			log_not_found off;
	}

	location ~* \.php$ {
		fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_split_path_info ^(.+\.php)(.*)$;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	}
}

编辑 phpmyadmin 配置:

cp config.sample.inc.php config.inc.php
 $i++;
 $cfg['Servers'][$i]['verbose'] = 'server2';
 $cfg['Servers'][$i]['host'] = 'loalhost';
 $cfg['Servers'][$i]['port'] = '';
 $cfg['Servers'][$i]['socket'] = '';
 $cfg['Servers'][$i]['connect_type'] = 'tcp';
 $cfg['Servers'][$i]['extension'] = 'mysqli';
 $cfg['Servers'][$i]['auth_type'] = 'cookie';
 $cfg['Servers'][$i]['AllowNoPassword'] = false;

重启 nginx: brew services restart nginx

hadoop config

hdfs namenode -format
/usr/local/Cellar/hadoop/2.8.1/sbin/start-dfs.sh;/usr/local/Cellar/hadoop/2.8.1/sbin/start-yarn.sh

测试连接正常否:

Resource Manager: http://localhost:50070
JobTracker: http://localhost:8088
Specific Node Information: http://localhost:8042

«« url 检查 stf 一瞥 »»