在 macOS 中使用 cron 定时任务和 Linux 下略有区别。首先在终端输入,查看服务是否运行:sudo launchctl list | grep cron 输出结果:- 0 com.vix.cron 接下来查看启动项的配置:locate com.vix.cron 如果提示 database 不存在WARNING: The locate database /var/db/locate.database does not exist. To create the database, run the following command: sudo launchctl load -w
admin 2024-03-29 运维 76
MacOS 不像 Linux 有 /etc/init.d/rc.local 以及 service 的方式可以自动启动。而是使用 plist 文件,文件里描述程序路径和启动参数,用户登录后就会启动这个程序,而且pkill进程以后,程序会自动重启。plist文件分布在:/System/Library/LaunchDaemons # 是用户未登陆前就启动的服务(守护进程) /System/Library/LaunchAgents # 由Mac OS X为用户定义的任务项 /Library/LaunchDaemons # 由管理员定义的守护进程任务项 /Library/Launc
admin 2021-10-18 运维 1115
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
admin 2021-05-06 运维 730
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
admin 2020-11-09 运维 934
列出历史记录defaults read /Users/ice/Library/Preferences/com.apple.Terminal.plist PreviousCommands 删除历史记录defaults delete /Users/ice/Library/Preferences/com.apple.Terminal.plist PreviousCommands
admin 2020-08-19 运维 843
简单调用在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
admin 2020-08-11 运维 1395
1,macOS QQ 聊天记录文件位置~/Library/Containers/com.tencent.qq/Data/Library/Application Support/QQ 2,Apache 和 PHP 位置PHP 位置 /usr/local/php5Apache 位置 /usr/local/opt/httpdApache 配置文件 /usr/local/etc/httpdApache 重启 sudo apachectl restart3, Xcode 删除过程3.1.根目录下的必须要用管理员权限:sudo rm -rf /Applications/Xcode.app sudo
admin 2020-04-14 运维 874
一,问题描述在使用SSH连接远程服务器的时候,如果长时间不操作,再次进入 Terminal 时就会有卡死一段时间没有响应。等待一段时间以后,会发现以下错误提示:Write failed: Broken pipe这表示连接管道已经断开,所以只能重进行连接。二,解决方法方法一:客户端配置在客户端的 ~/.ssh/config文件(如不存在请自行创建)中添加下面内容:ServerAliveInterval 60方法二:服务器端配置在服务器的 /etc/ssh/sshd_config 中添加如下的配置:ClientAliveInterval 60方法三:临时SSH命令配置如果只是临时性的连接(即只作用
admin 2020-03-19 运维 958
macOS自带的PHP没有freetype扩展,需要自己安装。之前使用 https://php-osx.liip.ch/#install 安装PHP。 现在系统升级到 macOS Mojave后。提示:[WARNING] Detected macOS Mojave 10.14. There are serious issues with it, due to the original apache not loading foreign libraries anymore. PHP within apache will most certainly not work anymore if
admin 2019-06-02 运维 1125
macOS截图默认是png格式,修改为jpg格式: 调出终端 defaults write com.apple.screencapture type jpg
admin 2019-04-02 运维 868
随机推荐
WordPress 支持事务
Linux 网络流量监控 iftop
WordPress 实现自定义 Ajax 请求
Node.js 使用 Jest 做单元测试
ReferenceError: __dirname is not defined in ES module scope
MySQL 删除逗号分隔字段中的某一个值
Node.js 使用 Jest 和 supertest 做接口测试
JavaScript 中 0.1 加 0.2 不等于 0.3 的原因和解决方法