博客使用mina部署了,之前从编写到发布要打好几命令,而且还要登录的EC2上,执行的命令比较多

有以下几个问题

  • 每次发布产生的新版本./release/xxx,文件的生成时间更新为当前时间
  • 这造成了每次向S3同步的时候,都会同步所有文件,因为本地文件的时间戳已经改变,这样会使本来没有发生更改的文件也会被再次同步一次,浪费了拉取数据的次数

require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv'  # for rbenv support. (https://rbenv.org)
# require 'mina/rvm'    # for rvm support. (https://rvm.io)

# Basic settings:
#   domain       - The hostname to SSH to.
#   deploy_to    - Path to deploy into.
#   repository   - Git repo to clone from. (needed by mina/git)
#   branch       - Branch name to deploy. (needed by mina/git)

set :application_name, 'yourapp'
set :domain, 'hostname'
set :deploy_to, 'deploy_path'
set :repository, 'git@...'
set :branch, 'master'

# Optional settings:
  # set :user, 'Username'          # Username in the server to SSH to.
  # set :forward_agent, true     # SSH forward_agent.
  # set :port, '30000'           # SSH port number.

# shared dirs and files will be symlinked into the app-folder by the 'deploy:link_shared_paths' step.

# set :shared_dirs, fetch(:shared_dirs, []).push('somedir')

# 要保证项目文件夹里有config文件夹,否则不能建立ln目标文件
# set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml')

# This task is the environment that is loaded for all remote run commands, such as
# `mina deploy` or `mina rake`.
task :environment do
  # If you're using rbenv, use this to load the rbenv environment.
  # Be sure to commit your .ruby-version or .rbenv-version to your repository.
  # invoke :'rbenv:load'

  # For those using RVM, use this to load an RVM version@gemset.
  # invoke :'rvm:use', 'ruby-2.2.4@default'
end

# Put any custom commands you need to run at setup
# All paths in `shared_dirs` and `shared_paths` will be created on their own.
task :setup do
  # command %{rbenv install 2.3.0}
end

desc "Deploys the current version to the server."
task :deploy do
  # uncomment this line to make sure you pushed your local branch to the remote origin
  # invoke :'git:ensure_pushed'

  # 自定义本地要执行的任务 :local/:remote
  run(:local) do
    invoke :'hexo:generate'
    invoke :'hexo:deploy'
  end

  # 加入本地ssh-key到ssh-add代理,以便远程主机有权限拉取代码
  run(:local) do
    command %{ ssh-add ~/.ssh/id_rsa}
  end


  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.

    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    # invoke :'bundle:install'
    # invoke :'rails:db_migrate'
    # invoke :'rails:assets_precompile'
    invoke :'deploy:cleanup'

    on :launch do
      in_path(fetch(:current_path)) do
        # command %{mkdir -p tmp/}
        # command %{touch tmp/restart.txt}
        # 这里必须有可以执行的代码,否则运行时出错,没有代码要执行可以注释掉整个代码块
      end
    end
  end

  # you can use `run :local` to run tasks on local machine before of after the deploy scripts
  # run(:local) { touch 'hello.txt'}
end

# custom task
namespace :hexo do
  desc "genarte hexo posts"
  task :generate do
    def hexo_generate
      puts "Geginning generate posts"
      command %{ hexo g }
    end
    hexo_generate
  end

  desc "deploy hexo posts"
  task :deploy do
    def hexo_deploy
      puts "Deploying posts to git"
      command %{ hexo d }
    end
    hexo_deploy
  end

end
# For help in making your deploy script, see the Mina documentation:
#
#  - https://github.com/mina-deploy/mina/tree/master/docs

How to stop time: kiss

How to travel in time: read

How to escape time: music

How to feel time: write

How to release time: breathe ​​​​

以下几个事

  • 7月4日:出的最多的一次汗,瑜伽垫上都不止是湿透了,而是出水了 ​​​​
  • 7月1日:不要认为早上你能想起所有该做的事来,你总会忘记一两件
  • 6月30日:受到土豪一万点暴击

第一次洗牙,激动,高兴,就像买了新鞋一样。其实早就想洗,一直没去。医生说后槽牙长了一颗智齿,挤到前面的牙,建议拔掉,我一直以为这颗牙要坏了,刷牙时流血,有时候还疼,原来是智齿闹的。也刚知道正常情况下有28颗牙,上下左右各7颗。多出来的叫智齿,长在最后一颗牙的后面,所以最多有32颗牙齿

You are amazing,
Unique & beautiful.
There is nothing
more you need to be,
Do or have in
order to be happy.
You are perfect
just as you are.
Yes, really. So smile,
Give love & enjoy
every moment of
this precious life. ​​​

把Kindle降级了,降到刚入手时的版本,果然恢复神速了!付出的代价就是不能使用Amazon的服务了~简单说就是你不能再为设备添加新书了,原因是Amazon不为低版本固件提供服务。解决方法是先发送到电脑(需要先选择注册的设备,当然是选Kindle),再USB到设备,所以千万不要把你的设备注销或登出账号

开始降级

准备工作

  • 设备: kindle Pagewhite 一代
  • 固件: update_kindle_5.3.5.bin
  • 备份: documents文件夹

降级过程

  1. kindle连接电脑,update_kindle_5.3.5.bin复制到kindle设备的根目录下
  2. 按住电源键30秒,直到出现重启画面。这个过程保持数据线连接电脑,不要拔掉。如果30秒后还没有反应,可以松开手,或观察电源指示灯是否息灭,如果息灭,可以松手,这时应该也可以进入重启画面
  3. 等待自动更新完毕,查看固件版本为5.3.5,降级成功

关于固件

在网上搜索你要降级到的版本即可,本博降级的版本是刚入手时的 5.3.5,目前一代最新是5.6.1.1版,KP一代运行起来很卡

关于降级
网上有说降级后变砖的,无法降级,本博没有遇到,本博只在kindle Pagewhite 一代上进行了降级,尚不清楚其它版本能否成功降级

如何查看固件版本

  1. 在主页点击右上角三个横线图标
  2. 在弹出窗口点击设备信息
  3. 弹出窗口上显示有固件版本号

降级后可能遇到的问题

  1. Amazon的服务不能使用了
  • 带来的影响是你不能为设备添加新书了(所以降级前最好把你要看的书都下载),解决方法前文已经提到
  • 要是你不小心把账号从设备上注销或是Reset了设备,是没有办法从降级的设备绑定账号的,Amazon会拒绝注册你的账号,这样也就无法使用上文提到的USB大法了,唯一解决的方法是你只能先升级到最新版,绑定账号后再降回来。
  1. 又自动升级了
    网上说是在kindle根目录建立update.bin.tmp.partial文件夹,可以起到禁止自动更新的作用,本博没有试

  2. 书的封面不显示
    可能你没有连网,连网后过一会就会更新

  3. 书中的图片不显示
    只能重新下载这本书了

Kindle降级

之前喜欢的主题忘记备份找不见了,是一个游戏的截图,之后去网上找了半天也没有找到一摸一样的,毕竟是截图,不好找到一样的,最终找到两张差不多的,又PS了一下,终于满意了,请原谅我的强迫症 #纪念碑谷# ​​​​

终于把喜欢的主题找回来了

Jelena Ostapenko produced one of the great Grand Slam upsets as she beat third seed Simona Halep to win the French Open and claim her first major title.

The unseeded 20-year-old was a set and 3-0 down at one stage with Halep cruising, before she staged a remarkable recovery to claim the title at Roland Garros, 4-6 6-4 6-3, becoming the first Latvian ever to win a Grand Slam.

恭喜年仅20岁零2天的Jelena Ostapenko(世界排名第47)首夺大满贯女单冠军,也是她的首个法网冠军(逆转击败Simona Halep,世界排名第2),成为1997年的库尔滕后,又一位以非种子球手身份在法网拿到个人首冠的球手,世界排名升至第12位,成为目前女子网坛TOP20中最年轻的球手。 ​​​​

Jelena Ostapenko

Author: Maria Sharapova

At the end of 2015, I decided to write a memoir. This September, those pages will finally be published. It’s not easy to be the judge of your own work, but I can proudly say I have poured everything into it. It’s strong, yet it’s filled with vulnerability I didn’t know I was willing to share. Life is a tricky thing! There’s no right or wrong answer to any of it…best exam ever! All the things I share inside the pages of my book. I can’t believe how many of you have already preordered the book. Thank you so much!!

Unstoppable - My Life So Far

Preorder now:
Amazon - http://amzn.to/2oc7elf
B&N - http://bit.ly/2ouCqx9
iBooks - http://apple.co/2nN0aiV
Google Play - http://bit.ly/2oeYs5s
BAM - http://bit.ly/2ouCDQX
Indiebound - http://bit.ly/2ofjLE1
Read more about Unstoppable: http://bit.ly/SharapovaUnstoppableFB