OSX https://yyhh.org/notebook/osx en Fixing Problems after Upgrading from Snow Leopard to Mountain Lion https://yyhh.org/blog/2012/09/fixing-problems-after-upgrading-snow-leopard-mountain-lion <span>Fixing Problems after Upgrading from Snow Leopard to Mountain Lion</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Mon, 09/24/2012 - 01:28</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/osx" id="taxonomy-term-37" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/osx"> <div class="field field--name-name field--type-string field--label-hidden field__item">OSX</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>The IT department of my company has been urging us Mac users to upgrade OSX to Lion a long time ago. After getting a few papers submitted last week, I finally got around to upgrade the Snow Leopard for my Macbook Pro work machine. Since I couldn't find Lion on Apple Store any more, I decided to go straight to Mountain Lion. The download and installation went smoothly, and most things seemed to work after the upgrade. Here are a few things that broke and the fixes I found.</p> <h3>SSH with public key</h3> <p>Mountain Lion changed a few things that broke password-free SSH access to and from OSX using public/private key pairs.</p> <p><i>SSH from Mountain Lion to older SSH severs:</i></p> <p>Mountain Lion upgraded openssh client to version 5.9p1. SSH to some older version of ssh server would not work ("Connection reset by peer") due to ciphers being too long. We can use a shorter one by adding to file "~/.ssh/config". </p> <div class="codeblock"> Host address_of_your_ssh_server<br /> Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour </div> <p>This problem is a known issue of openssh. I remember did this fix for my Linux machines.</p> <p><i>SSH to Mountain Lion:</i></p> <p>This one took me a lot of googling to find the <a href="http://www.hkwebentrepreneurs.com/2012/08/password-free-ssh-on-os-x-mountain-lion.html">cause</a>. Basically, Mountain Lion changed /etc/sshd_config file, so that openssh server only checks "~/.ssh/authorized_keys" now, instead of checking both that and "~/.ssh/authorized_keys2". To fix this, all we need to do is to rename the later to the former.</p> <div class="codeblock"> $ mv ~/.ssh/authorized_keys2 ~/.ssh/authorized_keys </div> <p>I find this change rather annoying, as it adds little benefit but creates a lot of troubles. For example, it broke my backup solution. I am using <a href="http://backuppc.sourceforge.net/">backuppc</a> to backup this Macbook to a central backup server through password-less SSH. It took me a while to debug when backuppc reported the problem. </p> <h3>Homebrew</h3> <p>Running "brew doctor" would show the information needed to fix homebrew. Basically, one had to install xcode 4.5, install command line tools, install X, and so on. A lot of downloads and wait time. </p> <h3>Latex</h3> <p>All the latex programs were not in path any more. Since my latex distribution was pretty old anyway. I chose to download the latest version of MacTex to install. It took a long time to download though.</p> <h3>Lotus Notes</h3> <p>Mountain Lion has its own Notes.app now, which conflicts with Lotus Notes. During upgrading, Lotus Notes will be moved to be under a directory "/Application/Lotus Notes Local" or something similar. All you need to do is to find Notes.app in there, and rename it something else, e.g. "LNotes.app", and move it back to be under "/Application".</p> <h3>Java</h3> <p>Java is not installed by default. When using applications require it, you will be prompted to install.</p> <p>In conclusion, the upgrade from Snow Leopard to Mountain Lion works reasonablly OK, but be prepared to fix some problems. I think the upgrade experience of OSX is not better than Linux, as both require a similar amount of tweakings and searching solutions. However, upgrading in OSX costs money. If this was not on company tab and by their urging, I would not have bothered.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=162&amp;2=comment_node_blog&amp;3=comment_node_blog" token="arBwYz1afMski90mIpzYelLaiAUSrsENAShLbl_MFkY"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Mon, 24 Sep 2012 00:28:31 +0000 Huahai 162 at https://yyhh.org Install Vim with Homebrew Python on OS X https://yyhh.org/blog/2012/05/install-vim-homebrew-python-os-x <span>Install Vim with Homebrew Python on OS X</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Wed, 05/16/2012 - 05:50</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/vim" id="taxonomy-term-17" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/vim"> <div class="field field--name-name field--type-string field--label-hidden field__item">Vim</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/osx" id="taxonomy-term-37" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/osx"> <div class="field field--name-name field--type-string field--label-hidden field__item">OSX</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>For people that need full features of vim, the default installation of vim on Mac OS X is definitely not enough. For example, I need to <a href="http://yyhh.org/blog/2007/10/posting-blog-entry-drupal-within-vim">use vim to post to this blog</a>, which requires a version of vim with python support. I also prefer terminal version of vim to the GUI version, so <a href="http://code.google.com/p/macvim/">MacVim</a> is less desirable. </p> <p>One way to get what I want is to compile a version of vim with <a href="http://mxcl.github.com/homebrew/">homebrew</a>. Homebrew does not officially have a vim fomula, because that would be a duplicate of the system version. Fortunately, we can grab an unofficial formula at<br /><i><a href="https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb">https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb</a></i></p> <p>Also, you may want to install the latest homebrew python with the framework option: </p> <div class="codeblock"> brew install python --framework </div> <p>In order for vim to use the homebrew version of python (2.7.3) instead of the system one (an old 2.6), we need to change a line and add a line in the downloaded formula (vim.rb) file:</p> <div class="codeblock"> ...<br /> "--enable-pythoninterp=dynamic",<br /> "--with-python-config-dir=/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config",<br /> ... </div> <p>Now install vim with the formula:</p> <div class="codeblock"> brew install ./vim.rb </div> <p>To check vim is using the correct version of python. Issue command in vim:</p> <div class="codeblock"> :python import sys; print sys.version </div> <p>If we get something like this:</p> <div class="codeblock"> 2.7.3 (default, May 15 2012, 20:51:34)<br /> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]<br /> Press ENTER or type command to continue </div> <p>we are done!</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=152&amp;2=comment_node_blog&amp;3=comment_node_blog" token="yTThkv7YLDDUEe8ulF9-aAD7PGz0pBc-WF1WU7Nma0U"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Wed, 16 May 2012 04:50:40 +0000 Huahai 152 at https://yyhh.org