Flutter

浏览模式: 标准 | 列表 | 图文
Ruby SSL Error: certificate verify failed

Ruby SSL Error: certificate verify failed

安装fastlane的时候报错:

ERROR: SSL verification error at depth 0: ok (0)
ERROR: SSL verification error at depth 0: ok (0)
ERROR: SSL verification error at depth 0: ok (0)
ERROR: Could not find a valid gem 'rvm' (>= 0), here is why:
Unable to download data from https://ruby.taobao.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (certificate rejected) (https://ruby.taobao.org/specs.4.8.gz)
ERROR: SSL verification error at depth 0: ok (0)
ERROR: SSL verification error at depth 0: ok (0)
网上很多解决方法,什么重建 pem,之类的,或者临时关闭验证:【http.verify_mode = OpenSSL::SSL::VERIFY_NONE】,但更多人都推荐一句话的命令:rvm osx-ssl-certs update all。然而我运行下来却是:
Selected SSL certs for: curl
cURL certificate bundle curl is /usr/share/curl/curl-ca-bundle.crt not found
嗯,这回又是一堆人遇到了同样的问题,看看这个高票答案,居然只是说rvm用stable版?
$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled
不过也有人有不同的看法:
To find the location of this file use:

$ curl-config --ca

/usr/share/curl/curl-ca-bundle.crt
Backup your curl-ca-bundle.crt file:

$ cp /usr/share/curl/curl-ca-bundle.crt /usr/share/curl/curl-ca-bundle.crt.old
Then you want to concatenate the two file using:

$ cat cacert.pem /usr/share/curl/curl-ca-bundle.crt >> curl-ca-bundle-new.crt
看起来倒是可行。
参考 :
1、https://blog.engineyard.com/ruby-ssl-error-certificate-verify-failed
2、https://stackoverflow.com/questions/6414232/curl-certificate-error-when-using-rvm-to-install-ruby-1-9-2/6917309
mac 如何将img文件写到 SDCard

mac 如何将img文件写到 SDCard

有三篇教程

mac上本来双盘COPY是很简单的,打开diskutil,加载两个磁盘,对着要恢复的盘,右键:选择恢复,可以选择 img/dmg文件,也可以选择已经 mount的磁盘。然而在恢复树莓的时候,一直失败【忘了截图了】
于是找到了教程1,教你怎么在命令下行备份,方法很简单,就2步
1、diskutil list,查看你的SD卡对应的是哪个磁盘,
2、备份:sudo dd if=/dev/rdisk1 of=/path/to/backup.img bs=1m
恢复:sudo dd if=/path/to/backup.img of=/dev/rdisk1 bs=1m
3、如果觉得太大,还可以gzip
备份:sudo dd if=/dev/rdisk1 bs=1m | gzip > /path/to/backup.gz
恢复:gzip -dc /path/to/backup.gz | sudo dd of=/dev/rdisk1 bs=1m
如果你仔细看教程1,你会发现,diskutil list,显示的是当前磁盘,大部分都是直接写的/dev/disk3 之类的,而 上面的备份命令却写的是 rdisk1 。这是什么原因?教程1给了个wiki:https://elinux.org/RPi_Easy_SD_Card_Setup#Copying_an_image_to_the_SD_card_in_Mac.C2.A0OS.C2.A0X_.28command_line.29,有兴趣的话,可以去看看。
如果不想深究原因,那么看教程2,他会教你怎么弄,
1、df -h,看一下自己的SD卡是哪个,你会看到这时候显示的又和 diskutil list 不一样,df -h显示的都是 /dev/disk3s1 之类的
2、用diskutil unmount /dev/disk3s1,将它unmount掉
3、df -h 发现没有 /dev/disk3s1了
4、这时候参考 上面的rdisk方法,写入磁盘 /dev/rdisk[n] , 这个 n,就是刚才你 disk[3]s1 中的3,具体情况看你自己的sd卡是哪个盘
比如我这样:
sudo dd if=/Volumes/documents/2020-05-27-raspios-buster-lite-armhf.img of=/dev/rdisk3 bs=1m
1768+0 records in
1768+0 records out
1853882368 bytes transferred in 24.396307 secs (75990287 bytes/sec)
写入成功。
我就只知其然不知其所以然了,也没有过多深究。有兴趣的话,可以看看上面的教程3

Creating root-level directories and symbolic links on macOS Catalina

这是一篇引用文章,原文来自:https://derflounder.wordpress.com/2020/01/18/creating-root-level-directories-and-symbolic-links-on-macos-catalina/,可能部分用户打不开,毕竟是wordpress.com。。。

我简单的COPY一下:

One of the changes which came with macOS Catalina was the introduction of a read-only root volume for the OS. For users or environments which were used to using adding directories to the root level of the boot drive, this change meant they could no longer do that.

To address this need, Apple added a new method for creating directories at the root level which leverages Apple File System’s new firmlink functionality. Firmlinks are new in macOS Catalina and are similar in function to Unix symbolic links, but instead of only allowing travel one way (from source to destination) firmlinks allow bi-directional travel.

The use of firmlinks is exclusively reserved for the OS’s own use, but Apple has also made available what are called synthetic firmlinks. These synthetic firmlinks are how the OS enables folks to create directories and symbolic links on the read-only boot volume. For more details, please see below the jump.

To create a synthetic firmlink, you need to do the following:

1. Create a file in the /etc directory named synthetic.conf.
2. Make sure /etc/synthetic.conf has the following permissions:

  • root: read, write
  • wheel: read
  • everyone: read

3. In /etc/synthetic.conf, define the name(s) of the empty directory or symbolic link you want to have appear at the root level.

4. After all desired entries have been made, save the /etc/synthetic.conf file.

5. Restart the Mac to apply the changes.

For example, /etc/synthetic.conf may look like this:

# create an empty directory named "foo" at / which may be mounted over
foo

# create a symbolic link named "bar" at / which points to
# "System/Volumes/Data/bar", a writeable location at the root of the data volume
bar System/Volumes/Data/bar

# create a symbolic link named "baz" at / which points to "Users/me/baz"
baz Users/me/baz

Note: In those cases where you’re creating a symbolic link and are including a path, the start point for the directory path is not /. Instead, it is the next directory level down.

To show how this works, I’ve created a directory containing installer packages located at /Users/Shared/installers.

Screen Shot 2020 01 17 at 10 46 06 PM

To create a symbolic link at the root level named installers which points to /Users/Shared/installers, I would do the following:

1. Create the /etc/synthetic.conf file if it didn’t already exist.
2. Add the following entry to the /etc/synthetic.conf file:

1
installers Users/Shared/installers

Screen Shot 2020 01 17 at 10 32 45 PM

3. Reboot the Mac.

Note: Whomever designed this came down on the “tabs” side of the “tabs vs. spaces” debate. When creating the separation between installers and Users/Shared/installers in the /etc/synthetic.conf file, you need to use tabs. If you use spaces instead, the synthetic firmlink won’t be created.

After the reboot, you should see a symbolic link named installers at the root level of the boot volume. When you navigate to it, you should see the contents of /Users/Shared/installers.

Screen Shot 2020 01 17 at 10 33 30 PM

To remove the symbolic link, remove the relevant entry from /etc/synthetic.conf and then restart. After the reboot, the installers symbolic link should be missing from the root level of the boot volume.

Screen Shot 2020 01 17 at 10 46 15 PM

For more information, please see the synthetic.conf man page. This is available by entering the following command in Terminal on macOS Catalina:

man synthetic.conf,可以看到内容大致这样:

SYNTHETIC.CONF(5) BSD File Formats Manual SYNTHETIC.CONF(5)

NAME
synthetic.conf

SYNOPSIS
synthetic.conf -- synthetic symbolic link and directory manifest

DESCRIPTION
synthetic.conf describes virtual symbolic links and empty directories to
be created at the root mount point. Because the root mount point is read-
only as of macOS 10.15, physical files may not be created at this loca-
tion. All writeable paths must reside on the data volume, which is
mounted at /System/Volumes/Data.

synthetic.conf provides a mechanism for some limited, user-controlled
file-creation at /. The synthetic entities described in this file are
synthesized by the kernel during early system boot. They are not physi-
cally present on the disk, but when the system is booted, they behave as
if they were within certain parameters.

synthetic.conf is intended to be used for creating mount points at /
(e.g. for use as NFS mount points in enterprise deployments) and symbolic
links (e.g. for creating a package manager root without modifying the
system volume). synthetic.conf is read by apfs.util(8) during early sys-
tem boot.

FORMAT
synthetic.conf specifies a single synthetic entity per line. Each line
may have one or two columns, separated by a tab character. If a line has
a single column, it denotes a virtual empty directory to be created at /.
If a line has two columns, it denotes a symbolic link at / whose link
target is given in the second column.

In either case, the first column denotes the name of the entity to be
created at /.

A line beginning with the # character indicates a comment that is not
parsed.

SYNTHETIC ENTITIES
Synthetic entities may not be deleted at runtime. In order to delete a
synthetic entity, it must be removed from synthetic.conf, and the host
must be rebooted.

New files and directories may not be created within a synthetic empty
directory.

EXAMPLES
# create an empty directory named "foo" at / which may be mounted over
foo

# create a symbolic link named "bar" at / which points to
# "System/Volumes/Data/bar", a writeable location at the root of the data volume
bar System/Volumes/Data/bar

# create a symbolic link named "baz" at / which points to "Users/me/baz"
baz Users/me/baz

FILES
/etc/synthetic.conf

SEE ALSO
apfs.util(8) shutdown(8) reboot(2)

Darwin/macOS 2 July 2019 Darwin/macOS
参考 一下上面的内容,可以简单的试用一下。其实还行吧。(如果图片看不到。。就忍忍吧。)
---------
说白了就是几个事
1、在/etc目录下建一个 synthetic.conf 文件
2、设定的权限是:root 读写 wheel 读 everyone 读 ,权限值为:644
3、每行一条记录,目录名和目标引用的目录
比如你要在根目录下映射 一个 server,对应的是 /Users/gouki/Desktop,那就直接: server /Users/gouki/Desktop 就完事了
4、重要:改完得重启。。。。
--EOF
说白了,现在不支持根目录下的ln了。只能通过这个办法。如果有特别需要就试试吧。。。
----
::划重点::
1、权限是644
2、两个目录之间的间隔用tab,不是空格。原例子里用的是nano编辑 ,我用vim编辑的时候,tab居然无法输入(崩溃 )
3、对应的目录前好象不需要 /
4、多测试几次吧。我重启了三次才搞定
用pm2管理frpc

用pm2管理frpc

原来我的frpc是用supervisor来管理的。但不得不说的是,mac上面的supervisor真心不稳定。挂了重启还是会失败。

每次一失败,我都得跑上几十公里,去启动一下。。。于是这次尝试了用pm2来管理着看看,还算比较方便:
npm install -g pm2
pm2 start -x './frpc' -n frp -- -c /xxx/frp/frpc.ini
-x 是指定运行的文件
-n 是在pm2 status中显示的名称
-- 之后的是 ./frpc的参数 (最好是绝对路径)
运行如果没有报错,用pm2 status看一下就知道了。希望这样能够坚持长久一点
mac下为什么没有右键打印?

mac下为什么没有右键打印?

如题,windows就有这个功能。虽然是快速打开然后关闭。但好歹不需要等来等去的啊

因为是PDF,所以上一篇的内容就派上用场了。。。
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.1字母表示数学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.2代数式学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.3代数式的值学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.4整式学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.5合并同类项学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.6整式的加减学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.7同底数幂的乘法学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.8幂的乘方学案.pdf
gouki@gouki 第九章学案 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.9积的乘方学案.pdf
gouki@gouki 第九章学案 % cd ../第九章作业
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.1字母表示数作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.2代数式作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.3代数式的值作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.4整式作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.5合并同类项作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.6整式的加减作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.7同底数幂的乘法作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.8幂的乘方作业.pdf
gouki@gouki 第九章作业 % lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` 9.9积的乘方作业.pdf
嗯。没有用for in ,想着不多。。。其实还是应该可以用一下for in 或者 find . |exec 之类的

mac下实现命令行打印文件

最近全部改成电子上课,老师发课都在微信群里,说实话。真的挺烦。群里 也是各种聊天不止,怎么办?

最无耻的办法,将,只要是老师发的话,全部打印出来(嗯,超过20个字以上的。。。),但我怎么知道谁是老师呢?用wechaty pad版,针对指定群接收消息,或者无所谓,判断是否是群消息,同时发消息的人是谁(这个可以初期就记录下,并存储起来)
然后将文字的话,存成txt文件。调用命令行打印。
如果老师发的是pdf,嗯。不用担心,也能直接打印。
如果老师发的是图片,嗯?这个,能够直接打印
如果老师发的是word?嗯,这个。。。也打不了。。。
于是现在命令问题(原来字打错了)来了,只要老师发的是word(其实老师不用苹果,也不会有pages,事实上pages也不能直接打印),就没法打印,怎么办?网上有word2pdf的程序,先将word转成pdf再打印就OK了。
OK,那怎么打印呢?在mac下面其实很简单?
lpr -P`lpstat -v|awk '{print $3}'|head -1|awk 'BEGIN{FS=":"} {print $1}'` ~/Desktop/xxx.txt
上面是两个方法的信合,lpstat是获取当所有的打印机,取第一条默认的。。。然后用【lpr -P打印机名 要打的文件】,直接打印。
------
——EOF——
上面都是理论情况,实际上,我的pad plus已经过期了。
1、因为要200一个月,但我还没有完整的基于他开发,所以就暂废了
2、上面的打印其实浪费了不少纸。更关键的是,其实有些群我没有加,而且老师有时候发作业是通过【晓黑板】等第三方程序。那我基于他开发的意义就失去了
所以,做个记录吧。就当记录一下,打印机是怎么调用的吧。。。。
2年不到,掉了1000的电池容量了

2年不到,掉了1000的电池容量了

mac下运行ioreg -rn AppleSmartBattery | grep -i capacity

可以得到:
"AppleRawCurrentCapacity" = 6392

"AppleRawMaxCapacity" = 6452

"MaxCapacity" = 6452

"CurrentCapacity" = 6392

"LegacyBatteryInfo" = {"Amperage"=18446744073709551590,"Flags"=5,"Capacity"=6452,"Current"=6392,"Voltage"=12923,"Cycle Count"=94}

"DesignCapacity" = 7336

"BatteryData" = {"StateOfCharge"=100,"PMUConfigured"=0,"Voltage"=12930,"QmaxCell1"=7165,"AdapterPower"=1109165984,"SystemPower"=1108102207,"ResScale"=220,"QmaxCell2"=7161,"QmaxCell0"=7192,"CycleCount"=94,"DesignCapacity"=7336}
设计容量 7336,现在只有 6392了。。。2年不到,掉了1000了。。。不知道还能再战多久

iOS 9.3.5 环境安装微信

iOS 9.3.5 环境安装微信

最近的项目是基于VUE开发的,但总有用户说不正常,询问下来是因为使用ipad 2,ios 9.3.5。为此,从闲鱼买了个ipad mini。结果下载微信的时候说不兼容。最后,只能从Appstore的“更新”-“已购项目”找到微信,点击右边的云下载图标。系统会弹出“你要下载最新的兼容版本吗?该版本的“微信”与此设备不兼容。”的对话框,点击“下载”。这样就会在手机上下载最新的兼容当前手机环境的微信版本了。

后记:安装了也打不开。。。提示微信版本过低。

真是纠结

navicat 报错: unable to load key

navicat 报错: unable to load key

navicat的版本比较老了。在加载ssh的pub key时报这个错。开始的时候不知所r措,因为这个private key确实可以用来登录服务器。而且navicat也能够加载以前的private key,那么问题只有一个:文件有问题

打开能LOAD的文件和当前文件对比了一下,发现无法加载的这个文件,第一句话是:BEGIN OPENSSH PRIVATE KEY, 而能够正常加载的是BEGIN RSA PRIVATE KEY。

原来,现在的ssh-keygen默认创建的已经是新的格式的文件,而我的navicat太老。还不支持新的。。。(为什么不用新的navicat ? 1、太穷 2、新版居然没有 cmd + . 来关闭当前连接。。。。。好不爽!)

找到问题,那就好办了。。。问一下百度怎么办,找到的国内的介绍都用puttygen.exe来修改。。果然外事不决还得问google。果然立刻找到了 strackoverflow上,就有人说了,超级方便的命令:ssh-keygen -p -N "" -m pem -f /path/to/file

以防万一的话,你还是先备份一下吧。。。当然我是解决了,也能够登录了。赶紧喝杯啤酒压压惊

为什么微信开发者工具一直调用独显?

为什么微信开发者工具一直调用独显?

出门在外,如果没有带电源,请不要随便打开微信开发者工具,因为你一打开它,默认就帮你使用独显了。

也一直很纳闷,不就开发小程序或者公众号网页么,怎么就开独显了呢?搜了搜网上的贴子,然后也自己打开“活动监视器”,在能耗里,将微信开发者工具的进程展开,发现启动了很多wechatwebdevtools Helper,但就是有一个调用了独显,再展开,发现里面调用了 VTDecoderXPCService ,如果从来没有播放过视频,那就直接将这一整个helper退出吧(应该没啥事,反正我退了也真出啥事),退出 时,窗口界面会整体刷新一次【好象也没啥哦】

真要出事了,重启这个程序呗,但至少,你不用独显了,至少可以省上几小时的电。。