Howto fix this: ssh daemon asks for a password

今天折腾Git的升级,一下子把gitolite和gitlab都升级到了最新的。也遇到了不少问题,其中一个比较头疼的就是还和gitolite和gitlab都没有关系,是ssh的问题,后来在gitolite的文档中找到了很详细的处理办法,摘录在此。 appendix 1: ssh daemon asks for a password NOTE: This section should be useful to anyone trying to get password-less access working. It is not necessarily specific to gitolite, so keep that in mind if the wording feels a little more general than you were expecting. You have generated a keypair on your workstation… Continue reading Howto fix this: ssh daemon asks for a password

Add trusted files and directories in Global Security Settings panel

在开发Flex应用的时候,烦人的SecurityError 2148可以通过Adobe的官网页面来添加本地硬盘Trusted Path以屏蔽 google “Global Security Settings panel” 一般来说第一条就是这个设置面板,地址是 http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

OSX 的 iTerm2中显示中文文件系统

在iTerm2中需要正确的显示中文文件目录和文件名需要对iTerm2进行以下设置: iTerm2 Preference——Profiles——Terminal 修改其中的文字编码为utf-8 然后在使用ls时加上 -v 参数,作用是: -v      Force unedited printing of non-graphic characters; this is the default when output is not to a terminal. 这样中文字就能以UTF-8编码正确的显示了。 修改一下文件就可以输入中文了: ~/.inputrc中添加: set convert-meta off set meta-flag on set output-meta on

bash color code issue

网上大量的关于添加PS1的文章都说将~/.profile文件修改如下: PS1=’\e[0;32m\h\e[0m:\W \u\$’ 其实这样bash在利用readline计算字符数量的时候是会将那些\e[m的字符都计算在内的。这样就会导致不能正确的自动换行了。事实上正确的做法是: PS1=’\[\e[0;32m\]\h\[\e[m\]:\W \u\$’ 需要在这些不显示的字符前后包上 \[ \], 这样bash就不会将自动换行计算错误。

关闭Lion中的F8打开mission control快捷键

F8在很多的开发工具都会用到。VNC也会用,怎么能被lion自动就占用了呢。赶紧关闭。 F8这个快捷键在菜单中不能关闭。这个截至10.7.1还是这样。可能以后会改进。现在只能自己改文件: ~/Library/Preferences/com.apple.symbolichotkeys.plist 其中75, 76就是对应F8和shift+F8的打开mission control的快捷键,disable即可。需要重新登陆。

在Lion中配置apache php和mysql环境

mac os x 中有一些单独的软件可以方便你的amp开发,如mamp等。这样你可以有一个比较干净的额外的开发环境,使用起来也很方便。本文要讲的不是使用这些all in one的软件。而是利用lion中自带的apache php,并且安装mysql来进行开发。 Lion中自带了apache和php,那么对于这两个我们不需要额外安装,使用现成的即可,只是需要修改一下配置文件/etc/apache2/httpd.conf 放开原本注释掉的一行: #LoadModule php5_module libexec/apache2/libphp5.so 删除前面的# 另注:/etc/php.ini.default 改成/etc/php.ini 然后其中的参数修改了重启apache2ctl graceful即可生效。 然后在system preference里面的sharing的web sharing开启apache即可。 测试:http://localhost/~[username] 将打开~/Sites/index.html 接着去mysql网站下载mysql for mac os x 10.6,有dmg文件,加载后运行其中的mysql-5.5.15-osx10.6-x86_64.pkg就会将mysql安装到/usr/local/mysql-VERSION下。并且建立/usr/local/mysql的符号链接。如果需要自动启动,还可以安装一次MysqlStartupItem.pkg,这个只需要安装一次,以后升级不需要再安装。 安装完之后,可以使用命令 sudo /Library/StartupItems/MySQLCOM/MySQLCOM start 来启动 默认没有密码。为了安全,我们加上自己的密码(几个root用户和几个匿名用户): /usr/local/mysql/bin/mysql -u root 连上数据库, mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘newpwd’); mysql> SET PASSWORD FOR ‘root’@’127.0.0.1’ = PASSWORD(‘newpwd’); mysql> SET PASSWORD… Continue reading 在Lion中配置apache php和mysql环境

Mac OS X Terminal shortcut

(转自stackoverflow,略改) On Mac OS X 10.7 – the following keyboard shortcuts work by default. Meta-Right to jump forward by a word Meta-Left to jump backward by a word I have observed that default emacs key-bindings for simple text navigation seem to work on bash shells. You can use Meta-d to delete a word starting from… Continue reading Mac OS X Terminal shortcut

Install dnsmasq on Mac OS X with homebrew

上月发现某203.208.46.xx IP用于代替一堆域名很不错。今天发现这个IP被屏蔽了。于是只能换一个。但是要改好多东西好麻烦。于是想到用dnsmasq的方式来玩。hosts表示好累。 首先安装Homebrew /usr/bin/ruby -e “$(curl -fsSL https://raw.github.com/gist/323731)” 安装成功后将配置文件模版复制到配置文件的位置: cp /usr/local/Cellar/dnsmasq/2.57/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf 再配置一下自动启动: sudo cp /usr/local/Cellar/dnsmasq/2.57/uk.org.thekelleys.dnsmasq.plist /Library/LaunchDaemons sudo launchctl load -w /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist 然后修改上面的conf配置文件。修改网络连接的dns到127.0.0.1,而让dnsmasq去/usr/loca/etc/resolv.conf中找真正的DNS查询。这里/usr/local/etc/resolv.conf需要自信创建,并且告知配置文件。