惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
C
Cisco Blogs
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Cloudflare Blog
小众软件
小众软件
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss
博客园 - Franky
F
Fortinet All Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
G
Google Developers Blog
Recent Announcements
Recent Announcements
I
InfoQ
T
Threat Research - Cisco Blogs
V
V2EX
T
Tenable Blog
H
Help Net Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The GitHub Blog
The GitHub Blog
P
Privacy & Cybersecurity Law Blog
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
Docker
T
Tor Project blog
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
H
Heimdal Security Blog
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Martin Fowler
Martin Fowler
AWS News Blog
AWS News Blog
IT之家
IT之家
Google DeepMind News
Google DeepMind News
NISL@THU
NISL@THU
Google Online Security Blog
Google Online Security Blog
Vercel News
Vercel News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
SecWiki News
SecWiki News
GbyAI
GbyAI
P
Proofpoint News Feed
月光博客
月光博客
Schneier on Security
Schneier on Security

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN Mintty Tips and Configurations Generating Table of Contents for Markdown with Tagbar Convert Python Script to Exe on Windows with Pyinstaller Ubuntu on Windows Missing after Windows Update 使用代理加速 Mac 终端下载速度 My Experience with Several Zsh Plugin Managers 深圳租房小记 How to Install zplug inside Docker Container Why don't settings inside bashrc or bash_profile take effect? Setting Up Locale in Linux 谷歌 Adsense 申请及在 Hugo 中的配置 How to Write Algorithm Pseudo Code in LaTeX Nifty Nvim Techniques That Make My Life Easier -- Series 4 A Few Grammar Questions in Writing How to Read and Write Images with Unicode Paths in OpenCV Creating A Professional Table in LaTeX with booktabs How to Create Proper Folding for Vim/Nvim Configuration Linux Tips and Tricks -- s1 JPEG Image Orientation and Exif How Do I Show the Current File Path In Neovim? JPEG Image Quality in PIL Difference between view, reshape, transpose and permute in PyTorch Convert PIL or OpenCV Image to Bytes without Saving to Disk Fast Movement and Navigation Inside Vim or Neovim Unintuitive Behaviour of Case Sensitivity in Python glob Binding Keys in Zsh 几把机械键盘试用体验 Nvim Autocompletion with Deoplete Converting Markdown to Beautiful PDF with Pandoc Exclusive and Inclusive Motion in Neovim/Vim Nifty Nvim Techniques Which Make My Life Easier -- Series 3 Why Doesn't Jedi Autocompletion Work for Some Methods Vim-like Editing inside Browser Markdown 生成 HTML 时汉字之间出现多余空格问题 小米 9 安装谷歌商店(Google Play Store)与相关配置 Create Mappings That Take A Count in Neovim Spell Checking in Nvim English Words Completion inside Neovim/Vim How to Use Python Inside Vim Script with Neovim Nifty Little Nvim Techniques to Make My Life Easier -- Series 2 Setting up Ultisnips for Neovim Mac 上罗技 M590 鼠标设置 Nifty Little Nvim Techniques to Make My Life Easier -- Series 1 A Complete Guide on Writing LaTeX with Vimtex in Neovim Manipulating Images with Alpha Channels in Pillow Sublime Text Regular Expression Cheat Sheet Cropping Rotated Rectangles from Image with OpenCV Boosting Your Productivity on Terminal with Zsh and Plugins 最新版 Rime 输入法使用 (2022 更新) Display Image with Pillow inside Ubuntu on Windows Faster Directory Navigation with z.lua Cmder Advanced Configurations Nvim-qt Settings on Windows 10 Tmux Plugin Install and Management How to Debug Python Code in Terminal Markdown Writing and Previewing in Neovim -- A Complete Guide Line Number Settings for More Efficient Movement in Neovim 两个大规模中文语料库介绍以及处理 Windows 系统下几款程序员不可不用的神器 我的 2018 阅读清单 A Complete Guide to Neovim Configuration for Python Development How Is Newline Handled in Python and Various Editors? Two Issues Related to ImageFont Module in PIL 在 Listary 中调用 GoldenDict 或欧路词典查单词 Reading and Writing Text Files on Windows The Mathematics behind Font Shapes --- Bézier Curves and More 快速识别图片字体:字体识别工具介绍 Deoplete Failed to Load at Startup after Updating Python neovim Package What Is The Difference between pip, pip3 and pip3.6 Shipped with Anaconda3? Windows 10 系统下 Neovim 安装与配置
博客图床从七牛云存储迁移到腾讯云存储
2018-10-20 · via jdhao's digital space

去年建立博客的时候,选择了七牛对象存储来存放博客的图片,最近收到了七牛的邮件,之前一直在用的域名只是一个测试域名,再过一阵就要回收了,到时必须使用自己的域名。大概看了一下,申请自己的域名还要涉及注册和备案,我仅仅是需要存储图片,这样太费周章,所以决定把博客的图片从七牛迁移出来。

经过一番查找比较,最后决定使用腾讯云的对象存储 COS,由于我的图片量很少,所以就算付费,每个月实际的支出也不会太大。本文介绍图片迁移过程。

从七牛 bucket 下载图片#

七牛提供了命令行工具qshell 来对七牛存储进行操作,我们可以利用这个工具把 bucket 里面的图片全部下载到本地。对于 Mac 系统,下载以后解压文件,qshell_darwin_x64 即为可执行文件,为了方便后续操作,先建立 qshell 软链接,指向实际的可执行程序:

chmod u+x qshell_darwin_x64
ln -s qshell_darwin_x64 qshell

然后配置自己的账户:

<AK><SK> 分别是自己的 access key and secret key,可以从七牛账户的个人面板的 密钥管理 模块查看。

qshell 提供了一个 qdownload 功能,可以批量从 bucket 下载图片,但是该功能的下载流量默认是收费的,如果想要免费,建立配置文件 qdownload.conf,一个示例配置内容如下:

{
    "dest_dir"   :   "/Users/jdhao/Documents/qiniu_bucket_files",
    "bucket"     :   "github-pages-image-storage",
    "prefix"     :   "",
    "suffixes"   :   "",
    "cdn_domain" :   "olvlcptdv.bkt.clouddn.com",
    "referer"    :   "",
    "log_file"   :   "download.log",
    "log_level"  :   "info",
    "log_rotate" :   1,
    "log_stdout" :   false
}

dest_dir 填写下载的图片存放路径,确保路径存在;bucket 填写你在七牛建立的 bucket 的名称;cdn_domain 填写七牛给的测试域名;其他信息可以不用填写。

配置文件填写好以后,使用下面命令下载 bucket 里面所有图片:

qshell qdownload qdownload.conf

程序运行结束以后,所有的图片就被下载到了指定的目录下面。

设置腾讯云对象存储#

注册腾讯云,然后在对象存储里面建立一个存放博客图片的 bucket,注意权限要设置为「公有读私有写」1,这样别人访问博客的时候,才能看到图片。

然后把刚才下载的图片全部上传到这个 bucket 里面,可以批量拖拽上传。值得注意的是,如果七牛 bucket 下有文件夹,那么拷贝到腾讯云,也要保持文件夹结构,否则替换到腾讯的域名以后图片将无法访问。

替换原有的图片中七牛域名#

接下来,使用命令行工具或者带有正则表达式的编辑器,批量替换所有博客源代码中图片的地址,把七牛云的测试域名,替换为腾讯云存储提供的域名。创建的 bucket 的访问域名可以点击「基础配置」一栏,「基本信息」部分有域名信息。

另外,如果之前使用七牛时候使用了图像处理操作,原有图片链接中的图像操作部分也应该去掉。

图片上传工具#

找了一圈,支持上传到腾讯云存储的有两个不错的程序,一个是iPic,另外一个是PicGo。iPic 免费版只能使用新浪微博图床,要使用其他图床,需要付费版,每年 $9.9,个人觉得太贵,不值这么多,所以放弃。PicGo 支持腾讯云,并且免费,正好满足需要。

具体配置可以参考官方wiki。可以直接拖拽图片到 PicGO 的菜单栏图标实现图片上传,或者如果已经把图片拷贝到剪切板,使用默认的 Command + shift + P 快捷键上传图片,当然快捷键可以根据自己需求修改。

腾讯云对象存储配置 CDN#

如果直接使用腾讯云对象存储提供的图片 URL,每个月的流量费还是比较贵的,强烈建议搭配腾讯云提供的 CDN,能够减少流量费用支出。具体配置方法见 这里