Daily Archives: 2012/06/21

mac里terminal的初始化文件

按照bash的说法,.bash_profile和_bashrc的作用是不同的:

.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.

What is a login or non-login shell?

When you login (type username and password) via console, either sitting at the machine, or remotely via ssh: .bash_profile is executed to configure your shell before the initial command prompt.
But, if you’ve already logged into your machine and open a new terminal window (xterm) inside Gnome or KDE, then .bashrc is executed before the window command prompt. .bashrc is also run when you start a new bash instance by typing /bin/bash in a terminal.


Why two different files?

Say, you’d like to print some lengthy diagnostic information about your machine each time you login (load average, memory usage, current users, etc). You only want to see it on login, so you only want to place this in your .bash_profile. If you put it in your .bashrc, you’d see it every time you open a new terminal window.

但是mac里貌似比较变态,开启一个新的terminal 的时候,只会运行.bash_profile

 

Mac OS X — an exception

An exception to the terminal window guidelines is Mac OS X’s Terminal.app, which runs a login shell by default for each new terminal window, calling .bash_profile instead of .bashrc. Other GUI terminal emulators may do the same, but most tend not to.

所以为了保险起见,将.bash_profile设置成如下内容,可以确保.bashrc被调用。我们基本上也不需要两个不同的文件:

if [ -f ~/.bashrc ]; then

   source ~/.bashrc

fi

 

 

CI server的选择

持续集成(continuous integration)服务器的选择:

CruiseControl (http://cruisecontrol.sourceforge.net/
Hudson (https://hudson.dev.java.net/
LuntBuild (http://luntbuild.javaforge.com/
TeamCity (http://www.jetbrains.com/teamcity/
AntHill Pro (http://www.anthillpro.com/
Bamboo (http://www.atlassian.com/software/bamboo/
QuickBuild (http://www.pmease.com/)

xcode4.3的command line tools

Command Line Tools

Xcode 4.3 does not include a fully working set of command line tools by default. Nothing will build without it, despite the fact that xcode-select and which make may return correct values.

You must open Xcode, go to Preferences, and download this component from the Downloads section. You will require an Apple ID to download the component.

default compiler in mac OS

码农喜闻乐见的gcc在xcode4.2之后就没有了,悲剧啊

Default: gcc-4.0 on Mac OS X 10.4 and 10.5

Default: gcc-4.2 with Xcode 3.2 on Mac OS X 10.6

Default: llvm-gcc-4.2 with Xcode 4.0 and 4.1 on Mac OS X 10.6 and 10.7

Default: clang with Xcode 4.2 on Mac OS X 10.6 and 10.7

修改vmware里mac os的屏幕分辨率

在vmware里安装完mac os后,屏幕分辨率是1024×768, 很多程序不能在这个分辨率下运行。

发现了这篇文章,号称可以修改屏幕分辨率:

http://www.sysprobs.com/increase-screen-resolution-wide-screen-support-mac-os-virtual-machine-vmware-player-workstation

步骤如下:

1)      Download the Mac VGA driver for VMware here.

2)      Install the package in Mac OS X

3)      Restart the Mac Virtual machine. That’s it. Now you can see multiple screen resolution options in Mac virtual machine.

个人验证了一下,确实好使!推荐一下。我的环境是win7 + vmware 8 + mac os 10.7.