MacOS 不像 Linux 有 /etc/init.d/rc.local 以及 service 的方式可以自动启动。而是使用 plist 文件,文件里描述程序路径和启动参数,用户登录后就会启动这个程序,而且pkill进程以后,程序会自动重启。plist文件分布在:/System/Library/LaunchDaemons # 是用户未登陆前就启动的服务(守护进程) /System/Library/LaunchAgents # 由Mac OS X为用户定义的任务项 /Library/LaunchDaemons # 由管理员定义的守护进程任务项 /Library/Launc
SSH 密码登录#!/usr/bin/expect -f set password "123456" set timeout -1 spawn ssh user@xxx.xxx.xxx.xx expect "*assword:*" send "$password\r" expect "Last*" interact SSH 证书登录#!/usr/bin/expect -f set password "123456" set timeout -1 spawn ssh -i /Users/user/Cert/id_rsa user@xxx.xxx.xxx.xx -p 3002
macOS 安装 nginxbrew install nginx cp nginx.conf.default nginx.conf cd www.conf.default www.conf 安装PHP 参考:https://javascript.net.cn/articles/582找到PHP的位置/usr/local/php7 修改 ~/profilePATH="/usr/local/php7/bin:/usr/local/php7/sbin:$PATH" 开启php-fpm 关闭 php-fpmsudo killall php-fpm 如果遇到上传文件权限不够nginx open() cl
列出历史记录defaults read /Users/ice/Library/Preferences/com.apple.Terminal.plist PreviousCommands 删除历史记录defaults delete /Users/ice/Library/Preferences/com.apple.Terminal.plist PreviousCommands
简单调用在mac的命令行下面,执行:say hello world 就可以发出"hello world"的声音了,支持中文。文字转为语音新建一个文本文件aa.txt,在终端里在,cd 到该目录,然后执行:say -f aa.txt -o a.m4a 即可生成a.m4a这个语音文件。 -f 后面跟的是需要转换成语音的文件,-o 是 -out 的意思。修改语音声音打开系统偏好设置->辅助功能->语音参考:https://jingyan.baidu.com/article/48b37f8d23eaa61a64648813.htmlhttps://newsn.net/say/mac-command
微信联系我