作者归档:Keystion

使用Rclone把阿里云ECS文件同步到阿里云对象存储OSS

背景

需要把大约 25G 的图片、视频文件同步到阿里云对象存储OSS。

解决方案

1、安装 Rclone

> curl https://rclone.org/install.sh | sudo bash

2、配置 Rclone

> rclone config

No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

Enter name for new remote.
name> webclown-net

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
 1 / 1Fichier
   \ (fichier)
 2 / Akamai NetStorage
   \ (netstorage)
 3 / Alias for an existing remote
   \ (alias)
 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
   \ (s3)
 5 / Backblaze B2
....
Storage> 4

Option provider.
Choose your S3 provider.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
 1 / Amazon Web Services (AWS) S3
   \ (AWS)
 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
   \ (Alibaba)
 3 / Arvan Cloud Object Storage (AOS)
   \ (ArvanCloud)
 4 / Ceph Object Storage
   \ (Ceph)
...
provider> 2

Option env_auth.
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
Only applies if access_key_id and secret_access_key is blank.
Choose a number from below, or type in your own boolean value (true or false).
Press Enter for the default (false).
 1 / Enter AWS credentials in the next step.
   \ (false)
 2 / Get AWS credentials from the environment (env vars or IAM).
   \ (true)
env_auth> 1

Option access_key_id.
AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
access_key_id> 8888888888888

Option secret_access_key.
AWS Secret Access Key (password).
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
secret_access_key> Xxxxxxxxxxxxxxxxxxxx

Option endpoint.
Endpoint for OSS API.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Global Accelerate
   \ (oss-accelerate.aliyuncs.com)
 2 / Global Accelerate (outside mainland China)
   \ (oss-accelerate-overseas.aliyuncs.com)
 3 / East China 1 (Hangzhou)
   \ (oss-cn-hangzhou.aliyuncs.com)
 4 / East China 2 (Shanghai)
   \ (oss-cn-shanghai.aliyuncs.com)
 5 / North China 1 (Qingdao)
   \ (oss-cn-qingdao.aliyuncs.com)
 6 / North China 2 (Beijing)
   \ (oss-cn-beijing.aliyuncs.com)
...
endpoint> 6

Option acl.
Canned ACL used when creating buckets and storing or copying objects.
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
If the acl is an empty string then no X-Amz-Acl: header is added and
the default (private) will be used.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
   / Owner gets FULL_CONTROL.
 1 | No one else has access rights (default).
....
acl>

Option storage_class.
The storage class to use when storing new objects in OSS.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
 1 / Default
   \ ()
 2 / Standard storage class
   \ (STANDARD)
 3 / Archive storage mode
   \ (GLACIER)
 4 / Infrequent access storage mode
   \ (STANDARD_IA)
storage_class>

Edit advanced config?
y) Yes
n) No (default)
y/n> n

Configuration complete.
Options:
- type: s3
- provider: Alibaba
- access_key_id: 8888888888888
- secret_access_key: Xxxxxxxxxxxxxxxxxxxx
- endpoint: oss-cn-beijing.aliyuncs.com
Keep this "webclown-net" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Current remotes:

Name                 Type
====                 ====
webclown-net        s3

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

Done。接下来是同步命令:

> rclone sync /www/wwwroot/www.webclown.net/uploadfile/202201 webclown-net:webclown-net/uploadfile/202202 --progress --transfers=1
  • –progress:显示进度。
  • –transfers:使用线程上传,根据服务器带宽来配置。

其他:阿里云官方工具ossutil

使用的是「命令行工具ossutil 2.0(预览版)」,同步速度有点慢,均速在 600 kb/s 左右。传到猴年马月了。所以尝试Rclone。

同步命令:

> ossutil cp -r /www/wwwroot/www.webclown.net/uploadfile/202201 oss://webclown-net/uploadfile/202201

链接

  1. Rclone
  2. 阿里云OSS:命令行工具ossutil 2.0(预览版)

导出/备份 iPhone/iPad 照片到电脑

苹果电脑

  1. 打开「 照片.app 」;
  2. 选择照片;
  3. 菜单栏:文件 – 导出 – 导出 n 张照片;
    • 导出照片
  4. 选择导出照片配置
    • 照片
      • 照片种类:HEIC
      • 颜色描述文件:原始状态
      • 大小:实际到小
    • 信息
      • 包括:标题、关键词和说明及位置信息
    • 文件命名
      • 文件名称:使用文件名称
      • 子文件夹格式:无
    • 选择导出照片配置
  5. 导出到指定文件夹
  6. 查看导出进度
    • 导出进度

Windows

可以是用 iTunes 导出。

下载 Windows 版 iTunes – 官方 Apple 支持 (中国)

其他平台(通用方法)

  1. 使用网页端登录
  2. 找到 「照片」,选择照片下载(每次最多可下载1000项,图片为:JPG,视频为:MOV)
    • iCloud 导出图片

HBuilderX – 发布App错误集合

[Error] Provisioning profile doesn’t support the Associated Domains

[Info] begin copyFile files to ipa…
[Info] begin replace files to ipa…
[Info] begin update mobileprovision to ipa…
[Info] begin outPut t_entitlements_full plist file…
[Info] begin outPut outPutEntitlements plist file…
[Info] begin verifyPlistFiles
[Error] Provisioning profile doesn’t support the Associated Domains
[Error] Provisioning profile doesn’t include the com.apple.developer.associated-domains
[Error] verifyPlistFiles failed
[Info] Package make result:Failed. Reason:

错误原因:《Apple Developer Program 许可协议》已更新

登录 App Store Connect 同意《Apple Developer Program 许可协议》,即可

为什么 中文 不 需要 空格

这篇文章探讨了为什么中文不需要空格的原因。主要观点如下:

中文是一种典型的表意书写系统,每个汉字表示一个音节或语素。中文文本由连续的汉字组成,不同的词之间没有用空格分隔。大多数中文词可以用一到两个汉字表示,词长较短且变化较小。因此,中文读者在阅读时容易预测词的长度,从而更快识别词的开始和结束位置,即中文词边界位置的不确定性较小。

中文词边界位置的不确定性较小,无需空格来标记词边界。

相比之下,英语单词往往由多个字母组成,且词长的变化较大,这使得英语读者较难预测每个单词的开始和结束位置,即英语词边界位置的不确定性较大。因此,英语倾向于使用空格以减少词切分的认知负担。

英语词边界位置的不确定性较大,需要空格来标记词边界。


总之,中文和英语采用不同的词边界标记方式,都是为了实现更经济高效的阅读。

原文:为什么 中文 不 需要 空格

ERROR [nuxt] [request error] [unhandled] [500] fetch failed

ERROR [nuxt] [request error] [unhandled] [500] fetch failed

 ERROR  [nuxt] [request error] [unhandled] [500] fetch failed
  at Object.fetch (node:internal/deps/undici/undici:11118:11)  
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)  
  at async sendProxy (./node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1157:20)  
  at async ./node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1962:19  
  at async Object.callAsync (./node_modules/.pnpm/unctx@2.3.1/node_modules/unctx/dist/index.mjs:72:16)  
  at async Server.toNodeHandle (./node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:2249:7)

触发此错误代码

demo.vue

async foo() {
  const resData = await useFetch(`/api/good/1`, {
    method: 'DELETE',
  });
}

nuxt.config.ts

export default defineNuxtConfig({
  nitro: {
    routeRules: {
      "/api/**": {
        proxy: `${env.NUXT_API_URL}api/**`,
      },
  }
}

临时解决方案

把请求方式改为 POST 请求。

async foo() {
  const resData = await useFetch(`/api/good/1`, {
    method: 'POST',
  });
}

网上有说是这些情况:

  1. 代理域名 httphttps 的问题,测试过不是这个问题,和域名无关。
    1. 排查域名请求日志,出现此问题时,请求日志没有记录,说明请求没有到达后端,是前端请求问题。
    2. 尝试改下请求方式,发现 POST 请求正常,DELETE 请求报错,也许是请求方式问题,但是不确定,先临时解决一下。
  2. 降级 h3@1.9.0 版本,降级后,问题依然存在。
  3. 降级 nuxt@3.10.3 版本,降级后,问题依然存在。

参考

  1. 基于nitro的Nuxt3服务端无法请求https,难道是我写错了?
  2. [nuxt] [request error] [unhandled] [500] using proxyRequest or sendProxy · Issue #376 · unjs/h3
  3. Nuxt v3.11.0 proxyRequest in server api routes makes nitro crash if proxy server is down · Issue #26318 · nuxt/nuxt

印象笔记导出Markdown

解决方案

  1. 确认印象笔记版本 9.5.10

  2. 导出笔记:

    1. 方式一:全选笔记导出为 .enex 格式。
    2. 方式二:选择笔记本导出为 .enex 格式。
  3. .enex 格式转换为 .md 格式

    方式一:

    使用 evernote2md 工具将 .enex 格式转换为 .md 格式。

    evernote2md 我的笔记.enex ./output
    

    方式二:yarle

  4. done。

获取印象笔记 9.5.10 版本安装包:

链接:https://pan.quark.cn/s/dc30a92ff0c6

提取码:jVuH

背景

已经不在使用印象笔记有几年,打算把笔记导出来,以备后用(会吗?)。

印象笔记为国内版,国际版为 Evernote。国内版的笔记从 9.5.10 版本之后是无法导出为 .enex 格式的,只能导出 .notes.html 格式,.notes 还是加密的(encoding="base64:aes"),国际版可以正常导出 .enex 格式。 evernote2md 可以将 .notes 格式转换为 .md 格式。

  • 方案1:.notes + evernote2md 🙅
  • 方案2:.html + evernote_move 🙅
  • 方案3:.enex + evernote2md
  • 方案4:.enex + yarle

方案4 yarle 优点,支持导出多种软件使用的Markdown格式(更多),如:

  • Obsidian
  • LogSeq
  • Tana
  • Heptabase

参考

  1. wormi4ok/evernote2md – Github
  2. akosbalasko/yarle – Github
  3. 印象笔记导出格式更新,enex变为notes,恶心行为+1
  4. 印象笔记导出HTML再转markdown的方法_印象笔记导出markdown-CSDN博客

在prettier3项目中替代pretty-quick

解决方案

.husky/pre-commit 中添加以下内容

# 获取暂存区的文件列表
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0

# 美化所有暂存区的文件
echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write

# 将修改/美化的文件添加回暂存
echo "$FILES" | xargs git add

背景

在 prettier v3.x 版本的项目中,使用 pretty-quick 会报错:

.../isSupportedExtension.js:12
  ..._prettier.resolveConfig.sync(file, {
                             ^
TypeError: _prettier.resolveConfig.sync is not a function

可以降低 prettier 版本到 2.x 来解决这个问题,但是项目里面额外使用了 tailwindcss,而 tailwindcss 依赖的 postcss 依赖的 prettier 版本是 3.x,所以降低 prettier 版本不是一个好的解决方案。

参考

  1. Pre-commit Hook · Prettier
  2. pretty-quick will break with prettier v3 · Issue #164 · azz/pretty-quick
  3. Editor Setup – Tailwind CSS
  4. tailwindlabs/prettier-plugin-tailwindcss: A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order.

我使用的快捷指令(iOS,iPadOS,macOS)

平常有用到的一些常用的快捷指令,可以在 快捷指令.app 中打开,并使用。

iOS

iPadOS

macOS

图片、视频

徕卡水印

https://www.icloud.com/shortcuts/3446145a0980480caef78e8a641d49c5

standby快捷指令二维码
徕卡水印

哈苏水印

https://www.icloud.com/shortcuts/cfc0151ba78343e1ab5477cd894c59c9

哈苏水印快捷指令二维码
哈苏水印

Apple水印

https://www.icloud.com/shortcuts/ea6e897570504b28a8f1fb8a3b9306b4

Apple水印快捷指令二维码
Apple水印

阿莱水印

https://www.icloud.com/shortcuts/f89ac598fa9e4483b95e00c5483cf277

阿莱水印快捷指令二维码
阿莱水印

Lumix水印

https://www.icloud.com/shortcuts/6a3b9a3e6e9443c5bde872f62d2a3d97

Lumix水印快捷指令二维码
Lumix水印

蔡司水印

https://www.icloud.com/shortcuts/0d678d51c5f2464c8ca485edafa075ec

蔡司水印快捷指令二维码
蔡司水印

富士水印

https://www.icloud.com/shortcuts/24a69e95508e4ea18f77a1f04106125a

富士水印快捷指令二维码
富士水印

索尼水印

https://www.icloud.com/shortcuts/a38e70a622c14d9abc69afca1a3f6f1b

索尼水印快捷指令二维码
索尼水印

佳能水印

https://www.icloud.com/shortcuts/67801f45a15346fab6674a63012e0900

佳能水印快捷指令二维码
佳能水印

尼康水印

https://www.icloud.com/shortcuts/1a8314cadb874550877cf0caf80b7d0a

尼康水印快捷指令二维码
尼康水印

iPhone水印

https://www.icloud.com/shortcuts/aa0a3c6f879b4a239efed7da72825655

iPhone水印快捷指令二维码
iPhone水印

视频到 GIF

https://www.icloud.com/shortcuts/22693aae57ba4f57af5d1db80ae632a0

视频到GIF快捷指令二维码

 

Bing Wallpaper

获取 bing.com 的壁纸,储存到相册,然后设置为桌面壁纸,结合自动化,实现每日自动更换壁纸

https://www.icloud.com/shortcuts/68ee2f995d9e416e8d8564bbd2f1d331

BingWallpaper快捷指令二维码

压缩图片

https://www.icloud.com/shortcuts/417c2eee095a4ba299b026ffd76eacae

压缩图片快捷指令二维码

截屏

  • macOS 储存到桌面
  • iOS、iPadOS 储存到相册

https://www.icloud.com/shortcuts/73bf300bb15b42da97eaf690c231aa15

截屏快捷指令二维码

 

 

 

 

 

 

最开始是在 mac 上使用,想要截取APP切换界面,电脑上出现这个界面之后就没办法再去按截屏键,然后想通过Siri语音触发这个快捷指令,然后实现了截屏

macOs Sonoma command + tab 无法切换窗口

其他

扫一扫

https://www.icloud.com/shortcuts/6558c55151a147f0923072a1db3202c8

扫一扫快捷指令二维码

 

定位解析

https://www.icloud.com/shortcuts/44516645ba2340709b6851100fef103c

🕰️ 时间:2023年10月26日 18:53:10
📍 位置:北京市xxx路

🌏 坐标:北纬 39°00′00.00″ 东经 116°00′00.00″
⛰️ 海拔:40.939米

定位解析快捷指令二维码

 

手电筒闪烁

https://www.icloud.com/shortcuts/b422552335774500bdac786c8db605ba

手电筒闪烁快捷指令二维码

standby

https://www.icloud.com/shortcuts/09f757ff0c1a4dc98728d87b25ca9605

结合自动化,实现定时息屏

standby快捷指令二维码

 

更多推荐

可疑邮件:企业网址域名通知函

起因

最近帮朋友维护公司相关网站,有个域名即将到期,不准备续费了,让帮忙把域名下的服务转移到另一个网站。

然后去阿里云域名服务里面查看该域名的信息,还有 200 多天过期,但是看 ESC、虚拟主机 实例里面都没有该域名解析对应的 IP。追问情况下,对方发给一张截图,说最近公司收到了这个通知函。

企业网址域名通知函

然后再仔细看图片就不太对了,域名不正常、续费价格不正常、续费年限都不对。

正常续费价格:

  • 首次购买和续费 价格一样
  • 白金域名(短域名或品牌域名),首次购买和续费均有溢价
  • 其他情况,首次购买有溢价,续费正常价格

续费年限:1-10 年 均可以续费,并不是5、10年限制

结果

抱着试试看的态度,搜索了一下「企业网址域名通知函 可疑邮件」,

企业网址域名通知函 可疑邮件 搜索结果

如果你尝试联系对方,微信对方不加,电话联系,非常热情。

参考