ubuntu20.04安装了几次2.0都失败
ubuntu12.04已经无法安装系统本身的更新了,更别说安装其他软件
强迫症发作,于是有了这次:
git --version
sudo apt install git
git --version
github用户名
git config --global user.name "qiuhaidong"
#or haydnyau
github登录帐号邮箱名
git config --global user.email "690982322@qq.com"
#or 1148891016@qq.com
Password caching
To use this option, you need to turn on the credential helper so that git will save your password in memory for some time:
git config --global credential.helper cache
First, we need to check for existing ssh keys on your computer. Open up Terminal and run:
cd ~/.ssh
# Checks to see if there is a directory named ".ssh" in your user directory
If it says “No such file or directory” go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
最好就是把 .shh 这个文件夹删除了,做step 2
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.不要输入文件名
ssh-keygen -t rsa -C "your_email@example.com"
我的就是:ssh-keygen -t rsa -C "690982322@qq.com"
#or 1148891016@qq.com
Now you need to enter a passphrase.设置密码。(有人是密码都不要的,再按两下enter就行了)
Which should give you something like this:
Your identification has been saved in /home/you/.ssh/id_rsa.
Your public key has been saved in /home/you/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
ctrl+h,显示隐藏文件,这里其实可以打开这个id_rsa.pub文件,直接复制,不用安装下面的软件
sudo apt-get install xclip
# Downloads and installs xclip.
xclip -sel clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
到github网站,登陆,头像,设置,SSH and GPG keys,把旧的SSH keys删除,添加新的,title不用管,粘贴到key就行了
ssh -T git@github.com
这里可能会还要按照提示做一下,不难,看英文做
如果看到:
Hi qiuhaidong! You've successfully authenticated, but GitHub does not provide shell access.
# or haydnyau
If that username is correct, you’ve successfully set up your SSH key. Don’t worry about the shell access thing, you don’t want that anyway.
If you see “access denied” please consider using HTTPS instead of SSH. If you need SSH start at these instructions for diagnosing the issue.
看官网命令
rvm --version
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
会显示失败,先不管它
Install RVM:命令
curl -sSL https://get.rvm.io | bash -s stable
如下:
dong@Ubuntu:~$ curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
gpg: 于 2021年01月16日 星期六 02时46分22秒 CST 创建的签名,使用 RSA,钥匙号 39499BDB
gpg: 无法检查签名:没有公钥
GPG signature verification failed for '/home/dong/.rvm/archives/rvm-1.29.12.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
In case of further problems with validation please refer to https://rvm.io/rvm/security
这个提示错误,并且给出了解决方法:
运行:
命令1:
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
命令2:
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
再运行上一条命令安装rvm:
curl -L https://get.rvm.io | bash -s stable
输出:
* To start using RVM you need to run `source /home/dong/.rvm/scripts/rvm`
安装成功,按照提示运行:
source /home/dong/.rvm/scripts/rvm
测试:
rvm --version
git --version
安装ruby2.2.6(1.9.3太久了,无法安装)
rvm install 2.2.6
会提示输入本机密码
rvm use 2.2.6
git clone -b source git@github.com:qiuhaidong/qiuhaidong.github.com.git octopress
# 或者 git clone git://github.com/imathis/octopress.git octopress
# octopress 2.0 原码
cd octopress
gem install bundler
bundle install
rake install
rake setup_github_pages
这里可能会要输入链接等,ssh,https
The rake task will ask you for a URL of the Github repo. Copy the SSH or HTTPS URL from your newly created repository
(e.g. git@github.com:username/username.github.io.git)
git@github.com:qiuhaidong/qiuhaidong.github.com.git
https://github.com/qiuhaidong/qiuhaidong.github.com.git
or
git@github.com:haydnyau/haydnyau.github.io.git
https://github.com/haydnyau/haydnyau.github.io.git
and paste it in as a response.
This will:
Next run:
rake generate
rake deploy
This will generate your blog, copy the generated files into _deploy/
, add them to git, commit and push them up to the master branch. In a few seconds you should get an email from Github telling you that your commit has been received and will be published on your site.
来自官网
下面这个不知道要不要做:
Now you have a place to commit the generated content for your site, but you should also set up repository to store the source for your blog. After you set up a repository for your blog source, add it as the origin remote.
git remote add origin (your repo url)
# set your new origin as the default branch
git config branch.master.remote origin
Now push your changes and you’ll be all set.
上面这个不知道要不要做:
来自官网
Don’t forget to commit the source for your blog.
git add .
git commit -m 'update'
git push origin source
category_list
插件在 octopress\plugins\
文件夹里面,新建一个文件,名为:category_list_tag.rb
。并将下面的代码粘贴到里面。
module Jekyll
class CategoryListTag < Liquid::Tag
def render(context)
html = ""
categories = context.registers[:site].categories.keys
categories.sort.each do |category|
posts_in_category = context.registers[:site].categories[category].size
category_dir = context.registers[:site].config['category_dir']
category_url = File.join(category_dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase)
html << "<li class='category'><a href='/#{category_url}/'>#{category} (#{posts_in_category})</a></li>\n"
end
html
end
end
end
Liquid::Template.register_tag('category_list', Jekyll::CategoryListTag)
这个插件会向liquid
注册一个名为category_list
的tag
,该tag
就是以li
的形式将站点所有的category
组织起来。如果要将category
加入到侧边导航栏,需要增加一个aside
。
aside
在 octopress\source\_includes\asides\
文件夹里面,新建一个文件,名为:category_list.html
。并粘贴下面的代码:
注意: 去掉 %
前面的2个 \
这里如果不加上\
,markdown格式会显示category_list
的内容。我是为了正确显示代码才加上的
<section>
<h1>Categories</h1>
<ul id="categories">
{\% category_list \%}
</ul>
</section>
代码如下:
dong@Ubuntu:~/octopress$ git push origin source
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
打开文件~/octopress/.git/config,查看
[remote "origin"]
url = git@github.com:haydnyau/haydnyau.github.io.git
我是改了几次,com.git和io.git搞错了
preview.sh代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build #生成
jekyll serve
=================================
deploy.sh代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build
octopress deploy
=================================
(不行,这个会造成有些blog页面头尾显示不全)发布,并上传/_posts/源文件,deploy.sh 代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build
mv _posts/ _site/
octopress deploy
mv _site/_posts/ .
注意这个点 “.”
.
或者 ./
表示当前目录
更改了/home/dong/haydnyau/_templates/post
增加了:
categories:
categories: {{ categories }}
因为格式问题没有显示,参见原文件
重装octopress 2.0 博客失败
很多新旧的软件,依赖,都不兼容了
算了,世界在发展,有的旧事物必然被淘汰
毕竟连作者都不维护了
而且连3.0都不维护了
============================
博文1,Octopress 3 Arrives to Make Blog Generation Crazy Simple
安装git
设置好用户名,email等等,参见之前的blog
添加ssh钥匙到github
安装rvm
安装ruby 2.7.0,好像默认就是
修复安装2.2.6失败的教程
安装octopress
gem install octopress
创建博客的主文件夹
octopress new haydnyau #名字自取
新建一篇blog
octopress new post hello world
生成网页
jekyll build
为避免下面的错误:
sudo bundle add webrick
本地预览
jekyll serve
dong@Ubuntu:~/haydnyau$ bundle exec jekyll serve
Configuration file: /home/dong/haydnyau/_config.yml
Source: /home/dong/haydnyau
Destination: /home/dong/haydnyau/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.398 seconds.
Auto-regeneration: enabled for '/home/dong/haydnyau'
------------------------------------------------
Jekyll 4.2.1 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
/home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `require_relative'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `setup'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:100:in `process'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/jekyll:25:in `load'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/jekyll:25:in `<main>'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/ruby_executable_hooks:22:in `eval'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/ruby_executable_hooks:22:in `<main>'
dong@Ubuntu:~/haydnyau$
原因:
This happens because webrick is no longer a bundled gem in Ruby 3.0. From https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:
- The following libraries are no longer bundled gems or standard libraries. Install the corresponding gems to use these features.
- sdbm
- webrick
- net-telnet
- xmlrpc
Adding gem "webrick"
to my Gemfile solves the problem, but Jekyll should include it in its gemspec.
I think you want run: bundle add webrick
.
我运行:
sudo bundle add webrick
dong@Ubuntu:~/haydnyau$ bundle add webrick
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using public_suffix 4.0.6
Using bundler 2.3.4
Using colorator 1.1.0
Using concurrent-ruby 1.1.9
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using ffi 1.15.4
Using forwardable-extended 2.6.0
Using rb-fsevent 0.11.0
Using rexml 3.2.5
Using liquid 4.0.3
Using mercenary 0.4.0
Using rouge 3.27.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.8.0
Using webrick 1.7.0
Using addressable 2.8.0
Using sassc 2.4.0
Using rb-inotify 0.10.1
Using kramdown 2.3.1
Using terminal-table 2.0.0
Using listen 3.7.0
Using kramdown-parser-gfm 1.1.0
Using jekyll-sass-converter 2.1.0
Using pathutil 0.16.2
Using em-websocket 0.5.3
Using i18n 1.8.11
Using jekyll-watch 2.2.1
Using jekyll 4.2.1
Using jekyll-feed 0.16.0
Using jekyll-seo-tag 2.7.1
Using minima 2.5.1
dong@Ubuntu:~/haydnyau$
问题解决
解决前后的Gemfile文件:
生成发布配置文件
octopress deploy init git git@github.com:haydnyau/haydnyau.github.com.git
发布
octopress deploy
git上传
git init
git add .
还有的以后琢磨
买个早餐,吃饱,睡觉
今晚
并不是说命中率最高、速度最快,而是心态最好,进入境界。
就像麦迪说的,35秒13分并不是他的最好,他的最好是进入了“in the zone”的境界。
我今晚也一样。
具体这样说吧:
心跳如常,不为任何情况所动,该怎样怎样。
进攻:
该跑跑,该停停,该切切,该快快,该慢慢。
该投投,不犹豫。
该晃晃,该突突,该传传,该断断。
防守:
该紧紧,该松松。
被背打就被背打,不懊恼。
能帽帽,不喜不惧。
其他:
投不进就不进,不懊恼,不可惜,继续。
失误就失误,继续。
开场还是抢七,该怎样怎样。
不怕强劲的对手,不怕拖累队友。
心态控制体能,微汗。
如李小龙说的:从心所欲,一心一意,表达自己。
心态如常,张弛有道,不为所动。
这一年,三件事:到京东打工,学做饭,耳朵生病。
打工
是做苦力,卖力气,很丢人,但,荒废了两年,终于动了。具体的,以前写过,不重复。
做饭
很有门道,比如炒青菜,刚下锅,有的马上熟了,有的还没炒到,心慌。淡定,正常翻炒,就行了。还有先炒猪肉,再放面去炒,再放青菜,看起来一大锅,怕青菜在上面炒不熟,慌了。淡定,正常翻炒,就行了。
淡定,正常地做,就行了。
生病
对自己太狠。秋冬,连续俩月通宵夜班,噪声大,有压力,情绪不稳定,早上洗冷水澡,重糖,重淀粉(米面主食),重油,重盐,吃辣椒,估计血糖高,血脂高,血压高,血粘稠,睡眠严重不足,內耳供血不足,听觉神经长期疲累不堪。免疫力下降,感冒,鼻塞,咽鼓管之类的不通畅。
种种原因,祸不单行,差点聋了。
就这三件事。
吸取教训,放下执念,放过自己,好好生活。
day 68
今天休假
昨天耳朵又听到低沉的发动机的轰隆隆的声音,我以为是耳鸣,现在基本可以确定,这就是附近道路晚上泥头车汽車发动机或者工廠機器運转的声音。
在京东时也常常听到。
我感冒鼻塞时,耳朵对这些声音特别敏感。
就这样。
昨天上班时,没搞清情况,情绪又崩溃了……
補充:
工作沒勁頭,好想打電話給媽,和她坦白這一切,想讓她接受我的平庸,我的失敗,我的不婚,想發泄所有的不安、恐懼、負面情緒。
幸好,我還懂得衝動憤怒情緒不穩定時,別做決定,別做事。
休息了一天,現在知道不是耳鳴,是感冒鼻塞或者咽鼓管堵塞或者其他的聽力系統的某一部分出了問題,而引起的狀況,感冒好了,整個聽力系統自然就沒事了。
此一時彼一時,我又回京東上班了。
總不能閒着不做事,沒有收入是不行的。
不過我有保護自己,現在上日班,一天只需要工作6小時,活也不是很忙,挺好的。
保護自己呀,一定要!
很多時候,挺多人,都對我很好的。很照顧我,甚至我不要臉地說,他們有時簡直是寵我。
比如老大喻胡龍,人手足夠時,叫我不用幹活,讓別人做了我的那份工作,他會罵別人,但是不會說我我。還有他老婆,給東西我吃。
比如潤峯大哥,旁邊的人工作比我更忙,但是他卻是幫我。
比如?韋亦凡?(音譯,不知道是不是這個名字),其實不是很熟悉,但是京東發的小零食,他經常給我吃。
還有大劉,老李,光頭大哥,光頭二哥,肥佬,肥仔老楊,胖子……還有很多我不知道名字的人。
所以:
越努力越幸運。
我是個認真做事的人,別人看在眼裏,自然在條件允許時幫助我。
-別人幫我,是證明了別人是好人,自己別得瑟,得意不忘形。
一直以來,都是很多人幫助我,加油吧,中年人,別辜負了那麼多的善意。