Showing posts with label Mac OS. Show all posts
Showing posts with label Mac OS. Show all posts

Saturday, September 13, 2008

[Intel]性能无损运行Windows程序,Darwine配置教程(转载)

转载来源:麦客孤独 帖子

Darwine源于Wine项目,该项目为UNIX提供运行Windows程序的环境。
装好Darwine后插入已染毒的U盘并不会使Mac中毒,但是不要双击病毒文件,它可能真的会运行,比如“熊猫烧香”可以很好的运行,但是不用担心,UNIX构架会保护你的系统不会有太大损害。

首先下载Darwine,去下面的网址下载Darwine:
http://www.kronenberg.org/darwine/
有两个,一个是稳定版1.0,一个是不稳定版1.1.2,建议下载1.1.2,因为以我对Wine的一向了解,不管是哪一个版本,Wine的bug就没少过。
Tiger还要注意安装x11。

下载后将Darwine整个文件夹拖到Applications里。
下面进行设置:
进入Darwine文件夹里的Sample WineLib Applications文件夹,双击运行winecfg.exe,这个程序会自动建立你的Wine环境,这一步是必须做的;完成后你的主文件夹里会多出一个文件夹:.wine,但因为是隐藏文件夹,你看不见,请打开主文件夹,在Finder菜单中选择“前往”,“前往文件夹”,手动输入.wine就能进入了。
这里你会看到一个driver_c文件夹,这就是虚拟出来的C盘,双击进入。

刚才你也许注意到了,winecfg.exe程序上的内容都是乱码,这是因为缺少中文字体,我们需要从Windows下拷贝微软雅黑字体(MSYH.TTF MSYHBD.TTF,下载见帖子后面,字体有版权)到当前文件夹->Windows->Fonts中,打开终端:输入

然后复制以下内容到终端:
REGEDIT4 

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"Arial"="Microsoft YaHei" 
"Arial CE,238"="Microsoft YaHei" 
"Arial CYR,204"="Microsoft YaHei" 
"Arial Greek,161"="Microsoft YaHei" 
"Arial TUR,162"="Microsoft YaHei" 
"Courier New"="Microsoft YaHei" 
"Courier New CE,238"="Microsoft YaHei" 
"Courier New CYR,204"="Microsoft YaHei" 
"Courier New Greek,161"="Microsoft YaHei" 
"Courier New TUR,162"="Microsoft YaHei" 
"FixedSys"="Microsoft YaHei" 
"Helv"="Microsoft YaHei" 
"Helvetica"="Microsoft YaHei" 
"MS Sans Serif"="Microsoft YaHei" 
"MS Shell Dlg"="Microsoft YaHei" 
"MS Shell Dlg 2"="Microsoft YaHei" 
"System"="Microsoft YaHei" 
"Tahoma"="Microsoft YaHei" 
"Times"="Microsoft YaHei" 
"Times New Roman CE,238"="Microsoft YaHei" 
"Times New Roman CYR,204"="Microsoft YaHei" 
"Times New Roman Greek,161"="Microsoft YaHei" 
"Times New Roman TUR,162"="Microsoft YaHei" 
"Tms Rmn"="Microsoft YaHei"

按下control+d结束输入进程,关闭终端。
然后双击windows文件夹中的regedit.exe,导入主文件夹下的cn.reg。

再次运行winecfg.exe,此时中文字体就能看见了,关于Darwine可能是会显示繁体中文的问题,大家不用担心,并不影响简体中文软件的使用。

关于装好的软件会找不到快捷方式的问题,这里有一个解决方法:
编写脚本,例如WinRAR,所在文件夹是~/.wine/drive_c/Program\ Files/WinRAR/,那么编写脚本是这样的:

#! /bin/bash
env WINEPREFIX=~/.wine/ /Applications/Darwine/Wine.bundle/Contents/bin/wine "c:\Program Files\WinRAR\WinRAR.exe"
exit 0

文本编辑器似乎无法编写纯文本文件,请使用cat、vi或nano(都是终端程序)编写,写好后放在桌面,如上面的例子,生成的脚本叫做WinRAR。
请打开终端:输入chmod 755 (不回车,后有空格),将脚本拖入终端,回车,脚本就可以双击运行了。

微软雅黑字体下载:
Part1:http://www.mediafire.com/?kkqaa4io1ah

Wednesday, September 3, 2008

Bring Back Tiger's X11 to Leopard in 3 Steps (ZZ)

The original article is here "Bring Back Tiger's X11 to Leopard in 3 Steps"
   (Discovered by Tim Baur and reported on the x11-users mailing list).

Mac OS 10.5 (Leopard) ships with a very broken version of X11. It's totally unusable for anyone (like me) who spends a significant portion of their day in X11.

The good news is you can get the version of X11 from Tiger to run on Leopard. Here's how you do it:

Step 1: First you need to remove the new and crappy version of X11. I did this with the following commands in the terminal:
sudo rm /System/Library/LaunchAgents/org.x.X11.plist 
sudo rm /Library/Receipts/X11User.pkg 
sudo pkgutil --forget com.apple.pkg.X11User # UPDATE [2007/10/29]: I forgot to include this in the original steps.
Note: X11User.pkg may not exist in /Library/Receipts. That's OK.

Step 2: Install Tiger's X11.app. If you have your Mac's installer CDs, the package you need to double-click the file X11User.pkg found inside System/Installation/Packages/ on the installer CD.
Note: There are lots of versions of X11.app for Tiger. The original Tiger CD ships with one that was PPC only, which I accidentally installed when I did this the first time. If you have a recent Installer CD that came with your mac, I would use that. Otherwise, it appears you can download it here, but I haven't tried that.

Step 3: The final step is to edit the file /etc/X11/xinit/xinitrc and go to the bottom of the file and replace "exec quartz-wm" with "exec /usr/X11R6/bin/quartz-wm".

That's it! Now X11.app doesn't suck as bad anymore.

Thursday, August 28, 2008

Macports on Leopard

As a student, to buy softwares is not what I can afford, and I don’t like to search and use the crack version of the commercial software. Open source software project in UNIX world is really good for me. I believe that Mac OS is UNIX based operating system, so I want to make my macbook with leopard os well compatible with open source projects.
Just as any Unix system, an easy to use system for compiling ,installing, and upgrading open-source software in your operating system is really necessary to open source fans. There are in fact two different projects doing this for Mac OS X. One is called MacPorts (upgraded from the old Darwinports), and the other is Fink.
There are some discussions about “Darwinports vs Fink”- which is better? I didn’t do much research , but I think Macports community is more active then Fink. So Macprot becomes my choice.
There is no trick during installing Macports on Leopard, as there is a simple .dmg file on the official website of the Macports. And the guide on the website should be enough for your to get start.

Wednesday, August 20, 2008

Mac Tip: Add Quit to the Finder Menu (zz)


Finder.pngMac OS X only: Sick of not being able to exit Finder? A quick terminal command will add a "quit" option to the menu in Finder. This means you can run Finder like any other Mac application. If you're running some heavy applications, simply close Finder and enjoy the extra, albeit small, processing power. Open a terminal and enter the following command:



defaults write com.apple.Finder QuitMenuItem 1


You will need to restart for the changes to take effect. Here's the caveat: Finder also manages the icons on your desktop. If you exit Finder, you won't be able to see any of the icons on your desktop. Just click the icon in the dock to bring Finder back.

Monday, March 31, 2008

Boot camp & vm Fision

参考麦客孤独的教程:boot camp和vm fusion 完美合作详细说明,用VM Fusion 启动boot camp 安装的windows。但是在我自己操作中,遇到问题,打开VM后点Boot camp partition不能行windows,出现对话框提示:

Cannot open the disk '/Users/binchen/Library/Application Support/VMware Fusion/Virtual Machines/Boot Camp/%2Fdev%2Fdisk0/Boot Camp partition.vmwarevm/Boot Camp partition.vmdk' or one of the snapshot disks it depends on.

Reason: The partition table on the physical disk has changed since the disk was created. Remove the physical disk from the virtual machine, then add it again.

VM fusion Version 1.1.1 (72241) eng,

Leopard 10.5.2

boot camp 2.0 (分区后安装win用NTFs格式化了)

启动时按option可以选择windows启动,但是在mac的系统设置,启动盘里没有示windows启动


不会弄,于是乎寻找网上,用vmware-rawcreator 手动创建vm导boot camp 分区系统的。(ref:original thread)自己新建一个vm但是启动的是boot camp安装的windows系统,把原来默认的boot camp partition 虚拟机删掉就可以了。


主要操作如下:

  1. In VMWare Fusion, create a new vmware instance called WindowsXp. Under “Settings” for that vm, you can change or add a new IDE hard drive. This will make life easier, since you won’t have to worry about having the right SCSI driver if you are running a minimalistic Linux distro. From the command line, WindowsXp is really a directory called WindowsXP.vmwarevm (yes, vm appears twice in that extension).
  2. Close WindowsXP in VMWare Fusion, so you can edit it directly.
  3. In a terminal:
    1.  cd "/Library/Application Support/VMware Fusion/"
    2. List the partitions on your hard drive. ./vmware-rawdiskCreator print /dev/disk0
    3. Create a file that points VMWare at your partition. (My bootcamp partition is number 3, so that is why you see a 3 in the following command.) ./vmware-rawdiskCreator create /dev/disk0 3  /Users/USERNAME/WindowsXP.vmwarevm/bootcamp_partition ide
  4. Add or edit these lines in the text file /Users/USERNAME/WindowsXP.vmwarevm/WindowsXP.vmx ide0:0.present = "TRUE"     ide0:0.fileName = "bootcamp_partition.vmdk"
  5.  Run WindowsXP in VMWare Fusion. You will be asked for your administrative password, because VMWare Fusion must be granted access to read and write to your bootcamp partition
倒是可以运行windows了,只是原先的问题不知道在哪里,看log文件说disk0不能打开,不懂啊,抓狂!
Link to that log file: vmware.txt


Monday, March 17, 2008

Mac 字典软件 Dictionay 2.0

如今so international, 电子字典是每台电脑的必备。用上Mac后用的都是web translation, 因为每找到好的软件,Dojam试过,感觉翻译不好; Mac自带的Dictionary2.0默认的只有英英翻译和Wikipedia, 在快速阅读的时候基本就是添乱。
不过有点希望了,找到在Mac 的 Dictionary2.0 添加其他翻译包的,还有达人作了字典转换器,可以将Startdic的字典包转换成Dictionary2.0使用的包,强!
我就现成下载了牛津英汉字典美化版 参考博文。下载解压到自己用户目录下的资源库中的Dictionaries中(Library/Dictionaries)就可以了。注意:下载的包解压后是一个Contents目录,那么,在Library/Dictionaries下自己建一个文件夹命名为:XXX.dictionary(就是扩展名为dictionary的文件夹),然后把Contents目录放进去。

需要自己转换其他字典包的,请参考达人的blog:Mac Dictionary Kit
并感谢我google到并下在现成包包的兄弟blog:MAC字典软件 英汉字典下载


Wednesday, February 27, 2008

如何让MAC读写NTFS分区

第一,下载MacFuse,第二,下载NTFS-3G,第三,安装MacFuse,第四,重启后再安装NTFS-3G。完成这四个步骤后就可以读写NTFS分区了。不过要想完美,还要多加一步,在NTFS分区的根目录上,建立一个叫.ntfs-locale的文件(注意文件前面有个点),文件的內容是zh_CN。建好之后,此分区上就可以支持简体中文文件名了。对了,注意安装顺序和重启问题哦。

Where is the bookmarks of the safari ?

After new Mac os X system installed in the Macinosh HD, the previous Mac os X system is all achieved in to a file "Previous system" in the Macinosh HD. 

If you did not extract the bookmarks before the installation, you have to find the old useful Bookmarks in the previous system and add them to Safari:

For Safari under Mac os X, replace the Library/Safari/Bookmark.plist with the old one. The old but useful Bookmark.plist location:
/Macinosh_HD/Previous_system/User/username/Library/Safari/Bookmark.plist
If you want to extract Bookmarks to other bowsers, this Bookmark.plist is not useful, but .
webachieve files are need.
Those files are under:
/Previous_system/User/username/Library/Caches/Metadata/Safari/Bookmarks 

The Metadata directory also includes the Bookmarks of Camino and data of iCal.

Tuesday, February 26, 2008

How to burn ISO disc images?

Disc images are a fairly common packaging standard for large software programs. If you want to try out a new Linux distribution, for example, chances are you'll need to download a disc image in ISO format and burn it to a blank CD-ROM or DVD.

Instead of telling the program you want to burn an image, then choosing the file, which we usually do under windows, you're supposed to do the reverse: You choose the file, then tell the program you want to burn it. So, to burn an ISO image to disc, here's what to do:

1. Insert a blank disc.
2. Start Disk Utility.
3. From the File menu, choose Open Disk Image and select the ISO to be burned.
4. In the list of volumes, you will now see an item representing the ISO file. Select it.
5. Click the Burn button and follow the instructions.

That's it! Simple enough!

Thursday, January 3, 2008

MAC OS 下中文TXT乱码

症状:以前从Windows复制到移动硬盘里TXT文档在Mac OS下,或者从Windows上复制到Mac OS下,中文TXT文档打开时会变成乱码。

原因:编码的问题。

解决:将TextEdit的预置里编码设置一下可解决。

运行TextEdit,在菜单 - 预置 - 打开和保存,把编码改成Chinese (GB 18030) 即可。

“TextEdit-->Menu-->Preference-->Open and Save-->encoding: Chinese (GB 18030)