如果您的 Mac 使用了固件密码,这个组合键将不起任何作用或导致您的 Mac 从 macOS 恢复功能启动。要重置 NVRAM,请先关闭固件密码。
在您的 Mac 完成启动后,您可能需要打开“系统偏好设置”并调整已重置的任何设置,例如音量、显示屏分辨率、启动磁盘选择或时区。
进一步了解
如果您使用的是 Mac 台式电脑而非笔记本电脑,并且每次关闭 Mac 并断开 Mac 电源时,音量或时区等设置均会重置,则您可能需要更换 Mac 中的电池。这个小电池位于电脑的主板上,用于在断开 Mac 电源连接时帮助 NVRAM 保存设置。您可以携 Mac 前往 Apple 服务提供商处来更换该电池。
如果遇到了与睡眠、唤醒、电源、为 Mac 笔记本电脑电池充电有关的问题或其他与电源相关的症状,您可能需要重置 SMC(系统管理控制器)。
rtmp {
server {
listen 1935;
application live {
live on;
record off;}# HLS# For HLS to work please create a directory in tmpfs (/tmp/hls here)# for the fragments. The directory contents is served via HTTP (see# http{} section in config)## Incoming stream must be in H264/AAC. For iPhones use baseline H264# profile (see ffmpeg example).# This example creates RTMP stream from movie ready for HLS:## ffmpeg -loglevel verbose -re -i movie.avi -vcodec libx264# -vprofile baseline -acodec libmp3lame -ar 44100 -ac 1# -f flv rtmp://localhost:1935/hls/movie## If you need to transcode live stream use 'exec' feature.#
application hls {
live on;
hls on;
hls_path /usr/local/var/www/hls;}# MPEG-DASH is similar to HLS
application dash {
live on;
dash on;
dash_path /tmp/dash;}}}
#修改root本地账户密码
#mysql安装完成之后,生成的默认密码在 /var/log/mysqld.log 文件中。使用 grep 命令找到日志中的密码。
#shell> grep ‘temporary password’ /var/log/mysqld.log
#首次通过初始密码登录后,使用以下命令修改密码, 或使用 mysql_secure_installation命令也可以按提示修改
shell> mysql -uroot -p
mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘NewPassword’;
##问题汇总: 1. mysql 5.7 默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 错误
#解决方法,将密码强度改为LOW
#0 or LOW #1 or MEDIUM #2 or STRONG
#在mysql终端下运行:
mysql> set global validate_password_policy=0;
#默认都要求密码8位以上,可以使用下列命令修改长度为4
mysql> set global validate_password_length=4;
2. telnet mysql时出现:is not allowed to connect to this MySQL serverConnection closed by foreign host
#解决方法
#在mysql终端下运行:(%表示所有ip,如果要求本机适用localhost或ip地址代替)
mysql> grant all privileges on *.* to ‘root’@’%’ identified by ‘123456’;
#使授权生效
mysql> flush privileges;
3. mysql 安装后默认不支持中文,需要修改编码。
#修改 /etc/my.cnf 配置文件,在相关节点(没有则自行添加)下添加编码配置,如下:
比如: “-“.join(str(n) for n in range(100))语句执行3趟,每趟10000次的时间统计如下测试:
一、 终端命令行方式:
python -m timeit -n 10000 -r 3 -v ‘”-“.join(str(n) for n in range(100))’
raw times: 0.345 0.351 0.329
10000 loops, best of 3: 32.9 usec per loop
每次执行了10000次,共执行3次,最好的1次,平均每loop是32.9 usec(32.9微秒,10000 loops,best of 3的意思是一共repeat了3次,每一次10000 loops,取最好的那一次来平均)。32.9 usec就是这一行python表达式的执行时间。
二、python模块内方式:
>>> import timeit
>>> timeit.timeit(‘”-“.join(str(n) for n in range(100))’, number = 10000)
0.3615691661834717
>>> timeit.repeat(‘”-“.join(str(n) for n in range(100))’, number = 10000, repeat=3)[0.37982702255249023, 0.3650989532470703, 0.3783681392669678]
三、jupyter note使用方式
%timeit -n 1000 -r 3 “-“.join(str(n) for n in range(100))