clang 跨平台编译 iOS/macOS arm64/x86_64
May 19, 2021
Target 不同的目标平台对应不同的 -target $triple 参数: iOS 平台: armv7:-target arm64-apple-darwin arm64:-target armv7-apple-darwin macOS 平台: i386:-target i386-apple-macos x86_64:-target x86_64-apple-macos …
从包含多架构的 framework 生成 xcframework
May 06, 2021
xcframework 是多个 framework 的集合,它是一个包含有多个 framework 的文件夹。 以腾讯云的 ImSDK 为例演示如何生成 ImSDK.xcframework。 ImSDK.framework 里包含了 3 种架构:armv7 arm64 x86_64,分别对应真机和模拟器。 …
使用 -l 链接时,如何确定链接动态库还是静态库
Apr 25, 2021
比如:-lssl 是链接到 libssl.a 还是 libssl.so? 由编译参数决定: -Wl,-static,静态链接。 -Wl,-dynamic,动态链接。 如果动态库和静态库混乱链接,加上 -search_paths_first。 …
Shell 脚本获取微信登录二维码
Apr 21, 2021
生成二维码需要先获取 sdk_ticket,获取方法参考: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140183 https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Login/Login_via_Scan.html 根据官方的文档描述,得到 sdk_ticket 后,计算出签名,然后发起 GET 查询,就可以得到登录的二维码(Base64)。 …
FreeBSD 入门笔记
Apr 19, 2021
配置 sudo root 用户权限最高,除非必要情况,日常维护和使用应该使用普通用户帐号。 系统默认不提供 sudo 命令,需要使用 root 用户自行安装: pkg install sudo 创建一个普通用户(用户名 v),默认添加到 staff 分组: …
在 Linode 上安装 FreeBSD
Apr 17, 2021
Linode 作为全球知名到主机服务商,官方提供的服务器系统只有 Linux,想要尝试 FreeBSD 系统只能自己安装。 FreeBSD 13.0 可以在这里下载:https://www.freebsd.org/where/ …
iOS 7.0.4 evasi0n 越狱
Apr 09, 2021
因为 evasi0n.com 已经不提供服务了,在越狱的时候会提示无法获取包信息: 修改 hosts 同管理员权限打开命令行(cmd): 修改 host notepad %windir%\system32\drivers\etc\hosts : 127.0.0.1 evasi0n.com 127.0.0.1 cn2.evasi0n.com 创建本地 HTTP 服务器 用记事本创建一个名称为 apple-ipa-info.plist 的文件,内容如下: …
在虚拟机里安装 FreeBSD
Apr 08, 2021
环境是 macOS + Parallels Desktop 到 freebsd.org 下载目前最新的发行版本 FreeBSD-12.2-RELEASE-amd64-disc1.iso 创建一个虚拟机,类型指定为 FreeBSD: 点击完成,虚拟机就自动开机了,先手动停止虚拟机,在启动顺序里,添加引导标记参数 vm.bios.efi = 1: …
Ubuntu 设置系统时区
Mar 29, 2021
最简单直接的方法: timedatectl set-timezone Asia/Shanghai 传统方法: tzselect 按提示逐步操作: Please identify a location so that time zone rules can be set correctly. Please select a continent, ocean, "coord", or "TZ". 1) Africa 2) Americas 3) Antarctica 4) Asia 5) Atlantic Ocean 6) Australia 7) Europe 8) Indian Ocean 9) Pacific Ocean 10) coord - I want to use geographical coordinates. 11) TZ - I want to specify the timezone using the Posix TZ format. #? 4 Please select a country whose clocks agree with yours. 1) Afghanistan 18) Israel 35) Palestine 2) Armenia 19) Japan 36) Philippines 3) Azerbaijan 20) Jordan 37) Qatar 4) Bahrain 21) Kazakhstan 38) Russia 5) Bangladesh 22) Korea (North) 39) Saudi Arabia 6) Bhutan 23) Korea (South) 40) Singapore 7) Brunei 24) Kuwait 41) Sri Lanka 8) Cambodia 25) Kyrgyzstan 42) Syria 9) China 26) Laos 43) Taiwan 10) Cyprus 27) Lebanon 44) Tajikistan 11) East Timor 28) Macau 45) Thailand 12) Georgia 29) Malaysia 46) Turkmenistan 13) Hong Kong 30) Mongolia 47) United Arab Emirates 14) India 31) Myanmar (Burma) 48) Uzbekistan 15) Indonesia 32) Nepal 49) Vietnam 16) Iran 33) Oman 50) Yemen 17) Iraq 34) Pakistan #? 9 Please select one of the following timezones. 1) Beijing Time 2) Xinjiang Time #? 1 The following information has been given: China Beijing Time Therefore TZ='Asia/Shanghai' will be used. Selected time is now: Mon Mar 29 12:53:57 CST 2021. Universal Time is now: Mon Mar 29 04:53:57 UTC 2021. Is the above information OK? 1) Yes 2) No #? 1 You can make this change permanent for yourself by appending the line TZ='Asia/Shanghai'; export TZ to the file '.profile' in your home directory; then log out and log in again. Here is that TZ value again, this time on standard output so that you can use the /usr/bin/tzselect command in shell scripts: Asia/Shanghai 最后设置系统时区: …
备份和恢复 Docker 镜像
Mar 28, 2021
备份 Image docker save nginx | gzip > nginx.tar.gz 恢复 Image gunzip --stdout nginx.tar.gz | docker load 官方参考资料 https://docs.docker.com/engine/reference/commandline/load/ https://docs.docker.com/engine/reference/commandline/save/