需求:SSH免密码登陆
利用ssh-keygen -t rsa -b 4096 -C "xxx@xxx.com"生成公,私钥的时候设置私钥密码,导致ssh免登录设置完成后一直需要输入私钥密码,才能链接SSH服务端,非常不方便
Enter passphrase for key '~/.ssh/id_rsa':
解决:
第一步:
将私钥添加到钥匙串中,按照提示输入私钥密码
ssh-add -K ~/.ssh/id_rsa
第二步:
在.ssh文件夹下config文件中配置服务器属性,UseKeychain,AddKeysToAgent设置为YES
如果没有……继续阅读 »
sharezer
3年前 (2019-10-15) 2088浏览 1评论
0个赞
// 显示Mac隐藏文件
defaults write com.apple.finder AppleShowAllFiles YES
// 隐藏Mac隐藏文件
defaults write com.apple.finder AppleShowAllFiles NO
// 强制使用集显
sudo pmset -a GPUSwitch 0
// 强制使用独显
sudo pmset -a GPUSwitch 1
// 自动切换模式
sudo pmset -a GPUSwitch 2
// 修改Mac地址
sudo ifconfig en0 ether [mac地址]
……继续阅读 »
sharezer
4年前 (2019-07-17) 1612浏览 0评论
0个赞
……继续阅读 »
sharezer
4年前 (2019-05-29) 1688浏览 0评论
0个赞
if captureFilePath != nil{
let image: NSImage = getImageFromURL(url: captureFilePath!)!
image.lockFocus()
NSColor.white.setStroke()
let height: Int = Int(image.size.height)
let width: Int = Int(image.size.width)
let lineWidth = CGFloat(height > width ? h……继续阅读 »
sharezer
6年前 (2016-12-13) 2642浏览 0评论
0个赞
@IBAction func SaveImage(_ sender: Any) {
if resuleImage.image != nil {
let savePanel = NSSavePanel.init()
savePanel.allowedFileTypes = [(captureFilePath?.pathExtension)!]
savePanel.message = "Choose the path to save the image"
savePanel.isExtensionHidden = false
……继续阅读 »
sharezer
6年前 (2016-12-13) 2395浏览 0评论
0个赞