如果直接在finder中cmd+x/cmd+v,是没有任何作用的。原来一直以为只有cmd+c/cmd+v,然后再去删除原来的。或者。。。。拖动文件
其实,cmd+c/cmd+option+v,就相当于剪切了!
这个快捷键,从Lion版开始就有了,只是之前真心不知道。
brew 安装个软件,没装成功却开始报这个错了:
Already up-to-date.
Error: Calling needs :cxx11 is disabled! There is no replacement.
Please report this to the chrisdeeming/legacyphp
tap: /usr/local/Homebrew/Library/Taps/chrisdeeming/homebrew-legacyphp/Formula/php@7.0.rb:41
我晕。现在都7.2了,这个源还报错?看了下官网。原来这个源不再需要:needcxx11了。OK,官网说重新brew update一下就好了。
重新brew update。恢复正常
1、https://github.com/chrisdeeming/homebrew-legacyphp/pull/4
2、https://github.com/chrisdeeming/homebrew-legacyphp/issues/2
简单的弄一下。因为有时候要改配置,然后打开mamp,点击重启会耗时特别长。。。。所以简单的弄了一下
XML/HTML代码
- #!/bin/bash
-
- function start(){
- /Applications/MAMP/Library/bin/httpd -f "/Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf" -k start
- }
-
- function stop(){
- /Applications/MAMP/Library/bin/httpd -f "/Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf" -k stop
- }
-
- function restart(){
- (stop)
- (start)
- }
-
- function status(){
- ps aux|grep httpd
- }
-
- echo "which do you want to?input the number."
- echo "1. start"
- echo "2. stop"
- echo "3. restart"
- echo "4. status"
- read num
-
- case "$num" in
- [1] ) (start);;
- [2] ) (stop);;
- [3] ) (restart);;
- [4] ) (status);;
- *) echo "exit";;
- esac
有人说重置SMC可以解决这个问题,然而我没有试。最后看LOG,居然一堆连网错误,难道要校验checksum?
再到苹果官网上看到这个:
https://discussions.apple.com/message/33927150#33927150
- Hi,
-
- Had the same problem, but for me it worked by
-
- removing all DNS search domains
- untick the automatic proxy configuration
-
-
- for the Wifi adapter.
-
- good luck.
果然尝试。果然有效(最终发现还是有问题,终于。。重置NVRAM,安装完成)
网址:https://appletoolbox.com/2017/12/macos-could-not-be-installed-how-to-fix/
- 节选
- Next, let’s try out the basic NVRAM reset (or PRAM for older Macs) on your computer.
- Follow these steps if you are not sure about how to do the NVRAM reset
- Shut down your Mac
- Turn it on and immediately press and hold these four keys together: Option, Command, P, and R macOS Could Not Be Installed, How-To Fix
- Release the keys after about 20 seconds, during which your Mac might appear to restart
- Open System Preferences and check (and adjust, if necessary) any settings that reset, like volume, display resolution, startup disk selection, or time zone
- 说白了,就是启动的时候 cmd+option+P+R,等20秒。放开,再重启
一切都清静 了。只是感觉这一版,没什么变动的
linux上面,如果替换文件中的内容,其实还是比较方便的。比如:sed -i 's/xxx/yyy/g' xxx.txt
然而同样的命令,如果放到mac下面,就会报:sed: 1: "xxx.txt": invalid command code o
到stackoverflow.com就会发现已经有人回复了:https://stackoverflow.com/questions/19456518/invalid-command-code-despite-escaping-periods-using-sed
XML/HTML代码
- If you are on a OS X, this probably has nothing to do with the sed command. On the OSX version of sed, the -i option expects an extension argument so your command is actually parsed as the extension argument and the file path is interpreted as the command code.
-
- Try adding the -e argument explicitly and giving '' as argument to -i:
-
- find ./ -type f -exec sed -i '' -e "s/192.168.20.1/new.domain.com/" {} \;
- See this.
所以上面的代码就改为:sed -i '' -e 's/xxx/yyy/g' xxx.txt ,搞定
参考:
1、https://stackoverflow.com/questions/19456518/invalid-command-code-despite-escaping-periods-using-sed
2、https://stackoverflow.com/questions/7573368/in-place-edits-with-sed-on-os-x