后台程序读取终端将进入暂停状态

需要从STDIN读取输入的程序,后台运行时出行 suspended(tty input) 状态,在后台处于暂停工作状态。

  • 演示:
    $cat cread.sh
    while read foo; do

    echo Foo is $foo
    

    done
    $ ./cread.sh
    this
    Foo is this
    ^C
    ~/work/shell choe@MBP⌚ 14:20:11
    $ ./cread.sh &
    [2] 2357
    [2] + 2357 suspended (tty input) ./cread.sh
    ~/work/shell choe@MBP⌚ 14:20:20
    $ fg
    [2] - 2357 continued ./cread.sh

    Foo is
    ~/work/shell choe@MBP⌚ 14:20:56

    引入 STDIN redirect 功能

    $ ./cread.sh < /dev/null &
    [2] 2368
    [2] - 2368 done ./cread.sh < /dev/null
    ~/work/shell choe@MBP⌚ 14:21:13
    $ ps -ef|grep cread

    501  2346   564   0  2:20下午 ttys005    0:00.00 sh ./cread.sh
    

    ssh dynamic forward 后台运行

    $ ssh -T -D 1080 root@192.168.66.100 </dev/null &
    [1] 2665
    ~/blog on  master! choe@MBP⌚ 14:33:12
    $ Last failed login: Fri Nov 24 06:33:09 UTC 2017 from 192.168.145.21 on ssh:notty
    There were 4667 failed login attempts since the last successful login.

    [1] + 2665 done ssh -T -D 1080 root@192.168.66.100 < /dev/null
    加入STDIN重定向</dev/null 后,然而ssh 自动退出了,
    ~/blog on  master! choe@MBP⌚ 14:33:16
    $ ps -ef|grep ssh

    501  1426     1   0 10:56上午 ??         0:00.05 /usr/bin/ssh-agent -l
    

    ~/blog on  master! choe@MBP⌚ 14:38:37
    $ ssh -TnN -D 1080 root@192.168.66.100 &
    [1] 2706
    ~/blog on  master! choe@MBP⌚ 14:38:57
    $ ps -ef|grep ssh

    501  1426     1   0 10:56上午 ??         0:00.05 /usr/bin/ssh-agent -l
    501  2706   499   0  2:38下午 ttys001    0:00.03 ssh -TnN -D 1080 root@192.168.66.100
    

    ~/blog on  master! choe@MBP⌚ 14:39:09

#tar

tar 不支持in-place更新文件!
To pull your file from your archive, you can use tar xzf archive.tar.gz my/path/to/file.txt. Note that the directories in the file’s path will be created as well. Use tar t (i.e. tar tzf archive.tar.gz) to list the files in the archive.

[TOC]

表格中打出br

Shift + Enter

html 图片自加超链接 链接图片自身

1
2
3
4
5
6
7
8
9
10
11
12
13

<a href="www.yourdomain.com" target="_blank">
<img src="/i/eg_buttonnext.gif" width="675" height="900" border="0" />
</a>
choe: 将热点文字 替换为 图片即可

# beautify
<a href="/path/imageName.png" target="_blank">
<img src="/path/imageName.png" width="675" height="900" border="0" />
</a>

# oneline version for copy
<a href="/path/imageName.png" target="_blank"><img src="/path/imageName.png" width="675" height="900" border="0" /></a>

hello, buddy!
test only

[TOC]

jekyll vs hugo vs hexo

https://www.techiediaries.com/jekyll-hugo-hexo/

Hexo

https://hexo.io/docs/

https://blog.peiyingchi.com/2017/03/11/hexo-user-notes/

https://zhuanlan.zhihu.com/p/26877716

https://linlif.github.io/2017/05/27/Hexo%E4%BD%BF%E7%94%A8%E6%94%BB%E7%95%A5-%E6%B7%BB%E5%8A%A0%E5%88%86%E7%B1%BB%E5%8F%8A%E6%A0%87%E7%AD%BE/

https://blog.csdn.net/Likianta/article/details/78943573

https://lanjingling.github.io/2015/09/24/use-of-hexo-2/

https://blog.csdn.net/kunkun5love/article/details/79130956

http://theme-next.iissnan.com/theme-settings.html#categories-page

Hexo常见问题解决方案

https://xuanwo.io/2014/08/14/hexo-usual-problem/

theme-next

https://github.com/theme-next/hexo-theme-next

https://github.com/theme-next/hexo-theme-next/blob/master/docs/INSTALLATION.md

blog style

https://github.com/iissnan/hexo-theme-next/issues/119

https://blog.csdn.net/dataiyangu/article/details/85057957

https://www.oncecoupled.com/sidebar-show-mobile/

https://io-oi.me/tech/hexo-next-optimization.html

enable sidebar on mobile移动设备上开启侧栏

https://github.com/iissnan/hexo-theme-next/pull/1717

1
2
3
4
5
6
7
$ cd hexo
$ ls
_config.yml node_modules package.json public scaffolds source themes

~/blog/themes on  master! ⌚ 16:59:21
$ ls
landscape next next-reloaded

[yaml]~/blog/_config.yml

1
2
3
##Themes: https://hexo.io/themes/

theme: next-reloaded

Set theme in main Hexo root config _config.yml file:

1
theme: next

移动端显示 back-to-top 按钮和侧栏

文件位置:~/blog/themes/next/_config.yml

1
2
> `# Enable sidebar on narrow viewonmobile: true`
>
1
2
3
4
5
6
7
8
9
10
find . -name "*config.yml" -type f
./next/_config.yml

./node_modules/hexo/node_modules/hexo-cli/assets/_config.yml
./node_modules/hexo/node_modules/hexo-cli/assets/themes/landscape/_config.yml

./_config.yml
./themes/next/_config.yml
./themes/next-reloaded/_config.yml
./themes/landscape/_config.yml

hexo images 统一的图片存放地

https://hexo.io/docs/asset-folders.html

Global Asset Folder

Assets are non-post files in the source folder, such as images, CSS or JavaScript files. For instance, If you are only going to have a few images in the Hexo project, then the easiest way is to keep them in a source/images directory. Then, you can access them using something like ![](/images/image.jpg)

插件地址

https://hexo.io/plugins/index.html

  • hexo-filter-plantuml

    Generate PlantUML Diagram with markdown code fence

  • hexo-filter-sequence

    Generate UML sequence diagrams for Hexo.

  • hexo-tag-plantuml

    hexo-tag-plantuml is a tag plugin for Hexo. It can work with plantuml to draw uml.

插件的安装

npm install -g hexo-cli

npm install hexo-deployer-git –save

npm install hexo-generator-feed

npm install hexo-generator-sitemap

npm install hexo-generator-sitemap –save

npm install hexo-generator-feed –save

npm install hexo-generator-baidu-sitemap –save

npm install hexo-browsersync –save

npm install –save-dev hexo-typora-image

1
[npm install --save hexo-filter-flowchart](https://www.npmjs.com/package/hexo-filter-flowchart)

hexo install:

$ npm install -g hexo-cli

#test

$ hexo

config your blog: https://hexo.io/docs/configuration.html
_config.yml

language: zh-CN
timezone: Asia/Shanghai
note: Asia\Shanghai cause error: TypeError: Cannot read property ‘offset’ of null
generate blog: https://hexo.io/docs/commands.html

Deployment

Hexo provides a fast and easy deployment strategy. You only need one single command to deploy your site to your servers.
$ hexo deploy
Before your first deployment, you will have to modify some settings in _config.yml. A valid deployment setting must have a type field. For example:
Git
Install hexo-deployer-git.
$ npm install hexo-deployer-git –save
Edit settings.
deploy:
type: git
repo: git@github.com:cuiwm/cuiwm.github.io.git #
branch: master
message: [message]

同时托管到github和coding
hexo干货系列:(四)将hexo博客同时托管到github和coding

image-20180801151622486

configure domain

configure your domain dns setting in your dns isp site
$ echo “91kuaile.cn” > source/CNAME
reference:

$npm install hexo-generator-feed
$npm install hexo-generator-sitemap

#插件
插件是配置是在hexo 目录下的_config.yml ,不是theme下的next下的_config.yml

Extensions

Plugins:

  • hexo-generator-feed
  • hexo-generator-sitemap

    Feed Atom

    feed:
    type: atom
    path: atom.xml
    limit: 20

    sitemap

    sitemap:
    path: sitemap.xml

Reference:

$ hexo new page “tags”
INFO Created: ~/blog/source/tags/index.md

$ hexo new draft “My First Blog Post”
creates -> ./source/_drafts/My-First-Blog-Post.md

The stuff between the dashes — at the top of the markdown file is called “front-matter”. It is metadata that is used by Hexo and the active theme. See the Hexo documentation on Front-Matter for more information.
Ensure that your Markdown content for the page sits BELOW the front-matter dashes — or the content will not display (and you’ll likely see a YAMLException error in the server output).

Saving changes to your Markdown files will be automatically detected by the running hexo server and regenerated as static HTML files, but you must refresh the browser to view the changes.

If you dislike having to manually refresh the browser each time, the hexo-livereload or hexo-browsersync plugins can do it automatically.

To install the hexo-browsersync plugin (my personal favorite):

$ npm install hexo-browsersync –save

$ hexo server –draft –open # restart the server

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.