diff options
author | garhve <git@garhve.com> | 2023-01-02 06:02:01 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2023-01-02 06:02:01 +0800 |
commit | be772f40c42711de54a3331db2781b1511acba9d (patch) | |
tree | 0808a7750d3c1055b0e86071c219d872775b1f92 | |
parent | 3ae5ecf803ed2d4ece2c9da6d91aae0f075c5b0c (diff) |
change to zola
103 files changed, 5399 insertions, 5352 deletions
diff --git a/cn/index.html b/cn/index.html deleted file mode 100644 index e9373ef..0000000 --- a/cn/index.html +++ /dev/null @@ -1,163 +0,0 @@ -<!DOCTYPE html> -<html lang="en-us" prefix="og: http://ogp.me/ns#"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/cn/" /> - <link rel="canonical" href="https://blog.garhve.com/cn/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "", - "name" : "blog | garhve\u0027s hub", - "headline" : "blog | garhve\u0027s hub", - "description" : "", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-20 00:24:42 \u002b0800 CST", - "dateModified" : "2022-12-20 00:24:42 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/cn\/", - "keywords" : [ ] - } -</script> -<title>blog | garhve's hub</title> - <meta property="og:title" content="blog | garhve's hub" /> - <meta property="og:type" content="website" /> - <meta property="og:description" content="" /> - <meta name="description" content="" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="posts"> - <div class="row"> - <div class="col-xs-12"> - -<header> - <div class="header-title"> - <a href="/cn/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/en/">English</a> - </div> - -</div> -<div class="header-line"></div> - - <div id="posts-list"> - <section> - <h1 class="site-date-catalog">2022</h1> - - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-12-20 00:24:42 CST">Dec 20</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/cn/posts/prose-1/">随笔(1)</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-12-09 16:38:56 CST">Dec 09</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/cn/posts/2/">测试自动创建博客</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-12-05 08:45:07 CST">Dec 05</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/cn/posts/1/">起步</a> - </div> - </div> - </div> - </div> - - </section> - - </div> - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - -</body> - -</html> diff --git a/cn/index.xml b/cn/index.xml deleted file mode 100644 index 0b9a604..0000000 --- a/cn/index.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> - <channel> - <title>blog | garhve's hub</title> - <link>https://blog.garhve.com/cn/</link> - <description>Recent content on blog | garhve's hub</description> - <generator>Hugo -- gohugo.io</generator> - <language>en-us</language> - <lastBuildDate>Tue, 20 Dec 2022 00:24:42 +0800</lastBuildDate><atom:link href="https://blog.garhve.com/cn/index.xml" rel="self" type="application/rss+xml" /> - <item> - <title>随笔(1)</title> - <link>https://blog.garhve.com/cn/posts/prose-1/</link> - <pubDate>Tue, 20 Dec 2022 00:24:42 +0800</pubDate> - - <guid>https://blog.garhve.com/cn/posts/prose-1/</guid> - <description>真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, 刮得我脸颊生疼。那一瞬间,我有些恍惚。 -我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, 但在新冠的淫威下,终究是落陷了。 -虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, 与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, 如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, 不仅催促我多囤药,口罩也要戴双层。 我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。 -下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, 我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, 还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。 -我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, 甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 电影没法去了,我需要出门买药。 -重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! 即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, 令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 我忘记了思考,我生而自由。 -甩甩脑袋,我下了楼,还有退烧药等着我去买。</description> - </item> - - <item> - <title>测试自动创建博客</title> - <link>https://blog.garhve.com/cn/posts/2/</link> - <pubDate>Fri, 09 Dec 2022 16:38:56 +0800</pubDate> - - <guid>https://blog.garhve.com/cn/posts/2/</guid> - <description>hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: -写作 编辑器随便用个支持MD的就行了,这句陈述挺好。 -但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。 -不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。 -其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭&hellip; 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难&hellip; 先将就一下吧,看看有没有什么好的办法解决它。 -图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 -在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。 -Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ -发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 -原先,发布一篇博客我的流程为, -hugo new post -&gt; vim 找到文章 -&gt; 保存或者发布 -&gt; 然后到public文件夹 push出去。 -太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~ -这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 也许可以将代码优化下以后就省心了,哈哈。 -更新:拖了三天,终于把代码补完了~ blog.sh -# usage: prog new/edit/push [en/cn] push() { read -r -p &#34;Do you want to push?[y/n] &#34; ans .</description> - </item> - - <item> - <title>起步</title> - <link>https://blog.garhve.com/cn/posts/1/</link> - <pubDate>Mon, 05 Dec 2022 08:45:07 +0800</pubDate> - - <guid>https://blog.garhve.com/cn/posts/1/</guid> - <description>最近开始有意识的管理自己的一些配置文档的格式了,具体来说就是希望将它们做好分类并尽量保持整洁干净。 在以前,尽管我也有做好区分的想法,但无奈软件一装多,$HOME就不受控制的堆满了大大小小的dotfiles。 而现在,每次装软件前,则会先查找一翻Google,提前把需要的一些环境变量或者变量准备好,以期将软件的配置文件 或者工作文件夹放进.config 或 .local</description> - </item> - - </channel> -</rss> diff --git a/cn/posts/1/index.html b/cn/posts/1/index.html deleted file mode 100644 index baa2bc8..0000000 --- a/cn/posts/1/index.html +++ /dev/null @@ -1,160 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/cn/posts/1/" /> - <link rel="canonical" href="https://blog.garhve.com/cn/posts/1/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "起步", - "headline" : "起步", - "description" : "最近开始有意识的管理自己的一些配置文档的格式了,具体来说就是希望将它们做好分类并尽量保持整洁干净。 在以前,尽管我也有做好区分的想法,但无奈软件一装多,$HOME就不受控制的堆满了大大小小的dotfiles。 而现在,每次装软件前,则会先查找一翻Google,提前把需要的一些环境变量或者变量准备好,以期将软件的配置文件 或者工作文件夹放进.config 或 .local", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-05 08:45:07 \u002b0800 CST", - "dateModified" : "2022-12-05 08:45:07 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/cn\/posts\/1\/", - "keywords" : [ ] - } -</script> -<title>起步</title> - <meta property="og:title" content="起步" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="最近开始有意识的管理自己的一些配置文档的格式了,具体来说就是希望将它们做好分类并尽量保持整洁干净。 在以前,尽管我也有做好区分的想法,但无奈软件一装多,$HOME就不受控制的堆满了大大小小的dotfiles。 而现在,每次装软件前,则会先查找一翻Google,提前把需要的一些环境变量或者变量准备好,以期将软件的配置文件 或者工作文件夹放进.config 或 .local" /> - <meta name="description" content="最近开始有意识的管理自己的一些配置文档的格式了,具体来说就是希望将它们做好分类并尽量保持整洁干净。 在以前,尽管我也有做好区分的想法,但无奈软件一装多,$HOME就不受控制的堆满了大大小小的dotfiles。 而现在,每次装软件前,则会先查找一翻Google,提前把需要的一些环境变量或者变量准备好,以期将软件的配置文件 或者工作文件夹放进.config 或 .local" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post Chinese" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/cn/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/en/">English</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">起步</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-12-05 08:45:07 CST"> - 05 Dec 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>最近开始有意识的管理自己的一些配置文档的格式了,具体来说就是希望将它们做好分类并尽量保持整洁干净。 -在以前,尽管我也有做好区分的想法,但无奈软件一装多,$HOME就不受控制的堆满了大大小小的dotfiles。 -而现在,每次装软件前,则会先查找一翻Google,提前把需要的一些环境变量或者变量准备好,以期将软件的配置文件 -或者工作文件夹放进.config 或 .local</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/cn/posts/2/index.html b/cn/posts/2/index.html deleted file mode 100644 index 8e51f09..0000000 --- a/cn/posts/2/index.html +++ /dev/null @@ -1,239 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/cn/posts/2/" /> - <link rel="canonical" href="https://blog.garhve.com/cn/posts/2/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "测试自动创建博客", - "headline" : "测试自动创建博客", - "description" : "hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题:\n写作 编辑器随便用个支持MD的就行了,这句陈述挺好。\n但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。\n不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。\n其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭\u0026hellip; 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难\u0026hellip; 先将就一下吧,看看有没有什么好的办法解决它。\n图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。\n在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。\nLinux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~\n发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。\n原先,发布一篇博客我的流程为,\nhugo new post -\u0026gt; vim 找到文章 -\u0026gt; 保存或者发布 -\u0026gt; 然后到public文件夹 push出去。\n太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~\n这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 也许可以将代码优化下以后就省心了,哈哈。\n更新:拖了三天,终于把代码补完了~ blog.sh\n# usage: prog new\/edit\/push [en\/cn] push() { read -r -p \u0026#34;Do you want to push?[y\/n] \u0026#34; ans .", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-09 16:38:56 \u002b0800 CST", - "dateModified" : "2022-12-09 16:38:56 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/cn\/posts\/2\/", - "keywords" : [ ] - } -</script> -<title>测试自动创建博客</title> - <meta property="og:title" content="测试自动创建博客" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: -写作 编辑器随便用个支持MD的就行了,这句陈述挺好。 -但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。 -不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。 -其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭&hellip; 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难&hellip; 先将就一下吧,看看有没有什么好的办法解决它。 -图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 -在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。 -Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ -发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 -原先,发布一篇博客我的流程为, -hugo new post -&gt; vim 找到文章 -&gt; 保存或者发布 -&gt; 然后到public文件夹 push出去。 -太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~ -这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 也许可以将代码优化下以后就省心了,哈哈。 -更新:拖了三天,终于把代码补完了~ blog.sh -# usage: prog new/edit/push [en/cn] push() { read -r -p &#34;Do you want to push?[y/n] &#34; ans ." /> - <meta name="description" content="hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: -写作 编辑器随便用个支持MD的就行了,这句陈述挺好。 -但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。 -不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。 -其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭&hellip; 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难&hellip; 先将就一下吧,看看有没有什么好的办法解决它。 -图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 -在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。 -Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ -发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 -原先,发布一篇博客我的流程为, -hugo new post -&gt; vim 找到文章 -&gt; 保存或者发布 -&gt; 然后到public文件夹 push出去。 -太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~ -这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 也许可以将代码优化下以后就省心了,哈哈。 -更新:拖了三天,终于把代码补完了~ blog.sh -# usage: prog new/edit/push [en/cn] push() { read -r -p &#34;Do you want to push?[y/n] &#34; ans ." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post Chinese" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/cn/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/en/">English</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">测试自动创建博客</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-12-09 16:38:56 CST"> - 09 Dec 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题:</p> -<h3 id="写作">写作</h3> -<p>编辑器随便用个支持MD的就行了,这句陈述挺好。</p> -<p>但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 -所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local -文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, -同步文件再在每台电脑上额外加个云,想想我都受不了。</p> -<p>不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 -问题我不太想用。</p> -<p>其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, -达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 -使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 -直接使用vim写文章,有点别扭… 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难… -先将就一下吧,看看有没有什么好的办法解决它。</p> -<h3 id="图片">图片</h3> -<p>图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, -但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 -服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。</p> -<p>在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 -保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 -我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, -后面使用即可。</p> -<p>Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~</p> -<h3 id="发布">发布</h3> -<p>Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 -自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 -尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, -其中便包括这个博客。 -Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 -cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。</p> -<p>原先,发布一篇博客我的流程为,</p> -<blockquote> -<p>hugo new post -> vim 找到文章 -> 保存或者发布 -> 然后到public文件夹 -push出去。</p> -</blockquote> -<p>太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 -怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 -我也可以直接将草稿发布出来,看得见,我才有动力写~</p> -<p>这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 -也许可以将代码优化下以后就省心了,哈哈。</p> -<p>更新:拖了三天,终于把代码补完了~ <a href="https://git.garhve.com/codes/tree/bash/blog.sh?id=46e07255bbe67b1dbf93dcd7f33e25f10eb8f8de">blog.sh</a></p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="font-style:italic"># usage: prog new/edit/push [en/cn]</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>push() { -</span></span><span style="display:flex;"><span> read -r -p <span style="font-style:italic">"Do you want to push?[y/n] "</span> ans -</span></span><span style="display:flex;"><span>... -</span></span><span style="display:flex;"><span>[ $# -lt 1 ] && echo <span style="font-style:italic">"usage: </span><span style="font-weight:bold">$(</span>basename $0<span style="font-weight:bold">)</span><span style="font-style:italic"> new/edit/push [en/cn]"</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>[ $1 == <span style="font-style:italic">"new"</span> ] && new <span style="font-style:italic">"</span>$2<span style="font-style:italic">"</span> -</span></span><span style="display:flex;"><span>[ $1 == <span style="font-style:italic">"edit"</span> ] && edit <span style="font-style:italic">"</span>$2<span style="font-style:italic">"</span> -</span></span><span style="display:flex;"><span>[ $1 == <span style="font-style:italic">"push"</span> ] && push -</span></span></code></pre></div><p>以后只需要在文件夹里<code>./blog.sh action language</code> 即可。 -大大方便了使用呀。 -<img src="https://assets.garhve.com/pictures/screenshots/2022/12/wIAgJv.png" alt="wIAgJv"> -也许以后就能多写写了(bushi)</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/cn/posts/index.html b/cn/posts/index.html deleted file mode 100644 index 2e69bb6..0000000 --- a/cn/posts/index.html +++ /dev/null @@ -1,165 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/cn/posts/" /> - <link rel="canonical" href="https://blog.garhve.com/cn/posts/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Posts", - "headline" : "Posts", - "description" : "", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-20 00:24:42 \u002b0800 CST", - "dateModified" : "2022-12-20 00:24:42 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/cn\/posts\/", - "keywords" : [ ] - } -</script> -<title>Posts</title> - <meta property="og:title" content="Posts" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="" /> - <meta name="description" content="" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="posts"> - <div class="row"> - <div class="col-xs-12"> - -<header> - <div class="header-title"> - <a href="/cn/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/en/">English</a> - </div> - -</div> -<div class="header-line"></div> - - - <h1 class="taxonomy-term"></h1> - <div id="posts-list"> - <section> - <h1 class="site-date-catalog">2022</h1> - - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-12-20 00:24:42 CST">Dec 20</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/cn/posts/prose-1/">随笔(1)</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-12-09 16:38:56 CST">Dec 09</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/cn/posts/2/">测试自动创建博客</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-12-05 08:45:07 CST">Dec 05</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/cn/posts/1/">起步</a> - </div> - </div> - </div> - </div> - - </section> - - </div> - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - -</body> - -</html> diff --git a/cn/posts/index.xml b/cn/posts/index.xml deleted file mode 100644 index e814956..0000000 --- a/cn/posts/index.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> - <channel> - <title>Posts on blog | garhve's hub</title> - <link>https://blog.garhve.com/cn/posts/</link> - <description>Recent content in Posts on blog | garhve's hub</description> - <generator>Hugo -- gohugo.io</generator> - <language>en-us</language> - <lastBuildDate>Tue, 20 Dec 2022 00:24:42 +0800</lastBuildDate><atom:link href="https://blog.garhve.com/cn/posts/index.xml" rel="self" type="application/rss+xml" /> - <item> - <title>随笔(1)</title> - <link>https://blog.garhve.com/cn/posts/prose-1/</link> - <pubDate>Tue, 20 Dec 2022 00:24:42 +0800</pubDate> - - <guid>https://blog.garhve.com/cn/posts/prose-1/</guid> - <description>真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, 刮得我脸颊生疼。那一瞬间,我有些恍惚。 -我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, 但在新冠的淫威下,终究是落陷了。 -虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, 与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, 如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, 不仅催促我多囤药,口罩也要戴双层。 我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。 -下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, 我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, 还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。 -我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, 甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 电影没法去了,我需要出门买药。 -重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! 即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, 令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 我忘记了思考,我生而自由。 -甩甩脑袋,我下了楼,还有退烧药等着我去买。</description> - </item> - - <item> - <title>测试自动创建博客</title> - <link>https://blog.garhve.com/cn/posts/2/</link> - <pubDate>Fri, 09 Dec 2022 16:38:56 +0800</pubDate> - - <guid>https://blog.garhve.com/cn/posts/2/</guid> - <description>hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: -写作 编辑器随便用个支持MD的就行了,这句陈述挺好。 -但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。 -不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。 -其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭&hellip; 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难&hellip; 先将就一下吧,看看有没有什么好的办法解决它。 -图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 -在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。 -Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ -发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 -原先,发布一篇博客我的流程为, -hugo new post -&gt; vim 找到文章 -&gt; 保存或者发布 -&gt; 然后到public文件夹 push出去。 -太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~ -这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 也许可以将代码优化下以后就省心了,哈哈。 -更新:拖了三天,终于把代码补完了~ blog.sh -# usage: prog new/edit/push [en/cn] push() { read -r -p &#34;Do you want to push?[y/n] &#34; ans .</description> - </item> - - <item> - <title>起步</title> - <link>https://blog.garhve.com/cn/posts/1/</link> - <pubDate>Mon, 05 Dec 2022 08:45:07 +0800</pubDate> - - <guid>https://blog.garhve.com/cn/posts/1/</guid> - <description>最近开始有意识的管理自己的一些配置文档的格式了,具体来说就是希望将它们做好分类并尽量保持整洁干净。 在以前,尽管我也有做好区分的想法,但无奈软件一装多,$HOME就不受控制的堆满了大大小小的dotfiles。 而现在,每次装软件前,则会先查找一翻Google,提前把需要的一些环境变量或者变量准备好,以期将软件的配置文件 或者工作文件夹放进.config 或 .local</description> - </item> - - </channel> -</rss> diff --git a/cn/posts/prose-1/index.html b/cn/posts/prose-1/index.html deleted file mode 100644 index be18b63..0000000 --- a/cn/posts/prose-1/index.html +++ /dev/null @@ -1,191 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/cn/posts/prose-1/" /> - <link rel="canonical" href="https://blog.garhve.com/cn/posts/prose-1/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "随笔(1)", - "headline" : "随笔(1)", - "description" : "真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, 刮得我脸颊生疼。那一瞬间,我有些恍惚。\n我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, 但在新冠的淫威下,终究是落陷了。\n虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, 与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, 如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, 不仅催促我多囤药,口罩也要戴双层。 我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。\n下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, 我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, 还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。\n我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, 甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 电影没法去了,我需要出门买药。\n重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! 即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, 令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 我忘记了思考,我生而自由。\n甩甩脑袋,我下了楼,还有退烧药等着我去买。", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-20 00:24:42 \u002b0800 CST", - "dateModified" : "2022-12-20 00:24:42 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/cn\/posts\/prose-1\/", - "keywords" : [ ] - } -</script> -<title>随笔(1)</title> - <meta property="og:title" content="随笔(1)" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, 刮得我脸颊生疼。那一瞬间,我有些恍惚。 -我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, 但在新冠的淫威下,终究是落陷了。 -虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, 与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, 如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, 不仅催促我多囤药,口罩也要戴双层。 我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。 -下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, 我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, 还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。 -我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, 甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 电影没法去了,我需要出门买药。 -重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! 即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, 令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 我忘记了思考,我生而自由。 -甩甩脑袋,我下了楼,还有退烧药等着我去买。" /> - <meta name="description" content="真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, 刮得我脸颊生疼。那一瞬间,我有些恍惚。 -我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, 但在新冠的淫威下,终究是落陷了。 -虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, 与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, 如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, 不仅催促我多囤药,口罩也要戴双层。 我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。 -下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, 我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, 还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。 -我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, 甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 电影没法去了,我需要出门买药。 -重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! 即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, 令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 我忘记了思考,我生而自由。 -甩甩脑袋,我下了楼,还有退烧药等着我去买。" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post Chinese" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/cn/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/en/">English</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">随笔(1)</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-12-20 00:24:42 CST"> - 20 Dec 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, -刮得我脸颊生疼。那一瞬间,我有些恍惚。</p> -<p>我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 -打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, -但在新冠的淫威下,终究是落陷了。</p> -<p>虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, -与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, -如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 -但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, -不仅催促我多囤药,口罩也要戴双层。 -我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。</p> -<p>下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, -我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 -看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, -还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。</p> -<p>我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, -甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 -电影没法去了,我需要出门买药。</p> -<p>重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! -即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, -令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 -我忘记了思考,我生而自由。</p> -<p>甩甩脑袋,我下了楼,还有退烧药等着我去买。</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/cn/sitemap.xml b/cn/sitemap.xml deleted file mode 100644 index 1b36e94..0000000 --- a/cn/sitemap.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" - xmlns:xhtml="http://www.w3.org/1999/xhtml"> - <url> - <loc>https://blog.garhve.com/cn/</loc> - <lastmod>2022-12-20T00:24:42+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/" - /> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/" - /> - </url><url> - <loc>https://blog.garhve.com/cn/posts/</loc> - <lastmod>2022-12-20T00:24:42+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/posts/" - /> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/posts/" - /> - </url><url> - <loc>https://blog.garhve.com/cn/posts/prose-1/</loc> - <lastmod>2022-12-20T00:24:42+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/cn/posts/2/</loc> - <lastmod>2022-12-09T16:38:56+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/posts/2/" - /> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/posts/2/" - /> - </url><url> - <loc>https://blog.garhve.com/cn/posts/1/</loc> - <lastmod>2022-12-05T08:45:07+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/posts/1/" - /> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/posts/1/" - /> - </url> -</urlset> diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..cf2078a --- /dev/null +++ b/config.toml @@ -0,0 +1,79 @@ +# The URL the site will be built for +base_url = "https://blog.garhve.com" + +# Set theme +#theme = "" + +# The site title and description; used in feeds by default. +title = "garhve's gibberish" +description = "a place for me to jibber jabber" + +# The default language; used in feeds. +default_language = "en" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# The taxonomies to be rendered for the site and their configuration. +# Example: +# taxonomies = [ +# {name = "tags", feed = true}, # each tag will have its own feed +# {name = "tags", lang = "fr"}, # you can have taxonomies with the same name in multiple languages +# {name = "categories", paginate_by = 5}, # 5 items per page for a term +# {name = "authors"}, # Basic definition: no feed or pagination +# ] +taxonomies = [ + {name = "categories", rss = false}, + {name = "tags", rss = false}, +] + +# The additional languages for the site. +# Example: +# languages = [ +# {code = "fr", feed = true}, # there will be a feed for French content +# {code = "fr", search = true}, # there will be a Search Index for French content +# {code = "it"}, # there won't be a feed for Italian content +# ] + +[markdown] +# When set to "true", all code blocks are highlighted. +highlight_code = true + +# The theme to use for code highlighting. +# See below for list of allowed values. +highlight_theme = "nord" + +# When set to "true", emoji aliases translated to their corresponding +# Unicode emoji equivalent in the rendered Markdown files. (e.g.: :smile: => 😄) +render_emoji = false + +[search] +# Whether to include the title of the page/section in the index +include_title = false +# Whether to include the description of the page/section in the index +include_description = false +# Whether to include the rendered content of the page/section in the index +include_content = false + +[extra] +# Author name, appears in footer. +author = "garhve" + +# Path to the header icon / favicon image. +# Please save image to static/images +icon = "/images/logo.ico" + +favicon = "/images/favicon.png" + +# header icon width. +# height will be automatically rendered. +iconsize = 70 + +# number of posts in index.html. +indexposts = 100 + +# switch to dark-theme +dark_mode = true + +# show theme-toggler +theme_toggler = true diff --git a/content/post/_index.md b/content/post/_index.md new file mode 100644 index 0000000..ab81384 --- /dev/null +++ b/content/post/_index.md @@ -0,0 +1,7 @@ ++++ +sort_by = "date" +template = "index.html" +page_template = "post-page.html" +[extra] +math = false ++++ diff --git a/content/post/architecture of linux kernel.md b/content/post/architecture of linux kernel.md new file mode 100644 index 0000000..5547051 --- /dev/null +++ b/content/post/architecture of linux kernel.md @@ -0,0 +1,26 @@ ++++ +title = "Architecture of Linux Kernel" +date = 2022-09-03 +[taxonomies] +categories = ["cs"] +tags = ["linux"] +[extra] +math = true ++++ +## Description + +Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged). + +Modern operating systems support at least 2 levels: + +- **User space**: For applications to run in unprivileged user mode +- **Kernel space**: For the kernel (and all its components) to run in privileged mode – kernel mode + +Address of these 2 spaces are separate. + +Applications in user mode will auto-linked to glibc(the GNU standard C library). Libraries only available in user mode, kernel mode doesn't have this conception. An application only can through **System call** to access kernel. On the other hand, system calls are the only legal entry point into the kernel space. + +> Libraries APIs: man section 3 +> System calls APIs: man section 2 + +to be continue... diff --git a/content/post/escape sequence.md b/content/post/escape sequence.md new file mode 100644 index 0000000..1659ef7 --- /dev/null +++ b/content/post/escape sequence.md @@ -0,0 +1,370 @@ ++++ +title = "Escape Sequences" +date = 2022-09-12 +[taxonomies] +categories = ["code"] +tags = ["c"] +[extra] +math = false ++++ + +> copied from [github](https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797) in case one day it disappears +> +> more information could visit [vt100 User Guide](https://vt100.net/docs/vt100-ug/chapter3.html) + +# ANSI Escape Sequences + +Standard escape codes are prefixed with `Escape`: + +- Ctrl-Key: `^[` +- Octal: `\033` +- Unicode: `\u001b` +- Hexadecimal: `\x1B` +- Decimal: `27` + +Followed by the command, somtimes delimited by opening square bracket (`[`), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. + +Arguments are delimeted by semi colon (`;`). + +For example: + +```sh +\x1b[1;31m # Set style to bold, red foreground. +``` + +## Sequences + +- `ESC` - sequence starting with `ESC` (`\x1B`) +- `CSI` - Control Sequence Introducer: sequence starting with `ESC [` or CSI (`\x9B`) +- `DCS` - Device Control String: sequence starting with `ESC P` or DCS (`\x90`) +- `OSC` - Operating System Command: sequence starting with `ESC ]` or OSC (`\x9D`) + +Any whitespaces between sequences and arguments should be ignored. They are present for improved readability. + +## General ASCII Codes + + +| Name | decimal | octal | hex | C-escape | Ctrl-Key | Description | +| ----- | ------- | ----- | ---- | ---------------- | -------- | ----------------------------- | +| `BEL` | 7 | 007 | 0x07 | `\a` | `^G` | Terminal bell | +| `BS` | 8 | 010 | 0x08 | `\b` | `^H` | Backspace | +| `HT` | 9 | 011 | 0x09 | `\t` | `^I` | Horizontal TAB | +| `LF` | 10 | 012 | 0x0A | `\n` | `^J` | Linefeed (newline) | +| `VT` | 11 | 013 | 0x0B | `\v` | `^K` | Vertical TAB | +| `FF` | 12 | 014 | 0x0C | `\f` | `^L` | Formfeed (also: New page`NP`) | +| `CR` | 13 | 015 | 0x0D | `\r` | `^M` | Carriage return | +| `ESC` | 27 | 033 | 0x1B | `\e`[*](#escape) | `^[` | Escape character | +| `DEL` | 127 | 177 | 0x7F | `<none>` | `<none>` | Delete character | + +<div id="escape"></div> + +> **Note:** Some control escape sequences, like `\e` for `ESC`, are not guaranteed to work in all languages and compilers. It is recommended to use the decimal, octal or hex representation as escape code. + +> **Note:** The **Ctrl-Key** representation is simply associating the non-printable characters from ASCII code 1 with the printable (letter) characters from ASCII code 65 ("A"). ASCII code 1 would be `^A` (Ctrl-A), while ASCII code 7 (BEL) would be `^G` (Ctrl-G). This is a common representation (and input method) and historically comes from one of the VT series of terminals. + +## Cursor Controls + + +| ESC Code Sequence | Description | +| :------------------------------------------------- | :----------------------------------------------------- | +| `ESC[H` | moves cursor to home position (0, 0) | +| `ESC[{line};{column}H` <br> `ESC[{line};{column}f` | moves cursor to line #, column # | +| `ESC[#A` | moves cursor up # lines | +| `ESC[#B` | moves cursor down # lines | +| `ESC[#C` | moves cursor right # columns | +| `ESC[#D` | moves cursor left # columns | +| `ESC[#E` | moves cursor to beginning of next line, # lines down | +| `ESC[#F` | moves cursor to beginning of previous line, # lines up | +| `ESC[#G` | moves cursor to column # | +| `ESC[6n` | request cursor position (reports as`ESC[#;#R`) | +| `ESC M` | moves cursor one line up, scrolling if needed | +| `ESC 7` | save cursor position (DEC) | +| `ESC 8` | restores the cursor to the last saved position (DEC) | +| `ESC[s` | save cursor position (SCO) | +| `ESC[u` | restores the cursor to the last saved position (SCO) | + +> **Note:** Some sequences, like saving and restoring cursors, are private sequences and are not standardized. While some terminal emulators (i.e. xterm and derived) support both SCO and DEC sequences, they are likely to have different functionality. It is therefore recommended to use DEC sequences. + +## Erase Functions + + +| ESC Code Sequence | Description | +| :---------------- | :--------------------------------------- | +| `ESC[J` | erase in display (same as ESC\[0J) | +| `ESC[0J` | erase from cursor until end of screen | +| `ESC[1J` | erase from cursor to beginning of screen | +| `ESC[2J` | erase entire screen | +| `ESC[3J` | erase saved lines | +| `ESC[K` | erase in line (same as ESC\[0K) | +| `ESC[0K` | erase from cursor to end of line | +| `ESC[1K` | erase start of line to the cursor | +| `ESC[2K` | erase the entire line | + +> Note: Erasing the line won't move the cursor, meaning that the cursor will stay at the last position it was at before the line was erased. You can use `\r` after erasing the line, to return the cursor to the start of the current line. + +## Colors / Graphics Mode + + +| ESC Code Sequence | Reset Sequence | Description | +| :---------------- | :------------- | :--------------------------------------------------------- | +| `ESC[1;34;{...}m` | | Set graphics modes for cell, separated by semicolon (`;`). | +| `ESC[0m` | | reset all modes (styles and colors) | +| `ESC[1m` | `ESC[22m` | set bold mode. | +| `ESC[2m` | `ESC[22m` | set dim/faint mode. | +| `ESC[3m` | `ESC[23m` | set italic mode. | +| `ESC[4m` | `ESC[24m` | set underline mode. | +| `ESC[5m` | `ESC[25m` | set blinking mode | +| `ESC[7m` | `ESC[27m` | set inverse/reverse mode | +| `ESC[8m` | `ESC[28m` | set hidden/invisible mode | +| `ESC[9m` | `ESC[29m` | set strikethrough mode. | + +> **Note:** Some terminals may not support some of the graphic mode sequences listed above. + +> **Note:** Both dim and bold modes are reset with the `ESC[22m` sequence. The `ESC[21m` sequence is a non-specified sequence for double underline mode and only work in some terminals and is reset with `ESC[24m`. + +### Color codes + +Most terminals support 8 and 16 colors, as well as 256 (8-bit) colors. These colors are set by the user, but have commonly defined meanings. + +#### 8-16 Colors + + +| Color Name | Foreground Color Code | Background Color Code | +| :--------- | :-------------------- | :-------------------- | +| Black | `30` | `40` | +| Red | `31` | `41` | +| Green | `32` | `42` | +| Yellow | `33` | `43` | +| Blue | `34` | `44` | +| Magenta | `35` | `45` | +| Cyan | `36` | `46` | +| White | `37` | `47` | +| Default | `39` | `49` | +| Reset | `0` | `0` | + +> **Note:** the _Reset_ color is the reset code that resets _all_ colors and text effects, Use _Default_ color to reset colors only. + +Most terminals, apart from the basic set of 8 colors, also support the "bright" or "bold" colors. These have their own set of codes, mirroring the normal colors, but with an additional `;1` in their codes: + +```sh +# Set style to bold, red foreground. +\x1b[1;31mHello +# Set style to dimmed white foreground with red background. +\x1b[2;37;41mWorld +``` + +Terminals that support the [aixterm specification](https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/cmds/aixcmds1/aixterm.htm) provides bright versions of the ISO colors, without the need to use the bold modifier: + + +| Color Name | Foreground Color Code | Background Color Code | +| :------------- | :-------------------- | :-------------------- | +| Bright Black | `90` | `100` | +| Bright Red | `91` | `101` | +| Bright Green | `92` | `102` | +| Bright Yellow | `93` | `103` | +| Bright Blue | `94` | `104` | +| Bright Magenta | `95` | `105` | +| Bright Cyan | `96` | `106` | +| Bright White | `97` | `107` | + +#### 256 Colors + +The following escape codes tells the terminal to use the given color ID: + + +| ESC Code Sequence | Description | +| :---------------- | :-------------------- | +| `ESC[38;5;{ID}m` | Set foreground color. | +| `ESC[48;5;{ID}m` | Set background color. | + +Where `{ID}` should be replaced with the color index from 0 to 255 of the following color table: + + + +The table starts with the original 16 colors (0-15). + +The proceeding 216 colors (16-231) or formed by a 3bpc RGB value offset by 16, packed into a single value. + +The final 24 colors (232-255) are grayscale starting from a shade slighly lighter than black, ranging up to shade slightly darker than white. + +Some emulators interpret these steps as linear increments (`256 / 24`) on all three channels, although some emulators may explicitly define these values. + +#### RGB Colors + +More modern terminals supports [Truecolor](https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29) (24-bit RGB), which allows you to set foreground and background colors using RGB. + +These escape sequences are usually not well documented. + + +| ESC Code Sequence | Description | +| :---------------------- | :--------------------------- | +| `ESC[38;2;{r};{g};{b}m` | Set foreground color as RGB. | +| `ESC[48;2;{r};{g};{b}m` | Set background color as RGB. | + +> Note that `;38` and `;48` corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as `;2` and `;5` sets the color format. + +## Screen Modes + +### Set Mode + + +| ESC Code Sequence | Description | +| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ESC[={value}h` | Changes the screen width or type to the mode specified by value. | +| `ESC[=0h` | 40 x 25 monochrome (text) | +| `ESC[=1h` | 40 x 25 color (text) | +| `ESC[=2h` | 80 x 25 monochrome (text) | +| `ESC[=3h` | 80 x 25 color (text) | +| `ESC[=4h` | 320 x 200 4-color (graphics) | +| `ESC[=5h` | 320 x 200 monochrome (graphics) | +| `ESC[=6h` | 640 x 200 monochrome (graphics) | +| `ESC[=7h` | Enables line wrapping | +| `ESC[=13h` | 320 x 200 color (graphics) | +| `ESC[=14h` | 640 x 200 color (16-color graphics) | +| `ESC[=15h` | 640 x 350 monochrome (2-color graphics) | +| `ESC[=16h` | 640 x 350 color (16-color graphics) | +| `ESC[=17h` | 640 x 480 monochrome (2-color graphics) | +| `ESC[=18h` | 640 x 480 color (16-color graphics) | +| `ESC[=19h` | 320 x 200 color (256-color graphics) | +| `ESC[={value}l` | Resets the mode by using the same values that Set Mode uses, except for 7, which disables line wrapping. The last character in this escape sequence is a lowercase L. | + +### Common Private Modes + +These are some examples of private modes, which are not defined by the specification, but are implemented in most terminals. + + +| ESC Code Sequence | Description | +| :---------------- | :------------------------------ | +| `ESC[?25l` | make cursor invisible | +| `ESC[?25h` | make cursor visible | +| `ESC[?47l` | restore screen | +| `ESC[?47h` | save screen | +| `ESC[?1049h` | enables the alternative buffer | +| `ESC[?1049l` | disables the alternative buffer | + +Refer to the [XTerm Control Sequences](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html) for a more in-depth list of private modes defined by XTerm. + +> Note: While these modes may be supported by the most terminals, some may not work in multiplexers like tmux. + +### Keyboard Strings + +```sh +ESC[{code};{string};{...}p +``` + +Redefines a keyboard key to a specified string. + +The parameters for this escape sequence are defined as follows: + +- `code` is one or more of the values listed in the following table. These values represent keyboard keys and key combinations. When using these values in a command, you must type the semicolons shown in this table in addition to the semicolons required by the escape sequence. The codes in parentheses are not available on some keyboards. `ANSI.SYS` will not interpret the codes in parentheses for those keyboards unless you specify the `/X` switch in the `DEVICE` command for `ANSI.SYS`. +- `string` is either the ASCII code for a single character or a string contained in quotation marks. For example, both 65 and "A" can be used to represent an uppercase A. + +> **IMPORTANT:** Some of the values in the following table are not valid for all computers. Check your computer's documentation for values that are different. + +#### List of keyboard strings + + +| Key | Code | SHIFT+code | CTRL+code | ALT+code | +| ------------------------ | -------- | ---------- | --------- | --------- | +| F1 | 0;59 | 0;84 | 0;94 | 0;104 | +| F2 | 0;60 | 0;85 | 0;95 | 0;105 | +| F3 | 0;61 | 0;86 | 0;96 | 0;106 | +| F4 | 0;62 | 0;87 | 0;97 | 0;107 | +| F5 | 0;63 | 0;88 | 0;98 | 0;108 | +| F6 | 0;64 | 0;89 | 0;99 | 0;109 | +| F7 | 0;65 | 0;90 | 0;100 | 0;110 | +| F8 | 0;66 | 0;91 | 0;101 | 0;111 | +| F9 | 0;67 | 0;92 | 0;102 | 0;112 | +| F10 | 0;68 | 0;93 | 0;103 | 0;113 | +| F11 | 0;133 | 0;135 | 0;137 | 0;139 | +| F12 | 0;134 | 0;136 | 0;138 | 0;140 | +| HOME (num keypad) | 0;71 | 55 | 0;119 | \-- | +| UP ARROW (num keypad) | 0;72 | 56 | (0;141) | \-- | +| PAGE UP (num keypad) | 0;73 | 57 | 0;132 | \-- | +| LEFT ARROW (num keypad) | 0;75 | 52 | 0;115 | \-- | +| RIGHT ARROW (num keypad) | 0;77 | 54 | 0;116 | \-- | +| END (num keypad) | 0;79 | 49 | 0;117 | \-- | +| DOWN ARROW (num keypad) | 0;80 | 50 | (0;145) | \-- | +| PAGE DOWN (num keypad) | 0;81 | 51 | 0;118 | \-- | +| INSERT (num keypad) | 0;82 | 48 | (0;146) | \-- | +| DELETE (num keypad) | 0;83 | 46 | (0;147) | \-- | +| HOME | (224;71) | (224;71) | (224;119) | (224;151) | +| UP ARROW | (224;72) | (224;72) | (224;141) | (224;152) | +| PAGE UP | (224;73) | (224;73) | (224;132) | (224;153) | +| LEFT ARROW | (224;75) | (224;75) | (224;115) | (224;155) | +| RIGHT ARROW | (224;77) | (224;77) | (224;116) | (224;157) | +| END | (224;79) | (224;79) | (224;117) | (224;159) | +| DOWN ARROW | (224;80) | (224;80) | (224;145) | (224;154) | +| PAGE DOWN | (224;81) | (224;81) | (224;118) | (224;161) | +| INSERT | (224;82) | (224;82) | (224;146) | (224;162) | +| DELETE | (224;83) | (224;83) | (224;147) | (224;163) | +| PRINT SCREEN | \-- | \-- | 0;114 | \-- | +| PAUSE/BREAK | \-- | \-- | 0;0 | \-- | +| BACKSPACE | 8 | 8 | 127 | (0) | +| ENTER | 13 | \-- | 10 | (0 | +| TAB | 9 | 0;15 | (0;148) | (0;165) | +| NULL | 0;3 | \-- | \-- | \-- | +| A | 97 | 65 | 1 | 0;30 | +| B | 98 | 66 | 2 | 0;48 | +| C | 99 | 66 | 3 | 0;46 | +| D | 100 | 68 | 4 | 0;32 | +| E | 101 | 69 | 5 | 0;18 | +| F | 102 | 70 | 6 | 0;33 | +| G | 103 | 71 | 7 | 0;34 | +| H | 104 | 72 | 8 | 0;35 | +| I | 105 | 73 | 9 | 0;23 | +| J | 106 | 74 | 10 | 0;36 | +| K | 107 | 75 | 11 | 0;37 | +| L | 108 | 76 | 12 | 0;38 | +| M | 109 | 77 | 13 | 0;50 | +| N | 110 | 78 | 14 | 0;49 | +| O | 111 | 79 | 15 | 0;24 | +| P | 112 | 80 | 16 | 0;25 | +| Q | 113 | 81 | 17 | 0;16 | +| R | 114 | 82 | 18 | 0;19 | +| S | 115 | 83 | 19 | 0;31 | +| T | 116 | 84 | 20 | 0;20 | +| U | 117 | 85 | 21 | 0;22 | +| V | 118 | 86 | 22 | 0;47 | +| W | 119 | 87 | 23 | 0;17 | +| X | 120 | 88 | 24 | 0;45 | +| Y | 121 | 89 | 25 | 0;21 | +| Z | 122 | 90 | 26 | 0;44 | +| 1 | 49 | 33 | \-- | 0;120 | +| 2 | 50 | 64 | 0 | 0;121 | +| 3 | 51 | 35 | \-- | 0;122 | +| 4 | 52 | 36 | \-- | 0;123 | +| 5 | 53 | 37 | \-- | 0;124 | +| 6 | 54 | 94 | 30 | 0;125 | +| 7 | 55 | 38 | \-- | 0;126 | +| 8 | 56 | 42 | \-- | 0;126 | +| 9 | 57 | 40 | \-- | 0;127 | +| 0 | 48 | 41 | \-- | 0;129 | +| \- | 45 | 95 | 31 | 0;130 | +| \= | 61 | 43 | \--- | 0;131 | +| \[ | 91 | 123 | 27 | 0;26 | +| \] | 93 | 125 | 29 | 0;27 | +| | 92 | 124 | 28 | 0;43 | +| ; | 59 | 58 | \-- | 0;39 | +| ' | 39 | 34 | \-- | 0;40 | +| , | 44 | 60 | \-- | 0;51 | +| . | 46 | 62 | \-- | 0;52 | +| / | 47 | 63 | \-- | 0;53 | +| \` | 96 | 126 | \-- | (0;41) | +| ENTER (keypad) | 13 | \-- | 10 | (0;166) | +| / (keypad) | 47 | 47 | (0;142) | (0;74) | +| \* (keypad) | 42 | (0;144) | (0;78) | \-- | +| \- (keypad) | 45 | 45 | (0;149) | (0;164) | +| \+ (keypad) | 43 | 43 | (0;150) | (0;55) | +| 5 (keypad) | (0;76) | 53 | (0;143) | \-- | + +## Resources + +- [Wikipedia: ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code) +- [Build your own Command Line with ANSI escape codes](http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html) +- [ascii-table: ANSI Escape sequences](http://ascii-table.com/ansi-escape-sequences.php) +- [bluesock: ansi codes](https://bluesock.org/~willkg/dev/ansi.html) +- [bash-hackers: Terminal Codes (ANSI/VT100) introduction](http://wiki.bash-hackers.org/scripting/terminalcodes) +- [XTerm Control Sequences](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html) +- [VT100 – Various terminal manuals](https://vt100.net/) +- [xterm.js – Supported Terminal Sequences](https://xtermjs.org/docs/api/vtfeatures/) diff --git a/content/post/first website.md b/content/post/first website.md new file mode 100644 index 0000000..d4a21fa --- /dev/null +++ b/content/post/first website.md @@ -0,0 +1,66 @@ ++++ +title = "First Website" +date = 2022-08-10 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ + +So now I can say my website is on.. even though it just literally has nothing but a printing *hello* + + +I got this *garhve.com* domain on namesilo for $9.95 per year, it's really cheap! I always want a domain that is .com suffix. + +Now, the web is https, this is a bit difficult for me. + +Due to personal interest, I didn't choose frame to base my website. I use **Nginx** but I don't familiar with it. making it shows my content is not that difficult even that I don't know much fancy state, but I stucked on SSL. + +In order to use https instead of http, I choosed **let's encrypt**, which is good for me and it's free. However, I can only getting my non-www domain working. when it comes to www domain, it still http. + +I found solutions all about using return to returning https, but it won't work + +```nginx +server { + server_name www.garhve.com; + return 301 https://www.garhve.com$request_uri +} +``` + +This would return me a 404 error... + +After searching and searching, I found where i was getting wrong. + +Above statement only return https-www which doesn't hold any contents, all I need is to redirect the https-www to https-non-www. + +So, change to this one + +```nginx +server { + listen 80; + server_name www.garhve.com garhve.com; + return 301 https://garhve.com$request_uri; +} # this block will redirect http-both to https-both + +server { + listen 443 ssl http2; #http2 is newer and more secure http + listen [::]:443 ssl http2; + + server_name www.garhve.com; + include /path_to_cert_file; + return 301 https://garhve.com$request_uri; +} # this block will redirect https-www to https-non-www + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name garhve.com; + include /path_to_cert_file; + + #location to real content +} # this block is where we hold web content. +``` + +It will redirect *https-www* to *https-non-www*. Now, both domain will point to same location -- my home page. diff --git a/content/post/getting unified experience.md b/content/post/getting unified experience.md new file mode 100644 index 0000000..8fc08af --- /dev/null +++ b/content/post/getting unified experience.md @@ -0,0 +1,20 @@ ++++ +title = "Getting unified experience" +date = 2022-12-07 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ + +Lately, I'm trying get my tools working seamlessly cross my 2 working machines as well as a server. + +Since I already heard dotfiles for a while, but didn't get chance to familiar with. So I start searching around trying to set a dotfile up. + +Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server. + +Here's a brief description: all configuration files I want to put in `.config`, all plugins and config related files I want to place in `.local`. +The files I want to sync now are the configs and plugins of vim, zsh, tmux, gpg, and git. Those 5 softwares are my root. + +The problem is, due to different environment, my config for those machines have some custom setting, such as `XDG` env, my macOS doesn't need it. diff --git a/content/post/install archlinux on tencent server.md b/content/post/install archlinux on tencent server.md new file mode 100644 index 0000000..c07c478 --- /dev/null +++ b/content/post/install archlinux on tencent server.md @@ -0,0 +1,62 @@ ++++ +title = "Install arch linux on Tencent server" +date = 2022-08-10 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ + +In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous... + +My requirement as below: + +1. abroad provider because they don't have to register.. +2. the the budget's not relax, all I can choosing was in range of $0 - $10. +3. It can runs Arch linux seamlessly + +I already eye on one: Linode. But they don't see me... and banned all my gmail account from their service... + + + +Fine! It's your loss! + +My second thought was hostkey, They got excellent support, and cheapest price comparing with other service me compared. So be it. I paid €3 to get one. + +The server was great at first. But when it comes to custom OS installation because I want my server runs Arch linux, things got frustrating. The server supports me mount custom OS installer from their library, but even it shows me that mounted successfully, i still can't boot from ISO, not saying start installation.. + +There is where excellent support comes from. I feedbacked the issue, they immediately help me fixed it. Thanks a lot! + +And then, I started installation... + +I never tried install a arch linux into server. So when it has not network. I totally fucked up, I googled and googled. Finally I found that in official wiki, this issue has a solution. The solution tells me that if we had static IP, we can get network through `systemd-network` service which comes with iso. It's very tricky. + +It associates another service called `systemd-resolve`. Network can be reachable if both in proper configuration.. + +> Start both systemd service, then edit their config.. +> +> - For `systemd-network`, we can edit `/etc/systemd/network/20-*.conf` +> - For `systemd-resolve`, we can link `/etc/resolv.conf` to `/run/systemd/resolve/stub-resolv.conf` + +After tricky part done, other steps just as normal as install in local env. + +I struggled and successfully installed arch linux on my server, but then i encountered night traffic jam.. No matter how hard I try, I just can't ssh into my server. That's unacceptable! I immediately start looking for other provider.. + +Then, I found Tencent Cloud.. + +I already have one server of it, based on Shanghai. It is good, but building a website in it would require me to register, so I never consider using it. + +I rent a server that based on Hong Kong, cost me ¥42 per month. But this has really good quality. even now at 2:05am when I'm writing this essay. It still performs stable connection. + +First thing I got hands on Tencent Hong Kong server, I changed OS to arch linux, just as before. But Tencent doesn't provide arch linux ISO, so i found some blogs on internet to know how to do it. And I succeed. + + + +There involves three parts to install arch: + +- Mount ISO to driver and delete other thing +- Manually add entry of ArchISO to grub +- Static IP is of internal whereas hostkey is public. + +So now, I got a server that running Arch Linux. Next, buiding a website on it! diff --git a/content/post/mess with bash(1).md b/content/post/mess with bash(1).md new file mode 100644 index 0000000..7b5c55a --- /dev/null +++ b/content/post/mess with bash(1).md @@ -0,0 +1,158 @@ ++++ +title = "Mess with bash(1)" +date = 2022-08-25 +[taxonomies] +categories = ["code"] +tags = ["bash"] +[extra] +math = false ++++ +### Crontab + +`crontab` is a useful tool, I really regret that I don't familar it earlier. + +It's usage really simple, and these two are my frequent using: + +```bash +crontab -e #edit crontab file that reside in /var/spool/cron +crontab -l #list current crontab job +``` + +It basic syntax as follow, also really simple + + +example of usage: + +1. delete file *foo* every minute + `* * * * * rm foo` +2. delete file *foo* every 15 minutes + `15 * * * * rm foo` +3. delete file *foo* every beginning of hour + `0 * * * * rm foo` +4. delete file *foo* every minute after 3 hours + `* 3 * * * rm foo` +5. delete file *foo* every day at 18:30 + `30 18 * * * rm foo` +6. delete file *foo* every beginning of month + `0 0 0 * * rm foo` +7. delete file *foo* on beginning of 1st,10th of month + `0 0 1,10 * * rm foo` + +The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker. + +--- + +### tr + +`tr` is really useful when encountered situation that needs struggle with string. +Three frequency ways of using `tr` + +1. **shrink** multiple characters into single one + + `tr -s '[string]'` + e.g. `echo "ssssssspaaaaace" | tr -s 'sa'` would convert "ssssssspace" to "space" +2. **delete** specific character. I usually use it to delete white space or delimiter + + `tr -d '[string]'` + e.g. `echo "blog.garhve.com" | tr -d '.o'` would convert url to "blggarhvecm" +3. **convert** specific character to another one. + + `tr '[string1]' '[string2]'` + e.g. `echo "woopwon | tr "wo" "fe"` would result "feepfen" + +--- + +### cut + +I use `cut` mostly to get word from a string, especially get relative path from absolute path. Because I always want to loop to get same sub-directories file from different main directory, `cut` helps a lot. + +for now, I only use it one way + +`echo string | cut -d '[character]' -f position` +e.g. `echo path/to/most/inner/file | cut -d '/' -f1` this will give me word before first '/', which is 'path' + +Often, `rev` will co-work with `cut` to get last one word + +e.g. `echo blog.garhve.com | rev | cut -d '.' -f 1 | rev` this will give word after last '/', which is com. + +> *a worth noting here is that the `rev` command needs to appear twice because it usage is not so intuitive, it reverse whole string* +> +> `echo "hello world" | rev` will get 'dlrow olleh` +> +> `echo "hello world" | cut -d ' ' -f1 | rev` will give result of 'dlrow' +> +> `echo "hello world" | rev | cut -d ' ' -f1` will give same result, as 'dlrow' +> +> `echo "hello world" | rev | cut -d ' ' -f1 | rev` will give expected result, as 'world' + +### Daily update bt tracker + +I already learn shell script for a while.. so I wrote a simple script to test whether I really got used to it, but result is obviously, I need more and more practice to memorize commands. + +```bash +#! /bin/sh +#bt-tracker.txt +site=https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt + +file=/path_to_aria_directory/aria2.conf + +Addr=user@addr + +# Get bt-tracker and format it to fulfill aria needs, then store in variable +bt=$(curl $site | tr -s '[:space:]' | tr '[:space:]' ',') + +# sshpass is a software, that can allow me pass ssh password as argument +# so that I don't need to wait prompt +# 410 is the line of bt tracker resides, I now no other way to replace it. +$(sshpass -p 'password' ssh -T $Addr "sed -i '410d' $file | echo $bt >> $file") +``` + +> Usage of [tr](https://blog.garhve.com/index.php/archives/23/#tr) and [cut](https://blog.garhve.com/index.php/archives/23/#cut), expansion of 'command tips' is needed + +### Ways to find files or specific string in files + +In order to look up C definitions, I need to know where linux stores header files or which files store definitions I need. So that here comes up some methods to fulfill this need: + +1. `find 'path' -name 'file_name'` + +> e.g. `find / -name stdio.h` will return multiple location that stdio.h resides. this could expand to look for others +> +>  +> +> more info could see `man find` + +--- + +2. `grep -rnw 'path' -e 'pattern'` + +> e.g. `grep --include=\*.{h,c} -rnw / -e "from_kuid" will return string and filename that contains string. +> +>  +> +> * `-r` or `-R` is recursive, +> * `-n` is line number, and +> * `-w` stands for match the whole word. +> * `-l` (lower-case L) can be added to just give the file name of matching files. +> * `-e` is the pattern used during the search +> +> Along with these, `--exclude`, `--include`, `--exclude-dir` flags could be used for efficient searching: +> +> * This will only search through those files which have .c or .h extensions: +> +> ```bash +> grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern" +> ``` +> +> * This will exclude searching all the files ending with .o extension: +> +> ```bash +> grep --exclude=\*.o -rnw '/path/to/somewhere/' -e "pattern" +> ``` +> +> * For directories it's possible to exclude one or more directories using the `--exclude-dir` parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/: +> +> ```bash +> grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern" +> ``` +> +> more info could see [man grep](https://ss64.com/bash/grep.html). diff --git a/content/post/mess with bash(2).md b/content/post/mess with bash(2).md new file mode 100644 index 0000000..1e3b744 --- /dev/null +++ b/content/post/mess with bash(2).md @@ -0,0 +1,274 @@ ++++ +title = "Mess with Bash(2)" +date = 2022-09-29 +[taxonomies] +categories = ["code"] +tags = ["bash"] +[extra] +math = false ++++ +> More info is in this [tutorial](https://https://guide.bash.academy) + +> all value expansions (ie. all syntax with a `$` prefix) can only expand inside quoted arguments if the argument was *double-quoted* . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place! + +*"Value expansions (`$...`) must **always** be double-quoted."* + + +*Never leave a value expansion unquoted.* + + +## Redirection + +### File Redirection + +**0 is standard input, 1 is standard output, 2 is standard error** + +`[x] > file, [x] < file` + +Make ***File descriptor***(FD) `x` write to / read from file. + +> `echo hello > ~/World` +> +> `read line < ~/Word` +> +> `rm file 2>/dev/null` + +### File Descriptor copying + +`[x] >& y, [x] <& y` + +make FD `x` write to / read from FD `y`'s stream + +> the connection to the stream used by FD `y` is copied to FD `x` +> +> `curl cip.cc > result 2>&1` +> +> `ping localhost > result 2>&1` +> +> ```bash +> # exec can be used to change the file descriptors of bash itself, +> # and if you use an x that doesn't yet exist, +> # bash will create a new file descriptor ("plug") for you with that number. +> # - in command is to close new FD 3 we'd created before. +> # >&- is to close FD 1, <&- is to close FD0 +> exec 3>&1 >mylog; echo moo; exec 1>&3 3>&- +> ``` + +### Appending file redirection + +`[x] >> file` + +make FD `x` append to end of the file + +> A stream to `file` is opened for writing in append mode and is connected to file descriptor `x`. The regular file redirection operator `>` empties the file's contents when it opens the file so that only your bytes will be in the file. +> +> `echo hello >> ~/world` +> +> `echo world >> ~/world` + +### Redirecting standard output and standard error + +`&>file` + +Make both FD 1 (standard output) and FD 2 (standard error) write to file + +> This is a convenience operator which does the same thing as `>file 2>&1` but is more concise. Again, you can append rather than truncate by doubling the arrow: `&>>file` +> +> `ping localhost &>result` + +### Here documents + +```bash +<<delimiter + Here document +delimiter +``` + +Make FD 0 read from the string between `delimiter`s + +> Here-Documents are great for reading blocks of text to command line. +> +> ```bash +> cat << EOF +> this is within here document +> I can write as many lines as I like +> and terminate with line of demiliter only +> EOF //end of heredoc +> ``` + +### Here strings + +`<<< string` + +Make FD 0 read from the `string` + +> Here strings are very similar to here documents but more concise. They are generally preferred over here documents. +> +> ```bash +> cat <<< "This, +> is the here strings. tab will also be read." +> ``` + +### Moving file decipher + +`[x]>&y-, [x]<&y-` + +Replace FD `x` with FD `y` and close FD `y` + +> Easy way of `[x]>&y, y>&-` +> +> ```bash +> # 3>&1-: copy FD 1 to FD 3 and close FD 1. +> # >&3-: copy FD 3 to FD 1 and close FD 3. +> exec 3>&1- >mylog; echo moo; exec >&3- +> ``` + +### Reading and writing with file descriptor + +`[x] <> file` + +Open FD `x` for both reading and writing to `file` + +> The file descriptor at x is opened with a stream to the file that can be used for writing as well as reading bytes. Usually you'll use two file descriptors for this. **One of the rare cases where this is useful is when setting up a stream with a read/write device such as a network socket**. +> +> ```bash +> exec 5<>aFile +> cat >&5 "Hello world" # make FD 1 write to where FD 5 currently writing, copy file descriptor FD 5 to FD 1 +> cat <&5 # make FD 0 read from where FD 5 currently reading, copy file descriptor FD 5 to FD 0, then cat will send content to FD 1 +> ``` + +Exercise + +> Q: fix `exec 3>&2 2>log; echo 'Hello!'; exec 2>&3` so that the message is properly saved into the `log` file and such that FD 3 is properly closed afterwards: +> +> A: +> +> 1. `exec 3>&1- 3>log; echo 'Hello!'; exec 1>&3-` +> 2. `exec 3>&1 1>&- 3>log; echo 'Hello!'; exec 1>&3 3>&-` + +## Expansion + +### pathname expansion + +1. pattern expansion is performed by bash before command even execute + + > `file *` will show info about all file in current directory. `*` will expand to content before `file` execute. + > +2. A *glob* is the name of the type of pattern supported by the bash shell. + + > basic glob name supported by bash + > + >  + > + > **Those glob will only affect current directory, explicit expression is required to working on other directory.** `ls /sub/*` + > +3. extended glob can be enable to get more powerful but also easy confusing feature of bash + + > bash: `shopt -s extglob` + > zsh. : `setopt extendedglob` + >  + > + >  + > + +### Command Substitution + +we can expansion commands within commands, but must use double-quote `""` instead of `''` + +```bash +# this will output contents in hello.h to screen +cat hello.h + +# this will expand `cat hello.h` to real contents in +# file hello.h and concatenate to previous sentence +echo "file hello.h contains contents of $(cat hello.h)" + +# this will output 'file hello.h contains contents of $(cat hello.h)' +# without expand command in $() +echo 'file hello.h contains contents of $(cat hello.h)' +``` + +In command, `$()` is called *value expansion*, it consists of value-expansion prefix `$` and subshell `(...)`. A subshell is essentially a small new bash process that is used to run a command while the main bash shell waits for the result. + +## Parameters + +There are three kind of parameters: + +1. Environment Parameter +2. Positional Parameter +3. Variables + +### Environment Parameter + +environment variables exist at the process level. That means they are not a feature of the bash shell, but rather a feature of any program process on your system. They can inherit by children, but children's EV can't be given to parent. + +### Positional Parameter + +Just as name indicates, these kind of parameters indicate arguments' position, and always starting from 0. + +for example, imaging we have a script `rename`, arguments could be passed to it to extend its usage: + +`rename dir name` there, we passed `dir` and `name` as argument, so that positional parameters in script would be `$1` and `$2`, representing arguments respectively. after `$2`, such as `$3` is unset since there has no more argument. + +> Positional Parameter is read-only + +a new usage: `bash -c 'ls "$1"' -- '/home'`. This will working like `ls /home`, dash is necessary since it is first variable in shell we ran commands and it makes positional value of arguments populated after it stand as we expect in shell single-quoted command gonna run in. + +### Special Parameter + +Special parameters are parameters whose name is a single symbolic character, they are used to request certain state information from the bash shell. Like positional parameter, they are *read-only*. + + + +### Variables + +definition: `name=value` *//no space around `=` like other programming language support* + +call: like *command expansion*, using variable is to expand it with prefix `$`, e.g. `$name` + +* Keep in mind, Expansion should always be double-quoted * + +### Parameter expansion + +> [GNU material](https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html) + +we expand parameters by prefixing their name with a `$` symbol + +> e.g. `name=me; echo hello "$name"`. `hello me`. + +In addition, we can put braces (`{` and `}`) around our parameter, which indicates where variable is about to begin and end. + +> e.g. `name=orange; echo there are 4 "${name}s"` `there are 4 oranges`. +> +> ```bash +> name=orange +> echo "there are 4 ${name}s." # there are 4 oranges. +> echo "there are 4 $names." # there are 4 . +> ``` +> +> here, we put `{}`around`name`so that bash can be told that suffix `s` is not a part of variable. otherwise, it will treat `names` as parameter and looking for its value, which is none in our example. + +parameter expansion brings up a powerful feature: *parameter expansion oerators* + +> While expanding a parameter, it is possible to apply an operator to the expanding value without alternate original value. +> +> I use these mostly +> +> ```bash +> # remove string before pattern ${name#pattern} shortest ${name##pattern} longest +> # remove string after pattern ${name%pattern} longest ${name%%pattern} shortest +> # delete first matching pattern ${name/pattern} +> # delete all matching pattern ${name//pattern} +> # substitute pattern with string ${name//pattern/string} +> +> foo="foo-bar-foobar" +> echo ${foo#*-} # echoes 'bar-foobar' (Removes 'foo-' because that matches '*-') +> echo ${foo##*-} # echoes 'foobar' (Removes 'foo-bar-') +> echo ${foo%-*} # echoes 'foo-bar' +> echo ${foo%%-*} # echoes 'foo' +> echo ${foo/-} # echoes 'foobar-foobar' +> echo ${foo//-} # echoes 'foobarfoobar' +> echo ${foo//-/_} # echoes 'foo_bar_foobar' +> ``` + + diff --git a/content/post/no problemo.md b/content/post/no problemo.md new file mode 100644 index 0000000..5cd9b8c --- /dev/null +++ b/content/post/no problemo.md @@ -0,0 +1,18 @@ ++++ +title = "No Problemo" +date = 2022-12-14 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ + +My feeling to express are fading... Not sure how I know it, just got this sense. + +Recently, I picked up an anime named "[The Simpsons](https://en.wikipedia.org/wiki/The_Simpsons)" which I watched first episode back in highschool. +This first time was not gave me too much impression. +but I fell in love with it right after re-watched first episode! So I downloaded the series up to 17.(33 in total but I'm not in rush) + + +It double diff --git a/content/post/past is great.md b/content/post/past is great.md new file mode 100644 index 0000000..151ddb3 --- /dev/null +++ b/content/post/past is great.md @@ -0,0 +1,25 @@ ++++ +title = "Past Is Great" +date = 2022-11-07 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ +Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great! + +First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect. + +Second is my YouTube keeps suggesting songs that got me reminiscence bump. Such songs that remind me when the time power cut is regular and the phone has not yet existed. I still remember the feel when I am wrapped in quilt and watch TV in the cold night... dizzy. + +Third just happened now, I was gonna start watching Doraemon, and the title of the episode I’m getting at is ‘Past is Great’, seriously??? + +even two of them would tell me the present is better than past, I still miss past. Midnight in Paris said we love past because present unsatisfied. And 'Past is Great' shows us comparing of ancient and modern lives style. Both views are most people miss about past, either think their life sucks or just wanna experience life in past. + +Well, I'm not both... I miss past is that it is fixed, it is unchangeable. No matter what we do now, past is past, it right there, waiting to be read. this feel just like when I watch shows or movies. I'd want to know what ending it will be, and release my imagination along with shows to get that result. + +Same thing happens here. Few scenes I remember, or the music I think familiar, but I don't know when or where I experienced it, I would start my imagination. Maybe I was doing something funny, maybe I was going to somewhere nice, maybe... maybe... then, I got here. The beauty part is, I always thought nice thing, and it always make me feel ease. That's good enough for me. + +I said there's this sign... Actually, not really. Just some shit things happend recently that make me want to run away. The 'sign' just is what I want to see now, not that it really a sign. + diff --git a/content/post/测试自动创建博客.md b/content/post/测试自动创建博客.md new file mode 100644 index 0000000..6ea2af8 --- /dev/null +++ b/content/post/测试自动创建博客.md @@ -0,0 +1,77 @@ ++++ +title = "测试自动创建博客" +date = 2022-12-09 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ + +hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: +### 写作 +编辑器随便用个支持MD的就行了,这句陈述挺好。 + +但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 +所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local +文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, +同步文件再在每台电脑上额外加个云,想想我都受不了。 + +不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 +问题我不太想用。 + +其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, +达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 +使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 +直接使用vim写文章,有点别扭... 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难... +先将就一下吧,看看有没有什么好的办法解决它。 + +### 图片 +图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, +但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 +服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 + +在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 +保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 +我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, +后面使用即可。 + +Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ + +### 发布 +Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 +自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 +尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, +其中便包括这个博客。 +Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 +cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 + +原先,发布一篇博客我的流程为, +> hugo new post -> vim 找到文章 -> 保存或者发布 -> 然后到public文件夹 +push出去。 + +太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 +怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 +我也可以直接将草稿发布出来,看得见,我才有动力写~ + +这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 +也许可以将代码优化下以后就省心了,哈哈。 + +更新:拖了三天,终于把代码补完了~ [blog.sh](https://git.garhve.com/codes/tree/bash/blog.sh?id=46e07255bbe67b1dbf93dcd7f33e25f10eb8f8de) +```bash +# usage: prog new/edit/push [en/cn] + +push() { + read -r -p "Do you want to push?[y/n] " ans +... +[ $# -lt 1 ] && echo "usage: $(basename $0) new/edit/push [en/cn]" + +[ $1 == "new" ] && new "$2" +[ $1 == "edit" ] && edit "$2" +[ $1 == "push" ] && push +``` + +以后只需要在文件夹里`./blog.sh action language` 即可。 +大大方便了使用呀。 + +也许以后就能多写写了(bushi) diff --git a/content/post/随笔1.md b/content/post/随笔1.md new file mode 100644 index 0000000..f088e21 --- /dev/null +++ b/content/post/随笔1.md @@ -0,0 +1,38 @@ ++++ +title = "随笔(1)" +date = 2022-12-20 +[taxonomies] +categories = ["period"] +tags = ["gibberish"] +[extra] +math = false ++++ +真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, +刮得我脸颊生疼。那一瞬间,我有些恍惚。 + +我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 +打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, +但在新冠的淫威下,终究是落陷了。 + +虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, +与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, +如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 +但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, +不仅催促我多囤药,口罩也要戴双层。 +我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。 + +下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, +我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 +看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, +还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。 + +我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, +甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 +电影没法去了,我需要出门买药。 + +重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! +即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, +令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 +我忘记了思考,我生而自由。 + +甩甩脑袋,我下了楼,还有退烧药等着我去买。 diff --git a/en/index.html b/en/index.html deleted file mode 100644 index b9885a0..0000000 --- a/en/index.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html lang="en-us"> - <head> - <title>https://blog.garhve.com</title> - <link rel="canonical" href="https://blog.garhve.com"> - <meta name="robots" content="noindex"> - <meta charset="utf-8"> - <meta http-equiv="refresh" content="0; url=https://blog.garhve.com"> - </head> -</html> diff --git a/en/sitemap.xml b/en/sitemap.xml deleted file mode 100644 index 5b63d59..0000000 --- a/en/sitemap.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" - xmlns:xhtml="http://www.w3.org/1999/xhtml"> - <url> - <loc>https://blog.garhve.com/posts/no-problemo/</loc> - <lastmod>2022-12-14T11:03:52+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/</loc> - <lastmod>2022-12-14T11:03:52+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/" - /> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/" - /> - </url><url> - <loc>https://blog.garhve.com/posts/</loc> - <lastmod>2022-12-14T11:03:52+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/posts/" - /> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/posts/" - /> - </url><url> - <loc>https://blog.garhve.com/posts/8/</loc> - <lastmod>2022-12-07T15:05:30+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/posts/7/</loc> - <lastmod>2022-11-07T09:16:15+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/posts/6/</loc> - <lastmod>2022-09-29T09:43:02+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/posts/5/</loc> - <lastmod>2022-09-12T09:02:06+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/posts/4/</loc> - <lastmod>2022-09-03T14:33:37+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/posts/3/</loc> - <lastmod>2022-08-25T13:40:56+08:00</lastmod> - </url><url> - <loc>https://blog.garhve.com/posts/2/</loc> - <lastmod>2022-08-10T19:24:59+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/posts/2/" - /> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/posts/2/" - /> - </url><url> - <loc>https://blog.garhve.com/posts/1/</loc> - <lastmod>2022-08-10T17:21:02+08:00</lastmod> - <xhtml:link - rel="alternate" - hreflang="cn" - href="https://blog.garhve.com/cn/posts/1/" - /> - <xhtml:link - rel="alternate" - hreflang="en" - href="https://blog.garhve.com/posts/1/" - /> - </url> -</urlset> diff --git a/fonts/Arvo.woff2 b/fonts/Arvo.woff2 Binary files differdeleted file mode 100644 index 03a457a..0000000 --- a/fonts/Arvo.woff2 +++ /dev/null diff --git a/fonts/FiraCode-Regular.woff2 b/fonts/FiraCode-Regular.woff2 Binary files differdeleted file mode 100644 index f8b63fb..0000000 --- a/fonts/FiraCode-Regular.woff2 +++ /dev/null diff --git a/fonts/PermanentMarker-Regular.woff2 b/fonts/PermanentMarker-Regular.woff2 Binary files differdeleted file mode 100644 index f4f49c0..0000000 --- a/fonts/PermanentMarker-Regular.woff2 +++ /dev/null diff --git a/fonts/huanzi.woff2 b/fonts/huanzi.woff2 Binary files differdeleted file mode 100644 index d2c5086..0000000 --- a/fonts/huanzi.woff2 +++ /dev/null diff --git a/index.html b/index.html deleted file mode 100644 index f8d45bf..0000000 --- a/index.html +++ /dev/null @@ -1,241 +0,0 @@ -<!DOCTYPE html> -<html lang="en-us" prefix="og: http://ogp.me/ns#"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/" /> - <link rel="canonical" href="https://blog.garhve.com/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "", - "name" : "blog | garhve\u0027s hub", - "headline" : "blog | garhve\u0027s hub", - "description" : "", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-14 11:03:52 \u002b0800 CST", - "dateModified" : "2022-12-14 11:03:52 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/", - "keywords" : [ ] - } -</script> -<title>blog | garhve's hub</title> - <meta property="og:title" content="blog | garhve's hub" /> - <meta property="og:type" content="website" /> - <meta property="og:description" content="" /> - <meta name="description" content="" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="posts"> - <div class="row"> - <div class="col-xs-12"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - <div id="posts-list"> - <section> - <h1 class="site-date-catalog">2022</h1> - - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-12-14 11:03:52 CST">Dec 14</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/no-problemo/">[draft]No Problemo</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-12-07 15:05:30 CST">Dec 07</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/8/">Getting unified experience</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-11-07 09:16:15 CST">Nov 07</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/7/">Past Is Great</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-09-29 09:43:02 CST">Sep 29</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/6/">Mess with Bash(2)</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-09-12 09:02:06 CST">Sep 12</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/5/">Escape Sequences</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-09-03 14:33:37 CST">Sep 03</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/4/">Architecture of Linux Kernel</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-08-25 13:40:56 CST">Aug 25</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/3/">Mess with bash(1)</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-08-10 19:24:59 CST">Aug 10</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/2/">Install arch linux on Tencent server</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-6 col-sm-2"> - <time datetime="2022-08-10 17:21:02 CST">Aug 10</time> - </div> - <div class="posts-title col-xs-9 col-sm-10"> - <div class="row"> - <div class="col-xs-11 col-sm-10"> - <a href="/posts/1/">First Website</a> - </div> - </div> - </div> - </div> - - </section> - - </div> - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - -</body> - -</html> diff --git a/index.xml b/index.xml deleted file mode 100644 index b32d96d..0000000 --- a/index.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> - <channel> - <title>blog | garhve's hub</title> - <link>https://blog.garhve.com/</link> - <description>Recent content on blog | garhve's hub</description> - <generator>Hugo -- gohugo.io</generator> - <language>en-us</language> - <lastBuildDate>Wed, 14 Dec 2022 11:03:52 +0800</lastBuildDate><atom:link href="https://blog.garhve.com/index.xml" rel="self" type="application/rss+xml" /> - <item> - <title>[draft]No Problemo</title> - <link>https://blog.garhve.com/posts/no-problemo/</link> - <pubDate>Wed, 14 Dec 2022 11:03:52 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/no-problemo/</guid> - <description>My feeling to express are fading&hellip; Not sure how I know it, just got this sense. Recently, I picked up an anime named &ldquo;The Simpsons&rdquo; which I watched first episode back in highschool. I fell in love with it right after re-watched first episode! So I downloaded the whole</description> - </item> - - <item> - <title>Getting unified experience</title> - <link>https://blog.garhve.com/posts/8/</link> - <pubDate>Wed, 07 Dec 2022 15:05:30 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/8/</guid> - <description>Lately, I&rsquo;m trying get my tools working seamlessly cross my 2 working machines as well as a server. -Since I already heard dotfiles for a while, but didn&rsquo;t get chance to familiar with. So I start searching around trying to set a dotfile up. -Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server. -Here&rsquo;s a brief description: all configuration files I want to put in .</description> - </item> - - <item> - <title>Past Is Great</title> - <link>https://blog.garhve.com/posts/7/</link> - <pubDate>Mon, 07 Nov 2022 09:16:15 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/7/</guid> - <description>Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great! -First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect.</description> - </item> - - <item> - <title>Mess with Bash(2)</title> - <link>https://blog.garhve.com/posts/6/</link> - <pubDate>Thu, 29 Sep 2022 09:43:02 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/6/</guid> - <description>More info is in this tutorial -all value expansions (ie. all syntax with a $ prefix) can only expand inside quoted arguments if the argument was double-quoted . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place! -&ldquo;Value expansions ($...) must always be double-quoted.&rdquo; -Never leave a value expansion unquoted. -Redirection File Redirection 0 is standard input, 1 is standard output, 2 is standard error</description> - </item> - - <item> - <title>Escape Sequences</title> - <link>https://blog.garhve.com/posts/5/</link> - <pubDate>Mon, 12 Sep 2022 09:02:06 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/5/</guid> - <description>copied from github in case one day it disappears -more information could visit vt100 User Guide -ANSI Escape Sequences Standard escape codes are prefixed with Escape: -Ctrl-Key: ^[ Octal: \033 Unicode: \u001b Hexadecimal: \x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. -Arguments are delimeted by semi colon (;).</description> - </item> - - <item> - <title>Architecture of Linux Kernel</title> - <link>https://blog.garhve.com/posts/4/</link> - <pubDate>Sat, 03 Sep 2022 14:33:37 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/4/</guid> - <description>Description Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged). -Modern operating systems support at least 2 levels: -User space: For applications to run in unprivileged user mode Kernel space: For the kernel (and all its components) to run in privileged mode – kernel mode Address of these 2 spaces are separate.</description> - </item> - - <item> - <title>Mess with bash(1)</title> - <link>https://blog.garhve.com/posts/3/</link> - <pubDate>Thu, 25 Aug 2022 13:40:56 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/3/</guid> - <description>Crontab crontab is a useful tool, I really regret that I don&rsquo;t familar it earlier. -It&rsquo;s usage really simple, and these two are my frequent using: -crontab -e #edit crontab file that reside in /var/spool/cron crontab -l #list current crontab job It basic syntax as follow, also really simple example of usage: -delete file foo every minute * * * * * rm foo delete file foo every 15 minutes 15 * * * * rm foo delete file foo every beginning of hour 0 * * * * rm foo delete file foo every minute after 3 hours * 3 * * * rm foo delete file foo every day at 18:30 30 18 * * * rm foo delete file foo every beginning of month 0 0 0 * * rm foo delete file foo on beginning of 1st,10th of month 0 0 1,10 * * rm foo The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker.</description> - </item> - - <item> - <title>Install arch linux on Tencent server</title> - <link>https://blog.garhve.com/posts/2/</link> - <pubDate>Wed, 10 Aug 2022 19:24:59 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/2/</guid> - <description>In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous&hellip; -My requirement as below: -abroad provider because they don&rsquo;t have to register.. the the budget&rsquo;s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don&rsquo;t see me&hellip; and banned all my gmail account from their service&hellip;</description> - </item> - - <item> - <title>First Website</title> - <link>https://blog.garhve.com/posts/1/</link> - <pubDate>Wed, 10 Aug 2022 17:21:02 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/1/</guid> - <description>So now I can say my website is on.. even though it just literally has nothing but a printing hello I got this garhve.com domain on namesilo for $9.95 per year, it&rsquo;s really cheap! I always want a domain that is .com suffix. -Now, the web is https, this is a bit difficult for me. -Due to personal interest, I didn&rsquo;t choose frame to base my website. I use Nginx but I don&rsquo;t familiar with it.</description> - </item> - - </channel> -</rss> diff --git a/js/lazyload.min.js b/js/lazyload.min.js deleted file mode 100644 index de094a9..0000000 --- a/js/lazyload.min.js +++ /dev/null @@ -1,2 +0,0 @@ -var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";function t(t,e,n){var o=e._settings;!n&&i(t)||(C(o.callback_enter,t),R.indexOf(t.tagName)>-1&&(N(t,e),I(t,o.class_loading)),E(t,e),a(t),C(o.callback_set,t))}var e={elements_selector:"img",container:document,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,callback_load:null,callback_error:null,callback_set:null,callback_enter:null,callback_finish:null,to_webp:!1},n=function(t){return _extends({},e,t)},o=function(t,e){return t.getAttribute("data-"+e)},r=function(t,e,n){var o="data-"+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},a=function(t){return r(t,"was-processed","true")},i=function(t){return"true"===o(t,"was-processed")},s=function(t,e){return r(t,"ll-timeout",e)},c=function(t){return o(t,"ll-timeout")},l=function(t){return t.filter(function(t){return!i(t)})},u=function(t,e){return t.filter(function(t){return t!==e})},d=function(t,e){var n,o=new t(e);try{n=new CustomEvent("LazyLoad::Initialized",{detail:{instance:o}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent("LazyLoad::Initialized",!1,!1,{instance:o})}window.dispatchEvent(n)},f=function(t,e){return e?t.replace(/\.(jpe?g|png)/gi,".webp"):t},_="undefined"!=typeof window,v=_&&!("onscroll"in window)||/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),g=_&&"IntersectionObserver"in window,h=_&&"classList"in document.createElement("p"),b=_&&function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))&&0===t.toDataURL("image/webp").indexOf("data:image/webp")}(),m=function(t,e,n,r){for(var a,i=0;a=t.children[i];i+=1)if("SOURCE"===a.tagName){var s=o(a,n);p(a,e,s,r)}},p=function(t,e,n,o){n&&t.setAttribute(e,f(n,o))},y=function(t,e){var n=b&&e.to_webp,r=o(t,e.data_src),a=o(t,e.data_bg);if(r){var i=f(r,n);t.style.backgroundImage='url("'+i+'")'}if(a){var s=f(a,n);t.style.backgroundImage=s}},w={IMG:function(t,e){var n=b&&e.to_webp,r=e.data_srcset,a=t.parentNode;a&&"PICTURE"===a.tagName&&m(a,"srcset",r,n);var i=o(t,e.data_sizes);p(t,"sizes",i);var s=o(t,r);p(t,"srcset",s,n);var c=o(t,e.data_src);p(t,"src",c,n)},IFRAME:function(t,e){var n=o(t,e.data_src);p(t,"src",n)},VIDEO:function(t,e){var n=e.data_src,r=o(t,n);m(t,"src",n),p(t,"src",r),t.load()}},E=function(t,e){var n=e._settings,o=t.tagName,r=w[o];if(r)return r(t,n),e._updateLoadingCount(1),void(e._elements=u(e._elements,t));y(t,n)},I=function(t,e){h?t.classList.add(e):t.className+=(t.className?" ":"")+e},L=function(t,e){h?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},C=function(t,e){t&&t(e)},O=function(t,e,n){t.addEventListener(e,n)},k=function(t,e,n){t.removeEventListener(e,n)},x=function(t,e,n){O(t,"load",e),O(t,"loadeddata",e),O(t,"error",n)},A=function(t,e,n){k(t,"load",e),k(t,"loadeddata",e),k(t,"error",n)},z=function(t,e,n){var o=n._settings,r=e?o.class_loaded:o.class_error,a=e?o.callback_load:o.callback_error,i=t.target;L(i,o.class_loading),I(i,r),C(a,i),n._updateLoadingCount(-1)},N=function(t,e){var n=function n(r){z(r,!0,e),A(t,n,o)},o=function o(r){z(r,!1,e),A(t,n,o)};x(t,n,o)},R=["IMG","IFRAME","VIDEO"],S=function(e,n,o){t(e,o),n.unobserve(e)},M=function(t){var e=c(t);e&&(clearTimeout(e),s(t,null))},j=function(t,e,n){var o=n._settings.load_delay,r=c(t);r||(r=setTimeout(function(){S(t,e,n),M(t)},o),s(t,r))},D=function(t){return t.isIntersecting||t.intersectionRatio>0},T=function(t){return{root:t.container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}},U=function(t,e){this._settings=n(t),this._setObserver(),this._loadingCount=0,this.update(e)};return U.prototype={_manageIntersection:function(t){var e=this._observer,n=this._settings.load_delay,o=t.target;n?D(t)?j(o,e,this):M(o):D(t)&&S(o,e,this)},_onIntersection:function(t){t.forEach(this._manageIntersection.bind(this))},_setObserver:function(){g&&(this._observer=new IntersectionObserver(this._onIntersection.bind(this),T(this._settings)))},_updateLoadingCount:function(t){this._loadingCount+=t,0===this._elements.length&&0===this._loadingCount&&C(this._settings.callback_finish)},update:function(t){var e=this,n=this._settings,o=t||n.container.querySelectorAll(n.elements_selector);this._elements=l(Array.prototype.slice.call(o)),!v&&this._observer?this._elements.forEach(function(t){e._observer.observe(t)}):this.loadAll()},destroy:function(){var t=this;this._observer&&(this._elements.forEach(function(e){t._observer.unobserve(e)}),this._observer=null),this._elements=null,this._settings=null},load:function(e,n){t(e,this,n)},loadAll:function(){var t=this;this._elements.forEach(function(e){t.load(e)})}},_&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)d(t,n);else d(t,e)}(U,window.lazyLoadOptions),U}); -//# sourceMappingURL=lazyload.min.js.map
\ No newline at end of file diff --git a/posts/1/index.html b/posts/1/index.html deleted file mode 100644 index c762f9b..0000000 --- a/posts/1/index.html +++ /dev/null @@ -1,200 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/1/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/1/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "First Website", - "headline" : "First Website", - "description" : "So now I can say my website is on.. even though it just literally has nothing but a printing hello I got this garhve.com domain on namesilo for $9.95 per year, it\u0026rsquo;s really cheap! I always want a domain that is .com suffix.\nNow, the web is https, this is a bit difficult for me.\nDue to personal interest, I didn\u0026rsquo;t choose frame to base my website. I use Nginx but I don\u0026rsquo;t familiar with it.", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-08-10 17:21:02 \u002b0800 CST", - "dateModified" : "2022-08-10 17:21:02 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/1\/", - "keywords" : [ ] - } -</script> -<title>First Website</title> - <meta property="og:title" content="First Website" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="So now I can say my website is on.. even though it just literally has nothing but a printing hello I got this garhve.com domain on namesilo for $9.95 per year, it&rsquo;s really cheap! I always want a domain that is .com suffix. -Now, the web is https, this is a bit difficult for me. -Due to personal interest, I didn&rsquo;t choose frame to base my website. I use Nginx but I don&rsquo;t familiar with it." /> - <meta name="description" content="So now I can say my website is on.. even though it just literally has nothing but a printing hello I got this garhve.com domain on namesilo for $9.95 per year, it&rsquo;s really cheap! I always want a domain that is .com suffix. -Now, the web is https, this is a bit difficult for me. -Due to personal interest, I didn&rsquo;t choose frame to base my website. I use Nginx but I don&rsquo;t familiar with it." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">First Website</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-08-10 17:21:02 CST"> - 10 Aug 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>So now I can say my website is on.. even though it just literally has nothing but a printing <em>hello</em> -<img src="https://assets.garhve.com/pictures/screenshots/2022/08/2751557406.png" alt="FirstWebsite.png"></p> -<p>I got this <em>garhve.com</em> domain on namesilo for $9.95 per year, it’s really cheap! I always want a domain that is .com suffix.</p> -<p>Now, the web is https, this is a bit difficult for me.</p> -<p>Due to personal interest, I didn’t choose frame to base my website. I use <strong>Nginx</strong> but I don’t familiar with it. making it shows my content is not that difficult even that I don’t know much fancy state, but I stucked on SSL.</p> -<p>In order to use https instead of http, I choosed <strong>let’s encrypt</strong>, which is good for me and it’s free. However, I can only getting my non-www domain working. when it comes to www domain, it still http.</p> -<p>I found solutions all about using return to returning https, but it won’t work</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-nginx" data-lang="nginx"><span style="display:flex;"><span><span style="font-weight:bold">server</span> { -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">server_name</span> <span style="font-style:italic">www.garhve.com</span>; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">return</span> 301 <span style="font-style:italic">https://www.garhve.com</span>$request_uri -</span></span><span style="display:flex;"><span><span style="">}</span> -</span></span></code></pre></div><p>This would return me a 404 error…</p> -<p>After searching and searching, I found where i was getting wrong.</p> -<p>Above statement only return https-www which doesn’t hold any contents, all I need is to redirect the https-www to https-non-www.</p> -<p>So, change to this one</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-nginx" data-lang="nginx"><span style="display:flex;"><span><span style="font-weight:bold">server</span> { -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">listen</span> 80; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">server_name</span> <span style="font-style:italic">www.garhve.com</span> <span style="font-style:italic">garhve.com</span>; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">return</span> 301 <span style="font-style:italic">https://garhve.com</span>$request_uri; -</span></span><span style="display:flex;"><span>} <span style="font-style:italic"># this block will redirect http-both to https-both -</span></span></span><span style="display:flex;"><span><span style="font-style:italic"></span> -</span></span><span style="display:flex;"><span><span style="font-weight:bold">server</span> { -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">listen</span> 443 <span style="font-style:italic">ssl</span> <span style="font-style:italic">http2</span>; <span style="font-style:italic">#http2 is newer and more secure http -</span></span></span><span style="display:flex;"><span><span style="font-style:italic"></span> <span style="font-weight:bold">listen</span> <span style="font-style:italic">[::]:443</span> <span style="font-style:italic">ssl</span> <span style="font-style:italic">http2</span>; -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">server_name</span> <span style="font-style:italic">www.garhve.com</span>; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">include</span> <span style="font-style:italic">/path_to_cert_file</span>; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">return</span> 301 <span style="font-style:italic">https://garhve.com</span>$request_uri; -</span></span><span style="display:flex;"><span>} <span style="font-style:italic"># this block will redirect https-www to https-non-www -</span></span></span><span style="display:flex;"><span><span style="font-style:italic"></span> -</span></span><span style="display:flex;"><span><span style="font-weight:bold">server</span> { -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">listen</span> 443 <span style="font-style:italic">ssl</span> <span style="font-style:italic">http2</span>; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">listen</span> <span style="font-style:italic">[::]:443</span> <span style="font-style:italic">ssl</span> <span style="font-style:italic">http2</span>; -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">server_name</span> <span style="font-style:italic">garhve.com</span>; -</span></span><span style="display:flex;"><span> <span style="font-weight:bold">include</span> <span style="font-style:italic">/path_to_cert_file</span>; -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span> <span style="font-style:italic">#location to real content -</span></span></span><span style="display:flex;"><span><span style="font-style:italic"></span>} <span style="font-style:italic"># this block is where we hold web content. -</span></span></span></code></pre></div><p>It will redirect <em>https-www</em> to <em>https-non-www</em>. Now, both domain will point to same location – my home page.</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/2/index.html b/posts/2/index.html deleted file mode 100644 index d56d8c5..0000000 --- a/posts/2/index.html +++ /dev/null @@ -1,197 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/2/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/2/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Install arch linux on Tencent server", - "headline" : "Install arch linux on Tencent server", - "description" : "In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous\u0026hellip;\nMy requirement as below:\nabroad provider because they don\u0026rsquo;t have to register.. the the budget\u0026rsquo;s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don\u0026rsquo;t see me\u0026hellip; and banned all my gmail account from their service\u0026hellip;", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-08-10 19:24:59 \u002b0800 CST", - "dateModified" : "2022-08-10 19:24:59 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/2\/", - "keywords" : [ ] - } -</script> -<title>Install arch linux on Tencent server</title> - <meta property="og:title" content="Install arch linux on Tencent server" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous&hellip; -My requirement as below: -abroad provider because they don&rsquo;t have to register.. the the budget&rsquo;s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don&rsquo;t see me&hellip; and banned all my gmail account from their service&hellip;" /> - <meta name="description" content="In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous&hellip; -My requirement as below: -abroad provider because they don&rsquo;t have to register.. the the budget&rsquo;s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don&rsquo;t see me&hellip; and banned all my gmail account from their service&hellip;" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Install arch linux on Tencent server</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-08-10 19:24:59 CST"> - 10 Aug 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous…</p> -<p>My requirement as below:</p> -<ol> -<li>abroad provider because they don’t have to register..</li> -<li>the the budget’s not relax, all I can choosing was in range of $0 - $10.</li> -<li>It can runs Arch linux seamlessly</li> -</ol> -<p>I already eye on one: Linode. But they don’t see me… and banned all my gmail account from their service…</p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/08/38383267.png" alt="cancelEmail.png"></p> -<p>Fine! It’s your loss!</p> -<p>My second thought was hostkey, They got excellent support, and cheapest price comparing with other service me compared. So be it. I paid €3 to get one.</p> -<p>The server was great at first. But when it comes to custom OS installation because I want my server runs Arch linux, things got frustrating. The server supports me mount custom OS installer from their library, but even it shows me that mounted successfully, i still can’t boot from ISO, not saying start installation..</p> -<p>There is where excellent support comes from. I feedbacked the issue, they immediately help me fixed it. Thanks a lot!</p> -<p>And then, I started installation…</p> -<p>I never tried install a arch linux into server. So when it has not network. I totally fucked up, I googled and googled. Finally I found that in official wiki, this issue has a solution. The solution tells me that if we had static IP, we can get network through <code>systemd-network</code> service which comes with iso. It’s very tricky.</p> -<p>It associates another service called <code>systemd-resolve</code>. Network can be reachable if both in proper configuration..</p> -<blockquote> -<p>Start both systemd service, then edit their config..</p> -<ul> -<li>For <code>systemd-network</code>, we can edit <code>/etc/systemd/network/20-*.conf</code></li> -<li>For <code>systemd-resolve</code>, we can link <code>/etc/resolv.conf</code> to <code>/run/systemd/resolve/stub-resolv.conf</code></li> -</ul> -</blockquote> -<p>After tricky part done, other steps just as normal as install in local env.</p> -<p>I struggled and successfully installed arch linux on my server, but then i encountered night traffic jam.. No matter how hard I try, I just can’t ssh into my server. That’s unacceptable! I immediately start looking for other provider..</p> -<p>Then, I found Tencent Cloud..</p> -<p>I already have one server of it, based on Shanghai. It is good, but building a website in it would require me to register, so I never consider using it.</p> -<p>I rent a server that based on Hong Kong, cost me ¥42 per month. But this has really good quality. even now at 2:05am when I’m writing this essay. It still performs stable connection.</p> -<p>First thing I got hands on Tencent Hong Kong server, I changed OS to arch linux, just as before. But Tencent doesn’t provide arch linux ISO, so i found some blogs on internet to know how to do it. And I succeed.</p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/08/4068602805.png" alt="tencentArch.png"></p> -<p>There involves three parts to install arch:</p> -<ul> -<li>Mount ISO to driver and delete other thing</li> -<li>Manually add entry of ArchISO to grub</li> -<li>Static IP is of internal whereas hostkey is public.</li> -</ul> -<p>So now, I got a server that running Arch Linux. Next, buiding a website on it!</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/3/index.html b/posts/3/index.html deleted file mode 100644 index 7608da9..0000000 --- a/posts/3/index.html +++ /dev/null @@ -1,282 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/3/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/3/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Mess with bash(1)", - "headline" : "Mess with bash(1)", - "description" : "Crontab crontab is a useful tool, I really regret that I don\u0026rsquo;t familar it earlier.\nIt\u0026rsquo;s usage really simple, and these two are my frequent using:\ncrontab -e #edit crontab file that reside in \/var\/spool\/cron crontab -l #list current crontab job It basic syntax as follow, also really simple example of usage:\ndelete file foo every minute * * * * * rm foo delete file foo every 15 minutes 15 * * * * rm foo delete file foo every beginning of hour 0 * * * * rm foo delete file foo every minute after 3 hours * 3 * * * rm foo delete file foo every day at 18:30 30 18 * * * rm foo delete file foo every beginning of month 0 0 0 * * rm foo delete file foo on beginning of 1st,10th of month 0 0 1,10 * * rm foo The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker.", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-08-25 13:40:56 \u002b0800 CST", - "dateModified" : "2022-08-25 13:40:56 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/3\/", - "keywords" : [ ] - } -</script> -<title>Mess with bash(1)</title> - <meta property="og:title" content="Mess with bash(1)" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="Crontab crontab is a useful tool, I really regret that I don&rsquo;t familar it earlier. -It&rsquo;s usage really simple, and these two are my frequent using: -crontab -e #edit crontab file that reside in /var/spool/cron crontab -l #list current crontab job It basic syntax as follow, also really simple example of usage: -delete file foo every minute * * * * * rm foo delete file foo every 15 minutes 15 * * * * rm foo delete file foo every beginning of hour 0 * * * * rm foo delete file foo every minute after 3 hours * 3 * * * rm foo delete file foo every day at 18:30 30 18 * * * rm foo delete file foo every beginning of month 0 0 0 * * rm foo delete file foo on beginning of 1st,10th of month 0 0 1,10 * * rm foo The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker." /> - <meta name="description" content="Crontab crontab is a useful tool, I really regret that I don&rsquo;t familar it earlier. -It&rsquo;s usage really simple, and these two are my frequent using: -crontab -e #edit crontab file that reside in /var/spool/cron crontab -l #list current crontab job It basic syntax as follow, also really simple example of usage: -delete file foo every minute * * * * * rm foo delete file foo every 15 minutes 15 * * * * rm foo delete file foo every beginning of hour 0 * * * * rm foo delete file foo every minute after 3 hours * 3 * * * rm foo delete file foo every day at 18:30 30 18 * * * rm foo delete file foo every beginning of month 0 0 0 * * rm foo delete file foo on beginning of 1st,10th of month 0 0 1,10 * * rm foo The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Mess with bash(1)</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-08-25 13:40:56 CST"> - 25 Aug 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <h3 id="crontab">Crontab</h3> -<p><code>crontab</code> is a useful tool, I really regret that I don’t familar it earlier.</p> -<p>It’s usage really simple, and these two are my frequent using:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>crontab -e <span style="font-style:italic">#edit crontab file that reside in /var/spool/cron</span> -</span></span><span style="display:flex;"><span>crontab -l <span style="font-style:italic">#list current crontab job</span> -</span></span></code></pre></div><p>It basic syntax as follow, also really simple -<img src="https://assets.garhve.com/pictures/screenshots/2022/08/1857817000.jpg" alt="crontab-layout.jpg"></p> -<p>example of usage:</p> -<ol> -<li>delete file <em>foo</em> every minute -<code>* * * * * rm foo</code></li> -<li>delete file <em>foo</em> every 15 minutes -<code>15 * * * * rm foo</code></li> -<li>delete file <em>foo</em> every beginning of hour -<code>0 * * * * rm foo</code></li> -<li>delete file <em>foo</em> every minute after 3 hours -<code>* 3 * * * rm foo</code></li> -<li>delete file <em>foo</em> every day at 18:30 -<code>30 18 * * * rm foo</code></li> -<li>delete file <em>foo</em> every beginning of month -<code>0 0 0 * * rm foo</code></li> -<li>delete file <em>foo</em> on beginning of 1st,10th of month -<code>0 0 1,10 * * rm foo</code></li> -</ol> -<p>The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker.</p> -<hr> -<h3 id="tr">tr</h3> -<p><code>tr</code> is really useful when encountered situation that needs struggle with string. -Three frequency ways of using <code>tr</code></p> -<ol> -<li> -<p><strong>shrink</strong> multiple characters into single one</p> -<p><code>tr -s '[string]'</code> -e.g. <code>echo "ssssssspaaaaace" | tr -s 'sa'</code> would convert “ssssssspace” to “space”</p> -</li> -<li> -<p><strong>delete</strong> specific character. I usually use it to delete white space or delimiter</p> -<p><code>tr -d '[string]'</code> -e.g. <code>echo "blog.garhve.com" | tr -d '.o'</code> would convert url to “blggarhvecm”</p> -</li> -<li> -<p><strong>convert</strong> specific character to another one.</p> -<p><code>tr '[string1]' '[string2]'</code> -e.g. <code>echo "woopwon | tr "wo" "fe"</code> would result “feepfen”</p> -</li> -</ol> -<hr> -<h3 id="cut">cut</h3> -<p>I use <code>cut</code> mostly to get word from a string, especially get relative path from absolute path. Because I always want to loop to get same sub-directories file from different main directory, <code>cut</code> helps a lot.</p> -<p>for now, I only use it one way</p> -<p><code>echo string | cut -d '[character]' -f position</code> -e.g. <code>echo path/to/most/inner/file | cut -d '/' -f1</code> this will give me word before first ‘/’, which is ‘path’</p> -<p>Often, <code>rev</code> will co-work with <code>cut</code> to get last one word</p> -<p>e.g. <code>echo blog.garhve.com | rev | cut -d '.' -f 1 | rev</code> this will give word after last ‘/’, which is com.</p> -<blockquote> -<p><em>a worth noting here is that the <code>rev</code> command needs to appear twice because it usage is not so intuitive, it reverse whole string</em></p> -<p><code>echo "hello world" | rev</code> will get ‘dlrow olleh`</p> -<p><code>echo "hello world" | cut -d ' ' -f1 | rev</code> will give result of ‘dlrow’</p> -<p><code>echo "hello world" | rev | cut -d ' ' -f1</code> will give same result, as ‘dlrow’</p> -<p><code>echo "hello world" | rev | cut -d ' ' -f1 | rev</code> will give expected result, as ‘world’</p> -</blockquote> -<h3 id="daily-update-bt-tracker">Daily update bt tracker</h3> -<p>I already learn shell script for a while.. so I wrote a simple script to test whether I really got used to it, but result is obviously, I need more and more practice to memorize commands.</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="">#! /bin/sh -</span></span></span><span style="display:flex;"><span><span style=""></span><span style="font-style:italic">#bt-tracker.txt</span> -</span></span><span style="display:flex;"><span>site=https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>file=/path_to_aria_directory/aria2.conf -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>Addr=user@addr -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># Get bt-tracker and format it to fulfill aria needs, then store in variable</span> -</span></span><span style="display:flex;"><span>bt=<span style="font-weight:bold">$(</span>curl $site | tr -s <span style="font-style:italic">'[:space:]'</span> | tr <span style="font-style:italic">'[:space:]'</span> <span style="font-style:italic">','</span><span style="font-weight:bold">)</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># sshpass is a software, that can allow me pass ssh password as argument</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># so that I don't need to wait prompt</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># 410 is the line of bt tracker resides, I now no other way to replace it.</span> -</span></span><span style="display:flex;"><span><span style="font-weight:bold">$(</span>sshpass -p <span style="font-style:italic">'password'</span> ssh -T $Addr <span style="font-style:italic">"sed -i '410d' </span>$file<span style="font-style:italic"> | echo </span>$bt<span style="font-style:italic"> >> </span>$file<span style="font-style:italic">"</span><span style="font-weight:bold">)</span> -</span></span></code></pre></div><blockquote> -<p>Usage of <a href="https://blog.garhve.com/index.php/archives/23/#tr">tr</a> and <a href="https://blog.garhve.com/index.php/archives/23/#cut">cut</a>, expansion of ‘command tips’ is needed</p> -</blockquote> -<h3 id="ways-to-find-files-or-specific-string-in-files">Ways to find files or specific string in files</h3> -<p>In order to look up C definitions, I need to know where linux stores header files or which files store definitions I need. So that here comes up some methods to fulfill this need:</p> -<ol> -<li><code>find 'path' -name 'file_name'</code></li> -</ol> -<blockquote> -<p>e.g. <code>find / -name stdio.h</code> will return multiple location that stdio.h resides. this could expand to look for others</p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/09/find_name.png" alt="image.png"></p> -<p>more info could see <code>man find</code></p> -</blockquote> -<hr> -<ol start="2"> -<li><code>grep -rnw 'path' -e 'pattern'</code></li> -</ol> -<blockquote> -<p>e.g. `grep –include=*.{h,c} -rnw / -e “from_kuid” will return string and filename that contains string.</p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/09/grep_string.png" alt="image.png"></p> -<ul> -<li><code>-r</code> or <code>-R</code> is recursive,</li> -<li><code>-n</code> is line number, and</li> -<li><code>-w</code> stands for match the whole word.</li> -<li><code>-l</code> (lower-case L) can be added to just give the file name of matching files.</li> -<li><code>-e</code> is the pattern used during the search</li> -</ul> -<p>Along with these, <code>--exclude</code>, <code>--include</code>, <code>--exclude-dir</code> flags could be used for efficient searching:</p> -<ul> -<li>This will only search through those files which have .c or .h extensions:</li> -</ul> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --include=<span style="font-weight:bold;font-style:italic">\*</span>.{c,h} -rnw <span style="font-style:italic">'/path/to/somewhere/'</span> -e <span style="font-style:italic">"pattern"</span> -</span></span></code></pre></div><ul> -<li>This will exclude searching all the files ending with .o extension:</li> -</ul> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --exclude=<span style="font-weight:bold;font-style:italic">\*</span>.o -rnw <span style="font-style:italic">'/path/to/somewhere/'</span> -e <span style="font-style:italic">"pattern"</span> -</span></span></code></pre></div><ul> -<li>For directories it’s possible to exclude one or more directories using the <code>--exclude-dir</code> parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/:</li> -</ul> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --exclude-dir={dir1,dir2,*.dst} -rnw <span style="font-style:italic">'/path/to/somewhere/'</span> -e <span style="font-style:italic">"pattern"</span> -</span></span></code></pre></div><p>more info could see <a href="https://ss64.com/bash/grep.html"><code>man grep</code></a>.</p> -</blockquote> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/4/index.html b/posts/4/index.html deleted file mode 100644 index 0f3907a..0000000 --- a/posts/4/index.html +++ /dev/null @@ -1,199 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/4/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/4/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Architecture of Linux Kernel", - "headline" : "Architecture of Linux Kernel", - "description" : "Description Modern microcontrollers nowadays support at least two privilege levels. Intel\/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged).\nModern operating systems support at least 2 levels:\nUser space: For applications to run in unprivileged user mode Kernel space: For the kernel (and all its components) to run in privileged mode – kernel mode Address of these 2 spaces are separate.", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-09-03 14:33:37 \u002b0800 CST", - "dateModified" : "2022-09-03 14:33:37 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/4\/", - "keywords" : [ ] - } -</script> -<title>Architecture of Linux Kernel</title> - <meta property="og:title" content="Architecture of Linux Kernel" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="Description Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged). -Modern operating systems support at least 2 levels: -User space: For applications to run in unprivileged user mode Kernel space: For the kernel (and all its components) to run in privileged mode – kernel mode Address of these 2 spaces are separate." /> - <meta name="description" content="Description Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged). -Modern operating systems support at least 2 levels: -User space: For applications to run in unprivileged user mode Kernel space: For the kernel (and all its components) to run in privileged mode – kernel mode Address of these 2 spaces are separate." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - <!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css" integrity="sha384-Juol1FqnotbkyZUT5Z7gUPjQ9gzlwCENvUZTpQBAPxtusdwFLRy382PSDx5UUJ4/" crossorigin="anonymous"> - - - <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js" integrity="sha384-97gW6UIJxnlKemYavrqDHSX3SiygeOwIZhwyOKRfSaf0JWKRVj9hLASHgFTzT+0O" crossorigin="anonymous"></script> - - - <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous" - onload="renderMathInElement(document.body);"></script> - </head> - - <script> -document.addEventListener("DOMContentLoaded", function() { - renderMathInElement(document.body, { - delimiters: [ - {left: "$$", right: "$$", display: true}, - {left: "$", right: "$", display: false} - ] - }); -}); -</script> -</html> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Architecture of Linux Kernel</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-09-03 14:33:37 CST"> - 03 Sep 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <h2 id="description">Description</h2> -<p>Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged).</p> -<p>Modern operating systems support at least 2 levels:</p> -<ul> -<li><strong>User space</strong>: For applications to run in unprivileged user mode</li> -<li><strong>Kernel space</strong>: For the kernel (and all its components) to run in privileged mode – kernel mode</li> -</ul> -<p>Address of these 2 spaces are separate.</p> -<p>Applications in user mode will auto-linked to glibc(the GNU standard C library). Libraries only available in user mode, kernel mode doesn’t have this conception. An application only can through <strong>System call</strong> to access kernel. On the other hand, system calls are the only legal entry point into the kernel space.</p> -<blockquote> -<p>Libraries APIs: man section 3 -System calls APIs: man section 2</p> -</blockquote> -<p>to be continue…</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/5/index.html b/posts/5/index.html deleted file mode 100644 index 9d3be5f..0000000 --- a/posts/5/index.html +++ /dev/null @@ -1,1452 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/5/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/5/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Escape Sequences", - "headline" : "Escape Sequences", - "description" : "copied from github in case one day it disappears\nmore information could visit vt100 User Guide\nANSI Escape Sequences Standard escape codes are prefixed with Escape:\nCtrl-Key: ^[ Octal: \\033 Unicode: \\u001b Hexadecimal: \\x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself.\nArguments are delimeted by semi colon (;).", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-09-12 09:02:06 \u002b0800 CST", - "dateModified" : "2022-09-12 09:02:06 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/5\/", - "keywords" : [ ] - } -</script> -<title>Escape Sequences</title> - <meta property="og:title" content="Escape Sequences" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="copied from github in case one day it disappears -more information could visit vt100 User Guide -ANSI Escape Sequences Standard escape codes are prefixed with Escape: -Ctrl-Key: ^[ Octal: \033 Unicode: \u001b Hexadecimal: \x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. -Arguments are delimeted by semi colon (;)." /> - <meta name="description" content="copied from github in case one day it disappears -more information could visit vt100 User Guide -ANSI Escape Sequences Standard escape codes are prefixed with Escape: -Ctrl-Key: ^[ Octal: \033 Unicode: \u001b Hexadecimal: \x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. -Arguments are delimeted by semi colon (;)." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Escape Sequences</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-09-12 09:02:06 CST"> - 12 Sep 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <blockquote> -<p>copied from <a href="https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797">github</a> in case one day it disappears</p> -<p>more information could visit <a href="https://vt100.net/docs/vt100-ug/chapter3.html">vt100 User Guide</a></p> -</blockquote> -<h1 id="ansi-escape-sequences">ANSI Escape Sequences</h1> -<p>Standard escape codes are prefixed with <code>Escape</code>:</p> -<ul> -<li>Ctrl-Key: <code>^[</code></li> -<li>Octal: <code>\033</code></li> -<li>Unicode: <code>\u001b</code></li> -<li>Hexadecimal: <code>\x1B</code></li> -<li>Decimal: <code>27</code></li> -</ul> -<p>Followed by the command, somtimes delimited by opening square bracket (<code>[</code>), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself.</p> -<p>Arguments are delimeted by semi colon (<code>;</code>).</p> -<p>For example:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span><span style="font-weight:bold;font-style:italic">\x</span>1b[1;31m <span style="font-style:italic"># Set style to bold, red foreground.</span> -</span></span></code></pre></div><h2 id="sequences">Sequences</h2> -<ul> -<li><code>ESC</code> - sequence starting with <code>ESC</code> (<code>\x1B</code>)</li> -<li><code>CSI</code> - Control Sequence Introducer: sequence starting with <code>ESC [</code> or CSI (<code>\x9B</code>)</li> -<li><code>DCS</code> - Device Control String: sequence starting with <code>ESC P</code> or DCS (<code>\x90</code>)</li> -<li><code>OSC</code> - Operating System Command: sequence starting with <code>ESC ]</code> or OSC (<code>\x9D</code>)</li> -</ul> -<p>Any whitespaces between sequences and arguments should be ignored. They are present for improved readability.</p> -<h2 id="general-ascii-codes">General ASCII Codes</h2> -<table> -<thead> -<tr> -<th>Name</th> -<th>decimal</th> -<th>octal</th> -<th>hex</th> -<th>C-escape</th> -<th>Ctrl-Key</th> -<th>Description</th> -</tr> -</thead> -<tbody> -<tr> -<td><code>BEL</code></td> -<td>7</td> -<td>007</td> -<td>0x07</td> -<td><code>\a</code></td> -<td><code>^G</code></td> -<td>Terminal bell</td> -</tr> -<tr> -<td><code>BS</code></td> -<td>8</td> -<td>010</td> -<td>0x08</td> -<td><code>\b</code></td> -<td><code>^H</code></td> -<td>Backspace</td> -</tr> -<tr> -<td><code>HT</code></td> -<td>9</td> -<td>011</td> -<td>0x09</td> -<td><code>\t</code></td> -<td><code>^I</code></td> -<td>Horizontal TAB</td> -</tr> -<tr> -<td><code>LF</code></td> -<td>10</td> -<td>012</td> -<td>0x0A</td> -<td><code>\n</code></td> -<td><code>^J</code></td> -<td>Linefeed (newline)</td> -</tr> -<tr> -<td><code>VT</code></td> -<td>11</td> -<td>013</td> -<td>0x0B</td> -<td><code>\v</code></td> -<td><code>^K</code></td> -<td>Vertical TAB</td> -</tr> -<tr> -<td><code>FF</code></td> -<td>12</td> -<td>014</td> -<td>0x0C</td> -<td><code>\f</code></td> -<td><code>^L</code></td> -<td>Formfeed (also: New page<code>NP</code>)</td> -</tr> -<tr> -<td><code>CR</code></td> -<td>13</td> -<td>015</td> -<td>0x0D</td> -<td><code>\r</code></td> -<td><code>^M</code></td> -<td>Carriage return</td> -</tr> -<tr> -<td><code>ESC</code></td> -<td>27</td> -<td>033</td> -<td>0x1B</td> -<td><code>\e</code><a href="#escape">*</a></td> -<td><code>^[</code></td> -<td>Escape character</td> -</tr> -<tr> -<td><code>DEL</code></td> -<td>127</td> -<td>177</td> -<td>0x7F</td> -<td><code><none></code></td> -<td><code><none></code></td> -<td>Delete character</td> -</tr> -</tbody> -</table> -<div id="escape"></div> -<blockquote> -<p><strong>Note:</strong> Some control escape sequences, like <code>\e</code> for <code>ESC</code>, are not guaranteed to work in all languages and compilers. It is recommended to use the decimal, octal or hex representation as escape code.</p> -</blockquote> -<blockquote> -<p><strong>Note:</strong> The <strong>Ctrl-Key</strong> representation is simply associating the non-printable characters from ASCII code 1 with the printable (letter) characters from ASCII code 65 (“A”). ASCII code 1 would be <code>^A</code> (Ctrl-A), while ASCII code 7 (BEL) would be <code>^G</code> (Ctrl-G). This is a common representation (and input method) and historically comes from one of the VT series of terminals.</p> -</blockquote> -<h2 id="cursor-controls">Cursor Controls</h2> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[H</code></td> -<td style="text-align:left">moves cursor to home position (0, 0)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[{line};{column}H</code> <br> <code>ESC[{line};{column}f</code></td> -<td style="text-align:left">moves cursor to line #, column #</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#A</code></td> -<td style="text-align:left">moves cursor up # lines</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#B</code></td> -<td style="text-align:left">moves cursor down # lines</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#C</code></td> -<td style="text-align:left">moves cursor right # columns</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#D</code></td> -<td style="text-align:left">moves cursor left # columns</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#E</code></td> -<td style="text-align:left">moves cursor to beginning of next line, # lines down</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#F</code></td> -<td style="text-align:left">moves cursor to beginning of previous line, # lines up</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[#G</code></td> -<td style="text-align:left">moves cursor to column #</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[6n</code></td> -<td style="text-align:left">request cursor position (reports as<code>ESC[#;#R</code>)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC M</code></td> -<td style="text-align:left">moves cursor one line up, scrolling if needed</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC 7</code></td> -<td style="text-align:left">save cursor position (DEC)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC 8</code></td> -<td style="text-align:left">restores the cursor to the last saved position (DEC)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[s</code></td> -<td style="text-align:left">save cursor position (SCO)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[u</code></td> -<td style="text-align:left">restores the cursor to the last saved position (SCO)</td> -</tr> -</tbody> -</table> -<blockquote> -<p><strong>Note:</strong> Some sequences, like saving and restoring cursors, are private sequences and are not standardized. While some terminal emulators (i.e. xterm and derived) support both SCO and DEC sequences, they are likely to have different functionality. It is therefore recommended to use DEC sequences.</p> -</blockquote> -<h2 id="erase-functions">Erase Functions</h2> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[J</code></td> -<td style="text-align:left">erase in display (same as ESC[0J)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[0J</code></td> -<td style="text-align:left">erase from cursor until end of screen</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[1J</code></td> -<td style="text-align:left">erase from cursor to beginning of screen</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[2J</code></td> -<td style="text-align:left">erase entire screen</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[3J</code></td> -<td style="text-align:left">erase saved lines</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[K</code></td> -<td style="text-align:left">erase in line (same as ESC[0K)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[0K</code></td> -<td style="text-align:left">erase from cursor to end of line</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[1K</code></td> -<td style="text-align:left">erase start of line to the cursor</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[2K</code></td> -<td style="text-align:left">erase the entire line</td> -</tr> -</tbody> -</table> -<blockquote> -<p>Note: Erasing the line won’t move the cursor, meaning that the cursor will stay at the last position it was at before the line was erased. You can use <code>\r</code> after erasing the line, to return the cursor to the start of the current line.</p> -</blockquote> -<h2 id="colors--graphics-mode">Colors / Graphics Mode</h2> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Reset Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[1;34;{...}m</code></td> -<td style="text-align:left"></td> -<td style="text-align:left">Set graphics modes for cell, separated by semicolon (<code>;</code>).</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[0m</code></td> -<td style="text-align:left"></td> -<td style="text-align:left">reset all modes (styles and colors)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[1m</code></td> -<td style="text-align:left"><code>ESC[22m</code></td> -<td style="text-align:left">set bold mode.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[2m</code></td> -<td style="text-align:left"><code>ESC[22m</code></td> -<td style="text-align:left">set dim/faint mode.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[3m</code></td> -<td style="text-align:left"><code>ESC[23m</code></td> -<td style="text-align:left">set italic mode.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[4m</code></td> -<td style="text-align:left"><code>ESC[24m</code></td> -<td style="text-align:left">set underline mode.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[5m</code></td> -<td style="text-align:left"><code>ESC[25m</code></td> -<td style="text-align:left">set blinking mode</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[7m</code></td> -<td style="text-align:left"><code>ESC[27m</code></td> -<td style="text-align:left">set inverse/reverse mode</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[8m</code></td> -<td style="text-align:left"><code>ESC[28m</code></td> -<td style="text-align:left">set hidden/invisible mode</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[9m</code></td> -<td style="text-align:left"><code>ESC[29m</code></td> -<td style="text-align:left">set strikethrough mode.</td> -</tr> -</tbody> -</table> -<blockquote> -<p><strong>Note:</strong> Some terminals may not support some of the graphic mode sequences listed above.</p> -</blockquote> -<blockquote> -<p><strong>Note:</strong> Both dim and bold modes are reset with the <code>ESC[22m</code> sequence. The <code>ESC[21m</code> sequence is a non-specified sequence for double underline mode and only work in some terminals and is reset with <code>ESC[24m</code>.</p> -</blockquote> -<h3 id="color-codes">Color codes</h3> -<p>Most terminals support 8 and 16 colors, as well as 256 (8-bit) colors. These colors are set by the user, but have commonly defined meanings.</p> -<h4 id="8-16-colors">8-16 Colors</h4> -<table> -<thead> -<tr> -<th style="text-align:left">Color Name</th> -<th style="text-align:left">Foreground Color Code</th> -<th style="text-align:left">Background Color Code</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left">Black</td> -<td style="text-align:left"><code>30</code></td> -<td style="text-align:left"><code>40</code></td> -</tr> -<tr> -<td style="text-align:left">Red</td> -<td style="text-align:left"><code>31</code></td> -<td style="text-align:left"><code>41</code></td> -</tr> -<tr> -<td style="text-align:left">Green</td> -<td style="text-align:left"><code>32</code></td> -<td style="text-align:left"><code>42</code></td> -</tr> -<tr> -<td style="text-align:left">Yellow</td> -<td style="text-align:left"><code>33</code></td> -<td style="text-align:left"><code>43</code></td> -</tr> -<tr> -<td style="text-align:left">Blue</td> -<td style="text-align:left"><code>34</code></td> -<td style="text-align:left"><code>44</code></td> -</tr> -<tr> -<td style="text-align:left">Magenta</td> -<td style="text-align:left"><code>35</code></td> -<td style="text-align:left"><code>45</code></td> -</tr> -<tr> -<td style="text-align:left">Cyan</td> -<td style="text-align:left"><code>36</code></td> -<td style="text-align:left"><code>46</code></td> -</tr> -<tr> -<td style="text-align:left">White</td> -<td style="text-align:left"><code>37</code></td> -<td style="text-align:left"><code>47</code></td> -</tr> -<tr> -<td style="text-align:left">Default</td> -<td style="text-align:left"><code>39</code></td> -<td style="text-align:left"><code>49</code></td> -</tr> -<tr> -<td style="text-align:left">Reset</td> -<td style="text-align:left"><code>0</code></td> -<td style="text-align:left"><code>0</code></td> -</tr> -</tbody> -</table> -<blockquote> -<p><strong>Note:</strong> the <em>Reset</em> color is the reset code that resets <em>all</em> colors and text effects, Use <em>Default</em> color to reset colors only.</p> -</blockquote> -<p>Most terminals, apart from the basic set of 8 colors, also support the “bright” or “bold” colors. These have their own set of codes, mirroring the normal colors, but with an additional <code>;1</code> in their codes:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span><span style="font-style:italic"># Set style to bold, red foreground.</span> -</span></span><span style="display:flex;"><span><span style="font-weight:bold;font-style:italic">\x</span>1b[1;31mHello -</span></span><span style="display:flex;"><span><span style="font-style:italic"># Set style to dimmed white foreground with red background.</span> -</span></span><span style="display:flex;"><span><span style="font-weight:bold;font-style:italic">\x</span>1b[2;37;41mWorld -</span></span></code></pre></div><p>Terminals that support the <a href="https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/cmds/aixcmds1/aixterm.htm">aixterm specification</a> provides bright versions of the ISO colors, without the need to use the bold modifier:</p> -<table> -<thead> -<tr> -<th style="text-align:left">Color Name</th> -<th style="text-align:left">Foreground Color Code</th> -<th style="text-align:left">Background Color Code</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left">Bright Black</td> -<td style="text-align:left"><code>90</code></td> -<td style="text-align:left"><code>100</code></td> -</tr> -<tr> -<td style="text-align:left">Bright Red</td> -<td style="text-align:left"><code>91</code></td> -<td style="text-align:left"><code>101</code></td> -</tr> -<tr> -<td style="text-align:left">Bright Green</td> -<td style="text-align:left"><code>92</code></td> -<td style="text-align:left"><code>102</code></td> -</tr> -<tr> -<td style="text-align:left">Bright Yellow</td> -<td style="text-align:left"><code>93</code></td> -<td style="text-align:left"><code>103</code></td> -</tr> -<tr> -<td style="text-align:left">Bright Blue</td> -<td style="text-align:left"><code>94</code></td> -<td style="text-align:left"><code>104</code></td> -</tr> -<tr> -<td style="text-align:left">Bright Magenta</td> -<td style="text-align:left"><code>95</code></td> -<td style="text-align:left"><code>105</code></td> -</tr> -<tr> -<td style="text-align:left">Bright Cyan</td> -<td style="text-align:left"><code>96</code></td> -<td style="text-align:left"><code>106</code></td> -</tr> -<tr> -<td style="text-align:left">Bright White</td> -<td style="text-align:left"><code>97</code></td> -<td style="text-align:left"><code>107</code></td> -</tr> -</tbody> -</table> -<h4 id="256-colors">256 Colors</h4> -<p>The following escape codes tells the terminal to use the given color ID:</p> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[38;5;{ID}m</code></td> -<td style="text-align:left">Set foreground color.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[48;5;{ID}m</code></td> -<td style="text-align:left">Set background color.</td> -</tr> -</tbody> -</table> -<p>Where <code>{ID}</code> should be replaced with the color index from 0 to 255 of the following color table:</p> -<p><img src="https://user-images.githubusercontent.com/995050/47952855-ecb12480-df75-11e8-89d4-ac26c50e80b9.png" alt="256 Color table"></p> -<p>The table starts with the original 16 colors (0-15).</p> -<p>The proceeding 216 colors (16-231) or formed by a 3bpc RGB value offset by 16, packed into a single value.</p> -<p>The final 24 colors (232-255) are grayscale starting from a shade slighly lighter than black, ranging up to shade slightly darker than white.</p> -<p>Some emulators interpret these steps as linear increments (<code>256 / 24</code>) on all three channels, although some emulators may explicitly define these values.</p> -<h4 id="rgb-colors">RGB Colors</h4> -<p>More modern terminals supports <a href="https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29">Truecolor</a> (24-bit RGB), which allows you to set foreground and background colors using RGB.</p> -<p>These escape sequences are usually not well documented.</p> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[38;2;{r};{g};{b}m</code></td> -<td style="text-align:left">Set foreground color as RGB.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[48;2;{r};{g};{b}m</code></td> -<td style="text-align:left">Set background color as RGB.</td> -</tr> -</tbody> -</table> -<blockquote> -<p>Note that <code>;38</code> and <code>;48</code> corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as <code>;2</code> and <code>;5</code> sets the color format.</p> -</blockquote> -<h2 id="screen-modes">Screen Modes</h2> -<h3 id="set-mode">Set Mode</h3> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[={value}h</code></td> -<td style="text-align:left">Changes the screen width or type to the mode specified by value.</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=0h</code></td> -<td style="text-align:left">40 x 25 monochrome (text)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=1h</code></td> -<td style="text-align:left">40 x 25 color (text)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=2h</code></td> -<td style="text-align:left">80 x 25 monochrome (text)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=3h</code></td> -<td style="text-align:left">80 x 25 color (text)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=4h</code></td> -<td style="text-align:left">320 x 200 4-color (graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=5h</code></td> -<td style="text-align:left">320 x 200 monochrome (graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=6h</code></td> -<td style="text-align:left">640 x 200 monochrome (graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=7h</code></td> -<td style="text-align:left">Enables line wrapping</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=13h</code></td> -<td style="text-align:left">320 x 200 color (graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=14h</code></td> -<td style="text-align:left">640 x 200 color (16-color graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=15h</code></td> -<td style="text-align:left">640 x 350 monochrome (2-color graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=16h</code></td> -<td style="text-align:left">640 x 350 color (16-color graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=17h</code></td> -<td style="text-align:left">640 x 480 monochrome (2-color graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=18h</code></td> -<td style="text-align:left">640 x 480 color (16-color graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[=19h</code></td> -<td style="text-align:left">320 x 200 color (256-color graphics)</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[={value}l</code></td> -<td style="text-align:left">Resets the mode by using the same values that Set Mode uses, except for 7, which disables line wrapping. The last character in this escape sequence is a lowercase L.</td> -</tr> -</tbody> -</table> -<h3 id="common-private-modes">Common Private Modes</h3> -<p>These are some examples of private modes, which are not defined by the specification, but are implemented in most terminals.</p> -<table> -<thead> -<tr> -<th style="text-align:left">ESC Code Sequence</th> -<th style="text-align:left">Description</th> -</tr> -</thead> -<tbody> -<tr> -<td style="text-align:left"><code>ESC[?25l</code></td> -<td style="text-align:left">make cursor invisible</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[?25h</code></td> -<td style="text-align:left">make cursor visible</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[?47l</code></td> -<td style="text-align:left">restore screen</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[?47h</code></td> -<td style="text-align:left">save screen</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[?1049h</code></td> -<td style="text-align:left">enables the alternative buffer</td> -</tr> -<tr> -<td style="text-align:left"><code>ESC[?1049l</code></td> -<td style="text-align:left">disables the alternative buffer</td> -</tr> -</tbody> -</table> -<p>Refer to the <a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">XTerm Control Sequences</a> for a more in-depth list of private modes defined by XTerm.</p> -<blockquote> -<p>Note: While these modes may be supported by the most terminals, some may not work in multiplexers like tmux.</p> -</blockquote> -<h3 id="keyboard-strings">Keyboard Strings</h3> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>ESC[{code};{string};{...}p -</span></span></code></pre></div><p>Redefines a keyboard key to a specified string.</p> -<p>The parameters for this escape sequence are defined as follows:</p> -<ul> -<li><code>code</code> is one or more of the values listed in the following table. These values represent keyboard keys and key combinations. When using these values in a command, you must type the semicolons shown in this table in addition to the semicolons required by the escape sequence. The codes in parentheses are not available on some keyboards. <code>ANSI.SYS</code> will not interpret the codes in parentheses for those keyboards unless you specify the <code>/X</code> switch in the <code>DEVICE</code> command for <code>ANSI.SYS</code>.</li> -<li><code>string</code> is either the ASCII code for a single character or a string contained in quotation marks. For example, both 65 and “A” can be used to represent an uppercase A.</li> -</ul> -<blockquote> -<p><strong>IMPORTANT:</strong> Some of the values in the following table are not valid for all computers. Check your computer’s documentation for values that are different.</p> -</blockquote> -<h4 id="list-of-keyboard-strings">List of keyboard strings</h4> -<table> -<thead> -<tr> -<th>Key</th> -<th>Code</th> -<th>SHIFT+code</th> -<th>CTRL+code</th> -<th>ALT+code</th> -</tr> -</thead> -<tbody> -<tr> -<td>F1</td> -<td>0;59</td> -<td>0;84</td> -<td>0;94</td> -<td>0;104</td> -</tr> -<tr> -<td>F2</td> -<td>0;60</td> -<td>0;85</td> -<td>0;95</td> -<td>0;105</td> -</tr> -<tr> -<td>F3</td> -<td>0;61</td> -<td>0;86</td> -<td>0;96</td> -<td>0;106</td> -</tr> -<tr> -<td>F4</td> -<td>0;62</td> -<td>0;87</td> -<td>0;97</td> -<td>0;107</td> -</tr> -<tr> -<td>F5</td> -<td>0;63</td> -<td>0;88</td> -<td>0;98</td> -<td>0;108</td> -</tr> -<tr> -<td>F6</td> -<td>0;64</td> -<td>0;89</td> -<td>0;99</td> -<td>0;109</td> -</tr> -<tr> -<td>F7</td> -<td>0;65</td> -<td>0;90</td> -<td>0;100</td> -<td>0;110</td> -</tr> -<tr> -<td>F8</td> -<td>0;66</td> -<td>0;91</td> -<td>0;101</td> -<td>0;111</td> -</tr> -<tr> -<td>F9</td> -<td>0;67</td> -<td>0;92</td> -<td>0;102</td> -<td>0;112</td> -</tr> -<tr> -<td>F10</td> -<td>0;68</td> -<td>0;93</td> -<td>0;103</td> -<td>0;113</td> -</tr> -<tr> -<td>F11</td> -<td>0;133</td> -<td>0;135</td> -<td>0;137</td> -<td>0;139</td> -</tr> -<tr> -<td>F12</td> -<td>0;134</td> -<td>0;136</td> -<td>0;138</td> -<td>0;140</td> -</tr> -<tr> -<td>HOME (num keypad)</td> -<td>0;71</td> -<td>55</td> -<td>0;119</td> -<td>--</td> -</tr> -<tr> -<td>UP ARROW (num keypad)</td> -<td>0;72</td> -<td>56</td> -<td>(0;141)</td> -<td>--</td> -</tr> -<tr> -<td>PAGE UP (num keypad)</td> -<td>0;73</td> -<td>57</td> -<td>0;132</td> -<td>--</td> -</tr> -<tr> -<td>LEFT ARROW (num keypad)</td> -<td>0;75</td> -<td>52</td> -<td>0;115</td> -<td>--</td> -</tr> -<tr> -<td>RIGHT ARROW (num keypad)</td> -<td>0;77</td> -<td>54</td> -<td>0;116</td> -<td>--</td> -</tr> -<tr> -<td>END (num keypad)</td> -<td>0;79</td> -<td>49</td> -<td>0;117</td> -<td>--</td> -</tr> -<tr> -<td>DOWN ARROW (num keypad)</td> -<td>0;80</td> -<td>50</td> -<td>(0;145)</td> -<td>--</td> -</tr> -<tr> -<td>PAGE DOWN (num keypad)</td> -<td>0;81</td> -<td>51</td> -<td>0;118</td> -<td>--</td> -</tr> -<tr> -<td>INSERT (num keypad)</td> -<td>0;82</td> -<td>48</td> -<td>(0;146)</td> -<td>--</td> -</tr> -<tr> -<td>DELETE (num keypad)</td> -<td>0;83</td> -<td>46</td> -<td>(0;147)</td> -<td>--</td> -</tr> -<tr> -<td>HOME</td> -<td>(224;71)</td> -<td>(224;71)</td> -<td>(224;119)</td> -<td>(224;151)</td> -</tr> -<tr> -<td>UP ARROW</td> -<td>(224;72)</td> -<td>(224;72)</td> -<td>(224;141)</td> -<td>(224;152)</td> -</tr> -<tr> -<td>PAGE UP</td> -<td>(224;73)</td> -<td>(224;73)</td> -<td>(224;132)</td> -<td>(224;153)</td> -</tr> -<tr> -<td>LEFT ARROW</td> -<td>(224;75)</td> -<td>(224;75)</td> -<td>(224;115)</td> -<td>(224;155)</td> -</tr> -<tr> -<td>RIGHT ARROW</td> -<td>(224;77)</td> -<td>(224;77)</td> -<td>(224;116)</td> -<td>(224;157)</td> -</tr> -<tr> -<td>END</td> -<td>(224;79)</td> -<td>(224;79)</td> -<td>(224;117)</td> -<td>(224;159)</td> -</tr> -<tr> -<td>DOWN ARROW</td> -<td>(224;80)</td> -<td>(224;80)</td> -<td>(224;145)</td> -<td>(224;154)</td> -</tr> -<tr> -<td>PAGE DOWN</td> -<td>(224;81)</td> -<td>(224;81)</td> -<td>(224;118)</td> -<td>(224;161)</td> -</tr> -<tr> -<td>INSERT</td> -<td>(224;82)</td> -<td>(224;82)</td> -<td>(224;146)</td> -<td>(224;162)</td> -</tr> -<tr> -<td>DELETE</td> -<td>(224;83)</td> -<td>(224;83)</td> -<td>(224;147)</td> -<td>(224;163)</td> -</tr> -<tr> -<td>PRINT SCREEN</td> -<td>--</td> -<td>--</td> -<td>0;114</td> -<td>--</td> -</tr> -<tr> -<td>PAUSE/BREAK</td> -<td>--</td> -<td>--</td> -<td>0;0</td> -<td>--</td> -</tr> -<tr> -<td>BACKSPACE</td> -<td>8</td> -<td>8</td> -<td>127</td> -<td>(0)</td> -</tr> -<tr> -<td>ENTER</td> -<td>13</td> -<td>--</td> -<td>10</td> -<td>(0</td> -</tr> -<tr> -<td>TAB</td> -<td>9</td> -<td>0;15</td> -<td>(0;148)</td> -<td>(0;165)</td> -</tr> -<tr> -<td>NULL</td> -<td>0;3</td> -<td>--</td> -<td>--</td> -<td>--</td> -</tr> -<tr> -<td>A</td> -<td>97</td> -<td>65</td> -<td>1</td> -<td>0;30</td> -</tr> -<tr> -<td>B</td> -<td>98</td> -<td>66</td> -<td>2</td> -<td>0;48</td> -</tr> -<tr> -<td>C</td> -<td>99</td> -<td>66</td> -<td>3</td> -<td>0;46</td> -</tr> -<tr> -<td>D</td> -<td>100</td> -<td>68</td> -<td>4</td> -<td>0;32</td> -</tr> -<tr> -<td>E</td> -<td>101</td> -<td>69</td> -<td>5</td> -<td>0;18</td> -</tr> -<tr> -<td>F</td> -<td>102</td> -<td>70</td> -<td>6</td> -<td>0;33</td> -</tr> -<tr> -<td>G</td> -<td>103</td> -<td>71</td> -<td>7</td> -<td>0;34</td> -</tr> -<tr> -<td>H</td> -<td>104</td> -<td>72</td> -<td>8</td> -<td>0;35</td> -</tr> -<tr> -<td>I</td> -<td>105</td> -<td>73</td> -<td>9</td> -<td>0;23</td> -</tr> -<tr> -<td>J</td> -<td>106</td> -<td>74</td> -<td>10</td> -<td>0;36</td> -</tr> -<tr> -<td>K</td> -<td>107</td> -<td>75</td> -<td>11</td> -<td>0;37</td> -</tr> -<tr> -<td>L</td> -<td>108</td> -<td>76</td> -<td>12</td> -<td>0;38</td> -</tr> -<tr> -<td>M</td> -<td>109</td> -<td>77</td> -<td>13</td> -<td>0;50</td> -</tr> -<tr> -<td>N</td> -<td>110</td> -<td>78</td> -<td>14</td> -<td>0;49</td> -</tr> -<tr> -<td>O</td> -<td>111</td> -<td>79</td> -<td>15</td> -<td>0;24</td> -</tr> -<tr> -<td>P</td> -<td>112</td> -<td>80</td> -<td>16</td> -<td>0;25</td> -</tr> -<tr> -<td>Q</td> -<td>113</td> -<td>81</td> -<td>17</td> -<td>0;16</td> -</tr> -<tr> -<td>R</td> -<td>114</td> -<td>82</td> -<td>18</td> -<td>0;19</td> -</tr> -<tr> -<td>S</td> -<td>115</td> -<td>83</td> -<td>19</td> -<td>0;31</td> -</tr> -<tr> -<td>T</td> -<td>116</td> -<td>84</td> -<td>20</td> -<td>0;20</td> -</tr> -<tr> -<td>U</td> -<td>117</td> -<td>85</td> -<td>21</td> -<td>0;22</td> -</tr> -<tr> -<td>V</td> -<td>118</td> -<td>86</td> -<td>22</td> -<td>0;47</td> -</tr> -<tr> -<td>W</td> -<td>119</td> -<td>87</td> -<td>23</td> -<td>0;17</td> -</tr> -<tr> -<td>X</td> -<td>120</td> -<td>88</td> -<td>24</td> -<td>0;45</td> -</tr> -<tr> -<td>Y</td> -<td>121</td> -<td>89</td> -<td>25</td> -<td>0;21</td> -</tr> -<tr> -<td>Z</td> -<td>122</td> -<td>90</td> -<td>26</td> -<td>0;44</td> -</tr> -<tr> -<td>1</td> -<td>49</td> -<td>33</td> -<td>--</td> -<td>0;120</td> -</tr> -<tr> -<td>2</td> -<td>50</td> -<td>64</td> -<td>0</td> -<td>0;121</td> -</tr> -<tr> -<td>3</td> -<td>51</td> -<td>35</td> -<td>--</td> -<td>0;122</td> -</tr> -<tr> -<td>4</td> -<td>52</td> -<td>36</td> -<td>--</td> -<td>0;123</td> -</tr> -<tr> -<td>5</td> -<td>53</td> -<td>37</td> -<td>--</td> -<td>0;124</td> -</tr> -<tr> -<td>6</td> -<td>54</td> -<td>94</td> -<td>30</td> -<td>0;125</td> -</tr> -<tr> -<td>7</td> -<td>55</td> -<td>38</td> -<td>--</td> -<td>0;126</td> -</tr> -<tr> -<td>8</td> -<td>56</td> -<td>42</td> -<td>--</td> -<td>0;126</td> -</tr> -<tr> -<td>9</td> -<td>57</td> -<td>40</td> -<td>--</td> -<td>0;127</td> -</tr> -<tr> -<td>0</td> -<td>48</td> -<td>41</td> -<td>--</td> -<td>0;129</td> -</tr> -<tr> -<td>-</td> -<td>45</td> -<td>95</td> -<td>31</td> -<td>0;130</td> -</tr> -<tr> -<td>=</td> -<td>61</td> -<td>43</td> -<td>-–</td> -<td>0;131</td> -</tr> -<tr> -<td>[</td> -<td>91</td> -<td>123</td> -<td>27</td> -<td>0;26</td> -</tr> -<tr> -<td>]</td> -<td>93</td> -<td>125</td> -<td>29</td> -<td>0;27</td> -</tr> -<tr> -<td></td> -<td>92</td> -<td>124</td> -<td>28</td> -<td>0;43</td> -</tr> -<tr> -<td>;</td> -<td>59</td> -<td>58</td> -<td>--</td> -<td>0;39</td> -</tr> -<tr> -<td>'</td> -<td>39</td> -<td>34</td> -<td>--</td> -<td>0;40</td> -</tr> -<tr> -<td>,</td> -<td>44</td> -<td>60</td> -<td>--</td> -<td>0;51</td> -</tr> -<tr> -<td>.</td> -<td>46</td> -<td>62</td> -<td>--</td> -<td>0;52</td> -</tr> -<tr> -<td>/</td> -<td>47</td> -<td>63</td> -<td>--</td> -<td>0;53</td> -</tr> -<tr> -<td>`</td> -<td>96</td> -<td>126</td> -<td>--</td> -<td>(0;41)</td> -</tr> -<tr> -<td>ENTER (keypad)</td> -<td>13</td> -<td>--</td> -<td>10</td> -<td>(0;166)</td> -</tr> -<tr> -<td>/ (keypad)</td> -<td>47</td> -<td>47</td> -<td>(0;142)</td> -<td>(0;74)</td> -</tr> -<tr> -<td>* (keypad)</td> -<td>42</td> -<td>(0;144)</td> -<td>(0;78)</td> -<td>--</td> -</tr> -<tr> -<td>- (keypad)</td> -<td>45</td> -<td>45</td> -<td>(0;149)</td> -<td>(0;164)</td> -</tr> -<tr> -<td>+ (keypad)</td> -<td>43</td> -<td>43</td> -<td>(0;150)</td> -<td>(0;55)</td> -</tr> -<tr> -<td>5 (keypad)</td> -<td>(0;76)</td> -<td>53</td> -<td>(0;143)</td> -<td>--</td> -</tr> -</tbody> -</table> -<h2 id="resources">Resources</h2> -<ul> -<li><a href="https://en.wikipedia.org/wiki/ANSI_escape_code">Wikipedia: ANSI escape code</a></li> -<li><a href="http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html">Build your own Command Line with ANSI escape codes</a></li> -<li><a href="http://ascii-table.com/ansi-escape-sequences.php">ascii-table: ANSI Escape sequences</a></li> -<li><a href="https://bluesock.org/~willkg/dev/ansi.html">bluesock: ansi codes</a></li> -<li><a href="http://wiki.bash-hackers.org/scripting/terminalcodes">bash-hackers: Terminal Codes (ANSI/VT100) introduction</a></li> -<li><a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">XTerm Control Sequences</a></li> -<li><a href="https://vt100.net/">VT100 – Various terminal manuals</a></li> -<li><a href="https://xtermjs.org/docs/api/vtfeatures/">xterm.js – Supported Terminal Sequences</a></li> -</ul> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/6/index.html b/posts/6/index.html deleted file mode 100644 index ecb751a..0000000 --- a/posts/6/index.html +++ /dev/null @@ -1,361 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/6/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/6/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Mess with Bash(2)", - "headline" : "Mess with Bash(2)", - "description" : "More info is in this tutorial\nall value expansions (ie. all syntax with a $ prefix) can only expand inside quoted arguments if the argument was double-quoted . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place!\n\u0026ldquo;Value expansions ($...) must always be double-quoted.\u0026rdquo;\nNever leave a value expansion unquoted.\nRedirection File Redirection 0 is standard input, 1 is standard output, 2 is standard error", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-09-29 09:43:02 \u002b0800 CST", - "dateModified" : "2022-09-29 09:43:02 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/6\/", - "keywords" : [ ] - } -</script> -<title>Mess with Bash(2)</title> - <meta property="og:title" content="Mess with Bash(2)" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="More info is in this tutorial -all value expansions (ie. all syntax with a $ prefix) can only expand inside quoted arguments if the argument was double-quoted . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place! -&ldquo;Value expansions ($...) must always be double-quoted.&rdquo; -Never leave a value expansion unquoted. -Redirection File Redirection 0 is standard input, 1 is standard output, 2 is standard error" /> - <meta name="description" content="More info is in this tutorial -all value expansions (ie. all syntax with a $ prefix) can only expand inside quoted arguments if the argument was double-quoted . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place! -&ldquo;Value expansions ($...) must always be double-quoted.&rdquo; -Never leave a value expansion unquoted. -Redirection File Redirection 0 is standard input, 1 is standard output, 2 is standard error" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Mess with Bash(2)</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-09-29 09:43:02 CST"> - 29 Sep 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <blockquote> -<p>More info is in this <a href="https://https://guide.bash.academy">tutorial</a></p> -</blockquote> -<blockquote> -<p>all value expansions (ie. all syntax with a <code>$</code> prefix) can only expand inside quoted arguments if the argument was <em>double-quoted</em> . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place!</p> -</blockquote> -<p><em>“Value expansions (<code>$...</code>) must <strong>always</strong> be double-quoted.”</em></p> -<p><em>Never leave a value expansion unquoted.</em></p> -<h2 id="redirection">Redirection</h2> -<h3 id="file-redirection">File Redirection</h3> -<p><strong>0 is standard input, 1 is standard output, 2 is standard error</strong></p> -<p><code>[x] > file, [x] < file</code></p> -<p>Make <em><strong>File descriptor</strong></em>(FD) <code>x</code> write to / read from file.</p> -<blockquote> -<p><code>echo hello > ~/World</code></p> -<p><code>read line < ~/Word</code></p> -<p><code>rm file 2>/dev/null</code></p> -</blockquote> -<h3 id="file-descriptor-copying">File Descriptor copying</h3> -<p><code>[x] >& y, [x] <& y</code></p> -<p>make FD <code>x</code> write to / read from FD <code>y</code>’s stream</p> -<blockquote> -<p>the connection to the stream used by FD <code>y</code> is copied to FD <code>x</code></p> -<p><code>curl cip.cc > result 2>&1</code></p> -<p><code>ping localhost > result 2>&1</code></p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="font-style:italic"># exec can be used to change the file descriptors of bash itself,</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># and if you use an x that doesn't yet exist,</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># bash will create a new file descriptor ("plug") for you with that number.</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># - in command is to close new FD 3 we'd created before.</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># >&- is to close FD 1, <&- is to close FD0</span> -</span></span><span style="display:flex;"><span>exec 3>&1 >mylog; echo moo; exec 1>&3 3>&- -</span></span></code></pre></div></blockquote> -<h3 id="appending-file-redirection">Appending file redirection</h3> -<p><code>[x] >> file</code></p> -<p>make FD <code>x</code> append to end of the file</p> -<blockquote> -<p>A stream to <code>file</code> is opened for writing in append mode and is connected to file descriptor <code>x</code>. The regular file redirection operator <code>></code> empties the file’s contents when it opens the file so that only your bytes will be in the file.</p> -<p><code>echo hello >> ~/world</code></p> -<p><code>echo world >> ~/world</code></p> -</blockquote> -<h3 id="redirecting-standard-output-and-standard-error">Redirecting standard output and standard error</h3> -<p><code>&>file</code></p> -<p>Make both FD 1 (standard output) and FD 2 (standard error) write to file</p> -<blockquote> -<p>This is a convenience operator which does the same thing as <code>>file 2>&1</code> but is more concise. Again, you can append rather than truncate by doubling the arrow: <code>&>>file</code></p> -<p><code>ping localhost &>result</code></p> -</blockquote> -<h3 id="here-documents">Here documents</h3> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="font-style:italic"><<delimiter -</span></span></span><span style="display:flex;"><span><span style="font-style:italic"> Here document -</span></span></span><span style="display:flex;"><span><span style="font-style:italic">delimiter</span> -</span></span></code></pre></div><p>Make FD 0 read from the string between <code>delimiter</code>s</p> -<blockquote> -<p>Here-Documents are great for reading blocks of text to command line.</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cat <span style="font-style:italic"><< EOF -</span></span></span><span style="display:flex;"><span><span style="font-style:italic">this is within here document -</span></span></span><span style="display:flex;"><span><span style="font-style:italic">I can write as many lines as I like -</span></span></span><span style="display:flex;"><span><span style="font-style:italic">and terminate with line of demiliter only -</span></span></span><span style="display:flex;"><span><span style="font-style:italic">EOF</span> //end of heredoc -</span></span></code></pre></div></blockquote> -<h3 id="here-strings">Here strings</h3> -<p><code><<< string</code></p> -<p>Make FD 0 read from the <code>string</code></p> -<blockquote> -<p>Here strings are very similar to here documents but more concise. They are generally preferred over here documents.</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cat <<< <span style="font-style:italic">"This, -</span></span></span><span style="display:flex;"><span><span style="font-style:italic">is the here strings. tab will also be read."</span> -</span></span></code></pre></div></blockquote> -<h3 id="moving-file-decipher">Moving file decipher</h3> -<p><code>[x]>&y-, [x]<&y-</code></p> -<p>Replace FD <code>x</code> with FD <code>y</code> and close FD <code>y</code></p> -<blockquote> -<p>Easy way of <code>[x]>&y, y>&-</code></p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="font-style:italic"># 3>&1-: copy FD 1 to FD 3 and close FD 1.</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># >&3-: copy FD 3 to FD 1 and close FD 3.</span> -</span></span><span style="display:flex;"><span>exec 3>&1- >mylog; echo moo; exec >&3- -</span></span></code></pre></div></blockquote> -<h3 id="reading-and-writing-with-file-descriptor">Reading and writing with file descriptor</h3> -<p><code>[x] <> file</code></p> -<p>Open FD <code>x</code> for both reading and writing to <code>file</code></p> -<blockquote> -<p>The file descriptor at x is opened with a stream to the file that can be used for writing as well as reading bytes. Usually you’ll use two file descriptors for this. <strong>One of the rare cases where this is useful is when setting up a stream with a read/write device such as a network socket</strong>.</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>exec 5<>aFile -</span></span><span style="display:flex;"><span>cat >&5 <span style="font-style:italic">"Hello world"</span> <span style="font-style:italic"># make FD 1 write to where FD 5 currently writing, copy file descriptor FD 5 to FD 1</span> -</span></span><span style="display:flex;"><span>cat <&5 <span style="font-style:italic"># make FD 0 read from where FD 5 currently reading, copy file descriptor FD 5 to FD 0, then cat will send content to FD 1</span> -</span></span></code></pre></div></blockquote> -<p>Exercise</p> -<blockquote> -<p>Q: fix <code>exec 3>&2 2>log; echo 'Hello!'; exec 2>&3</code> so that the message is properly saved into the <code>log</code> file and such that FD 3 is properly closed afterwards:</p> -<p>A:</p> -<ol> -<li><code>exec 3>&1- 3>log; echo 'Hello!'; exec 1>&3-</code></li> -<li><code>exec 3>&1 1>&- 3>log; echo 'Hello!'; exec 1>&3 3>&-</code></li> -</ol> -</blockquote> -<h2 id="expansion">Expansion</h2> -<h3 id="pathname-expansion">pathname expansion</h3> -<ol> -<li> -<p>pattern expansion is performed by bash before command even execute</p> -<blockquote> -<p><code>file *</code> will show info about all file in current directory. <code>*</code> will expand to content before <code>file</code> execute.</p> -</blockquote> -</li> -<li> -<p>A <em>glob</em> is the name of the type of pattern supported by the bash shell.</p> -<blockquote> -<p>basic glob name supported by bash<img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665123982.png" alt="explanation"></p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665133964.png" alt="example"></p> -<p><strong>Those glob will only affect current directory, explicit expression is required to working on other directory.</strong> <code>ls /sub/*</code></p> -</blockquote> -</li> -<li> -<p>extended glob can be enable to get more powerful but also easy confusing feature of bash</p> -<blockquote> -<p>bash: <code>shopt -s extglob</code> -zsh. : <code>setopt extendedglob</code> -<img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665134156.png" alt="explanation"></p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665134205.png" alt="!(my)* get expand because of * is outside !(), which makes it expland another whole pathname"></p> -</blockquote> -</li> -</ol> -<h3 id="command-substitution">Command Substitution</h3> -<p>we can expansion commands within commands, but must use double-quote <code>""</code> instead of <code>''</code></p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="font-style:italic"># this will output contents in hello.h to screen</span> -</span></span><span style="display:flex;"><span>cat hello.h -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># this will expand `cat hello.h` to real contents in </span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># file hello.h and concatenate to previous sentence</span> -</span></span><span style="display:flex;"><span>echo <span style="font-style:italic">"file hello.h contains contents of </span><span style="font-weight:bold">$(</span>cat hello.h<span style="font-weight:bold">)</span><span style="font-style:italic">"</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># this will output 'file hello.h contains contents of $(cat hello.h)'</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># without expand command in $()</span> -</span></span><span style="display:flex;"><span>echo <span style="font-style:italic">'file hello.h contains contents of $(cat hello.h)'</span> -</span></span></code></pre></div><p>In command, <code>$()</code> is called <em>value expansion</em>, it consists of value-expansion prefix <code>$</code> and subshell <code>(...)</code>. A subshell is essentially a small new bash process that is used to run a command while the main bash shell waits for the result.</p> -<h2 id="parameters">Parameters</h2> -<p>There are three kind of parameters:</p> -<ol> -<li>Environment Parameter</li> -<li>Positional Parameter</li> -<li>Variables</li> -</ol> -<h3 id="environment-parameter">Environment Parameter</h3> -<p>environment variables exist at the process level. That means they are not a feature of the bash shell, but rather a feature of any program process on your system. They can inherit by children, but children’s EV can’t be given to parent.</p> -<h3 id="positional-parameter">Positional Parameter</h3> -<p>Just as name indicates, these kind of parameters indicate arguments’ position, and always starting from 0.</p> -<p>for example, imaging we have a script <code>rename</code>, arguments could be passed to it to extend its usage:</p> -<p><code>rename dir name</code> there, we passed <code>dir</code> and <code>name</code> as argument, so that positional parameters in script would be <code>$1</code> and <code>$2</code>, representing arguments respectively. after <code>$2</code>, such as <code>$3</code> is unset since there has no more argument.</p> -<blockquote> -<p>Positional Parameter is read-only</p> -</blockquote> -<p>a new usage: <code>bash -c 'ls "$1"' -- '/home'</code>. This will working like <code>ls /home</code>, dash is necessary since it is first variable in shell we ran commands and it makes positional value of arguments populated after it stand as we expect in shell single-quoted command gonna run in.</p> -<h3 id="special-parameter">Special Parameter</h3> -<p>Special parameters are parameters whose name is a single symbolic character, they are used to request certain state information from the bash shell. Like positional parameter, they are <em>read-only</em>.</p> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1666054171.png" alt="different kinds of special parameters and the information they hold"></p> -<h3 id="variables">Variables</h3> -<p>definition: <code>name=value</code> <em>//no space around <code>=</code> like other programming language support</em></p> -<p>call: like <em>command expansion</em>, using variable is to expand it with prefix <code>$</code>, e.g. <code>$name</code></p> -<ul> -<li>Keep in mind, Expansion should always be double-quoted *</li> -</ul> -<h3 id="parameter-expansion">Parameter expansion</h3> -<blockquote> -<p><a href="https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html">GNU material</a></p> -</blockquote> -<p>we expand parameters by prefixing their name with a <code>$</code> symbol</p> -<blockquote> -<p>e.g. <code>name=me; echo hello "$name"</code>. <code>hello me</code>.</p> -</blockquote> -<p>In addition, we can put braces (<code>{</code> and <code>}</code>) around our parameter, which indicates where variable is about to begin and end.</p> -<blockquote> -<p>e.g. <code>name=orange; echo there are 4 "${name}s"</code> <code>there are 4 oranges</code>.</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>name=orange -</span></span><span style="display:flex;"><span>echo <span style="font-style:italic">"there are 4 </span><span style="font-weight:bold;font-style:italic">${</span>name<span style="font-weight:bold;font-style:italic">}</span><span style="font-style:italic">s."</span> <span style="font-style:italic"># there are 4 oranges.</span> -</span></span><span style="display:flex;"><span>echo <span style="font-style:italic">"there are 4 </span>$names<span style="font-style:italic">."</span> <span style="font-style:italic"># there are 4 .</span> -</span></span></code></pre></div><p>here, we put <code>{}</code>around<code>name</code>so that bash can be told that suffix <code>s</code> is not a part of variable. otherwise, it will treat <code>names</code> as parameter and looking for its value, which is none in our example.</p> -</blockquote> -<p>parameter expansion brings up a powerful feature: <em>parameter expansion oerators</em></p> -<blockquote> -<p>While expanding a parameter, it is possible to apply an operator to the expanding value without alternate original value.</p> -<p>I use these mostly</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="font-style:italic"># remove string before pattern ${name#pattern} shortest ${name##pattern} longest</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># remove string after pattern ${name%pattern} longest ${name%%pattern} shortest</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># delete first matching pattern ${name/pattern}</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># delete all matching pattern ${name//pattern}</span> -</span></span><span style="display:flex;"><span><span style="font-style:italic"># substitute pattern with string ${name//pattern/string}</span> -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>foo=<span style="font-style:italic">"foo-bar-foobar"</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo#*-<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'bar-foobar' (Removes 'foo-' because that matches '*-')</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo##*-<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'foobar' (Removes 'foo-bar-')</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo%-*<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'foo-bar'</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo%%-*<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'foo'</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo/-<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'foobar-foobar'</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo//-<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'foobarfoobar'</span> -</span></span><span style="display:flex;"><span>echo <span style="font-weight:bold;font-style:italic">${</span>foo//-/_<span style="font-weight:bold;font-style:italic">}</span> <span style="font-style:italic"># echoes 'foo_bar_foobar'</span> -</span></span></code></pre></div></blockquote> -<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665660923.png" alt="part of operators as shown picture"></p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/7/index.html b/posts/7/index.html deleted file mode 100644 index 0678690..0000000 --- a/posts/7/index.html +++ /dev/null @@ -1,166 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/7/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/7/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Past Is Great", - "headline" : "Past Is Great", - "description" : "Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great!\nFirst is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect.", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-11-07 09:16:15 \u002b0800 CST", - "dateModified" : "2022-11-07 09:16:15 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/7\/", - "keywords" : [ ] - } -</script> -<title>Past Is Great</title> - <meta property="og:title" content="Past Is Great" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great! -First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect." /> - <meta name="description" content="Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great! -First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Past Is Great</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-11-07 09:16:15 CST"> - 07 Nov 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great!</p> -<p>First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect.</p> -<p>Second is my YouTube keeps suggesting songs that got me reminiscence bump. Such songs that remind me when the time power cut is regular and the phone has not yet existed. I still remember the feel when I am wrapped in quilt and watch TV in the cold night… dizzy.</p> -<p>Third just happened now, I was gonna start watching Doraemon, and the title of the episode I’m getting at is ‘Past is Great’, seriously???</p> -<p>even two of them would tell me the present is better than past, I still miss past. Midnight in Paris said we love past because present unsatisfied. And ‘Past is Great’ shows us comparing of ancient and modern lives style. Both views are most people miss about past, either think their life sucks or just wanna experience life in past.</p> -<p>Well, I’m not both… I miss past is that it is fixed, it is unchangeable. No matter what we do now, past is past, it right there, waiting to be read. this feel just like when I watch shows or movies. I’d want to know what ending it will be, and release my imagination along with shows to get that result.</p> -<p>Same thing happens here. Few scenes I remember, or the music I think familiar, but I don’t know when or where I experienced it, I would start my imagination. Maybe I was doing something funny, maybe I was going to somewhere nice, maybe… maybe… then, I got here. The beauty part is, I always thought nice thing, and it always make me feel ease. That’s good enough for me.</p> -<p>I said there’s this sign… Actually, not really. Just some shit things happend recently that make me want to run away. The ‘sign’ just is what I want to see now, not that it really a sign.</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/8/index.html b/posts/8/index.html deleted file mode 100644 index 8166ea7..0000000 --- a/posts/8/index.html +++ /dev/null @@ -1,168 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/8/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/8/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Getting unified experience", - "headline" : "Getting unified experience", - "description" : "Lately, I\u0026rsquo;m trying get my tools working seamlessly cross my 2 working machines as well as a server.\nSince I already heard dotfiles for a while, but didn\u0026rsquo;t get chance to familiar with. So I start searching around trying to set a dotfile up.\nFrankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server.\nHere\u0026rsquo;s a brief description: all configuration files I want to put in .", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-07 15:05:30 \u002b0800 CST", - "dateModified" : "2022-12-07 15:05:30 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/8\/", - "keywords" : [ ] - } -</script> -<title>Getting unified experience</title> - <meta property="og:title" content="Getting unified experience" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="Lately, I&rsquo;m trying get my tools working seamlessly cross my 2 working machines as well as a server. -Since I already heard dotfiles for a while, but didn&rsquo;t get chance to familiar with. So I start searching around trying to set a dotfile up. -Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server. -Here&rsquo;s a brief description: all configuration files I want to put in ." /> - <meta name="description" content="Lately, I&rsquo;m trying get my tools working seamlessly cross my 2 working machines as well as a server. -Since I already heard dotfiles for a while, but didn&rsquo;t get chance to familiar with. So I start searching around trying to set a dotfile up. -Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server. -Here&rsquo;s a brief description: all configuration files I want to put in ." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">Getting unified experience</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-12-07 15:05:30 CST"> - 07 Dec 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>Lately, I’m trying get my tools working seamlessly cross my 2 working machines as well as a server.</p> -<p>Since I already heard dotfiles for a while, but didn’t get chance to familiar with. So I start searching around trying to set a dotfile up.</p> -<p>Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server.</p> -<p>Here’s a brief description: all configuration files I want to put in <code>.config</code>, all plugins and config related files I want to place in <code>.local</code>. -The files I want to sync now are the configs and plugins of vim, zsh, tmux, gpg, and git. Those 5 softwares are my root.</p> -<p>The problem is, due to different environment, my config for those machines have some custom setting, such as <code>XDG</code> env, my macOS doesn’t need it.</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/9/index.html b/posts/9/index.html deleted file mode 100644 index 2826311..0000000 --- a/posts/9/index.html +++ /dev/null @@ -1,256 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/9/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/9/" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "测试自动创建博客", - "headline" : "测试自动创建博客", - "description" : "hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题:\n写作 编辑器随便用个支持MD的就行了,这句陈述挺好。\n但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。\n不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。\n其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭\u0026hellip; 用vim写markdown。\n图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。\n在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。\nLinux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~\n发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。\n原先,发布一篇博客我的流程为,\nhugo new post -\u0026gt; vim 找到文章 -\u0026gt; 保存或者发布 -\u0026gt; 然后到public文件夹 push出去。\n太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~\n###################################################################### # @author : garhve (dev@garhve.com) # @file : blog # @created : Friday Dec 09, 2022 16:09:42 CST # # @description : simplify blog publishing.", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-09 16:38:56 \u002b0800 CST", - "dateModified" : "2022-12-09 16:38:56 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/9\/", - "keywords" : [ ] - } -</script> -<title>测试自动创建博客</title> - <meta property="og:title" content="测试自动创建博客" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: -写作 编辑器随便用个支持MD的就行了,这句陈述挺好。 -但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。 -不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。 -其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭&hellip; 用vim写markdown。 -图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 -在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。 -Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ -发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 -原先,发布一篇博客我的流程为, -hugo new post -&gt; vim 找到文章 -&gt; 保存或者发布 -&gt; 然后到public文件夹 push出去。 -太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~ -###################################################################### # @author : garhve (dev@garhve.com) # @file : blog # @created : Friday Dec 09, 2022 16:09:42 CST # # @description : simplify blog publishing." /> - <meta name="description" content="hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题: -写作 编辑器随便用个支持MD的就行了,这句陈述挺好。 -但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local 文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, 同步文件再在每台电脑上额外加个云,想想我都受不了。 -不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 问题我不太想用。 -其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, 达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 直接使用vim写文章,有点别扭&hellip; 用vim写markdown。 -图片 图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, 但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。 -在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, 后面使用即可。 -Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~ -发布 Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, 其中便包括这个博客。 Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。 -原先,发布一篇博客我的流程为, -hugo new post -&gt; vim 找到文章 -&gt; 保存或者发布 -&gt; 然后到public文件夹 push出去。 -太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~ -###################################################################### # @author : garhve (dev@garhve.com) # @file : blog # @created : Friday Dec 09, 2022 16:09:42 CST # # @description : simplify blog publishing." /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="" /> - - - - - <style>body{font-family:bree serif,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:85%;background-color:#f6f8fa;border-radius:6px;font-family:fira code,monospace}.markdown-body pre>code{padding:0;font-size:80%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">测试自动创建博客</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-12-09 16:38:56 CST"> - 09 Dec 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题:</p> -<h3 id="写作">写作</h3> -<p>编辑器随便用个支持MD的就行了,这句陈述挺好。</p> -<p>但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 -所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local -文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, -同步文件再在每台电脑上额外加个云,想想我都受不了。</p> -<p>不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 -问题我不太想用。</p> -<p>其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, -达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 -使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 -直接使用vim写文章,有点别扭… 用vim写markdown。</p> -<h3 id="图片">图片</h3> -<p>图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, -但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 -服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。</p> -<p>在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 -保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 -我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, -后面使用即可。</p> -<p>Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~</p> -<h3 id="发布">发布</h3> -<p>Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 -自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 -尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, -其中便包括这个博客。 -Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 -cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。</p> -<p>原先,发布一篇博客我的流程为,</p> -<blockquote> -<p>hugo new post -> vim 找到文章 -> 保存或者发布 -> 然后到public文件夹 -push出去。</p> -</blockquote> -<p>太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 -怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 -我也可以直接将草稿发布出来,看得见,我才有动力写~</p> -<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>###################################################################### -</span></span><span style="display:flex;"><span># @author : garhve (dev@garhve.com) -</span></span><span style="display:flex;"><span># @file : blog -</span></span><span style="display:flex;"><span># @created : Friday Dec 09, 2022 16:09:42 CST -</span></span><span style="display:flex;"><span># -</span></span><span style="display:flex;"><span># @description : simplify blog publishing. -</span></span><span style="display:flex;"><span>###################################################################### -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>p="$(pwd)" -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>cd "$HOME/Storage/data/blog" -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>echo "Enter the blog name" -</span></span><span style="display:flex;"><span>read -r name -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>hugo new posts/"$name" -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>echo "1. en" -</span></span><span style="display:flex;"><span>echo "2. cn" -</span></span><span style="display:flex;"><span>echo "all option would be default to 1 except 2[1 or 2]: " -</span></span><span style="display:flex;"><span>read l -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>if [ l -eq 1 ]; then -</span></span><span style="display:flex;"><span> lang="en" -</span></span><span style="display:flex;"><span>elif [ l -eq 2 ]; then -</span></span><span style="display:flex;"><span> lang="cn" -</span></span><span style="display:flex;"><span>else -</span></span><span style="display:flex;"><span> lang="en" -</span></span><span style="display:flex;"><span>fi -</span></span><span style="display:flex;"><span>[ lang == "cn" ] && mv "content/en/posts/$name" "content/cn/posts/$name" -</span></span><span style="display:flex;"><span>vim "content/$lang/posts/$name" -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>hugo -</span></span><span style="display:flex;"><span>cd public -</span></span><span style="display:flex;"><span>git add . -</span></span><span style="display:flex;"><span>read -r -p "commit message: " com -</span></span><span style="display:flex;"><span>git commit -m "$com" -</span></span><span style="display:flex;"><span> -</span></span><span style="display:flex;"><span>cd "$p" -</span></span></code></pre></div><p>这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 -也许可以将代码优化下以后就省心了,哈哈。</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/posts/index.html b/posts/index.html deleted file mode 100644 index c6f649b..0000000 --- a/posts/index.html +++ /dev/null @@ -1,243 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "Posts", - "headline" : "Posts", - "description" : "", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-14 11:03:52 \u002b0800 CST", - "dateModified" : "2022-12-14 11:03:52 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/", - "keywords" : [ ] - } -</script> -<title>Posts</title> - <meta property="og:title" content="Posts" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="" /> - <meta name="description" content="" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="posts"> - <div class="row"> - <div class="col-xs-12"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - - <h1 class="taxonomy-term"></h1> - <div id="posts-list"> - <section> - <h1 class="site-date-catalog">2022</h1> - - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-12-14 11:03:52 CST">Dec 14</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/no-problemo/">[draft]No Problemo</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-12-07 15:05:30 CST">Dec 07</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/8/">Getting unified experience</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-11-07 09:16:15 CST">Nov 07</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/7/">Past Is Great</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-09-29 09:43:02 CST">Sep 29</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/6/">Mess with Bash(2)</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-09-12 09:02:06 CST">Sep 12</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/5/">Escape Sequences</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-09-03 14:33:37 CST">Sep 03</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/4/">Architecture of Linux Kernel</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-08-25 13:40:56 CST">Aug 25</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/3/">Mess with bash(1)</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-08-10 19:24:59 CST">Aug 10</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/2/">Install arch linux on Tencent server</a> - </div> - </div> - </div> - </div> - - <div class="row posts-line"> - <div class="posts-date col-xs-2"> - <time datetime="2022-08-10 17:21:02 CST">Aug 10</time> - </div> - <div class="posts-title col-xs-10"> - <div class="row"> - <div class="col-xs-12"> - <a href="/posts/1/">First Website</a> - </div> - </div> - </div> - </div> - - </section> - - </div> - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - -</body> - -</html> diff --git a/posts/index.xml b/posts/index.xml deleted file mode 100644 index 6f8785d..0000000 --- a/posts/index.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> - <channel> - <title>Posts on blog | garhve's hub</title> - <link>https://blog.garhve.com/posts/</link> - <description>Recent content in Posts on blog | garhve's hub</description> - <generator>Hugo -- gohugo.io</generator> - <language>en-us</language> - <lastBuildDate>Wed, 14 Dec 2022 11:03:52 +0800</lastBuildDate><atom:link href="https://blog.garhve.com/posts/index.xml" rel="self" type="application/rss+xml" /> - <item> - <title>[draft]No Problemo</title> - <link>https://blog.garhve.com/posts/no-problemo/</link> - <pubDate>Wed, 14 Dec 2022 11:03:52 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/no-problemo/</guid> - <description>My feeling to express are fading&hellip; Not sure how I know it, just got this sense. Recently, I picked up an anime named &ldquo;The Simpsons&rdquo; which I watched first episode back in highschool. I fell in love with it right after re-watched first episode! So I downloaded the whole</description> - </item> - - <item> - <title>Getting unified experience</title> - <link>https://blog.garhve.com/posts/8/</link> - <pubDate>Wed, 07 Dec 2022 15:05:30 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/8/</guid> - <description>Lately, I&rsquo;m trying get my tools working seamlessly cross my 2 working machines as well as a server. -Since I already heard dotfiles for a while, but didn&rsquo;t get chance to familiar with. So I start searching around trying to set a dotfile up. -Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server. -Here&rsquo;s a brief description: all configuration files I want to put in .</description> - </item> - - <item> - <title>Past Is Great</title> - <link>https://blog.garhve.com/posts/7/</link> - <pubDate>Mon, 07 Nov 2022 09:16:15 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/7/</guid> - <description>Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great! -First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect.</description> - </item> - - <item> - <title>Mess with Bash(2)</title> - <link>https://blog.garhve.com/posts/6/</link> - <pubDate>Thu, 29 Sep 2022 09:43:02 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/6/</guid> - <description>More info is in this tutorial -all value expansions (ie. all syntax with a $ prefix) can only expand inside quoted arguments if the argument was double-quoted . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place! -&ldquo;Value expansions ($...) must always be double-quoted.&rdquo; -Never leave a value expansion unquoted. -Redirection File Redirection 0 is standard input, 1 is standard output, 2 is standard error</description> - </item> - - <item> - <title>Escape Sequences</title> - <link>https://blog.garhve.com/posts/5/</link> - <pubDate>Mon, 12 Sep 2022 09:02:06 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/5/</guid> - <description>copied from github in case one day it disappears -more information could visit vt100 User Guide -ANSI Escape Sequences Standard escape codes are prefixed with Escape: -Ctrl-Key: ^[ Octal: \033 Unicode: \u001b Hexadecimal: \x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. -Arguments are delimeted by semi colon (;).</description> - </item> - - <item> - <title>Architecture of Linux Kernel</title> - <link>https://blog.garhve.com/posts/4/</link> - <pubDate>Sat, 03 Sep 2022 14:33:37 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/4/</guid> - <description>Description Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged). -Modern operating systems support at least 2 levels: -User space: For applications to run in unprivileged user mode Kernel space: For the kernel (and all its components) to run in privileged mode – kernel mode Address of these 2 spaces are separate.</description> - </item> - - <item> - <title>Mess with bash(1)</title> - <link>https://blog.garhve.com/posts/3/</link> - <pubDate>Thu, 25 Aug 2022 13:40:56 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/3/</guid> - <description>Crontab crontab is a useful tool, I really regret that I don&rsquo;t familar it earlier. -It&rsquo;s usage really simple, and these two are my frequent using: -crontab -e #edit crontab file that reside in /var/spool/cron crontab -l #list current crontab job It basic syntax as follow, also really simple example of usage: -delete file foo every minute * * * * * rm foo delete file foo every 15 minutes 15 * * * * rm foo delete file foo every beginning of hour 0 * * * * rm foo delete file foo every minute after 3 hours * 3 * * * rm foo delete file foo every day at 18:30 30 18 * * * rm foo delete file foo every beginning of month 0 0 0 * * rm foo delete file foo on beginning of 1st,10th of month 0 0 1,10 * * rm foo The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker.</description> - </item> - - <item> - <title>Install arch linux on Tencent server</title> - <link>https://blog.garhve.com/posts/2/</link> - <pubDate>Wed, 10 Aug 2022 19:24:59 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/2/</guid> - <description>In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous&hellip; -My requirement as below: -abroad provider because they don&rsquo;t have to register.. the the budget&rsquo;s not relax, all I can choosing was in range of $0 - $10. It can runs Arch linux seamlessly I already eye on one: Linode. But they don&rsquo;t see me&hellip; and banned all my gmail account from their service&hellip;</description> - </item> - - <item> - <title>First Website</title> - <link>https://blog.garhve.com/posts/1/</link> - <pubDate>Wed, 10 Aug 2022 17:21:02 +0800</pubDate> - - <guid>https://blog.garhve.com/posts/1/</guid> - <description>So now I can say my website is on.. even though it just literally has nothing but a printing hello I got this garhve.com domain on namesilo for $9.95 per year, it&rsquo;s really cheap! I always want a domain that is .com suffix. -Now, the web is https, this is a bit difficult for me. -Due to personal interest, I didn&rsquo;t choose frame to base my website. I use Nginx but I don&rsquo;t familiar with it.</description> - </item> - - </channel> -</rss> diff --git a/posts/no-problemo/index.html b/posts/no-problemo/index.html deleted file mode 100644 index 3cf1a18..0000000 --- a/posts/no-problemo/index.html +++ /dev/null @@ -1,159 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8" /> - <meta name="generator" content="Hugo 0.108.0"> - - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="author" content="garhve" /> - <meta property="og:url" content="https://blog.garhve.com/posts/no-problemo/" /> - <link rel="canonical" href="https://blog.garhve.com/posts/no-problemo/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> - - <script type="application/ld+json"> - { - "@context" : "http://schema.org", - "@type" : "BlogPosting", - "mainEntityOfPage": { - "@type": "WebPage", - "@id": "https:\/\/blog.garhve.com" - }, - "articleSection" : "posts", - "name" : "[draft]No Problemo", - "headline" : "[draft]No Problemo", - "description" : "My feeling to express are fading\u0026hellip; Not sure how I know it, just got this sense. Recently, I picked up an anime named \u0026ldquo;The Simpsons\u0026rdquo; which I watched first episode back in highschool. I fell in love with it right after re-watched first episode! So I downloaded the whole", - "inLanguage" : "en-US", - "author" : "garhve", - "creator" : "garhve", - "publisher": "garhve", - "accountablePerson" : "garhve", - "copyrightHolder" : "garhve", - "copyrightYear" : "2022", - "datePublished": "2022-12-14 11:03:52 \u002b0800 CST", - "dateModified" : "2022-12-14 11:03:52 \u002b0800 CST", - "url" : "https:\/\/blog.garhve.com\/posts\/no-problemo\/", - "keywords" : [ ] - } -</script> -<title>[draft]No Problemo</title> - <meta property="og:title" content="[draft]No Problemo" /> - <meta property="og:type" content="article" /> - <meta property="og:description" content="My feeling to express are fading&hellip; Not sure how I know it, just got this sense. Recently, I picked up an anime named &ldquo;The Simpsons&rdquo; which I watched first episode back in highschool. I fell in love with it right after re-watched first episode! So I downloaded the whole" /> - <meta name="description" content="My feeling to express are fading&hellip; Not sure how I know it, just got this sense. Recently, I picked up an anime named &ldquo;The Simpsons&rdquo; which I watched first episode back in highschool. I fell in love with it right after re-watched first episode! So I downloaded the whole" /> - <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> - - - - - <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> - - - <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> - - - - - <link href="/index.xml" rel="alternate" type="application/rss+xml" - title="blog | garhve's hub"> - - <link rel="preconnect" href="https://fonts.gstatic.com"> - <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> - - - -</head> - - -<body> - <article class="post English" id="article"> - <div class="row"> - <div class="col-xs-12"> - <div class="site-header"> - -<header> - <div class="header-title"> - <a href="/" - >Garhve</a - > - </div> - <div class="header-subtitle"></div> -</header> -<div class="row end-md center-xs header-items"> -</div> -<div class="row end-xs"> - - <div class="lang-switch col-xs-3 col-xs-offset-9"> - <a href="/cn/">Chinese</a> - </div> - -</div> -<div class="header-line"></div> - - </div> - <header class="post-header"> - <h1 class="post-title">[draft]No Problemo</h1> - - <div class="row post-desc"> - <div class="col-xs-6"> - - <time class="post-date" datetime="2022-12-14 11:03:52 CST"> - 14 Dec 2022 - </time> - - </div> - <div class="col-xs-6"> - - <div class="post-author"> - <a target="_blank" href="https://garhve.com">@garhve</a> - </div> - - </div> - </div> - - </header> - - <div class="post-content markdown-body"> - - <p>My feeling to express are fading… Not sure how I know it, just got this sense. -Recently, I picked up an anime named “<a href="https://en.wikipedia.org/wiki/The_Simpsons">The Simpsons</a>” which I watched first episode back in highschool. -I fell in love with it right after re-watched first episode! So I downloaded the whole</p> - - </div> - - <div class="row"> - <div class="col-xs-12"> - - </div> - </div> - - - <div style="height: 50px;"></div> - - - <div class="site-footer"> - - - -</div> - - </div> - </div> - </article> - - - -<script> - - - - - -</script> - - - -</body> - -</html> diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..f8414f0 --- /dev/null +++ b/public/404.html @@ -0,0 +1,3 @@ +<!doctype html> +<title>404 Not Found</title> +<h1>404 Not Found</h1> diff --git a/public/categories/code/index.html b/public/categories/code/index.html new file mode 100644 index 0000000..c5e2952 --- /dev/null +++ b/public/categories/code/index.html @@ -0,0 +1,75 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>code | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Category: code]</p> + + +<p> + <div class="date"> + 2022-09-29 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/mess-with-bash-2/">Mess with Bash(2)</a> + </div> +</p> + +<p> + <div class="date"> + 2022-09-12 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/escape-sequence/">Escape Sequences</a> + </div> +</p> + +<p> + <div class="date"> + 2022-08-25 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/mess-with-bash-1/">Mess with bash(1)</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/categories/cs/index.html b/public/categories/cs/index.html new file mode 100644 index 0000000..98d6565 --- /dev/null +++ b/public/categories/cs/index.html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>cs | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Category: cs]</p> + + +<p> + <div class="date"> + 2022-09-03 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/architecture-of-linux-kernel/">Architecture of Linux Kernel</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/categories/index.html b/public/categories/index.html new file mode 100644 index 0000000..c9bdb10 --- /dev/null +++ b/public/categories/index.html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Categories</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Categories]</p> + +<ul> + + <li> + <a href="https://blog.garhve.com/categories/code/">/code</a> + (3) + </li> + + <li> + <a href="https://blog.garhve.com/categories/cs/">/cs</a> + (1) + </li> + + <li> + <a href="https://blog.garhve.com/categories/period/">/period</a> + (7) + </li> + +</ul> + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/categories/period/index.html b/public/categories/period/index.html new file mode 100644 index 0000000..22044aa --- /dev/null +++ b/public/categories/period/index.html @@ -0,0 +1,111 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>period | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Category: period]</p> + + +<p> + <div class="date"> + 2022-12-20 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/sui-bi-1/">随笔(1)</a> + </div> +</p> + +<p> + <div class="date"> + 2022-12-14 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/no-problemo/">No Problemo</a> + </div> +</p> + +<p> + <div class="date"> + 2022-12-09 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/ce-shi-zi-dong-chuang-jian-bo-ke/">测试自动创建博客</a> + </div> +</p> + +<p> + <div class="date"> + 2022-12-07 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/getting-unified-experience/">Getting unified experience</a> + </div> +</p> + +<p> + <div class="date"> + 2022-11-07 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/past-is-great/">Past Is Great</a> + </div> +</p> + +<p> + <div class="date"> + 2022-08-10 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/first-website/">First Website</a> + </div> +</p> + +<p> + <div class="date"> + 2022-08-10 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/install-archlinux-on-tencent-server/">Install arch linux on Tencent server</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/dark.css b/public/dark.css new file mode 100644 index 0000000..cef7c28 --- /dev/null +++ b/public/dark.css @@ -0,0 +1 @@ +body{line-height:1.5;color:#feffff;background-color:#2E3440;font-family:sans-serif;width:80%;min-width:200px;max-width:720px;margin:0 auto;padding-top:40px;padding-bottom:40px}body img,body video{display:block;margin:0 auto;max-width:90%}body ul{margin-left:1rem;padding-left:1rem}body a{color:#feffff;text-decoration:underline}@media screen and (max-width: 480px){body{width:90%}}.header{color:#eee;background-color:#2E3440;top:0;padding-bottom:5px;border-bottom:solid 1px #b3deef;overflow:hidden}.header a{color:#eee}.button_no_decoration{color:#b3deef;border:none;outline:none;background:transparent;vertical-align:middle;font-family:sans-serif}.site_title{display:flex;justify-content:space-between;font-size:1.5rem}.site_title a{color:#feffff;text-decoration:none}.menu{text-align:right}.menu a{text-decoration:none}.date{color:#ffc24b;display:inline;margin-right:15px}.date_postpage{color:#b3deef;text-align:right}.title{color:#b3deef;font-size:1.3rem;display:inline}.title a{text-decoration:none}.archive_title{font-size:1.3rem}.archive_title a{text-decoration:none}.title_postpage{font-size:1.6em;line-height:1.4em;font-weight:bold;color:#feffff}.taxonomies a{font-size:0.9rem;color:#eee;text-decoration:none}.taxonomies_postpage{text-align:right}.taxonomies_postpage a{font-size:0.9rem;color:#eee;text-decoration:none}.taxonomies_index a{font-size:0.9rem;color:#eee;text-decoration:none}@media screen and (max-width: 480px){.taxonomies_index a{display:none}}.taxonomies_list a{text-decoration:none}.footer{color:#eee;text-align:right;margin-top:50px;padding-top:0px}.footer a{color:#eee}h1{font-size:2.2rem;color:#b3deef}h2{font-size:2.0rem;color:#b3deef}h3{font-size:1.5rem;color:#b3deef}h4{font-size:1.3rem;color:#b3deef}h5{font-size:1.2rem;color:#b3deef}h6{font-size:1.1rem;color:#b3deef}h1,h2,h3,h4,h5,h6{font-weight:bold}pre{border:1px solid #AAA;overflow-x:auto;overflow-y:hidden;padding:20px}:not(pre)>code{background-color:#ffc24b;color:#282828;opacity:50%}blockquote{border-left:5px solid #b3deef;padding:0.5rem;margin:1rem;color:#c0c0c0}table{max-width:90%}table th{padding:10px}table th,td{border:solid 1px #d3b987}table td{padding:10px}button{color:#282828;background-color:#b3deef;border:solid;border-radius:3px;border-color:#b3deef} diff --git a/public/images/favicon.png b/public/images/favicon.png Binary files differnew file mode 100644 index 0000000..596fb43 --- /dev/null +++ b/public/images/favicon.png diff --git a/public/images/logo.png b/public/images/logo.png Binary files differnew file mode 100644 index 0000000..596fb43 --- /dev/null +++ b/public/images/logo.png diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..449e940 --- /dev/null +++ b/public/index.html @@ -0,0 +1,316 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + + <title>garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + + + + + <h3>2022 </h3> + + + <p> + <div class="date"> + 2022-12-20 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/sui-bi-1/">随笔(1)</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-12-14 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/no-problemo/">No Problemo</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-12-09 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/ce-shi-zi-dong-chuang-jian-bo-ke/">测试自动创建博客</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-12-07 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/getting-unified-experience/">Getting unified experience</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-11-07 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/past-is-great/">Past Is Great</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-09-29 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/mess-with-bash-2/">Mess with Bash(2)</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + + +  <a href="https://blog.garhve.com/tags/bash/">#bash</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-09-12 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/escape-sequence/">Escape Sequences</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + + +  <a href="https://blog.garhve.com/tags/c/">#c</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-09-03 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/architecture-of-linux-kernel/">Architecture of Linux Kernel</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/cs/">/cs</a> + + + + + +  <a href="https://blog.garhve.com/tags/linux/">#linux</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-08-25 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/mess-with-bash-1/">Mess with bash(1)</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + + +  <a href="https://blog.garhve.com/tags/bash/">#bash</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-08-10 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/first-website/">First Website</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-08-10 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/install-archlinux-on-tencent-server/">Install arch linux on Tencent server</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/js/theme.js b/public/js/theme.js new file mode 100644 index 0000000..be2a9d1 --- /dev/null +++ b/public/js/theme.js @@ -0,0 +1,22 @@ +const key = 'current_emily_zola_style'; + +function getTheme() { + let theme = document.getElementById('stylesheet'); + let current_style = localStorage.getItem(key); + if (current_style === null) { + localStorage.setItem(key, theme.href); + } + theme.href = localStorage.getItem(key); +} + +function changeTheme() { + let current_style = localStorage.getItem(key); + if (current_style.includes('dark')) { + localStorage.setItem(key, '/light.css'); + } + else { + localStorage.setItem(key, '/dark.css'); + } + let theme = document.getElementById('stylesheet'); + theme.href = localStorage.getItem(key); +}
\ No newline at end of file diff --git a/public/post/architecture-of-linux-kernel/index.html b/public/post/architecture-of-linux-kernel/index.html new file mode 100644 index 0000000..fb665a9 --- /dev/null +++ b/public/post/architecture-of-linux-kernel/index.html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Architecture of Linux Kernel | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Architecture of Linux Kernel</div> +</p> +<p> + <div class="date_postpage">2022-09-03</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/cs/">/cs</a> + + + + +  <a href="https://blog.garhve.com/tags/linux/">#linux</a> + + + </div> +</p> + +<p> + <h2 id="description">Description</h2> +<p>Modern microcontrollers nowadays support at least two privilege levels. Intel/AMD x86-64 family supports 4 levels, whilst ARM (32bit) microcontrollers support up to 7 levels (6 privileged, 1 non-privileged).</p> +<p>Modern operating systems support at least 2 levels:</p> +<ul> +<li><strong>User space</strong>: For applications to run in unprivileged user mode</li> +<li><strong>Kernel space</strong>: For the kernel (and all its components) to run in privileged mode – kernel mode</li> +</ul> +<p>Address of these 2 spaces are separate.</p> +<p>Applications in user mode will auto-linked to glibc(the GNU standard C library). Libraries only available in user mode, kernel mode doesn't have this conception. An application only can through <strong>System call</strong> to access kernel. On the other hand, system calls are the only legal entry point into the kernel space.</p> +<blockquote> +<p>Libraries APIs: man section 3 +System calls APIs: man section 2</p> +</blockquote> +<p>to be continue...</p> + +</p> + + +<script> + MathJax = { + tex: { + inlineMath: [['$', '$'], ['\\(', '\\)']] + } + }; +</script> +<script type="text/javascript" async + src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"> +</script> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/ce-shi-zi-dong-chuang-jian-bo-ke/index.html b/public/post/ce-shi-zi-dong-chuang-jian-bo-ke/index.html new file mode 100644 index 0000000..4f7d79e --- /dev/null +++ b/public/post/ce-shi-zi-dong-chuang-jian-bo-ke/index.html @@ -0,0 +1,125 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>测试自动创建博客 | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">测试自动创建博客</div> +</p> +<p> + <div class="date_postpage">2022-12-09</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>hugo挺不错的,就是太麻烦了。以下几点都是在使用时遇到的一些问题:</p> +<h3 id="xie-zuo">写作</h3> +<p>编辑器随便用个支持MD的就行了,这句陈述挺好。</p> +<p>但现实是,我家里一台MacBook,一台arch Linux的Thinkpad,公司一台MacBook。 +所以跨平台对我来说就很重要了。我有点洁癖,家目录我都在努力的把config和local +文件整合在各自不同的区域名以至于不那么乱。在每台电脑上下个markdown editor, +同步文件再在每台电脑上额外加个云,想想我都受不了。</p> +<p>不过目前我试过了一个软件marktext,功能和UI都很不错,但由于同步 +问题我不太想用。</p> +<p>其实我比较倾向于下载个web app搭在我raspberry pi上,再通过公网挂出去, +达到我在任意地方都能使用的目的来着,但目前的app总有这样那样的问题 +使我不是很满意,也就一直耽搁着了,现在也就是通过ssh直接到我的arch里 +直接使用vim写文章,有点别扭... 用vim写markdown。并且由于通过ssh到电脑里写的文章,预览比较困难... +先将就一下吧,看看有没有什么好的办法解决它。</p> +<h3 id="tu-pian">图片</h3> +<p>图片怎么管理原本也是个问题,我买入了一个存储桶并配置好了nginx, +但这比较适合fetch图片,当我截了新图要上传时,要么登录存储桶要么scp到 +服务器去上传,而且传好后的url也是一个麻烦事。试了各种方法都不太行之后。</p> +<p>在Mac端我用了uPic,这个比较方便的是不止可以传图片,其他文件需要 +保存了也可以通过它上传,并且,它支持上传后直接拿到自定义对url,对于 +我自定义了域名去匹配nginx的规则很方便。而且只需第一次配置好, +后面使用即可。</p> +<p>Linux端呢,则暂时没有什么好办法,只能老老实实打开网页上传了~</p> +<h3 id="fa-bu">发布</h3> +<p>Hugo的发布其实也是一个问题。在上面说过,我有洁癖,其实我还有一些强迫症。 +自从GitHub被微软收购后,我很少使用了。虽然我只是一介平民,但我还是希望 +尽可能将我不同的指纹分散隔离开来。我用了我自有的服务器去托管我的一些服务, +其中便包括这个博客。 +Hugo我是安装在我的Linux上,我并没有让它接入公网。我有在服务器上托管了一个 +cgit来当我的私人仓库,于是理所当然的,我把public给git到服务器上了。</p> +<p>原先,发布一篇博客我的流程为,</p> +<blockquote> +<p>hugo new post -> vim 找到文章 -> 保存或者发布 -> 然后到public文件夹 +push出去。</p> +</blockquote> +<p>太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 +怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 +我也可以直接将草稿发布出来,看得见,我才有动力写~</p> +<p>这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。 +也许可以将代码优化下以后就省心了,哈哈。</p> +<p>更新:拖了三天,终于把代码补完了~ <a href="https://git.garhve.com/codes/tree/bash/blog.sh?id=46e07255bbe67b1dbf93dcd7f33e25f10eb8f8de">blog.sh</a> </p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#616e88;"># usage: prog new/edit/push [en/cn] +</span><span> +</span><span style="color:#88c0d0;">push</span><span>() { +</span><span> </span><span style="color:#88c0d0;">read </span><span>-r -p </span><span style="color:#a3be8c;">"Do you want to push?[y/n] "</span><span> ans +</span><span style="color:#88c0d0;">... +</span><span style="color:#88c0d0;">[ </span><span style="color:#81a1c1;">$# </span><span>-lt 1 </span><span style="color:#88c0d0;">] </span><span style="color:#81a1c1;">&& </span><span style="color:#88c0d0;">echo </span><span style="color:#a3be8c;">"usage: </span><span style="color:#81a1c1;">$</span><span style="color:#a3be8c;">(</span><span style="color:#88c0d0;">basename </span><span style="color:#81a1c1;">$</span><span>0</span><span style="color:#a3be8c;">) new/edit/push [en/cn]" +</span><span> +</span><span style="color:#88c0d0;">[ </span><span style="color:#81a1c1;">$</span><span>1 </span><span style="color:#81a1c1;">== </span><span style="color:#a3be8c;">"new" </span><span style="color:#88c0d0;">] </span><span style="color:#81a1c1;">&& </span><span style="color:#88c0d0;">new </span><span style="color:#a3be8c;">"</span><span style="color:#81a1c1;">$</span><span>2</span><span style="color:#a3be8c;">" +</span><span style="color:#88c0d0;">[ </span><span style="color:#81a1c1;">$</span><span>1 </span><span style="color:#81a1c1;">== </span><span style="color:#a3be8c;">"edit" </span><span style="color:#88c0d0;">] </span><span style="color:#81a1c1;">&& </span><span style="color:#88c0d0;">edit </span><span style="color:#a3be8c;">"</span><span style="color:#81a1c1;">$</span><span>2</span><span style="color:#a3be8c;">" +</span><span style="color:#88c0d0;">[ </span><span style="color:#81a1c1;">$</span><span>1 </span><span style="color:#81a1c1;">== </span><span style="color:#a3be8c;">"push" </span><span style="color:#88c0d0;">] </span><span style="color:#81a1c1;">&& </span><span style="color:#88c0d0;">push +</span></code></pre> +<p>以后只需要在文件夹里<code>./blog.sh action language</code> 即可。 +大大方便了使用呀。 +<img src="https://assets.garhve.com/pictures/screenshots/2022/12/wIAgJv.png" alt="wIAgJv" /> +也许以后就能多写写了(bushi)</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/escape-sequence/index.html b/public/post/escape-sequence/index.html new file mode 100644 index 0000000..d1ea413 --- /dev/null +++ b/public/post/escape-sequence/index.html @@ -0,0 +1,378 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Escape Sequences | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Escape Sequences</div> +</p> +<p> + <div class="date_postpage">2022-09-12</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + +  <a href="https://blog.garhve.com/tags/c/">#c</a> + + + </div> +</p> + +<p> + <blockquote> +<p>copied from <a href="https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797">github</a> in case one day it disappears</p> +<p>more information could visit <a href="https://vt100.net/docs/vt100-ug/chapter3.html">vt100 User Guide</a></p> +</blockquote> +<h1 id="ansi-escape-sequences">ANSI Escape Sequences</h1> +<p>Standard escape codes are prefixed with <code>Escape</code>:</p> +<ul> +<li>Ctrl-Key: <code>^[</code></li> +<li>Octal: <code>\033</code></li> +<li>Unicode: <code>\u001b</code></li> +<li>Hexadecimal: <code>\x1B</code></li> +<li>Decimal: <code>27</code></li> +</ul> +<p>Followed by the command, somtimes delimited by opening square bracket (<code>[</code>), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself.</p> +<p>Arguments are delimeted by semi colon (<code>;</code>).</p> +<p>For example:</p> +<pre data-lang="sh" style="background-color:#2e3440;color:#d8dee9;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#ebcb8b;">\x</span><span style="color:#88c0d0;">1b[1</span><span style="color:#81a1c1;">;</span><span style="color:#88c0d0;">31m </span><span style="color:#616e88;"># Set style to bold, red foreground. +</span></code></pre> +<h2 id="sequences">Sequences</h2> +<ul> +<li><code>ESC</code> - sequence starting with <code>ESC</code> (<code>\x1B</code>)</li> +<li><code>CSI</code> - Control Sequence Introducer: sequence starting with <code>ESC [</code> or CSI (<code>\x9B</code>)</li> +<li><code>DCS</code> - Device Control String: sequence starting with <code>ESC P</code> or DCS (<code>\x90</code>)</li> +<li><code>OSC</code> - Operating System Command: sequence starting with <code>ESC ]</code> or OSC (<code>\x9D</code>)</li> +</ul> +<p>Any whitespaces between sequences and arguments should be ignored. They are present for improved readability.</p> +<h2 id="general-ascii-codes">General ASCII Codes</h2> +<table><thead><tr><th>Name</th><th>decimal</th><th>octal</th><th>hex</th><th>C-escape</th><th>Ctrl-Key</th><th>Description</th></tr></thead><tbody> +<tr><td><code>BEL</code></td><td>7</td><td>007</td><td>0x07</td><td><code>\a</code></td><td><code>^G</code></td><td>Terminal bell</td></tr> +<tr><td><code>BS</code></td><td>8</td><td>010</td><td>0x08</td><td><code>\b</code></td><td><code>^H</code></td><td>Backspace</td></tr> +<tr><td><code>HT</code></td><td>9</td><td>011</td><td>0x09</td><td><code>\t</code></td><td><code>^I</code></td><td>Horizontal TAB</td></tr> +<tr><td><code>LF</code></td><td>10</td><td>012</td><td>0x0A</td><td><code>\n</code></td><td><code>^J</code></td><td>Linefeed (newline)</td></tr> +<tr><td><code>VT</code></td><td>11</td><td>013</td><td>0x0B</td><td><code>\v</code></td><td><code>^K</code></td><td>Vertical TAB</td></tr> +<tr><td><code>FF</code></td><td>12</td><td>014</td><td>0x0C</td><td><code>\f</code></td><td><code>^L</code></td><td>Formfeed (also: New page<code>NP</code>)</td></tr> +<tr><td><code>CR</code></td><td>13</td><td>015</td><td>0x0D</td><td><code>\r</code></td><td><code>^M</code></td><td>Carriage return</td></tr> +<tr><td><code>ESC</code></td><td>27</td><td>033</td><td>0x1B</td><td><code>\e</code><a href="https://blog.garhve.com/post/escape-sequence/#escape">*</a></td><td><code>^[</code></td><td>Escape character</td></tr> +<tr><td><code>DEL</code></td><td>127</td><td>177</td><td>0x7F</td><td><code><none></code></td><td><code><none></code></td><td>Delete character</td></tr> +</tbody></table> +<div id="escape"></div> +<blockquote> +<p><strong>Note:</strong> Some control escape sequences, like <code>\e</code> for <code>ESC</code>, are not guaranteed to work in all languages and compilers. It is recommended to use the decimal, octal or hex representation as escape code.</p> +</blockquote> +<blockquote> +<p><strong>Note:</strong> The <strong>Ctrl-Key</strong> representation is simply associating the non-printable characters from ASCII code 1 with the printable (letter) characters from ASCII code 65 ("A"). ASCII code 1 would be <code>^A</code> (Ctrl-A), while ASCII code 7 (BEL) would be <code>^G</code> (Ctrl-G). This is a common representation (and input method) and historically comes from one of the VT series of terminals.</p> +</blockquote> +<h2 id="cursor-controls">Cursor Controls</h2> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[H</code></td><td style="text-align: left">moves cursor to home position (0, 0)</td></tr> +<tr><td style="text-align: left"><code>ESC[{line};{column}H</code> <br> <code>ESC[{line};{column}f</code></td><td style="text-align: left">moves cursor to line #, column #</td></tr> +<tr><td style="text-align: left"><code>ESC[#A</code></td><td style="text-align: left">moves cursor up # lines</td></tr> +<tr><td style="text-align: left"><code>ESC[#B</code></td><td style="text-align: left">moves cursor down # lines</td></tr> +<tr><td style="text-align: left"><code>ESC[#C</code></td><td style="text-align: left">moves cursor right # columns</td></tr> +<tr><td style="text-align: left"><code>ESC[#D</code></td><td style="text-align: left">moves cursor left # columns</td></tr> +<tr><td style="text-align: left"><code>ESC[#E</code></td><td style="text-align: left">moves cursor to beginning of next line, # lines down</td></tr> +<tr><td style="text-align: left"><code>ESC[#F</code></td><td style="text-align: left">moves cursor to beginning of previous line, # lines up</td></tr> +<tr><td style="text-align: left"><code>ESC[#G</code></td><td style="text-align: left">moves cursor to column #</td></tr> +<tr><td style="text-align: left"><code>ESC[6n</code></td><td style="text-align: left">request cursor position (reports as<code>ESC[#;#R</code>)</td></tr> +<tr><td style="text-align: left"><code>ESC M</code></td><td style="text-align: left">moves cursor one line up, scrolling if needed</td></tr> +<tr><td style="text-align: left"><code>ESC 7</code></td><td style="text-align: left">save cursor position (DEC)</td></tr> +<tr><td style="text-align: left"><code>ESC 8</code></td><td style="text-align: left">restores the cursor to the last saved position (DEC)</td></tr> +<tr><td style="text-align: left"><code>ESC[s</code></td><td style="text-align: left">save cursor position (SCO)</td></tr> +<tr><td style="text-align: left"><code>ESC[u</code></td><td style="text-align: left">restores the cursor to the last saved position (SCO)</td></tr> +</tbody></table> +<blockquote> +<p><strong>Note:</strong> Some sequences, like saving and restoring cursors, are private sequences and are not standardized. While some terminal emulators (i.e. xterm and derived) support both SCO and DEC sequences, they are likely to have different functionality. It is therefore recommended to use DEC sequences.</p> +</blockquote> +<h2 id="erase-functions">Erase Functions</h2> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[J</code></td><td style="text-align: left">erase in display (same as ESC[0J)</td></tr> +<tr><td style="text-align: left"><code>ESC[0J</code></td><td style="text-align: left">erase from cursor until end of screen</td></tr> +<tr><td style="text-align: left"><code>ESC[1J</code></td><td style="text-align: left">erase from cursor to beginning of screen</td></tr> +<tr><td style="text-align: left"><code>ESC[2J</code></td><td style="text-align: left">erase entire screen</td></tr> +<tr><td style="text-align: left"><code>ESC[3J</code></td><td style="text-align: left">erase saved lines</td></tr> +<tr><td style="text-align: left"><code>ESC[K</code></td><td style="text-align: left">erase in line (same as ESC[0K)</td></tr> +<tr><td style="text-align: left"><code>ESC[0K</code></td><td style="text-align: left">erase from cursor to end of line</td></tr> +<tr><td style="text-align: left"><code>ESC[1K</code></td><td style="text-align: left">erase start of line to the cursor</td></tr> +<tr><td style="text-align: left"><code>ESC[2K</code></td><td style="text-align: left">erase the entire line</td></tr> +</tbody></table> +<blockquote> +<p>Note: Erasing the line won't move the cursor, meaning that the cursor will stay at the last position it was at before the line was erased. You can use <code>\r</code> after erasing the line, to return the cursor to the start of the current line.</p> +</blockquote> +<h2 id="colors-graphics-mode">Colors / Graphics Mode</h2> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Reset Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[1;34;{...}m</code></td><td style="text-align: left"></td><td style="text-align: left">Set graphics modes for cell, separated by semicolon (<code>;</code>).</td></tr> +<tr><td style="text-align: left"><code>ESC[0m</code></td><td style="text-align: left"></td><td style="text-align: left">reset all modes (styles and colors)</td></tr> +<tr><td style="text-align: left"><code>ESC[1m</code></td><td style="text-align: left"><code>ESC[22m</code></td><td style="text-align: left">set bold mode.</td></tr> +<tr><td style="text-align: left"><code>ESC[2m</code></td><td style="text-align: left"><code>ESC[22m</code></td><td style="text-align: left">set dim/faint mode.</td></tr> +<tr><td style="text-align: left"><code>ESC[3m</code></td><td style="text-align: left"><code>ESC[23m</code></td><td style="text-align: left">set italic mode.</td></tr> +<tr><td style="text-align: left"><code>ESC[4m</code></td><td style="text-align: left"><code>ESC[24m</code></td><td style="text-align: left">set underline mode.</td></tr> +<tr><td style="text-align: left"><code>ESC[5m</code></td><td style="text-align: left"><code>ESC[25m</code></td><td style="text-align: left">set blinking mode</td></tr> +<tr><td style="text-align: left"><code>ESC[7m</code></td><td style="text-align: left"><code>ESC[27m</code></td><td style="text-align: left">set inverse/reverse mode</td></tr> +<tr><td style="text-align: left"><code>ESC[8m</code></td><td style="text-align: left"><code>ESC[28m</code></td><td style="text-align: left">set hidden/invisible mode</td></tr> +<tr><td style="text-align: left"><code>ESC[9m</code></td><td style="text-align: left"><code>ESC[29m</code></td><td style="text-align: left">set strikethrough mode.</td></tr> +</tbody></table> +<blockquote> +<p><strong>Note:</strong> Some terminals may not support some of the graphic mode sequences listed above.</p> +</blockquote> +<blockquote> +<p><strong>Note:</strong> Both dim and bold modes are reset with the <code>ESC[22m</code> sequence. The <code>ESC[21m</code> sequence is a non-specified sequence for double underline mode and only work in some terminals and is reset with <code>ESC[24m</code>.</p> +</blockquote> +<h3 id="color-codes">Color codes</h3> +<p>Most terminals support 8 and 16 colors, as well as 256 (8-bit) colors. These colors are set by the user, but have commonly defined meanings.</p> +<h4 id="8-16-colors">8-16 Colors</h4> +<table><thead><tr><th style="text-align: left">Color Name</th><th style="text-align: left">Foreground Color Code</th><th style="text-align: left">Background Color Code</th></tr></thead><tbody> +<tr><td style="text-align: left">Black</td><td style="text-align: left"><code>30</code></td><td style="text-align: left"><code>40</code></td></tr> +<tr><td style="text-align: left">Red</td><td style="text-align: left"><code>31</code></td><td style="text-align: left"><code>41</code></td></tr> +<tr><td style="text-align: left">Green</td><td style="text-align: left"><code>32</code></td><td style="text-align: left"><code>42</code></td></tr> +<tr><td style="text-align: left">Yellow</td><td style="text-align: left"><code>33</code></td><td style="text-align: left"><code>43</code></td></tr> +<tr><td style="text-align: left">Blue</td><td style="text-align: left"><code>34</code></td><td style="text-align: left"><code>44</code></td></tr> +<tr><td style="text-align: left">Magenta</td><td style="text-align: left"><code>35</code></td><td style="text-align: left"><code>45</code></td></tr> +<tr><td style="text-align: left">Cyan</td><td style="text-align: left"><code>36</code></td><td style="text-align: left"><code>46</code></td></tr> +<tr><td style="text-align: left">White</td><td style="text-align: left"><code>37</code></td><td style="text-align: left"><code>47</code></td></tr> +<tr><td style="text-align: left">Default</td><td style="text-align: left"><code>39</code></td><td style="text-align: left"><code>49</code></td></tr> +<tr><td style="text-align: left">Reset</td><td style="text-align: left"><code>0</code></td><td style="text-align: left"><code>0</code></td></tr> +</tbody></table> +<blockquote> +<p><strong>Note:</strong> the <em>Reset</em> color is the reset code that resets <em>all</em> colors and text effects, Use <em>Default</em> color to reset colors only.</p> +</blockquote> +<p>Most terminals, apart from the basic set of 8 colors, also support the "bright" or "bold" colors. These have their own set of codes, mirroring the normal colors, but with an additional <code>;1</code> in their codes:</p> +<pre data-lang="sh" style="background-color:#2e3440;color:#d8dee9;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#616e88;"># Set style to bold, red foreground. +</span><span style="color:#ebcb8b;">\x</span><span style="color:#88c0d0;">1b[1</span><span style="color:#81a1c1;">;</span><span style="color:#88c0d0;">31mHello +</span><span style="color:#616e88;"># Set style to dimmed white foreground with red background. +</span><span style="color:#ebcb8b;">\x</span><span style="color:#88c0d0;">1b[2</span><span style="color:#81a1c1;">;</span><span style="color:#88c0d0;">37</span><span style="color:#81a1c1;">;</span><span style="color:#88c0d0;">41mWorld +</span></code></pre> +<p>Terminals that support the <a href="https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/cmds/aixcmds1/aixterm.htm">aixterm specification</a> provides bright versions of the ISO colors, without the need to use the bold modifier:</p> +<table><thead><tr><th style="text-align: left">Color Name</th><th style="text-align: left">Foreground Color Code</th><th style="text-align: left">Background Color Code</th></tr></thead><tbody> +<tr><td style="text-align: left">Bright Black</td><td style="text-align: left"><code>90</code></td><td style="text-align: left"><code>100</code></td></tr> +<tr><td style="text-align: left">Bright Red</td><td style="text-align: left"><code>91</code></td><td style="text-align: left"><code>101</code></td></tr> +<tr><td style="text-align: left">Bright Green</td><td style="text-align: left"><code>92</code></td><td style="text-align: left"><code>102</code></td></tr> +<tr><td style="text-align: left">Bright Yellow</td><td style="text-align: left"><code>93</code></td><td style="text-align: left"><code>103</code></td></tr> +<tr><td style="text-align: left">Bright Blue</td><td style="text-align: left"><code>94</code></td><td style="text-align: left"><code>104</code></td></tr> +<tr><td style="text-align: left">Bright Magenta</td><td style="text-align: left"><code>95</code></td><td style="text-align: left"><code>105</code></td></tr> +<tr><td style="text-align: left">Bright Cyan</td><td style="text-align: left"><code>96</code></td><td style="text-align: left"><code>106</code></td></tr> +<tr><td style="text-align: left">Bright White</td><td style="text-align: left"><code>97</code></td><td style="text-align: left"><code>107</code></td></tr> +</tbody></table> +<h4 id="256-colors">256 Colors</h4> +<p>The following escape codes tells the terminal to use the given color ID:</p> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[38;5;{ID}m</code></td><td style="text-align: left">Set foreground color.</td></tr> +<tr><td style="text-align: left"><code>ESC[48;5;{ID}m</code></td><td style="text-align: left">Set background color.</td></tr> +</tbody></table> +<p>Where <code>{ID}</code> should be replaced with the color index from 0 to 255 of the following color table:</p> +<p><img src="https://user-images.githubusercontent.com/995050/47952855-ecb12480-df75-11e8-89d4-ac26c50e80b9.png" alt="256 Color table" /></p> +<p>The table starts with the original 16 colors (0-15).</p> +<p>The proceeding 216 colors (16-231) or formed by a 3bpc RGB value offset by 16, packed into a single value.</p> +<p>The final 24 colors (232-255) are grayscale starting from a shade slighly lighter than black, ranging up to shade slightly darker than white.</p> +<p>Some emulators interpret these steps as linear increments (<code>256 / 24</code>) on all three channels, although some emulators may explicitly define these values.</p> +<h4 id="rgb-colors">RGB Colors</h4> +<p>More modern terminals supports <a href="https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29">Truecolor</a> (24-bit RGB), which allows you to set foreground and background colors using RGB.</p> +<p>These escape sequences are usually not well documented.</p> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[38;2;{r};{g};{b}m</code></td><td style="text-align: left">Set foreground color as RGB.</td></tr> +<tr><td style="text-align: left"><code>ESC[48;2;{r};{g};{b}m</code></td><td style="text-align: left">Set background color as RGB.</td></tr> +</tbody></table> +<blockquote> +<p>Note that <code>;38</code> and <code>;48</code> corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as <code>;2</code> and <code>;5</code> sets the color format.</p> +</blockquote> +<h2 id="screen-modes">Screen Modes</h2> +<h3 id="set-mode">Set Mode</h3> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[={value}h</code></td><td style="text-align: left">Changes the screen width or type to the mode specified by value.</td></tr> +<tr><td style="text-align: left"><code>ESC[=0h</code></td><td style="text-align: left">40 x 25 monochrome (text)</td></tr> +<tr><td style="text-align: left"><code>ESC[=1h</code></td><td style="text-align: left">40 x 25 color (text)</td></tr> +<tr><td style="text-align: left"><code>ESC[=2h</code></td><td style="text-align: left">80 x 25 monochrome (text)</td></tr> +<tr><td style="text-align: left"><code>ESC[=3h</code></td><td style="text-align: left">80 x 25 color (text)</td></tr> +<tr><td style="text-align: left"><code>ESC[=4h</code></td><td style="text-align: left">320 x 200 4-color (graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=5h</code></td><td style="text-align: left">320 x 200 monochrome (graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=6h</code></td><td style="text-align: left">640 x 200 monochrome (graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=7h</code></td><td style="text-align: left">Enables line wrapping</td></tr> +<tr><td style="text-align: left"><code>ESC[=13h</code></td><td style="text-align: left">320 x 200 color (graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=14h</code></td><td style="text-align: left">640 x 200 color (16-color graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=15h</code></td><td style="text-align: left">640 x 350 monochrome (2-color graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=16h</code></td><td style="text-align: left">640 x 350 color (16-color graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=17h</code></td><td style="text-align: left">640 x 480 monochrome (2-color graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=18h</code></td><td style="text-align: left">640 x 480 color (16-color graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[=19h</code></td><td style="text-align: left">320 x 200 color (256-color graphics)</td></tr> +<tr><td style="text-align: left"><code>ESC[={value}l</code></td><td style="text-align: left">Resets the mode by using the same values that Set Mode uses, except for 7, which disables line wrapping. The last character in this escape sequence is a lowercase L.</td></tr> +</tbody></table> +<h3 id="common-private-modes">Common Private Modes</h3> +<p>These are some examples of private modes, which are not defined by the specification, but are implemented in most terminals.</p> +<table><thead><tr><th style="text-align: left">ESC Code Sequence</th><th style="text-align: left">Description</th></tr></thead><tbody> +<tr><td style="text-align: left"><code>ESC[?25l</code></td><td style="text-align: left">make cursor invisible</td></tr> +<tr><td style="text-align: left"><code>ESC[?25h</code></td><td style="text-align: left">make cursor visible</td></tr> +<tr><td style="text-align: left"><code>ESC[?47l</code></td><td style="text-align: left">restore screen</td></tr> +<tr><td style="text-align: left"><code>ESC[?47h</code></td><td style="text-align: left">save screen</td></tr> +<tr><td style="text-align: left"><code>ESC[?1049h</code></td><td style="text-align: left">enables the alternative buffer</td></tr> +<tr><td style="text-align: left"><code>ESC[?1049l</code></td><td style="text-align: left">disables the alternative buffer</td></tr> +</tbody></table> +<p>Refer to the <a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">XTerm Control Sequences</a> for a more in-depth list of private modes defined by XTerm.</p> +<blockquote> +<p>Note: While these modes may be supported by the most terminals, some may not work in multiplexers like tmux.</p> +</blockquote> +<h3 id="keyboard-strings">Keyboard Strings</h3> +<pre data-lang="sh" style="background-color:#2e3440;color:#d8dee9;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#88c0d0;">ESC[{code</span><span>}</span><span style="color:#81a1c1;">;</span><span style="color:#88c0d0;">{string</span><span>}</span><span style="color:#81a1c1;">;</span><span style="color:#88c0d0;">{...</span><span>}</span><span style="color:#88c0d0;">p +</span></code></pre> +<p>Redefines a keyboard key to a specified string.</p> +<p>The parameters for this escape sequence are defined as follows:</p> +<ul> +<li><code>code</code> is one or more of the values listed in the following table. These values represent keyboard keys and key combinations. When using these values in a command, you must type the semicolons shown in this table in addition to the semicolons required by the escape sequence. The codes in parentheses are not available on some keyboards. <code>ANSI.SYS</code> will not interpret the codes in parentheses for those keyboards unless you specify the <code>/X</code> switch in the <code>DEVICE</code> command for <code>ANSI.SYS</code>.</li> +<li><code>string</code> is either the ASCII code for a single character or a string contained in quotation marks. For example, both 65 and "A" can be used to represent an uppercase A.</li> +</ul> +<blockquote> +<p><strong>IMPORTANT:</strong> Some of the values in the following table are not valid for all computers. Check your computer's documentation for values that are different.</p> +</blockquote> +<h4 id="list-of-keyboard-strings">List of keyboard strings</h4> +<table><thead><tr><th>Key</th><th>Code</th><th>SHIFT+code</th><th>CTRL+code</th><th>ALT+code</th></tr></thead><tbody> +<tr><td>F1</td><td>0;59</td><td>0;84</td><td>0;94</td><td>0;104</td></tr> +<tr><td>F2</td><td>0;60</td><td>0;85</td><td>0;95</td><td>0;105</td></tr> +<tr><td>F3</td><td>0;61</td><td>0;86</td><td>0;96</td><td>0;106</td></tr> +<tr><td>F4</td><td>0;62</td><td>0;87</td><td>0;97</td><td>0;107</td></tr> +<tr><td>F5</td><td>0;63</td><td>0;88</td><td>0;98</td><td>0;108</td></tr> +<tr><td>F6</td><td>0;64</td><td>0;89</td><td>0;99</td><td>0;109</td></tr> +<tr><td>F7</td><td>0;65</td><td>0;90</td><td>0;100</td><td>0;110</td></tr> +<tr><td>F8</td><td>0;66</td><td>0;91</td><td>0;101</td><td>0;111</td></tr> +<tr><td>F9</td><td>0;67</td><td>0;92</td><td>0;102</td><td>0;112</td></tr> +<tr><td>F10</td><td>0;68</td><td>0;93</td><td>0;103</td><td>0;113</td></tr> +<tr><td>F11</td><td>0;133</td><td>0;135</td><td>0;137</td><td>0;139</td></tr> +<tr><td>F12</td><td>0;134</td><td>0;136</td><td>0;138</td><td>0;140</td></tr> +<tr><td>HOME (num keypad)</td><td>0;71</td><td>55</td><td>0;119</td><td>--</td></tr> +<tr><td>UP ARROW (num keypad)</td><td>0;72</td><td>56</td><td>(0;141)</td><td>--</td></tr> +<tr><td>PAGE UP (num keypad)</td><td>0;73</td><td>57</td><td>0;132</td><td>--</td></tr> +<tr><td>LEFT ARROW (num keypad)</td><td>0;75</td><td>52</td><td>0;115</td><td>--</td></tr> +<tr><td>RIGHT ARROW (num keypad)</td><td>0;77</td><td>54</td><td>0;116</td><td>--</td></tr> +<tr><td>END (num keypad)</td><td>0;79</td><td>49</td><td>0;117</td><td>--</td></tr> +<tr><td>DOWN ARROW (num keypad)</td><td>0;80</td><td>50</td><td>(0;145)</td><td>--</td></tr> +<tr><td>PAGE DOWN (num keypad)</td><td>0;81</td><td>51</td><td>0;118</td><td>--</td></tr> +<tr><td>INSERT (num keypad)</td><td>0;82</td><td>48</td><td>(0;146)</td><td>--</td></tr> +<tr><td>DELETE (num keypad)</td><td>0;83</td><td>46</td><td>(0;147)</td><td>--</td></tr> +<tr><td>HOME</td><td>(224;71)</td><td>(224;71)</td><td>(224;119)</td><td>(224;151)</td></tr> +<tr><td>UP ARROW</td><td>(224;72)</td><td>(224;72)</td><td>(224;141)</td><td>(224;152)</td></tr> +<tr><td>PAGE UP</td><td>(224;73)</td><td>(224;73)</td><td>(224;132)</td><td>(224;153)</td></tr> +<tr><td>LEFT ARROW</td><td>(224;75)</td><td>(224;75)</td><td>(224;115)</td><td>(224;155)</td></tr> +<tr><td>RIGHT ARROW</td><td>(224;77)</td><td>(224;77)</td><td>(224;116)</td><td>(224;157)</td></tr> +<tr><td>END</td><td>(224;79)</td><td>(224;79)</td><td>(224;117)</td><td>(224;159)</td></tr> +<tr><td>DOWN ARROW</td><td>(224;80)</td><td>(224;80)</td><td>(224;145)</td><td>(224;154)</td></tr> +<tr><td>PAGE DOWN</td><td>(224;81)</td><td>(224;81)</td><td>(224;118)</td><td>(224;161)</td></tr> +<tr><td>INSERT</td><td>(224;82)</td><td>(224;82)</td><td>(224;146)</td><td>(224;162)</td></tr> +<tr><td>DELETE</td><td>(224;83)</td><td>(224;83)</td><td>(224;147)</td><td>(224;163)</td></tr> +<tr><td>PRINT SCREEN</td><td>--</td><td>--</td><td>0;114</td><td>--</td></tr> +<tr><td>PAUSE/BREAK</td><td>--</td><td>--</td><td>0;0</td><td>--</td></tr> +<tr><td>BACKSPACE</td><td>8</td><td>8</td><td>127</td><td>(0)</td></tr> +<tr><td>ENTER</td><td>13</td><td>--</td><td>10</td><td>(0</td></tr> +<tr><td>TAB</td><td>9</td><td>0;15</td><td>(0;148)</td><td>(0;165)</td></tr> +<tr><td>NULL</td><td>0;3</td><td>--</td><td>--</td><td>--</td></tr> +<tr><td>A</td><td>97</td><td>65</td><td>1</td><td>0;30</td></tr> +<tr><td>B</td><td>98</td><td>66</td><td>2</td><td>0;48</td></tr> +<tr><td>C</td><td>99</td><td>66</td><td>3</td><td>0;46</td></tr> +<tr><td>D</td><td>100</td><td>68</td><td>4</td><td>0;32</td></tr> +<tr><td>E</td><td>101</td><td>69</td><td>5</td><td>0;18</td></tr> +<tr><td>F</td><td>102</td><td>70</td><td>6</td><td>0;33</td></tr> +<tr><td>G</td><td>103</td><td>71</td><td>7</td><td>0;34</td></tr> +<tr><td>H</td><td>104</td><td>72</td><td>8</td><td>0;35</td></tr> +<tr><td>I</td><td>105</td><td>73</td><td>9</td><td>0;23</td></tr> +<tr><td>J</td><td>106</td><td>74</td><td>10</td><td>0;36</td></tr> +<tr><td>K</td><td>107</td><td>75</td><td>11</td><td>0;37</td></tr> +<tr><td>L</td><td>108</td><td>76</td><td>12</td><td>0;38</td></tr> +<tr><td>M</td><td>109</td><td>77</td><td>13</td><td>0;50</td></tr> +<tr><td>N</td><td>110</td><td>78</td><td>14</td><td>0;49</td></tr> +<tr><td>O</td><td>111</td><td>79</td><td>15</td><td>0;24</td></tr> +<tr><td>P</td><td>112</td><td>80</td><td>16</td><td>0;25</td></tr> +<tr><td>Q</td><td>113</td><td>81</td><td>17</td><td>0;16</td></tr> +<tr><td>R</td><td>114</td><td>82</td><td>18</td><td>0;19</td></tr> +<tr><td>S</td><td>115</td><td>83</td><td>19</td><td>0;31</td></tr> +<tr><td>T</td><td>116</td><td>84</td><td>20</td><td>0;20</td></tr> +<tr><td>U</td><td>117</td><td>85</td><td>21</td><td>0;22</td></tr> +<tr><td>V</td><td>118</td><td>86</td><td>22</td><td>0;47</td></tr> +<tr><td>W</td><td>119</td><td>87</td><td>23</td><td>0;17</td></tr> +<tr><td>X</td><td>120</td><td>88</td><td>24</td><td>0;45</td></tr> +<tr><td>Y</td><td>121</td><td>89</td><td>25</td><td>0;21</td></tr> +<tr><td>Z</td><td>122</td><td>90</td><td>26</td><td>0;44</td></tr> +<tr><td>1</td><td>49</td><td>33</td><td>--</td><td>0;120</td></tr> +<tr><td>2</td><td>50</td><td>64</td><td>0</td><td>0;121</td></tr> +<tr><td>3</td><td>51</td><td>35</td><td>--</td><td>0;122</td></tr> +<tr><td>4</td><td>52</td><td>36</td><td>--</td><td>0;123</td></tr> +<tr><td>5</td><td>53</td><td>37</td><td>--</td><td>0;124</td></tr> +<tr><td>6</td><td>54</td><td>94</td><td>30</td><td>0;125</td></tr> +<tr><td>7</td><td>55</td><td>38</td><td>--</td><td>0;126</td></tr> +<tr><td>8</td><td>56</td><td>42</td><td>--</td><td>0;126</td></tr> +<tr><td>9</td><td>57</td><td>40</td><td>--</td><td>0;127</td></tr> +<tr><td>0</td><td>48</td><td>41</td><td>--</td><td>0;129</td></tr> +<tr><td>-</td><td>45</td><td>95</td><td>31</td><td>0;130</td></tr> +<tr><td>=</td><td>61</td><td>43</td><td>---</td><td>0;131</td></tr> +<tr><td>[</td><td>91</td><td>123</td><td>27</td><td>0;26</td></tr> +<tr><td>]</td><td>93</td><td>125</td><td>29</td><td>0;27</td></tr> +<tr><td></td><td>92</td><td>124</td><td>28</td><td>0;43</td></tr> +<tr><td>;</td><td>59</td><td>58</td><td>--</td><td>0;39</td></tr> +<tr><td>'</td><td>39</td><td>34</td><td>--</td><td>0;40</td></tr> +<tr><td>,</td><td>44</td><td>60</td><td>--</td><td>0;51</td></tr> +<tr><td>.</td><td>46</td><td>62</td><td>--</td><td>0;52</td></tr> +<tr><td>/</td><td>47</td><td>63</td><td>--</td><td>0;53</td></tr> +<tr><td>`</td><td>96</td><td>126</td><td>--</td><td>(0;41)</td></tr> +<tr><td>ENTER (keypad)</td><td>13</td><td>--</td><td>10</td><td>(0;166)</td></tr> +<tr><td>/ (keypad)</td><td>47</td><td>47</td><td>(0;142)</td><td>(0;74)</td></tr> +<tr><td>* (keypad)</td><td>42</td><td>(0;144)</td><td>(0;78)</td><td>--</td></tr> +<tr><td>- (keypad)</td><td>45</td><td>45</td><td>(0;149)</td><td>(0;164)</td></tr> +<tr><td>+ (keypad)</td><td>43</td><td>43</td><td>(0;150)</td><td>(0;55)</td></tr> +<tr><td>5 (keypad)</td><td>(0;76)</td><td>53</td><td>(0;143)</td><td>--</td></tr> +</tbody></table> +<h2 id="resources">Resources</h2> +<ul> +<li><a href="https://en.wikipedia.org/wiki/ANSI_escape_code">Wikipedia: ANSI escape code</a></li> +<li><a href="http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html">Build your own Command Line with ANSI escape codes</a></li> +<li><a href="http://ascii-table.com/ansi-escape-sequences.php">ascii-table: ANSI Escape sequences</a></li> +<li><a href="https://bluesock.org/~willkg/dev/ansi.html">bluesock: ansi codes</a></li> +<li><a href="http://wiki.bash-hackers.org/scripting/terminalcodes">bash-hackers: Terminal Codes (ANSI/VT100) introduction</a></li> +<li><a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">XTerm Control Sequences</a></li> +<li><a href="https://vt100.net/">VT100 – Various terminal manuals</a></li> +<li><a href="https://xtermjs.org/docs/api/vtfeatures/">xterm.js – Supported Terminal Sequences</a></li> +</ul> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/first-website/index.html b/public/post/first-website/index.html new file mode 100644 index 0000000..a76d054 --- /dev/null +++ b/public/post/first-website/index.html @@ -0,0 +1,111 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>First Website | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">First Website</div> +</p> +<p> + <div class="date_postpage">2022-08-10</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>So now I can say my website is on.. even though it just literally has nothing but a printing <em>hello</em> +<img src="https://assets.garhve.com/pictures/screenshots/2022/08/2751557406.png" alt="FirstWebsite.png" /></p> +<p>I got this <em>garhve.com</em> domain on namesilo for $9.95 per year, it's really cheap! I always want a domain that is .com suffix.</p> +<p>Now, the web is https, this is a bit difficult for me.</p> +<p>Due to personal interest, I didn't choose frame to base my website. I use <strong>Nginx</strong> but I don't familiar with it. making it shows my content is not that difficult even that I don't know much fancy state, but I stucked on SSL.</p> +<p>In order to use https instead of http, I choosed <strong>let's encrypt</strong>, which is good for me and it's free. However, I can only getting my non-www domain working. when it comes to www domain, it still http.</p> +<p>I found solutions all about using return to returning https, but it won't work</p> +<pre data-lang="nginx" style="background-color:#2e3440;color:#d8dee9;" class="language-nginx "><code class="language-nginx" data-lang="nginx"><span>server { +</span><span> server_name www.garhve.com; +</span><span> return 301 https://www.garhve.com$request_uri +</span><span>} +</span></code></pre> +<p>This would return me a 404 error...</p> +<p>After searching and searching, I found where i was getting wrong.</p> +<p>Above statement only return https-www which doesn't hold any contents, all I need is to redirect the https-www to https-non-www.</p> +<p>So, change to this one</p> +<pre data-lang="nginx" style="background-color:#2e3440;color:#d8dee9;" class="language-nginx "><code class="language-nginx" data-lang="nginx"><span>server { +</span><span> listen 80; +</span><span> server_name www.garhve.com garhve.com; +</span><span> return 301 https://garhve.com$request_uri; +</span><span>} # this block will redirect http-both to https-both +</span><span> +</span><span>server { +</span><span> listen 443 ssl http2; #http2 is newer and more secure http +</span><span> listen [::]:443 ssl http2; +</span><span> +</span><span> server_name www.garhve.com; +</span><span> include /path_to_cert_file; +</span><span> return 301 https://garhve.com$request_uri; +</span><span>} # this block will redirect https-www to https-non-www +</span><span> +</span><span>server { +</span><span> listen 443 ssl http2; +</span><span> listen [::]:443 ssl http2; +</span><span> +</span><span> server_name garhve.com; +</span><span> include /path_to_cert_file; +</span><span> +</span><span> #location to real content +</span><span>} # this block is where we hold web content. +</span></code></pre> +<p>It will redirect <em>https-www</em> to <em>https-non-www</em>. Now, both domain will point to same location -- my home page.</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/getting-unified-experience/index.html b/public/post/getting-unified-experience/index.html new file mode 100644 index 0000000..87217f7 --- /dev/null +++ b/public/post/getting-unified-experience/index.html @@ -0,0 +1,75 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Getting unified experience | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Getting unified experience</div> +</p> +<p> + <div class="date_postpage">2022-12-07</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>Lately, I'm trying get my tools working seamlessly cross my 2 working machines as well as a server.</p> +<p>Since I already heard dotfiles for a while, but didn't get chance to familiar with. So I start searching around trying to set a dotfile up.</p> +<p>Frankly, it is not that simple as I thought, given that my grounds differ from each other: 1x macOS, 1x archLinux, 1x archLinux server.</p> +<p>Here's a brief description: all configuration files I want to put in <code>.config</code>, all plugins and config related files I want to place in <code>.local</code>. +The files I want to sync now are the configs and plugins of vim, zsh, tmux, gpg, and git. Those 5 softwares are my root.</p> +<p>The problem is, due to different environment, my config for those machines have some custom setting, such as <code>XDG</code> env, my macOS doesn't need it.</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/index.html b/public/post/index.html new file mode 100644 index 0000000..449e940 --- /dev/null +++ b/public/post/index.html @@ -0,0 +1,316 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + + <title>garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + + + + + <h3>2022 </h3> + + + <p> + <div class="date"> + 2022-12-20 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/sui-bi-1/">随笔(1)</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-12-14 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/no-problemo/">No Problemo</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-12-09 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/ce-shi-zi-dong-chuang-jian-bo-ke/">测试自动创建博客</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-12-07 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/getting-unified-experience/">Getting unified experience</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-11-07 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/past-is-great/">Past Is Great</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-09-29 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/mess-with-bash-2/">Mess with Bash(2)</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + + +  <a href="https://blog.garhve.com/tags/bash/">#bash</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-09-12 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/escape-sequence/">Escape Sequences</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + + +  <a href="https://blog.garhve.com/tags/c/">#c</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-09-03 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/architecture-of-linux-kernel/">Architecture of Linux Kernel</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/cs/">/cs</a> + + + + + +  <a href="https://blog.garhve.com/tags/linux/">#linux</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-08-25 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/mess-with-bash-1/">Mess with bash(1)</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + + +  <a href="https://blog.garhve.com/tags/bash/">#bash</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-08-10 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/first-website/">First Website</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + <p> + <div class="date"> + 2022-08-10 + </div> + + <div class="title"> + <a href="https://blog.garhve.com/post/install-archlinux-on-tencent-server/">Install arch linux on Tencent server</a> + </div> + + <div class="taxonomies_index"> + + +  <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> + </p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/install-archlinux-on-tencent-server/index.html b/public/post/install-archlinux-on-tencent-server/index.html new file mode 100644 index 0000000..a4eceb0 --- /dev/null +++ b/public/post/install-archlinux-on-tencent-server/index.html @@ -0,0 +1,106 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Install arch linux on Tencent server | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Install arch linux on Tencent server</div> +</p> +<p> + <div class="date_postpage">2022-08-10</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>In order to build a website for myself, I rent a server from Tencent. This is my final decision, the process is turtuous...</p> +<p>My requirement as below:</p> +<ol> +<li>abroad provider because they don't have to register..</li> +<li>the the budget's not relax, all I can choosing was in range of $0 - $10.</li> +<li>It can runs Arch linux seamlessly</li> +</ol> +<p>I already eye on one: Linode. But they don't see me... and banned all my gmail account from their service...</p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/08/38383267.png" alt="cancelEmail.png" /></p> +<p>Fine! It's your loss!</p> +<p>My second thought was hostkey, They got excellent support, and cheapest price comparing with other service me compared. So be it. I paid €3 to get one.</p> +<p>The server was great at first. But when it comes to custom OS installation because I want my server runs Arch linux, things got frustrating. The server supports me mount custom OS installer from their library, but even it shows me that mounted successfully, i still can't boot from ISO, not saying start installation..</p> +<p>There is where excellent support comes from. I feedbacked the issue, they immediately help me fixed it. Thanks a lot!</p> +<p>And then, I started installation...</p> +<p>I never tried install a arch linux into server. So when it has not network. I totally fucked up, I googled and googled. Finally I found that in official wiki, this issue has a solution. The solution tells me that if we had static IP, we can get network through <code>systemd-network</code> service which comes with iso. It's very tricky.</p> +<p>It associates another service called <code>systemd-resolve</code>. Network can be reachable if both in proper configuration..</p> +<blockquote> +<p>Start both systemd service, then edit their config..</p> +<ul> +<li>For <code>systemd-network</code>, we can edit <code>/etc/systemd/network/20-*.conf</code></li> +<li>For <code>systemd-resolve</code>, we can link <code>/etc/resolv.conf</code> to <code>/run/systemd/resolve/stub-resolv.conf</code></li> +</ul> +</blockquote> +<p>After tricky part done, other steps just as normal as install in local env.</p> +<p>I struggled and successfully installed arch linux on my server, but then i encountered night traffic jam.. No matter how hard I try, I just can't ssh into my server. That's unacceptable! I immediately start looking for other provider..</p> +<p>Then, I found Tencent Cloud..</p> +<p>I already have one server of it, based on Shanghai. It is good, but building a website in it would require me to register, so I never consider using it.</p> +<p>I rent a server that based on Hong Kong, cost me ¥42 per month. But this has really good quality. even now at 2:05am when I'm writing this essay. It still performs stable connection.</p> +<p>First thing I got hands on Tencent Hong Kong server, I changed OS to arch linux, just as before. But Tencent doesn't provide arch linux ISO, so i found some blogs on internet to know how to do it. And I succeed.</p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/08/4068602805.png" alt="tencentArch.png" /></p> +<p>There involves three parts to install arch:</p> +<ul> +<li>Mount ISO to driver and delete other thing</li> +<li>Manually add entry of ArchISO to grub</li> +<li>Static IP is of internal whereas hostkey is public.</li> +</ul> +<p>So now, I got a server that running Arch Linux. Next, buiding a website on it!</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/mess-with-bash-1/index.html b/public/post/mess-with-bash-1/index.html new file mode 100644 index 0000000..3de81d7 --- /dev/null +++ b/public/post/mess-with-bash-1/index.html @@ -0,0 +1,194 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Mess with bash(1) | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Mess with bash(1)</div> +</p> +<p> + <div class="date_postpage">2022-08-25</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + +  <a href="https://blog.garhve.com/tags/bash/">#bash</a> + + + </div> +</p> + +<p> + <h3 id="crontab">Crontab</h3> +<p><code>crontab</code> is a useful tool, I really regret that I don't familar it earlier.</p> +<p>It's usage really simple, and these two are my frequent using:</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">crontab</span><span> -e </span><span style="color:#616e88;">#edit crontab file that reside in /var/spool/cron +</span><span style="color:#88c0d0;">crontab</span><span> -l </span><span style="color:#616e88;">#list current crontab job +</span></code></pre> +<p>It basic syntax as follow, also really simple +<img src="https://assets.garhve.com/pictures/screenshots/2022/08/1857817000.jpg" alt="crontab-layout.jpg" /></p> +<p>example of usage:</p> +<ol> +<li>delete file <em>foo</em> every minute +<code>* * * * * rm foo</code></li> +<li>delete file <em>foo</em> every 15 minutes +<code>15 * * * * rm foo</code></li> +<li>delete file <em>foo</em> every beginning of hour +<code>0 * * * * rm foo</code></li> +<li>delete file <em>foo</em> every minute after 3 hours +<code>* 3 * * * rm foo</code></li> +<li>delete file <em>foo</em> every day at 18:30 +<code>30 18 * * * rm foo</code></li> +<li>delete file <em>foo</em> every beginning of month +<code>0 0 0 * * rm foo</code></li> +<li>delete file <em>foo</em> on beginning of 1st,10th of month +<code>0 0 1,10 * * rm foo</code></li> +</ol> +<p>The usage really simple, I now use it to renew my SSL certification and daily update bt-tracker.</p> +<hr /> +<h3 id="tr">tr</h3> +<p><code>tr</code> is really useful when encountered situation that needs struggle with string. +Three frequency ways of using <code>tr</code></p> +<ol> +<li> +<p><strong>shrink</strong> multiple characters into single one</p> +<p><code>tr -s '[string]'</code> +e.g. <code>echo "ssssssspaaaaace" | tr -s 'sa'</code> would convert "ssssssspace" to "space"</p> +</li> +<li> +<p><strong>delete</strong> specific character. I usually use it to delete white space or delimiter</p> +<p><code>tr -d '[string]'</code> +e.g. <code>echo "blog.garhve.com" | tr -d '.o'</code> would convert url to "blggarhvecm"</p> +</li> +<li> +<p><strong>convert</strong> specific character to another one.</p> +<p><code>tr '[string1]' '[string2]'</code> +e.g. <code>echo "woopwon | tr "wo" "fe"</code> would result "feepfen"</p> +</li> +</ol> +<hr /> +<h3 id="cut">cut</h3> +<p>I use <code>cut</code> mostly to get word from a string, especially get relative path from absolute path. Because I always want to loop to get same sub-directories file from different main directory, <code>cut</code> helps a lot.</p> +<p>for now, I only use it one way</p> +<p><code>echo string | cut -d '[character]' -f position</code> +e.g. <code>echo path/to/most/inner/file | cut -d '/' -f1</code> this will give me word before first '/', which is 'path'</p> +<p>Often, <code>rev</code> will co-work with <code>cut</code> to get last one word</p> +<p>e.g. <code>echo blog.garhve.com | rev | cut -d '.' -f 1 | rev</code> this will give word after last '/', which is com.</p> +<blockquote> +<p><em>a worth noting here is that the <code>rev</code> command needs to appear twice because it usage is not so intuitive, it reverse whole string</em></p> +<p><code>echo "hello world" | rev</code> will get 'dlrow olleh`</p> +<p><code>echo "hello world" | cut -d ' ' -f1 | rev</code> will give result of 'dlrow'</p> +<p><code>echo "hello world" | rev | cut -d ' ' -f1</code> will give same result, as 'dlrow'</p> +<p><code>echo "hello world" | rev | cut -d ' ' -f1 | rev</code> will give expected result, as 'world'</p> +</blockquote> +<h3 id="daily-update-bt-tracker">Daily update bt tracker</h3> +<p>I already learn shell script for a while.. so I wrote a simple script to test whether I really got used to it, but result is obviously, I need more and more practice to memorize commands.</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#616e88;">#! /bin/sh +</span><span style="color:#616e88;">#bt-tracker.txt +</span><span>site</span><span style="color:#81a1c1;">=</span><span style="color:#a3be8c;">https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt +</span><span> +</span><span>file</span><span style="color:#81a1c1;">=</span><span style="color:#a3be8c;">/path_to_aria_directory/aria2.conf +</span><span> +</span><span>Addr</span><span style="color:#81a1c1;">=</span><span style="color:#a3be8c;">user@addr +</span><span> +</span><span style="color:#616e88;"># Get bt-tracker and format it to fulfill aria needs, then store in variable +</span><span>bt</span><span style="color:#81a1c1;">=$</span><span style="color:#a3be8c;">(</span><span style="color:#88c0d0;">curl </span><span style="color:#81a1c1;">$</span><span>site </span><span style="color:#81a1c1;">| </span><span style="color:#88c0d0;">tr</span><span> -s </span><span style="color:#a3be8c;">'[:space:]' </span><span style="color:#81a1c1;">| </span><span style="color:#88c0d0;">tr </span><span style="color:#a3be8c;">'[:space:]' ',') +</span><span> +</span><span style="color:#616e88;"># sshpass is a software, that can allow me pass ssh password as argument +</span><span style="color:#616e88;"># so that I don't need to wait prompt +</span><span style="color:#616e88;"># 410 is the line of bt tracker resides, I now no other way to replace it. +</span><span style="color:#81a1c1;">$</span><span style="color:#88c0d0;">(sshpass</span><span> -p </span><span style="color:#a3be8c;">'password'</span><span style="color:#88c0d0;"> ssh</span><span> -T </span><span style="color:#81a1c1;">$</span><span>Addr </span><span style="color:#a3be8c;">"sed -i '410d' </span><span style="color:#81a1c1;">$</span><span>file</span><span style="color:#a3be8c;"> | echo </span><span style="color:#81a1c1;">$</span><span>bt</span><span style="color:#a3be8c;"> >> </span><span style="color:#81a1c1;">$</span><span>file</span><span style="color:#a3be8c;">"</span><span style="color:#88c0d0;">) +</span></code></pre> +<blockquote> +<p>Usage of <a href="https://blog.garhve.com/index.php/archives/23/#tr">tr</a> and <a href="https://blog.garhve.com/index.php/archives/23/#cut">cut</a>, expansion of 'command tips' is needed</p> +</blockquote> +<h3 id="ways-to-find-files-or-specific-string-in-files">Ways to find files or specific string in files</h3> +<p>In order to look up C definitions, I need to know where linux stores header files or which files store definitions I need. So that here comes up some methods to fulfill this need:</p> +<ol> +<li><code>find 'path' -name 'file_name'</code></li> +</ol> +<blockquote> +<p>e.g. <code>find / -name stdio.h</code> will return multiple location that stdio.h resides. this could expand to look for others</p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/09/find_name.png" alt="image.png" /></p> +<p>more info could see <code>man find</code></p> +</blockquote> +<hr /> +<ol start="2"> +<li><code>grep -rnw 'path' -e 'pattern'</code></li> +</ol> +<blockquote> +<p>e.g. `grep --include=*.{h,c} -rnw / -e "from_kuid" will return string and filename that contains string.</p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/09/grep_string.png" alt="image.png" /></p> +<ul> +<li><code>-r</code> or <code>-R</code> is recursive,</li> +<li><code>-n</code> is line number, and</li> +<li><code>-w</code> stands for match the whole word.</li> +<li><code>-l</code> (lower-case L) can be added to just give the file name of matching files.</li> +<li><code>-e</code> is the pattern used during the search</li> +</ul> +<p>Along with these, <code>--exclude</code>, <code>--include</code>, <code>--exclude-dir</code> flags could be used for efficient searching:</p> +<ul> +<li>This will only search through those files which have .c or .h extensions:</li> +</ul> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">grep</span><span> --include</span><span style="color:#81a1c1;">=</span><span style="color:#ebcb8b;">\*</span><span>.{c</span><span style="color:#eceff4;">,</span><span>h} -rnw </span><span style="color:#a3be8c;">'/path/to/somewhere/'</span><span> -e </span><span style="color:#a3be8c;">"pattern" +</span></code></pre> +<ul> +<li>This will exclude searching all the files ending with .o extension:</li> +</ul> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">grep</span><span> --exclude</span><span style="color:#81a1c1;">=</span><span style="color:#ebcb8b;">\*</span><span>.o -rnw </span><span style="color:#a3be8c;">'/path/to/somewhere/'</span><span> -e </span><span style="color:#a3be8c;">"pattern" +</span></code></pre> +<ul> +<li>For directories it's possible to exclude one or more directories using the <code>--exclude-dir</code> parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/:</li> +</ul> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">grep</span><span> --exclude-dir</span><span style="color:#81a1c1;">=</span><span>{dir1</span><span style="color:#eceff4;">,</span><span>dir2</span><span style="color:#eceff4;">,</span><span style="color:#81a1c1;">*</span><span>.dst} -rnw </span><span style="color:#a3be8c;">'/path/to/somewhere/'</span><span> -e </span><span style="color:#a3be8c;">"pattern" +</span></code></pre> +<p>more info could see <a href="https://ss64.com/bash/grep.html">man grep</a>.</p> +</blockquote> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/mess-with-bash-2/index.html b/public/post/mess-with-bash-2/index.html new file mode 100644 index 0000000..7ee05a0 --- /dev/null +++ b/public/post/mess-with-bash-2/index.html @@ -0,0 +1,275 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Mess with Bash(2) | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Mess with Bash(2)</div> +</p> +<p> + <div class="date_postpage">2022-09-29</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/code/">/code</a> + + + + +  <a href="https://blog.garhve.com/tags/bash/">#bash</a> + + + </div> +</p> + +<p> + <blockquote> +<p>More info is in this <a href="https://https://guide.bash.academy">tutorial</a></p> +</blockquote> +<blockquote> +<p>all value expansions (ie. all syntax with a <code>$</code> prefix) can only expand inside quoted arguments if the argument was <em>double-quoted</em> . Single quotes will turn the dollar-syntax into literal characters, causing bash to output the dollar rather than expand its value in-place!</p> +</blockquote> +<p><em>"Value expansions (<code>$...</code>) must <strong>always</strong> be double-quoted."</em></p> +<p><em>Never leave a value expansion unquoted.</em></p> +<h2 id="redirection">Redirection</h2> +<h3 id="file-redirection">File Redirection</h3> +<p><strong>0 is standard input, 1 is standard output, 2 is standard error</strong></p> +<p><code>[x] > file, [x] < file</code></p> +<p>Make <em><strong>File descriptor</strong></em>(FD) <code>x</code> write to / read from file.</p> +<blockquote> +<p><code>echo hello > ~/World</code></p> +<p><code>read line < ~/Word</code></p> +<p><code>rm file 2>/dev/null</code></p> +</blockquote> +<h3 id="file-descriptor-copying">File Descriptor copying</h3> +<p><code>[x] >& y, [x] <& y</code></p> +<p>make FD <code>x</code> write to / read from FD <code>y</code>'s stream</p> +<blockquote> +<p>the connection to the stream used by FD <code>y</code> is copied to FD <code>x</code></p> +<p><code>curl cip.cc > result 2>&1</code></p> +<p><code>ping localhost > result 2>&1</code></p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#616e88;"># exec can be used to change the file descriptors of bash itself, +</span><span style="color:#616e88;"># and if you use an x that doesn't yet exist, +</span><span style="color:#616e88;"># bash will create a new file descriptor ("plug") for you with that number. +</span><span style="color:#616e88;"># - in command is to close new FD 3 we'd created before. +</span><span style="color:#616e88;"># >&- is to close FD 1, <&- is to close FD0 +</span><span style="color:#88c0d0;">exec </span><span style="color:#b48ead;">3</span><span style="color:#81a1c1;">>&</span><span style="color:#b48ead;">1 </span><span style="color:#81a1c1;">></span><span>mylog</span><span style="color:#81a1c1;">; </span><span style="color:#88c0d0;">echo</span><span> moo</span><span style="color:#81a1c1;">; </span><span style="color:#88c0d0;">exec </span><span style="color:#b48ead;">1</span><span style="color:#81a1c1;">>&</span><span style="color:#b48ead;">3 3</span><span style="color:#81a1c1;">>&</span><span style="color:#eceff4;">- +</span></code></pre> +</blockquote> +<h3 id="appending-file-redirection">Appending file redirection</h3> +<p><code>[x] >> file</code></p> +<p>make FD <code>x</code> append to end of the file</p> +<blockquote> +<p>A stream to <code>file</code> is opened for writing in append mode and is connected to file descriptor <code>x</code>. The regular file redirection operator <code>></code> empties the file's contents when it opens the file so that only your bytes will be in the file.</p> +<p><code>echo hello >> ~/world</code></p> +<p><code>echo world >> ~/world</code></p> +</blockquote> +<h3 id="redirecting-standard-output-and-standard-error">Redirecting standard output and standard error</h3> +<p><code>&>file</code></p> +<p>Make both FD 1 (standard output) and FD 2 (standard error) write to file</p> +<blockquote> +<p>This is a convenience operator which does the same thing as <code>>file 2>&1</code> but is more concise. Again, you can append rather than truncate by doubling the arrow: <code>&>>file</code></p> +<p><code>ping localhost &>result</code></p> +</blockquote> +<h3 id="here-documents">Here documents</h3> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#81a1c1;"><<delimiter +</span><span style="color:#a3be8c;"> Here document +</span><span style="color:#81a1c1;">delimiter +</span></code></pre> +<p>Make FD 0 read from the string between <code>delimiter</code>s</p> +<blockquote> +<p>Here-Documents are great for reading blocks of text to command line.</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">cat </span><span style="color:#81a1c1;"><< EOF +</span><span style="color:#a3be8c;">this is within here document +</span><span style="color:#a3be8c;">I can write as many lines as I like +</span><span style="color:#a3be8c;">and terminate with line of demiliter only +</span><span style="color:#a3be8c;">EOF //end of heredoc +</span></code></pre> +</blockquote> +<h3 id="here-strings">Here strings</h3> +<p><code><<< string</code></p> +<p>Make FD 0 read from the <code>string</code></p> +<blockquote> +<p>Here strings are very similar to here documents but more concise. They are generally preferred over here documents.</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">cat </span><span style="color:#81a1c1;"><<< </span><span style="color:#a3be8c;">"This, +</span><span style="color:#a3be8c;">is the here strings. tab will also be read." +</span></code></pre> +</blockquote> +<h3 id="moving-file-decipher">Moving file decipher</h3> +<p><code>[x]>&y-, [x]<&y-</code></p> +<p>Replace FD <code>x</code> with FD <code>y</code> and close FD <code>y</code></p> +<blockquote> +<p>Easy way of <code>[x]>&y, y>&-</code></p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#616e88;"># 3>&1-: copy FD 1 to FD 3 and close FD 1. +</span><span style="color:#616e88;"># >&3-: copy FD 3 to FD 1 and close FD 3. +</span><span style="color:#88c0d0;">exec </span><span style="color:#b48ead;">3</span><span style="color:#81a1c1;">>&</span><span style="color:#b48ead;">1</span><span>- </span><span style="color:#81a1c1;">></span><span>mylog</span><span style="color:#81a1c1;">; </span><span style="color:#88c0d0;">echo</span><span> moo</span><span style="color:#81a1c1;">; </span><span style="color:#88c0d0;">exec </span><span style="color:#81a1c1;">>&</span><span style="color:#b48ead;">3</span><span>- +</span></code></pre> +</blockquote> +<h3 id="reading-and-writing-with-file-descriptor">Reading and writing with file descriptor</h3> +<p><code>[x] <> file</code></p> +<p>Open FD <code>x</code> for both reading and writing to <code>file</code></p> +<blockquote> +<p>The file descriptor at x is opened with a stream to the file that can be used for writing as well as reading bytes. Usually you'll use two file descriptors for this. <strong>One of the rare cases where this is useful is when setting up a stream with a read/write device such as a network socket</strong>.</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#88c0d0;">exec </span><span style="color:#b48ead;">5</span><span style="color:#81a1c1;"><></span><span>aFile +</span><span style="color:#88c0d0;">cat </span><span style="color:#81a1c1;">>&</span><span style="color:#b48ead;">5 </span><span style="color:#a3be8c;">"Hello world" </span><span style="color:#616e88;"># make FD 1 write to where FD 5 currently writing, copy file descriptor FD 5 to FD 1 +</span><span style="color:#88c0d0;">cat </span><span style="color:#81a1c1;"><&</span><span style="color:#b48ead;">5 </span><span style="color:#616e88;"># make FD 0 read from where FD 5 currently reading, copy file descriptor FD 5 to FD 0, then cat will send content to FD 1 +</span></code></pre> +</blockquote> +<p>Exercise</p> +<blockquote> +<p>Q: fix <code>exec 3>&2 2>log; echo 'Hello!'; exec 2>&3</code> so that the message is properly saved into the <code>log</code> file and such that FD 3 is properly closed afterwards:</p> +<p>A:</p> +<ol> +<li><code>exec 3>&1- 3>log; echo 'Hello!'; exec 1>&3-</code></li> +<li><code>exec 3>&1 1>&- 3>log; echo 'Hello!'; exec 1>&3 3>&-</code></li> +</ol> +</blockquote> +<h2 id="expansion">Expansion</h2> +<h3 id="pathname-expansion">pathname expansion</h3> +<ol> +<li> +<p>pattern expansion is performed by bash before command even execute</p> +<blockquote> +<p><code>file *</code> will show info about all file in current directory. <code>*</code> will expand to content before <code>file</code> execute.</p> +</blockquote> +</li> +<li> +<p>A <em>glob</em> is the name of the type of pattern supported by the bash shell.</p> +<blockquote> +<p>basic glob name supported by bash<img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665123982.png" alt="explanation" /></p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665133964.png" alt="example" /></p> +<p><strong>Those glob will only affect current directory, explicit expression is required to working on other directory.</strong> <code>ls /sub/*</code></p> +</blockquote> +</li> +<li> +<p>extended glob can be enable to get more powerful but also easy confusing feature of bash</p> +<blockquote> +<p>bash: <code>shopt -s extglob</code> +zsh. : <code>setopt extendedglob</code> +<img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665134156.png" alt="explanation" /></p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665134205.png" alt="!(my)* get expand because of * is outside !(), which makes it expland another whole pathname" /></p> +</blockquote> +</li> +</ol> +<h3 id="command-substitution">Command Substitution</h3> +<p>we can expansion commands within commands, but must use double-quote <code>""</code> instead of <code>''</code></p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#616e88;"># this will output contents in hello.h to screen +</span><span style="color:#88c0d0;">cat</span><span> hello.h +</span><span> +</span><span style="color:#616e88;"># this will expand `cat hello.h` to real contents in +</span><span style="color:#616e88;"># file hello.h and concatenate to previous sentence +</span><span style="color:#88c0d0;">echo </span><span style="color:#a3be8c;">"file hello.h contains contents of </span><span style="color:#81a1c1;">$</span><span style="color:#a3be8c;">(</span><span style="color:#88c0d0;">cat</span><span style="color:#a3be8c;"> hello.h)" +</span><span> +</span><span style="color:#616e88;"># this will output 'file hello.h contains contents of $(cat hello.h)' +</span><span style="color:#616e88;"># without expand command in $() +</span><span style="color:#88c0d0;">echo </span><span style="color:#a3be8c;">'file hello.h contains contents of $(cat hello.h)' +</span></code></pre> +<p>In command, <code>$()</code> is called <em>value expansion</em>, it consists of value-expansion prefix <code>$</code> and subshell <code>(...)</code>. A subshell is essentially a small new bash process that is used to run a command while the main bash shell waits for the result.</p> +<h2 id="parameters">Parameters</h2> +<p>There are three kind of parameters:</p> +<ol> +<li>Environment Parameter</li> +<li>Positional Parameter</li> +<li>Variables</li> +</ol> +<h3 id="environment-parameter">Environment Parameter</h3> +<p>environment variables exist at the process level. That means they are not a feature of the bash shell, but rather a feature of any program process on your system. They can inherit by children, but children's EV can't be given to parent.</p> +<h3 id="positional-parameter">Positional Parameter</h3> +<p>Just as name indicates, these kind of parameters indicate arguments' position, and always starting from 0.</p> +<p>for example, imaging we have a script <code>rename</code>, arguments could be passed to it to extend its usage:</p> +<p><code>rename dir name</code> there, we passed <code>dir</code> and <code>name</code> as argument, so that positional parameters in script would be <code>$1</code> and <code>$2</code>, representing arguments respectively. after <code>$2</code>, such as <code>$3</code> is unset since there has no more argument.</p> +<blockquote> +<p>Positional Parameter is read-only</p> +</blockquote> +<p>a new usage: <code>bash -c 'ls "$1"' -- '/home'</code>. This will working like <code>ls /home</code>, dash is necessary since it is first variable in shell we ran commands and it makes positional value of arguments populated after it stand as we expect in shell single-quoted command gonna run in.</p> +<h3 id="special-parameter">Special Parameter</h3> +<p>Special parameters are parameters whose name is a single symbolic character, they are used to request certain state information from the bash shell. Like positional parameter, they are <em>read-only</em>.</p> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1666054171.png" alt="different kinds of special parameters and the information they hold" /></p> +<h3 id="variables">Variables</h3> +<p>definition: <code>name=value</code> <em>//no space around <code>=</code> like other programming language support</em></p> +<p>call: like <em>command expansion</em>, using variable is to expand it with prefix <code>$</code>, e.g. <code>$name</code></p> +<ul> +<li>Keep in mind, Expansion should always be double-quoted *</li> +</ul> +<h3 id="parameter-expansion">Parameter expansion</h3> +<blockquote> +<p><a href="https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html">GNU material</a></p> +</blockquote> +<p>we expand parameters by prefixing their name with a <code>$</code> symbol</p> +<blockquote> +<p>e.g. <code>name=me; echo hello "$name"</code>. <code>hello me</code>.</p> +</blockquote> +<p>In addition, we can put braces (<code>{</code> and <code>}</code>) around our parameter, which indicates where variable is about to begin and end.</p> +<blockquote> +<p>e.g. <code>name=orange; echo there are 4 "${name}s"</code> <code>there are 4 oranges</code>.</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span>name</span><span style="color:#81a1c1;">=</span><span style="color:#a3be8c;">orange +</span><span style="color:#88c0d0;">echo </span><span style="color:#a3be8c;">"there are 4 </span><span style="color:#81a1c1;">$</span><span style="color:#a3be8c;">{</span><span>name</span><span style="color:#a3be8c;">}s." </span><span style="color:#616e88;"># there are 4 oranges. +</span><span style="color:#88c0d0;">echo </span><span style="color:#a3be8c;">"there are 4 </span><span style="color:#81a1c1;">$</span><span>names</span><span style="color:#a3be8c;">." </span><span style="color:#616e88;"># there are 4 . +</span></code></pre> +<p>here, we put <code>{}</code>around<code>name</code>so that bash can be told that suffix <code>s</code> is not a part of variable. otherwise, it will treat <code>names</code> as parameter and looking for its value, which is none in our example.</p> +</blockquote> +<p>parameter expansion brings up a powerful feature: <em>parameter expansion oerators</em></p> +<blockquote> +<p>While expanding a parameter, it is possible to apply an operator to the expanding value without alternate original value.</p> +<p>I use these mostly</p> +<pre data-lang="bash" style="background-color:#2e3440;color:#d8dee9;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#616e88;"># remove string before pattern ${name#pattern} shortest ${name##pattern} longest +</span><span style="color:#616e88;"># remove string after pattern ${name%pattern} longest ${name%%pattern} shortest +</span><span style="color:#616e88;"># delete first matching pattern ${name/pattern} +</span><span style="color:#616e88;"># delete all matching pattern ${name//pattern} +</span><span style="color:#616e88;"># substitute pattern with string ${name//pattern/string} +</span><span> +</span><span>foo</span><span style="color:#81a1c1;">=</span><span style="color:#a3be8c;">"foo-bar-foobar" +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">#*</span><span>-} </span><span style="color:#616e88;"># echoes 'bar-foobar' (Removes 'foo-' because that matches '*-') +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">##*</span><span>-} </span><span style="color:#616e88;"># echoes 'foobar' (Removes 'foo-bar-') +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">%</span><span>-</span><span style="color:#81a1c1;">*</span><span>} </span><span style="color:#616e88;"># echoes 'foo-bar' +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">%%</span><span>-</span><span style="color:#81a1c1;">*</span><span>} </span><span style="color:#616e88;"># echoes 'foo' +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">/</span><span>-} </span><span style="color:#616e88;"># echoes 'foobar-foobar' +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">/</span><span>/-} </span><span style="color:#616e88;"># echoes 'foobarfoobar' +</span><span style="color:#88c0d0;">echo </span><span style="color:#81a1c1;">$</span><span>{foo</span><span style="color:#81a1c1;">/</span><span>/-</span><span style="color:#81a1c1;">/</span><span>_} </span><span style="color:#616e88;"># echoes 'foo_bar_foobar' +</span></code></pre> +</blockquote> +<p><img src="https://assets.garhve.com/pictures/screenshots/2022/10/1665660923.png" alt="part of operators as shown picture" /></p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/no-problemo/index.html b/public/post/no-problemo/index.html new file mode 100644 index 0000000..24a7ad6 --- /dev/null +++ b/public/post/no-problemo/index.html @@ -0,0 +1,75 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>No Problemo | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">No Problemo</div> +</p> +<p> + <div class="date_postpage">2022-12-14</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>My feeling to express are fading... Not sure how I know it, just got this sense.</p> +<p>Recently, I picked up an anime named "<a href="https://en.wikipedia.org/wiki/The_Simpsons">The Simpsons</a>" which I watched first episode back in highschool. +This first time was not gave me too much impression. +but I fell in love with it right after re-watched first episode! So I downloaded the series up to 17.(33 in total but I'm not in rush) +<img src="https://assets.garhve.com/pictures/screenshots/2022/12/ob8AFE.png" alt="simpson tv list" /></p> +<p>It double</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/past-is-great/index.html b/public/post/past-is-great/index.html new file mode 100644 index 0000000..2947ce1 --- /dev/null +++ b/public/post/past-is-great/index.html @@ -0,0 +1,77 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Past Is Great | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">Past Is Great</div> +</p> +<p> + <div class="date_postpage">2022-11-07</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>Lately, there’s a sign has been keeping jumping out in front of my eyes. That the past is great!</p> +<p>First is in the movie Midnight in Paris, directed by Woody Allen, which I just finished a week ago. It tells a story of how a screen writer loves 20th century because his loving artists all living in it. Though he finally realized that he loves past because the present is imperfect.</p> +<p>Second is my YouTube keeps suggesting songs that got me reminiscence bump. Such songs that remind me when the time power cut is regular and the phone has not yet existed. I still remember the feel when I am wrapped in quilt and watch TV in the cold night... dizzy.</p> +<p>Third just happened now, I was gonna start watching Doraemon, and the title of the episode I’m getting at is ‘Past is Great’, seriously???</p> +<p>even two of them would tell me the present is better than past, I still miss past. Midnight in Paris said we love past because present unsatisfied. And 'Past is Great' shows us comparing of ancient and modern lives style. Both views are most people miss about past, either think their life sucks or just wanna experience life in past.</p> +<p>Well, I'm not both... I miss past is that it is fixed, it is unchangeable. No matter what we do now, past is past, it right there, waiting to be read. this feel just like when I watch shows or movies. I'd want to know what ending it will be, and release my imagination along with shows to get that result.</p> +<p>Same thing happens here. Few scenes I remember, or the music I think familiar, but I don't know when or where I experienced it, I would start my imagination. Maybe I was doing something funny, maybe I was going to somewhere nice, maybe... maybe... then, I got here. The beauty part is, I always thought nice thing, and it always make me feel ease. That's good enough for me.</p> +<p>I said there's this sign... Actually, not really. Just some shit things happend recently that make me want to run away. The 'sign' just is what I want to see now, not that it really a sign.</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/post/sui-bi-1/index.html b/public/post/sui-bi-1/index.html new file mode 100644 index 0000000..3ab0202 --- /dev/null +++ b/public/post/sui-bi-1/index.html @@ -0,0 +1,92 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>随笔(1) | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p> + <div class="title_postpage">随笔(1)</div> +</p> +<p> + <div class="date_postpage">2022-12-20</div> + <div class="taxonomies_postpage"> + + + <a href="https://blog.garhve.com/categories/period/">/period</a> + + + + +  <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + + + </div> +</p> + +<p> + <p>真冷啊,我浑身打了一个激灵。凛冽的狂风在我推开家门的一瞬间便一拥而上, +刮得我脸颊生疼。那一瞬间,我有些恍惚。</p> +<p>我原本是打算去药店看看能不能买点退烧药的。自从封控政策放开后,感染数便直线上涨。 +打开网络,目光所及之处,尽是发烧头疼。我周围持续了一段时间的风平浪静, +但在新冠的淫威下,终究是落陷了。</p> +<p>虽说感染与否,我都抱以无所谓的态度,每日戴着口罩, +与其说是害怕,不如说已成习惯。无论去哪儿,出门必定提前找好口罩戴在脸上, +如同虔诚的信徒在出门前祈求关公玉帝佑我此行平安。 +但我女朋友则 vice versa,每天担心自己感染,公司家里两点一线绝不多走, +不仅催促我多囤药,口罩也要戴双层。 +我觉得有些小题大做,却又能理解这种心情。新冠病毒的威力让人琢磨不透。</p> +<p>下班到家,离6点还差半个钟头。我盘算着今天可以去看场电影。疫情发生快3年来, +我感觉已经很久没有正常生活了,心里也一直憋着一口不知缘由的闷气。 +看场被称为“视觉盛宴”的阿凡达,也许能 refresh 一下我的心情。但刚放好东西, +还未等我开口邀请,她便摸着自己的额头说,我,好像发烧了。</p> +<p>我再无法置身事外。我需要弥补之前的过错。我们没有布洛芬,没有抗原, +甚至连体温计也没有。而原因,则是我的漠不关心,没有提前准备好这些该死的东西。 +电影没法去了,我需要出门买药。</p> +<p>重新穿好衣服,我打开房门走了出去。脸上的寒冷让我惊觉,我没戴口罩! +即使在这逼仄的楼道中,冬日的风依旧可以肆无忌惮打在我脸上。清新的空气钻进我鼻腔, +令我大脑为之一振。于是我走至楼道阳台,贪婪地呼吸着未经过滤的空气。轻松的耳朵和下颊如此令我沉醉。 +我忘记了思考,我生而自由。</p> +<p>甩甩脑袋,我下了楼,还有退烧药等着我去买。</p> + +</p> + + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..73bed15 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: +Allow: / +Sitemap: https://blog.garhve.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..02cae4b --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8"?> +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> + <url> + <loc>https://blog.garhve.com/</loc> + </url> + <url> + <loc>https://blog.garhve.com/categories/</loc> + </url> + <url> + <loc>https://blog.garhve.com/categories/code/</loc> + </url> + <url> + <loc>https://blog.garhve.com/categories/cs/</loc> + </url> + <url> + <loc>https://blog.garhve.com/categories/period/</loc> + </url> + <url> + <loc>https://blog.garhve.com/post/</loc> + </url> + <url> + <loc>https://blog.garhve.com/post/architecture-of-linux-kernel/</loc> + <lastmod>2022-09-03</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/ce-shi-zi-dong-chuang-jian-bo-ke/</loc> + <lastmod>2022-12-09</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/escape-sequence/</loc> + <lastmod>2022-09-12</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/first-website/</loc> + <lastmod>2022-08-10</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/getting-unified-experience/</loc> + <lastmod>2022-12-07</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/install-archlinux-on-tencent-server/</loc> + <lastmod>2022-08-10</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/mess-with-bash-1/</loc> + <lastmod>2022-08-25</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/mess-with-bash-2/</loc> + <lastmod>2022-09-29</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/no-problemo/</loc> + <lastmod>2022-12-14</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/past-is-great/</loc> + <lastmod>2022-11-07</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/post/sui-bi-1/</loc> + <lastmod>2022-12-20</lastmod> + </url> + <url> + <loc>https://blog.garhve.com/tags/</loc> + </url> + <url> + <loc>https://blog.garhve.com/tags/bash/</loc> + </url> + <url> + <loc>https://blog.garhve.com/tags/c/</loc> + </url> + <url> + <loc>https://blog.garhve.com/tags/gibberish/</loc> + </url> + <url> + <loc>https://blog.garhve.com/tags/linux/</loc> + </url> +</urlset> diff --git a/public/tags/bash/index.html b/public/tags/bash/index.html new file mode 100644 index 0000000..3bcccab --- /dev/null +++ b/public/tags/bash/index.html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>bash | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Tag: bash]</p> + + +<p> + <div class="date"> + 2022-09-29 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/mess-with-bash-2/">Mess with Bash(2)</a> + </div> +</p> + +<p> + <div class="date"> + 2022-08-25 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/mess-with-bash-1/">Mess with bash(1)</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/tags/c/index.html b/public/tags/c/index.html new file mode 100644 index 0000000..0c0f0ca --- /dev/null +++ b/public/tags/c/index.html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>c | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Tag: c]</p> + + +<p> + <div class="date"> + 2022-09-12 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/escape-sequence/">Escape Sequences</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/tags/gibberish/index.html b/public/tags/gibberish/index.html new file mode 100644 index 0000000..c268c8c --- /dev/null +++ b/public/tags/gibberish/index.html @@ -0,0 +1,111 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>gibberish | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Tag: gibberish]</p> + + +<p> + <div class="date"> + 2022-12-20 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/sui-bi-1/">随笔(1)</a> + </div> +</p> + +<p> + <div class="date"> + 2022-12-14 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/no-problemo/">No Problemo</a> + </div> +</p> + +<p> + <div class="date"> + 2022-12-09 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/ce-shi-zi-dong-chuang-jian-bo-ke/">测试自动创建博客</a> + </div> +</p> + +<p> + <div class="date"> + 2022-12-07 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/getting-unified-experience/">Getting unified experience</a> + </div> +</p> + +<p> + <div class="date"> + 2022-11-07 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/past-is-great/">Past Is Great</a> + </div> +</p> + +<p> + <div class="date"> + 2022-08-10 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/first-website/">First Website</a> + </div> +</p> + +<p> + <div class="date"> + 2022-08-10 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/install-archlinux-on-tencent-server/">Install arch linux on Tencent server</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/tags/index.html b/public/tags/index.html new file mode 100644 index 0000000..0e16055 --- /dev/null +++ b/public/tags/index.html @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>Tags</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Tags]</p> + +<ul> + + <li> + <a href="https://blog.garhve.com/tags/bash/">#bash</a> + (2) + </li> + + <li> + <a href="https://blog.garhve.com/tags/c/">#c</a> + (1) + </li> + + <li> + <a href="https://blog.garhve.com/tags/gibberish/">#gibberish</a> + (7) + </li> + + <li> + <a href="https://blog.garhve.com/tags/linux/">#linux</a> + (1) + </li> + +</ul> + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/public/tags/linux/index.html b/public/tags/linux/index.html new file mode 100644 index 0000000..2cd6124 --- /dev/null +++ b/public/tags/linux/index.html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + +<title>linux | garhve's gibberish</title> + + + <link rel="shortcut icon" type="image/png" href="/images/favicon.png"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="https://blog.garhve.com/images/logo.ico" alt="garhve's gibberish" + width="70" height=auto></a></p> + <p><a href="/"> garhve's gibberish</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + +<p class="archive_title">[Tag: linux]</p> + + +<p> + <div class="date"> + 2022-09-03 + </div> + <div class="archive_title"> + <a href="https://blog.garhve.com/post/architecture-of-linux-kernel/">Architecture of Linux Kernel</a> + </div> +</p> + + + + </div> + </section> +</body> + +<div class="footer"> +  © garhve +</div> + +</html> diff --git a/sass/dark.scss b/sass/dark.scss new file mode 100644 index 0000000..31bb6e6 --- /dev/null +++ b/sass/dark.scss @@ -0,0 +1,235 @@ +$tender-blue:#b3deef; +$tender-yellow:#ffc24b; +$tender-red:#f43753; +$tender-magenta:#d3b987; + +$backgroundcolor: #282828; +$textcolor: #feffff; +$lighttextcolor: #eeeeee; + +body { + line-height: 1.5; + color: $textcolor; + background-color: #2E3440; + font-family: sans-serif; + width: 80%; + min-width: 200px; + max-width: 720px; + margin: 0 auto; + padding-top: 40px; + padding-bottom: 40px; + + img, video { + display: block; + margin: 0 auto; + max-width: 90%; + } + + ul { + margin-left: 1rem; + padding-left: 1rem; + } + + a { + color: $textcolor; + text-decoration: underline; + } + + @media screen and(max-width: 480px) { + width: 90%; + } +} + +.header { + color: $lighttextcolor; + background-color: #2E3440; + top: 0; + padding-bottom : 5px; + border-bottom: solid 1px $tender-blue; + overflow: hidden; + a { + color: $lighttextcolor; + } +} + +.button_no_decoration { + color: $tender-blue; + border: none; + outline: none; + background: transparent; + vertical-align: middle; + font-family: sans-serif; +} + +.site_title { + display: flex; + justify-content: space-between; + font-size: 1.5rem; + a { + color: $textcolor; + text-decoration: none; + } +} + +.menu { + text-align: right; + a { + text-decoration: none; + } +} + +.date { + color: $tender-yellow; + display: inline; + margin-right: 15px; +} + +.date_postpage { + color: $tender-blue; + text-align: right; +} + +.title { + color: $tender-blue; + font-size: 1.3rem; + a { + text-decoration: none; + } + display: inline; +} + +.archive_title { + font-size: 1.3rem; + a { + text-decoration: none; + } +} + +.title_postpage { + font-size: 1.6em; + line-height: 1.4em; + font-weight: bold; + color: $textcolor; +} + +.taxonomies a { + font-size: 0.9rem; + color: $lighttextcolor; + text-decoration: none; +} + +.taxonomies_postpage { + text-align: right; + a { + font-size: 0.9rem; + color: $lighttextcolor; + text-decoration: none; + } +} + +.taxonomies_index a { + font-size: 0.9rem; + color: $lighttextcolor; + text-decoration: none; + + @media screen and(max-width: 480px) { + display: none; + } +} + +.taxonomies_list { + a { + text-decoration: none; + } +} + +.footer { + color: $lighttextcolor; + text-align: right; + margin-top: 50px; + padding-top: 0px; + // border-top: solid 1px $tender-blue; + a { + color: $lighttextcolor; + } +} + +h1 { + font-size: 2.2rem; + color: $tender-blue; +} + +h2 { + font-size: 2.0rem; + color: $tender-blue; +} + +h3 { + font-size: 1.5rem; + color: $tender-blue; +} + +h4 { + font-size: 1.3rem; + color: $tender-blue; + +} + +h5 { + font-size: 1.2rem; + color: $tender-blue; +} + +h6 { + font-size: 1.1rem; + color: $tender-blue; + +} + +h1, h2, h3, h4, h5, h6 { + font-weight: bold; +} + +pre { + border: 1px solid #AAA; + overflow-x: auto; + overflow-y: hidden; + padding: 20px; +} + +:not(pre) > code { + background-color: $tender-yellow; + color: $backgroundcolor; + opacity: 50%; +} + +blockquote { + border-left: 5px solid $tender-blue; + padding: 0.5rem; + margin: 1rem; + color: #c0c0c0; +} + +table { + max-width: 90%; +} + +table th { + padding: 10px; +} + +table th, td { + border: solid 1px $tender-magenta; +} + +table td { + padding: 10px; +} + +button { + color: $backgroundcolor; + background-color: $tender-blue; + border: solid; + border-radius: 3px; + border-color: $tender-blue; +} diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index 0d381d4..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - - <sitemap> - <loc>https://blog.garhve.com/en/sitemap.xml</loc> - - <lastmod>2022-12-14T11:03:52+08:00</lastmod> - - </sitemap> - - <sitemap> - <loc>https://blog.garhve.com/cn/sitemap.xml</loc> - - <lastmod>2022-12-20T00:24:42+08:00</lastmod> - - </sitemap> - -</sitemapindex> diff --git a/static/images/favicon.png b/static/images/favicon.png Binary files differnew file mode 100644 index 0000000..596fb43 --- /dev/null +++ b/static/images/favicon.png diff --git a/static/images/logo.png b/static/images/logo.png Binary files differnew file mode 100644 index 0000000..596fb43 --- /dev/null +++ b/static/images/logo.png diff --git a/static/js/theme.js b/static/js/theme.js new file mode 100644 index 0000000..be2a9d1 --- /dev/null +++ b/static/js/theme.js @@ -0,0 +1,22 @@ +const key = 'current_emily_zola_style'; + +function getTheme() { + let theme = document.getElementById('stylesheet'); + let current_style = localStorage.getItem(key); + if (current_style === null) { + localStorage.setItem(key, theme.href); + } + theme.href = localStorage.getItem(key); +} + +function changeTheme() { + let current_style = localStorage.getItem(key); + if (current_style.includes('dark')) { + localStorage.setItem(key, '/light.css'); + } + else { + localStorage.setItem(key, '/dark.css'); + } + let theme = document.getElementById('stylesheet'); + theme.href = localStorage.getItem(key); +}
\ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..590d592 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + {% block title %} + <title>{{ config.title }}</title> + {% endblock %} + + <link rel="shortcut icon" type="image/png" href="{{ config.extra.favicon }}"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="{{ config.base_url }}{{ config.extra.icon }}" alt="{{ config.title }}" + width="{{ config.extra.iconsize }}" height=auto></a></p> + <p><a href="/"> {{ config.title }}</a></p> + </div> + <div class="menu"> + <!-- <a href="/tags">tags</a> + --><a href="/categories">categories</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + {% block content %} {% endblock %} + </div> + </section> +</body> + +<div class="footer"> +  © {{ config.extra.author }} +</div> + +</html> diff --git a/templates/categories/list.html b/templates/categories/list.html new file mode 100644 index 0000000..b6d98c2 --- /dev/null +++ b/templates/categories/list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %} +<title>Categories</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Categories]</p> + +<ul> + {% for term in terms %} + <li> + <a href="{{ term.permalink }}">/{{ term.name }}</a> + ({{ term.pages | length }}) + </li> + {% endfor %} +</ul> +{% endblock content %}
\ No newline at end of file diff --git a/templates/categories/single.html b/templates/categories/single.html new file mode 100644 index 0000000..b02797e --- /dev/null +++ b/templates/categories/single.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% block title %} +<title>{{ term.name }} | {{ config.title }}</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Category: {{ term.name }}]</p> + +{% for page in term.pages %} +<p> + <div class="date"> + {{ page.date }} + </div> + <div class="archive_title"> + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> + </div> +</p> +{% endfor %} + +{% endblock content %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..64ac3cd --- /dev/null +++ b/templates/index.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} + +{% block content %} + +{% set section = get_section(path="post/_index.md") %} +{% for year, pages in section.pages | group_by(attribute="year") %} + <h3>{{ year}} </h3> + + {% for page in pages %} + <p> + <div class="date"> + {{ page.date }} + </div> + + <div class="title"> + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> + </div> + + <div class="taxonomies_index"> + {% if page.taxonomies.categories %} + {% for category in page.taxonomies.categories %} +  <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">/{{ category }}</a> + {% endfor %} + {% endif %} + + {% if page.taxonomies.tags %} + {% for tag in page.taxonomies.tags %} +  <a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a> + {% endfor %} + {% endif %} + </div> + </p> + {% endfor %} +{% endfor %} + +{% endblock content %} diff --git a/templates/post-page.html b/templates/post-page.html new file mode 100644 index 0000000..894a27d --- /dev/null +++ b/templates/post-page.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} + +{% block title %} +<title>{{ page.title }} | {{ config.title }}</title> +{% endblock %} + +{% block content %} +<p> + <div class="title_postpage">{{ page.title }}</div> +</p> +<p> + <div class="date_postpage">{{ page.date }}</div> + <div class="taxonomies_postpage"> + {% if page.taxonomies.categories %} + {% for category in page.taxonomies.categories %} + <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">/{{ category }}</a> + {% endfor %} + {% endif %} + {% if page.taxonomies.tags %} + {% for tag in page.taxonomies.tags %} +  <a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a> + {% endfor %} + {% endif %} + </div> +</p> + +<p> + {{ page.content | safe }} +</p> + +{% if page.extra.math %} +<script> + MathJax = { + tex: { + inlineMath: [['$', '$'], ['\\(', '\\)']] + } + }; +</script> +<script type="text/javascript" async + src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"> +</script> +{% endif %} + +{% endblock content %} diff --git a/templates/tags/list.html b/templates/tags/list.html new file mode 100644 index 0000000..2b5a16c --- /dev/null +++ b/templates/tags/list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %} +<title>Tags</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Tags]</p> + +<ul> + {% for term in terms %} + <li> + <a href="{{ term.permalink }}">#{{ term.name }}</a> + ({{ term.pages | length }}) + </li> + {% endfor %} +</ul> +{% endblock content %}
\ No newline at end of file diff --git a/templates/tags/single.html b/templates/tags/single.html new file mode 100644 index 0000000..0549304 --- /dev/null +++ b/templates/tags/single.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% block title %} +<title>{{ term.name }} | {{ config.title }}</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Tag: {{ term.name }}]</p> + +{% for page in term.pages %} +<p> + <div class="date"> + {{ page.date }} + </div> + <div class="archive_title"> + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> + </div> +</p> +{% endfor %} + +{% endblock content %}
\ No newline at end of file diff --git a/themes/emily_zola_theme/config.toml b/themes/emily_zola_theme/config.toml new file mode 100644 index 0000000..02ef942 --- /dev/null +++ b/themes/emily_zola_theme/config.toml @@ -0,0 +1,81 @@ +# The URL the site will be built for +base_url = "https://emily-zola-theme.netlify.app/" + +# Set theme +#theme = "" + +# The site title and description; used in feeds by default. +title = "blog | garhve's hub" +description = "" + +# The default language; used in feeds. +default_language = "en" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# The taxonomies to be rendered for the site and their configuration. +# Example: +# taxonomies = [ +# {name = "tags", feed = true}, # each tag will have its own feed +# {name = "tags", lang = "fr"}, # you can have taxonomies with the same name in multiple languages +# {name = "categories", paginate_by = 5}, # 5 items per page for a term +# {name = "authors"}, # Basic definition: no feed or pagination +# ] +taxonomies = [ + {name = "categories", rss = false}, + {name = "tags", rss = false}, +] + +# The additional languages for the site. +# Example: +# languages = [ +# {code = "fr", feed = true}, # there will be a feed for French content +# {code = "fr", search = true}, # there will be a Search Index for French content +# {code = "it"}, # there won't be a feed for Italian content +# ] +# +# languages = [] + +[markdown] +# When set to "true", all code blocks are highlighted. +highlight_code = false + +# The theme to use for code highlighting. +# See below for list of allowed values. +# highlight_theme = "" + +# When set to "true", emoji aliases translated to their corresponding +# Unicode emoji equivalent in the rendered Markdown files. (e.g.: :smile: => 😄) +render_emoji = false + +[search] +# Whether to include the title of the page/section in the index +include_title = false +# Whether to include the description of the page/section in the index +include_description = false +# Whether to include the rendered content of the page/section in the index +include_content = false + +[extra] +# Author name, appears in footer. +emily_author = "author name" + +# Path to the header icon / favicon image. +# Please save image to static/images +emily_icon = "/images/logo.png" + +emily_favicon = "/images/favicon.png" + +# header icon width. +# height will be automatically rendered. +emily_iconsize = 70 + +# number of posts in index.html. +emily_indexposts = 100 + +# switch to dark-theme +emily_dark_mode = true + +# show theme-toggler +emily_theme_toggler = true diff --git a/themes/emily_zola_theme/content/about/index.md b/themes/emily_zola_theme/content/about/index.md new file mode 100644 index 0000000..b3a2558 --- /dev/null +++ b/themes/emily_zola_theme/content/about/index.md @@ -0,0 +1,12 @@ ++++ +title = "about this site and author" +date = 2020-01-01 +template = "post-page.html" ++++ + +### about this site +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +### about author + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/themes/emily_zola_theme/content/post/_index.md b/themes/emily_zola_theme/content/post/_index.md new file mode 100644 index 0000000..c7904ac --- /dev/null +++ b/themes/emily_zola_theme/content/post/_index.md @@ -0,0 +1,7 @@ ++++ +sort_by = "date" +template = "post.html" +page_template = "post-page.html" +[extra] +math = false ++++
\ No newline at end of file diff --git a/themes/emily_zola_theme/content/post/markdown_syntax_guide.md b/themes/emily_zola_theme/content/post/markdown_syntax_guide.md new file mode 100644 index 0000000..8e74f7a --- /dev/null +++ b/themes/emily_zola_theme/content/post/markdown_syntax_guide.md @@ -0,0 +1,70 @@ ++++ +title = "Markdown Syntax Guide" +date = 2021-01-02 +[taxonomies] +categories = ["code"] +tags = ["markdown"] ++++ + +### Headings +The following HTML `<h1>—<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest. + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +### Paragraph +Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. + +Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. + +### Blockquotes +> Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? + +### Code + +`inline code block` + +```rust +use std::io; + +fn main() { + println!("Guess the number!"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {}", guess); +} +``` + + +### Tables + +First Header | Second Header +------------ | ------------- +Content from cell 1 | Content from cell 2 +Content in the first column | Content in the second column + +### List Types +#### Ordered List +1. First item +2. Second item +3. Third item + +#### Unordered List +- List item +- Another item +- And another item + - orange + - apple + - banana + - watermelon
\ No newline at end of file diff --git a/themes/emily_zola_theme/content/post/mathjax_support.md b/themes/emily_zola_theme/content/post/mathjax_support.md new file mode 100644 index 0000000..709d27c --- /dev/null +++ b/themes/emily_zola_theme/content/post/mathjax_support.md @@ -0,0 +1,30 @@ ++++ +title = "MathJax Support" +date = 2021-01-03 +[taxonomies] +categories = ["math"] +tags = ["Euler's identity"] +[extra] +math = true ++++ + +**Please add the following lines in the front matter when using MathJax.** + +``` +[extra] +math = true +``` + +--- + +#### Euler's identity + +$e^{i\pi }+1=0$ + +#### Geometric interpretation + +Any complex number $z=x+iy$ can be represented by the point $(x,y)$ on the complex plane. This point can also be represented in polar coordinates as $(r,\theta )$, where $r$ is the absolute value of $z$ (distance from the origin), and $\theta$ is the argument of $z$ (angle counterclockwise from the positive x-axis). By the definitions of sine and cosine, this point has cartesian coordinates of $(r\cos \theta ,r\sin \theta )$, implying that $z=r(\cos \theta +i\sin \theta )$. According to Euler's formula, this is equivalent to saying $z=re^{i\theta}$. + +Euler's identity says that $-1=e^{i\pi }$. Since $e^{i\pi }$ is $re^{i\theta }$ for $r$ = 1 and $\theta =\pi$ , this can be interpreted as a fact about the number −1 on the complex plane: its distance from the origin is 1, and its angle from the positive x-axis is $\pi$ radians. + +[Euler's identity \- Wikipedia](https://en.wikipedia.org/wiki/Euler%27s_identity)
\ No newline at end of file diff --git a/themes/emily_zola_theme/content/post/welcome_to_emily.md b/themes/emily_zola_theme/content/post/welcome_to_emily.md new file mode 100644 index 0000000..64c0eac --- /dev/null +++ b/themes/emily_zola_theme/content/post/welcome_to_emily.md @@ -0,0 +1,9 @@ ++++ +title = "Welcome to emily, a KISS theme for Zola" +date = 2020-12-31 +[taxonomies] +categories = ["code"] +tags = ["rust"] ++++ + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/themes/emily_zola_theme/sass/dark.scss b/themes/emily_zola_theme/sass/dark.scss new file mode 100644 index 0000000..7e1306c --- /dev/null +++ b/themes/emily_zola_theme/sass/dark.scss @@ -0,0 +1,230 @@ +$tender-blue:#b3deef; +$tender-yellow:#ffc24b; +$tender-red:#f43753; +$tender-magenta:#d3b987; + +$backgroundcolor: #282828; +$textcolor: #feffff; +$lighttextcolor: #eeeeee; + +body { + line-height: 1.5; + color: $textcolor; + background-color: $backgroundcolor; + font-family: sans-serif; + width: 80%; + min-width: 200px; + max-width: 720px; + margin: 0 auto; + padding-top: 40px; + padding-bottom: 40px; + + img, video { + display: block; + margin: 0 auto; + max-width: 90%; + } + + ul { + margin-left: 1rem; + padding-left: 1rem; + } + + a { + color: $textcolor; + text-decoration: underline; + } + + @media screen and(max-width: 480px) { + width: 90%; + } +} + +.header { + color: $lighttextcolor; + background-color: $backgroundcolor; + top: 0; + padding-bottom : 5px; + border-bottom: solid 1px $tender-blue; + overflow: hidden; + a { + color: $lighttextcolor; + } +} + +.button_no_decoration { + color: $tender-blue; + border: none; + outline: none; + background: transparent; + vertical-align: middle; + font-family: sans-serif; +} + +.site_title { + display: flex; + justify-content: space-between; + font-size: 1.5rem; + a { + color: $textcolor; + text-decoration: none; + } +} + +.menu { + text-align: right; + a { + text-decoration: none; + } +} + +.date { + color: $tender-yellow; +} + +.date_postpage { + color: $tender-blue; + text-align: right; +} + +.title { + color: $tender-blue; + font-size: 1.3rem; + a { + text-decoration: none; + } +} + +.archive_title { + font-size: 1.3rem; + a { + text-decoration: none; + } +} + +.title_postpage { + font-size: 1.6em; + line-height: 1.4em; + font-weight: bold; + color: $textcolor; +} + +.taxonomies a { + font-size: 0.9rem; + color: $lighttextcolor; + text-decoration: none; +} + +.taxonomies_postpage { + text-align: right; + a { + font-size: 0.9rem; + color: $lighttextcolor; + text-decoration: none; + } +} + +.taxonomies_index a { + font-size: 0.9rem; + color: $lighttextcolor; + text-decoration: none; + + @media screen and(max-width: 480px) { + display: none; + } +} + +.taxonomies_list { + a { + text-decoration: none; + } +} + +.footer { + color: $lighttextcolor; + text-align: right; + margin-top: 50px; + padding-top: 0px; + // border-top: solid 1px $tender-blue; + a { + color: $lighttextcolor; + } +} + +h1 { + font-size: 2.2rem; + color: $tender-blue; +} + +h2 { + font-size: 2.0rem; + color: $tender-blue; +} + +h3 { + font-size: 1.5rem; + color: $tender-blue; +} + +h4 { + font-size: 1.3rem; + color: $tender-blue; + +} + +h5 { + font-size: 1.2rem; + color: $tender-blue; +} + +h6 { + font-size: 1.1rem; + color: $tender-blue; + +} + +h1, h2, h3, h4, h5, h6 { + font-weight: bold; +} + +pre { + border: 1px solid #AAA; + overflow-x: auto; + overflow-y: hidden; + padding: 20px; +} + +:not(pre) > code { + background-color: $tender-yellow; + color: $backgroundcolor; +} + +blockquote { + border-left: 5px solid $tender-blue; + padding: 0.5rem; + margin: 1rem; +} + +table { + max-width: 90%; +} + +table th { + padding: 10px; +} + +table th, td { + border: solid 1px $tender-magenta; +} + +table td { + padding: 10px; +} + +button { + color: $backgroundcolor; + background-color: $tender-blue; + border: solid; + border-radius: 3px; + border-color: $tender-blue; +} diff --git a/themes/emily_zola_theme/static/images/favicon.png b/themes/emily_zola_theme/static/images/favicon.png Binary files differnew file mode 100644 index 0000000..8e5a208 --- /dev/null +++ b/themes/emily_zola_theme/static/images/favicon.png diff --git a/themes/emily_zola_theme/static/images/logo.png b/themes/emily_zola_theme/static/images/logo.png Binary files differnew file mode 100644 index 0000000..8e5a208 --- /dev/null +++ b/themes/emily_zola_theme/static/images/logo.png diff --git a/themes/emily_zola_theme/static/images/ss01.png b/themes/emily_zola_theme/static/images/ss01.png Binary files differnew file mode 100644 index 0000000..78c88ff --- /dev/null +++ b/themes/emily_zola_theme/static/images/ss01.png diff --git a/themes/emily_zola_theme/static/images/ss02.png b/themes/emily_zola_theme/static/images/ss02.png Binary files differnew file mode 100644 index 0000000..1ff5eba --- /dev/null +++ b/themes/emily_zola_theme/static/images/ss02.png diff --git a/themes/emily_zola_theme/static/js/theme.js b/themes/emily_zola_theme/static/js/theme.js new file mode 100644 index 0000000..be2a9d1 --- /dev/null +++ b/themes/emily_zola_theme/static/js/theme.js @@ -0,0 +1,22 @@ +const key = 'current_emily_zola_style'; + +function getTheme() { + let theme = document.getElementById('stylesheet'); + let current_style = localStorage.getItem(key); + if (current_style === null) { + localStorage.setItem(key, theme.href); + } + theme.href = localStorage.getItem(key); +} + +function changeTheme() { + let current_style = localStorage.getItem(key); + if (current_style.includes('dark')) { + localStorage.setItem(key, '/light.css'); + } + else { + localStorage.setItem(key, '/dark.css'); + } + let theme = document.getElementById('stylesheet'); + theme.href = localStorage.getItem(key); +}
\ No newline at end of file diff --git a/themes/emily_zola_theme/templates/base.html b/themes/emily_zola_theme/templates/base.html new file mode 100644 index 0000000..040afe3 --- /dev/null +++ b/themes/emily_zola_theme/templates/base.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + {% block title %} + <title>{{ config.title }}</title> + {% endblock %} + + <link rel="shortcut icon" type="image/png" href="{{ config.extra.favicon }}"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + + <link id="stylesheet" rel="stylesheet" type="text/css" href="/dark.css"> + + <script type="text/javascript" src="/js/theme.js"></script> + +</head> + +<div class="header"> + <div class="site_title"> + <p><a href="/"><img src="{{ config.base_url }}{{ config.extra.icon }}" alt="{{ config.title }}" + width="{{ config.extra.iconsize }}" height=auto></a></p> + <p><a href="/"> {{ config.title }}</a></p> + </div> + <div class="menu"> + <a href="/post">>archives</a> + <a href="/about">>about</a> + </div> +</div> + +<body onload="getTheme()"> + <section class="section"> + <div class="container"> + {% block content %} {% endblock %} + </div> + </section> +</body> + +<div class="footer"> + <a href="/">{{ config.title }}</a> © {{ config.extra.author }} +</div> + +</html> diff --git a/themes/emily_zola_theme/templates/categories/list.html b/themes/emily_zola_theme/templates/categories/list.html new file mode 100644 index 0000000..b6d98c2 --- /dev/null +++ b/themes/emily_zola_theme/templates/categories/list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %} +<title>Categories</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Categories]</p> + +<ul> + {% for term in terms %} + <li> + <a href="{{ term.permalink }}">/{{ term.name }}</a> + ({{ term.pages | length }}) + </li> + {% endfor %} +</ul> +{% endblock content %}
\ No newline at end of file diff --git a/themes/emily_zola_theme/templates/categories/single.html b/themes/emily_zola_theme/templates/categories/single.html new file mode 100644 index 0000000..b02797e --- /dev/null +++ b/themes/emily_zola_theme/templates/categories/single.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% block title %} +<title>{{ term.name }} | {{ config.title }}</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Category: {{ term.name }}]</p> + +{% for page in term.pages %} +<p> + <div class="date"> + {{ page.date }} + </div> + <div class="archive_title"> + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> + </div> +</p> +{% endfor %} + +{% endblock content %} diff --git a/themes/emily_zola_theme/templates/index.html b/themes/emily_zola_theme/templates/index.html new file mode 100644 index 0000000..795b7e1 --- /dev/null +++ b/themes/emily_zola_theme/templates/index.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} + +{% block content %} + +{% set section = get_section(path="post/_index.md") %} +{% for page in section.pages %} + {% if loop.index0 == config.extra.indexposts %}{% break %}{% endif %} + <p> + <div class="date"> + {{ page.date }} + </div> + <div class="title"> + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> + </div> + <div class="taxonomies_index"> + {% if page.taxonomies.categories %} + {% for category in page.taxonomies.categories %} +  <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">/{{ category }}</a> + {% endfor %} + {% endif %} + {% if page.taxonomies.tags %} + {% for tag in page.taxonomies.tags %} +  <a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a> + {% endfor %} + {% endif %} + </div> + </p> +{% endfor %} + +{% endblock content %} diff --git a/themes/emily_zola_theme/templates/post-page.html b/themes/emily_zola_theme/templates/post-page.html new file mode 100644 index 0000000..894a27d --- /dev/null +++ b/themes/emily_zola_theme/templates/post-page.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} + +{% block title %} +<title>{{ page.title }} | {{ config.title }}</title> +{% endblock %} + +{% block content %} +<p> + <div class="title_postpage">{{ page.title }}</div> +</p> +<p> + <div class="date_postpage">{{ page.date }}</div> + <div class="taxonomies_postpage"> + {% if page.taxonomies.categories %} + {% for category in page.taxonomies.categories %} + <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">/{{ category }}</a> + {% endfor %} + {% endif %} + {% if page.taxonomies.tags %} + {% for tag in page.taxonomies.tags %} +  <a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a> + {% endfor %} + {% endif %} + </div> +</p> + +<p> + {{ page.content | safe }} +</p> + +{% if page.extra.math %} +<script> + MathJax = { + tex: { + inlineMath: [['$', '$'], ['\\(', '\\)']] + } + }; +</script> +<script type="text/javascript" async + src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"> +</script> +{% endif %} + +{% endblock content %} diff --git a/themes/emily_zola_theme/templates/post.html b/themes/emily_zola_theme/templates/post.html new file mode 100644 index 0000000..5f05c62 --- /dev/null +++ b/themes/emily_zola_theme/templates/post.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% block content %} + +<h3> + Categories & Tags +</h3> +<p class="taxonomies_list"> +{% set categories = get_taxonomy(kind="categories") %} + {% for term in categories.items %} + <a href="{{ term.permalink }}">/{{ term.name }} + ({{ term.pages | length }})</a> + {% endfor %} +</ul> +</p> + +<p class="taxonomies_list"> +{% set tags = get_taxonomy(kind="tags") %} + {% for term in tags.items %} + <a href="{{ term.permalink }}">#{{ term.name }} + ({{ term.pages | length }})</a> + {% endfor %} +</ul> +</p> + +{% for year, posts in section.pages | group_by(attribute="year") %} + <h3>{{ year }}</h3> + + {% for post in posts %} + <p> + <div class="date"> + {{ post.date }} + </div> + <div class="archive_title"> + <a href="{{ post.permalink }}">{{ post.title }}</a> + </div> + <div class="taxonomies_index"> + {% if post.taxonomies.categories %} + {% for category in post.taxonomies.categories %} +  <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">/{{ category }}</a> + {% endfor %} + {% endif %} + {% if post.taxonomies.tags %} + {% for tag in post.taxonomies.tags %} +  <a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">#{{ tag }}</a> + {% endfor %} + {% endif %} + </div> + </p> + {% endfor %} + +{% endfor %} + +{% endblock content %} diff --git a/themes/emily_zola_theme/templates/tags/list.html b/themes/emily_zola_theme/templates/tags/list.html new file mode 100644 index 0000000..2b5a16c --- /dev/null +++ b/themes/emily_zola_theme/templates/tags/list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %} +<title>Tags</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Tags]</p> + +<ul> + {% for term in terms %} + <li> + <a href="{{ term.permalink }}">#{{ term.name }}</a> + ({{ term.pages | length }}) + </li> + {% endfor %} +</ul> +{% endblock content %}
\ No newline at end of file diff --git a/themes/emily_zola_theme/templates/tags/single.html b/themes/emily_zola_theme/templates/tags/single.html new file mode 100644 index 0000000..0549304 --- /dev/null +++ b/themes/emily_zola_theme/templates/tags/single.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% block title %} +<title>{{ term.name }} | {{ config.title }}</title> +{% endblock %} + +{% block content %} +<p class="archive_title">[Tag: {{ term.name }}]</p> + +{% for page in term.pages %} +<p> + <div class="date"> + {{ page.date }} + </div> + <div class="archive_title"> + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> + </div> +</p> +{% endfor %} + +{% endblock content %}
\ No newline at end of file |