plan migrate my blog to github https://github.com/digoal/blog

简介:
网易的博客越来越不给力了,访问速度慢,而且技术文章经常被莫名其妙的封掉。准备迁移到github,用markdown格式保存(或者大家有没有其他更好的建议?)。

新的地址如下:

由于历史文章比较多,迁移起来还挺费事,先把html和xml搬过去,HTML先转换为txt,图片以及附件链接还有点问题。
后续再统一生成markdown。

导出blog html.zip (需要会员)

解压,文件名的前8位是yyyymmdd,所以可以按月来分目录。
-rw-r--r--. 1 root root  63323 Aug  2 17:27 20150723180657.html
-rw-r--r--. 1 root root  21680 Aug  2 17:27 20150730171400.html
-rw-r--r--. 1 root root   1864 Aug  2 17:27 20150731225341.html
-rw-r--r--. 1 root root  29882 Aug  2 17:27 20150802163937.html


下载安装w3m, pandoc(可用于转换html到markdown格式)
# yum localinstall --nogpgcheck https://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum search all pandoc
# yum install -y pandoc
# yum install -y w3m


对文件归类
# vi test.sh 

#!/bin/bash
for i in `ls /opt/soft_bak/blog/html/*.html`
do
  filename=`echo $i|awk -F '/' '{print $6}'|awk -F '.' '{print $1}'`
  echo $filename
  dirname=`echo $filename|awk '{print substr($1,1,6)}'`
  echo $dirname
  mkdir -p /tmp/blog/blog_html_backup/$dirname
  mkdir -p /tmp/blog/blog_txt_backup/$dirname
  cat $i|w3m -dump -cols 320 -T text/html > /tmp/blog/blog_txt_backup/$dirname/${filename}.txt
  cp $i /tmp/blog/blog_html_backup/$dirname/
done

调整一下index.html和index.txt的位置.


上传到github

生成并上传ssh key
验证
ssh -v git@github.com


cd ~/
git clone https://github.com/digoal/blog.git
cd ~/blog
cp -r /tmp/blog/* ~/blog/
git remote add blog git@github.com:digoal/blog
git pull blog master
git add .
git commit -m 'backup digoal 163 blog'
git push blog master

[参考]
1. https://progit.org/
2. http://iissnan.com/progit/
3. http://markdownpad.com/download.html
目录
相关文章
完美解决 fatal: unable to access ‘https://github.com/Homebrew/brew/‘
完美解决 fatal: unable to access ‘https://github.com/Homebrew/brew/‘
2089 0
|
4月前
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
2149 0
|
开发工具 git
github clone Failed to connect to github.com port 443 after xxx ms
github clone Failed to connect to github.com port 443 after xxx ms
1414 2
|
Shell 网络安全 开发工具
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
|
开发工具 git
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
2074 1
|
Linux 开发工具 git
【开发专题_03】unable to access ‘https://github.com/deviantony/docker-elk.git/‘: Failed connect to github
【开发专题_03】unable to access ‘https://github.com/deviantony/docker-elk.git/‘: Failed connect to github
300 2
|
网络虚拟化
解决方案:Github Failed to connect to github.com port 443 after 21224 ms: Timed out
解决方案:Github Failed to connect to github.com port 443 after 21224 ms: Timed out
426 0
|
Windows
Windows【工具 01】视频下载工具BBDown.exe详细使用说明(https://github.com/nilaoda/BBDown)mp4格式无法识别问题处理(最新版本1.6.1网盘分享)
Windows【工具 01】视频下载工具BBDown.exe详细使用说明(https://github.com/nilaoda/BBDown)mp4格式无法识别问题处理(最新版本1.6.1网盘分享)
1242 0
【Error】fatal: unable to access ‘https://github.com/PanJiaChen/vue-element-admin/‘: OpenSSL SSL_read:
【Error】fatal: unable to access ‘https://github.com/PanJiaChen/vue-element-admin/‘: OpenSSL SSL_read:
|
域名解析 网络协议 Windows
github:网址为 https://github.com/ 的网页可能暂时无法连接,或者它已永久性地移动到了新网址
github:网址为 https://github.com/ 的网页可能暂时无法连接,或者它已永久性地移动到了新网址
2195 0