macOS High Sierra
(10.13.6
)运行MATLAB R2014a
,结果出现空指针异常,具体异常信息如下图:继续阅读解决macOS High Sierra(10.13.6)运行MATLAB R2014a出现NullPointerExpetion的问题
Mac是苹果自1984年起以“Macintosh”开始的个人消费型计算机,如:iMac、Mac mini、Macbook air、Macbook pro、Mac pro等计算机。使用独立的Mac os系统,最新的OS X系列基于NeXT系统开发,不支持兼容。是一套完备而独立的生态系统。
macOS High Sierra
(10.13.6
)运行MATLAB R2014a
,结果出现空指针异常,具体异常信息如下图:在macOS High Sierra(10.13.6)
版本上,使用Homebrew
安装python2
的时候出现如下问题:
1 2 3 4 5 6 7 8 9 10 11 12 |
$ brew install python2 Warning: python@2 2.7.15_1 is already installed, it's just not linked You can use `brew link python@2` to link this version. $ brew link python@2 Linking /usr/local/Cellar/python@2/2.7.15_1... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks $ sudo brew link python@2 Password: Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system. |
网上的解决方法是把整个/usr/local
的所有者修改为当前用户,但是新版本的macOS High Sierra(10.13.6)
已经不支持这样操作了,如下:
1 2 |
$ sudo chown -R `whoami` /usr/local chown: /usr/local: Operation not permitted |
那么解决方法如下:
1 2 3 4 5 6 7 |
$ sudo chown -R `whoami` /usr/local/Homebrew/ $ sudo chown -R $(whoami) $(brew --prefix)/* $ sudo mkdir /usr/local/Frameworks $ sudo chown -R `whoami` /usr/local/Frameworks/ |
完成上面的操作后,我们可以看到已经能成功操作了:
1 2 3 4 5 6 7 8 |
$ brew link python@2 Linking /usr/local/Cellar/python@2/2.7.15_1... 5 symlinks created #如果曾经安装过pip可能导致pip被链接到系统的python版本,可是系统目录上各种无权限,因此我们移除已经安装的pip,重新链接pip到brew安装的python $ sudo rm -rf /usr/local/bin/pip $ brew reinstall python2 |
以前常在 Linux 的 Terminal 下使用 minicom 这个小程序来操作 USB to Serial (也就是 USB to RS-232) 来连接「数据采集卡」、Router、Switch 等网络设备
一般 Linux 底下的 minicom 使用 control + <Fn> 来操作一些 minicom 的一些特定功能
例如 control + x 就是 hang up 并退出 minicom
后来换成 OS X 之后的 minicom ,要求使用「meta key」组合键,如下图:
家里的一台Mac mini(Early 2009)
安装了OS X EI Caption
系统,启用了SSH
与VNC
远程桌面。但是在某次系统更新的时候,由于涉及到Remote Desktop Client
的更新,导致无法正常登录VNC
远程桌面,但是可以正常使用SSH
登录。
则使用如下命令重新启用VNC
远程桌面服务:
1 2 3 |
$ export VNC_PASSWORD=mypasswd $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -setreqperm -reqperm yes -clientopts -setvncpw -vncpw $VNC_PASSWORD -restart -agent -privs -all |
如果需要关闭VNC
远程桌面服务,则使用如下命令:
1 2 |
$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off |
微软曾经为macOS
提供过Windows
远程桌面,但是已经非常长时间没有更新过了,导致在macOS High Sierra
系统上的远程桌面是无法连接Windows 10
的。
其实微软还是为最新的macOS High Sierra
提供了远程桌面程序的,在苹果应用商店的应用名为Microsoft Remote Desktop Beta
,但是遗憾的是,设置了只能美国的用户才能下载。因此我们需要手工下载,然后安装。
可以在本站下载一份目前的最新拷贝。
使用
1 |
$ brew install ffmpeg |
安装ffmpeg
默认是不支持x265
的
使用
1 |
$ brew reinstall ffmpeg --with-x265 |
重新安装即可。
一般直接的H265
数据流(比如从摄像头抓取的H265
裸数据流保存的文件),是没办法在MacOS
上直接播放的,必须进行转码。简单的转码命令如下:
1 |
$ ffmpeg -i input.h265 -c:v libx265 output.mp4 |
在macOS High Sierra
系统上使用Safari
进行搜索的时候,总是莫名其妙的被修改搜索词,导致搜索结果驴唇不对马嘴。搜索了一下,这个锅应该是输入法导致的,最可恶的是不能拒绝输入法的推荐词汇,可以使用如下方式关闭输入法的自动英文矫正功能。
macOS Sierra
升级到macOS High Sierra
后执行cc
,git
等命令报错,错误信息如下:
1 |
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun |
解决方法如下:
1 |
$ xcode-select --install |
hdiutil convert -format UDRW -o destination_file.img source_file.iso
diskutil list
and determine the device node assigned to your flash media (e.g., /dev/disk2)diskutil unmountDisk /dev/diskN
(replace N with the disk number from the last command; in the previous example, N would be 2)sudo dd if=/path/to/destination_file.img.dmg of=/dev/diskN bs=1m
(replace /path/to/destination_file.img.dmg with the path where the image file is located; for example, ./win7.img.dmg)
diskutil eject /dev/diskN
, and remove your flash media when the command completes (this can take a few hours on slower drives)很多时候,我们系统上安装了好几个版本的Python
, 此时,我们往往没办法确定通过pip
安装的包会存放到那个目录下的site-packages
中,可以通过如下代码获取:
1 |
$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" |
在Ubuntu 16.04 LTS
系统上,这个输出是存在问题的,执行命令后输出的目录是:
1 |
/usr/lib/python2.7/dist-packages |
实际上,通过pip
命令安装的目录有很大一部分被安装到了
1 |
/usr/local/lib/python2.7/dist-packages |
目录下。