易栈网-膘叔

浏览模式: 标准 | 列表 | 图文
转:一些升級 El Capitan 之後要注意的事項

转:一些升級 El Capitan 之後要注意的事項

以下内容纯COPY

前兩天 OS X El Capitan 出了 GM Candidate,所以就升級上去了,雖然外觀上 El Capitan 跟 Yosemite 看起來差不多,但是我裝的不少東西馬上就不能用了,這邊列一下目前遇到的問題跟解決方法,如果後面陸續遇到更多會持續補充。

首先最重要的是,El Capitan 增加了一個叫做 System Integrity Protection (簡稱 SIP ,或稱 rootless, 在 iOS 9 裡面也有) 的保護機制,SIP 最主要功能就是防止對系統程式的 code injection,還有使用未被 Apple 認可的 kext。

但是要關閉 SIP 也不難,只要進去 Recovery Mode (開機按著 Command + R 直接進入,千萬不要用按著 option 的方式選擇,否則會找不到 csrutil 的指令),用終端機輸入

csrutil disable
之後重新開機,就可以關閉 SIP 了。若有使用到以下說明要關閉 SIP 的軟體,就必須按照上述方法操作,才能正常使用該軟體之功能。而開啟 SIP 也很簡單,輸入

csrutil enable
特別要注意的是,csrutil 的設定實際上是在 NVRAM 中設定參數,所以當你重置 NVRAM (開機按住 command + option + P + R) 之後,SIP 會變回開啟狀態,所以要再重新關閉一次,切記切記!



而以下就是我目前遇到在 El Capitan 必須特別留意的軟體:

TotalFinder:必須在 1.7.1 以上,並且關閉 SIP。 (1.7.1 beta 載點)
XtraFinder:官網下載最新版,並且關閉 SIP。
Bartender:必須在 1.3.2 版以上(如果你無法升級,試著開啟 beta 版檢查),暫時關閉 SIP (成功安裝後可以再次開啟)
Homebrew:如果出現無法編譯的問題,就去下載 Xcode 7,開啟並安裝 command line tools 之後就能解決
iStat Menus:必須在 5.11 版以上 (5.11 beta 載點),但因為在 5.11 之後,iStat Menus 的每個元件並不是分開的,而是整個合併為一大塊元件,所以目前不能把其他項目放置在 iStat Menus 元件的中間(例如:以前可以 RAM → Spotlight → CPU 這樣穿插放,但現在不行,iStat Menus 的項目必須連續。)如果要改各個項目的順序,要在 iStat Menus 裡面的設定改,不能直接在 menubar 拖曳。
Sequel Pro:如果用 SSH 連接的話會出錯,去抓 Nightly Builds 就可以了
theos:iOS 9 SDK 跟 theos 裡面的 header 似乎有些問題,如果有問題的話去用 iOS 8.4 的 SDK 或者抓 Xcode 6.4 回來編譯。(目前測試如果用到 Springboard 跟 UIKit2.h 的 header 好像會出錯)
Parallels Desktop:必須在 PD 10 (含) 以上
Fantastical 2:如果不能用下載 beta 看看(載點)(感謝 @katerjacob 補充)
CleanMyMac 3:必須在 3.1 beta 以上
以上就是目前遇到的問題,但我覺得除了 iStat Menus 不能照以前的方法用之外(其實原因是因為 menucracker 失效了),其他不是太大問題。而 GM 版本雖然不是最終版本(這次是 GM Candidate,跟去年一樣,有可能會有 GM2、GM3),但是穩定性還算 OK(大家都知道,OS X 要真正穩定必須等到 10.x.2 之後…),所以如果有開發者帳號的,也可以考慮趕緊備份資料,準備上來 El Capitan 了!
所幸,上述程序我几乎都不用。除了homebrew/parallels desktop。。。这两个的问题我已经解决了。黑黑
如果你们有遇到或者要用上述程序的,先做好心里准备
brew upgrade不能升级go 1.5.1的解决方案(无效,已删)

brew upgrade不能升级go 1.5.1的解决方案(无效,已删)

本文是使用代理后提交时出现的BUG,本来是重复的,已删除 ,做个纪念。

不知道是数据太大了,还是什么其他原因:
[ERROR] 2015/11/19 01:22:08 parse response header: bufio: buffer full POST neatstudio.com:80/admin/admincp.php?job=article
HTTP/1.1 200 OK
Date: Wed, 18 Nov 2015 17:22:08 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.4.41-0+deb7u1
Set-Cookie: cid=17; expires=Fri, 18-Dec-2015 17:22:08 GMT
Set-Cookie: title=brew+upgrade%E4%B8%8D%E8%83%BD%E5%8D%87%E7%BA%A7go+1.5.1%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88; expires=Fri, 18-Dec-2015 17:22:08 GMT
Set-Cookie: description=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT
[ERROR] 2015/11/19 01:22:19 parse response header: bufio: buffer full POST neatstudio.com:80/admin/admincp.php?job=article
HTTP/1.1 200 OK
Date: Wed, 18 Nov 2015 17:22:18 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.4.41-0+deb7u1
Set-Cookie: cid=17; expires=Fri, 18-Dec-2015 17:22:19 GMT
Set-Cookie: title=brew+upgrade%E4%B8%8D%E8%83%BD%E5%8D%87%E7%BA%A7go+1.5.1%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88; expires=Fri, 18-Dec-2015 17:22:19 GMT
Set-Cookie: description=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT
估计是标题中有特殊字符?还是其他的呢?
或者是内容太多了吧?
brew upgrade不能升级go 1.5.1的解决方案

brew upgrade不能升级go 1.5.1的解决方案

在brew upgrade的时候,出错信息如下:

brew upgrade
==> Upgrading 1 outdated package, with result:
go 1.5.1
==> Upgrading go
==> Downloading https://storage.googleapis.com/golang/go1.5.1.src.tar.gz
Already downloaded: /Library/Caches/Homebrew/go-1.5.1.tar.gz
==> Downloading https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/go--gobootstrap-10.8.tar.gz
==> ./make.bash --no-clean
==> ./make.bash --no-clean
==> Cloning https://go.googlesource.com/tools.git
Cloning into '/Library/Caches/Homebrew/go--gotools--git'...
fatal: unable to access 'https://go.googlesource.com/tools.git/': Failed to connect to go.googlesource.com port 443: Operation timed out
Error: Failed to download resource "go--gotools"
Failure while executing: git clone https://go.googlesource.com/tools.git /Library/Caches/Homebrew/go--gotools--git
于是我想到,可以使用proxychains4来进行访问(之前已经安装 goagentx + cow [with shadowsocks] ),然而:
proxychains4 brew upgrade
[proxychains] config file found: /usr/local/Cellar/proxychains-ng/4.10/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.10/lib/libproxychains4.dylib
==> Upgrading 1 outdated package, with result:
go 1.5.1
==> Upgrading go
==> Downloading https://storage.googleapis.com/golang/go1.5.1.src.tar.gz
Already downloaded: /Library/Caches/Homebrew/go-1.5.1.tar.gz
==> Downloading https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/go--gobootstrap-10.8.tar.gz
==> ./make.bash --no-clean
Last 15 lines from /Users/xiaojianliang/Library/Logs/Homebrew/go/01.make.bash:
text/template
go/doc
go/build
cmd/go
fatal error: runtime: bsdthread_register error (unset DYLD_INSERT_LIBRARIES)

runtime stack:
runtime.throw(0x3e9855)
/usr/local/go/src/runtime/panic.go:491 +0xad fp=0x7fff5fbff390 sp=0x7fff5fbff360
runtime.goenvs()
/usr/local/go/src/runtime/os_darwin.c:103 +0x60 fp=0x7fff5fbff3a8 sp=0x7fff5fbff390
runtime.schedinit()
/usr/local/go/src/runtime/proc.c:141 +0x5f fp=0x7fff5fbff3d0 sp=0x7fff5fbff3a8
runtime.rt0_go(0x7fff5fbff408, 0x4, 0x7fff5fbff408, 0x0, 0x0, 0x4, 0x7fff5fbff670, 0x7fff5fbff6c6, 0x7fff5fbff6cc, 0x7fff5fbff6cf, ...)
/usr/local/go/src/runtime/asm_amd64.s:95 +0x116 fp=0x7fff5fbff3d8 sp=0x7fff5fbff3d0

READ THIS: https://git.io/brew-troubleshooting

These open issues may also help:
Homebrew goes ahead with installation after warning dev tools aren't installed https://github.com/Homebrew/homebrew/issues/19580
这回倒好,还没有到git clone,就直接出错了。看来proxychains和golang不兼容,怎么办?于是干脆我直接先clone一下看看:
:~$ proxychains4 git clone https://go.googlesource.com/tools.git /Library/Caches/Homebrew/go--gotools--git
[proxychains] config file found: /usr/local/Cellar/proxychains-ng/4.10/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.10/lib/libproxychains4.dylib
Cloning into '/Library/Caches/Homebrew/go--gotools--git'...
remote: Counting objects: 827, done
remote: Finding sources: 100% (12/12)
remote: Total 14355 (delta 9764), reused 14348 (delta 9764)
Receiving objects: 100% (14355/14355), 8.98 MiB | 119.00 KiB/s, done.
Resolving deltas: 100% (9764/9764), done.
Checking connectivity... done.
果然OK了。那么我再直接试一下upgrade吧?
brew upgrade
==> Upgrading 1 outdated package, with result:
go 1.5.1
==> Upgrading go
==> Downloading https://storage.googleapis.com/golang/go1.5.1.src.tar.gz
Already downloaded: /Library/Caches/Homebrew/go-1.5.1.tar.gz
==> Downloading https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/go--gobootstrap-10.8.tar.gz
==> ./make.bash --no-clean
==> ./make.bash --no-clean
==> Cloning https://go.googlesource.com/tools.git
Updating /Library/Caches/Homebrew/go--gotools--git
==> Checking out revision d02228d1857b9f49cd0252788516ff5584266eb6
==> go build
==> go build
==> Caveats
As of go 1.2, a valid GOPATH is required to use the `go get` command:
https://golang.org/doc/code.html#GOPATH

You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin
==> Summary
关于proxychains4在OSX EI Capitan上不能使用的问题

关于proxychains4在OSX EI Capitan上不能使用的问题

相信很多朋友在升级到OSX EI Capitan后发现proxychains无效了。随便你设置什么代理 ,都无法用来上网。

经过多次测试,发现程序没问题,然后到了官网后,发现有一个issue里也提到了这个问题,最后确认是SIP的问题,于是重启电脑,按cmd+R进入恢复模式,打开终端输入:csrutil disable,然后重启,一切OK~

对于开发人员来说,csrutil还是disable吧。比如brew 也有这个问题。

纪念一下sablog作者

只有图,没有字,随便看看吧

参考来源:
1、http://www.server110.com/sec_news/201511/11322.html
2、http://netsecurity.51cto.com/art/201510/495611.htm
3、http://www.hostloc.com/forum.php?mod=viewthread&tid=289531&page=1#pid3775357
4、http://www.court.gov.cn/zgcpwsw/jiangsu/jsshaszjrmfy/xs/201507/t20150710_9441657.htm 这个才是原地址,看最后一段话,明显是交友不慎啊
Parallels Desktop 下的虚拟机如何调整分辨率

Parallels Desktop 下的虚拟机如何调整分辨率

自从PD10开始,其实分辨率已经都可以自由调整了,但还是有很多朋友说,为什么分辨率那么大,图标和鼠标那么小?设置了分辨率后一重启又恢复了?

其实PD 10的虚拟机配置里有一个选项:
只要将这个勾去掉,你所有的分辨率的设置就都可以保存,而不再受retina的分辨率大小限制了。。
不信你可以加上试试(加上和取消这个勾不用重启,你就可以看到你的虚拟机分辨率的变化了。。。)
imageworkshop中的position的说明及代码

imageworkshop中的position的说明及代码

position有9个点:lt,mt,rt,lm,mm,rm,lb,mb,rb,其实对应的是几个英文:lt(left top),mt(middle top),rt(right top),以此类推

上官方原图:

OK,然后我们看一下他的代码是怎么写的,如果有人涉及到也可以借鉴:

<?php

/**
* Calculate the left top positions of a layer inside a parent layer container
* $position: http://phpimageworkshop.com/doc/22/corners-positions-schema-of-an-image.html
*
* @param integer $containerWidth
* @param integer $containerHeight
* @param integer $layerWidth
* @param integer $layerHeight
* @param integer $layerPositionX
* @param integer $layerPositionY
* @param string $position
*
* @return array
*/
public static function calculatePositions($containerWidth, $containerHeight, $layerWidth, $layerHeight, $layerPositionX, $layerPositionY, $position = 'LT')
{
$position = strtolower($position);

if ($position == 'rt') {

$layerPositionX = $containerWidth - $layerWidth - $layerPositionX;

} elseif ($position == 'lb') {

$layerPositionY = $containerHeight - $layerHeight - $layerPositionY;

} elseif ($position == 'rb') {

$layerPositionX = $containerWidth - $layerWidth - $layerPositionX;
$layerPositionY = $containerHeight - $layerHeight - $layerPositionY;

} elseif ($position == 'mm') {

$layerPositionX = (($containerWidth - $layerWidth) / 2) + $layerPositionX;
$layerPositionY = (($containerHeight - $layerHeight) / 2) + $layerPositionY;

} elseif ($position == 'mt') {

$layerPositionX = (($containerWidth - $layerWidth) / 2) + $layerPositionX;

} elseif ($position == 'mb') {

$layerPositionX = (($containerWidth - $layerWidth) / 2) + $layerPositionX;
$layerPositionY = $containerHeight - $layerHeight - $layerPositionY;

} elseif ($position == 'lm') {

$layerPositionY = (($containerHeight - $layerHeight) / 2) + $layerPositionY;

} elseif ($position == 'rm') {

$layerPositionX = $containerWidth - $layerWidth - $layerPositionX;
$layerPositionY = (($containerHeight - $layerHeight) / 2) + $layerPositionY;
}

return array(
'x' => $layerPositionX,
'y' => $layerPositionY,
);
}

END;

更新:composer 源

更新:composer 源

之前有发过一篇博客:几个常见的 Composer 国内镜像 ,经过长期的测试,发现这些源不是少内容就是速度慢,这不再推荐一个新的,用了它之后,我就腰不酸腿不疼了:http://packagist.phpcomposer.com 【其实这个就是原来的:http://pkg.phpcomposer.com/repo/packagist/,只是换个名字,但这个好象确实快了一点】

具体的操作方法查看上文的博客内容。

备份:不使用ssh_config实现git指定私钥

备份:不使用ssh_config实现git指定私钥

这是一个备份,起因是由于我现在使用的gogs不能使用ssh的方式连接,主要是不方便,所以目前我是使用了HTTP的方式。

看了这篇文章后对我有启发,但是我没有使用,所以只是先做个备份。原文在:http://www.luxingmin.com/archives/278.html
一直想实现指定git访问的私钥,网上资料给出来的都是通过ssh_config来实现,这种方法很繁琐,另外想实现git webhook部署时,使用这种方法也比较不灵活。

切入正题

建立git_ssh文件,内容如下

#!/bin/bash
ssh -i $SSH_KEY_FILE $1 $2
然后增加执行权限

chmod 755 git_ssh
然后就可以通过如下命令指定git访问时使用的ssh私钥

SSH_KEY_FILE=/root/git/id_rsa GIT_SSH=/root/git/git_ssh git clone git@xxx
---EOF---
QQ For Mac 4.0.4在OSX EI有问题,请别急着安装

QQ For Mac 4.0.4在OSX EI有问题,请别急着安装

正如标题所说的:QQ For Mac 4.0.4在OSX EI有问题,请别急着安装。

4.0.4是修复了聊天窗口的阴影问题,但他带来了更严重的问题,只要有收到消息,不管QQ当前运行在前台还是在状态栏,都会使得程序失去焦点。包括QQ自己也会这样。

因此你会遇到,在QQ里打字,刚打两下,突然,光标没了。需要鼠标点击一下当前窗口,才能继续 下去,如果你的群组过多,建议别升了,否则你永远处于1~2秒后就失去焦点。在任何程序 里都是。。

再忍忍吧。等4.0.5吧,为什么QA没测试出这个问题?

4.0.3的传送门:http://dldir1.qq.com/qqfile/QQforMac/QQ_V4.0.3.dmg

或者,如果你对3.1.2还有兴趣的话:http://dldir1.qq.com/qqfile/QQforMac/QQ_V3.1.2.dmg