From 86d0d27ef2dca7c7c6660c89edcd3aaceb31681f Mon Sep 17 00:00:00 2001 From: jultty Date: Sun, 18 Aug 2024 13:23:10 -0300 Subject: [PATCH] Migrate to Zola --- .github/workflows/pages.yml | 14 + .gitignore | 1 + README.md | 14 +- assets/css/style.css | 183 ---- assets/img/favicon.ico | Bin 15406 -> 0 bytes assets/js/data.js | 112 --- assets/js/links.js | 27 - assets/js/main-l10n.js | 67 -- assets/js/main.js | 28 - assets/js/post-l10n.js | 11 - assets/rss/en.rss | 40 - assets/rss/pt.rss | 19 - config.toml | 37 + content/feeds.md | 5 + content/feeds.pt.md | 5 + content/links/_index.md | 7 + content/links/_index.pt.md | 6 + content/links/mrusme-reader.md | 8 + content/links/mrusme-reader.pt.md | 8 + content/posts/_index.md | 6 + content/posts/_index.pt.md | 6 + .../md => content/posts}/introducing-tori.md | 10 +- .../posts}/meeting-the-bsd-family.md | 10 +- .../posts/scripts-em-ocaml.pt.md | 10 +- {posts/md => content/posts}/unwinding.md | 10 +- {posts/md => content/posts}/void-on-zfs.md | 23 +- index.html | 48 - pages/links.html | 27 - posts/.gitattributes | 1 - posts/gen.ml | 17 - posts/introducing-tori.html | 315 ------- posts/meeting-the-bsd-family.html | 132 --- posts/scripts-em-ocaml.html | 157 ---- posts/template.html | 88 -- posts/unwinding.html | 226 ----- posts/void-on-zfs.html | 849 ------------------ posts/watch.sh | 7 - CNAME => static/CNAME | 0 static/assets/css/style.css | 288 ++++++ static/assets/css/syntax-dark.css | 265 ++++++ static/assets/css/syntax-light.css | 61 ++ .../assets/fonts}/Mononoki.LICENSE | 0 .../css => static/assets/fonts}/Mononoki.ttf | Bin static/assets/img/icon/icon.svg | 51 ++ static/assets/img/icon/icon_16.png | Bin 0 -> 449 bytes static/assets/img/icon/icon_192.png | Bin 0 -> 5250 bytes static/assets/img/icon/icon_260.png | Bin 0 -> 7246 bytes static/assets/img/icon/icon_32.png | Bin 0 -> 845 bytes .../assets}/img/posts/void-on-zfs/desk.jpg | Bin .../assets}/img/posts/void-on-zfs/duo.jpg | Bin .../img/posts/void-on-zfs/karu-inside.jpg | Bin .../assets}/img/posts/void-on-zfs/notes.jpg | Bin static/assets/rss/en.rss | 19 + static/assets/rss/pt.rss | 19 + static/favicon.ico | Bin 0 -> 4286 bytes templates/404.html | 6 + templates/base.html | 80 ++ templates/index.html | 42 + templates/link-page.html | 14 + templates/links.html | 25 + templates/page.html | 5 + templates/post-page.html | 11 + templates/posts.html | 15 + update-feed.zsh | 86 -- 64 files changed, 1044 insertions(+), 2477 deletions(-) create mode 100644 .github/workflows/pages.yml delete mode 100644 assets/css/style.css delete mode 100755 assets/img/favicon.ico delete mode 100644 assets/js/data.js delete mode 100644 assets/js/links.js delete mode 100644 assets/js/main-l10n.js delete mode 100644 assets/js/main.js delete mode 100644 assets/js/post-l10n.js delete mode 100644 assets/rss/en.rss delete mode 100644 assets/rss/pt.rss create mode 100644 config.toml create mode 100644 content/feeds.md create mode 100644 content/feeds.pt.md create mode 100644 content/links/_index.md create mode 100644 content/links/_index.pt.md create mode 100644 content/links/mrusme-reader.md create mode 100644 content/links/mrusme-reader.pt.md create mode 100644 content/posts/_index.md create mode 100644 content/posts/_index.pt.md rename {posts/md => content/posts}/introducing-tori.md (99%) rename {posts/md => content/posts}/meeting-the-bsd-family.md (97%) rename posts/md/scripts-em-ocaml.md => content/posts/scripts-em-ocaml.pt.md (94%) rename {posts/md => content/posts}/unwinding.md (98%) rename {posts/md => content/posts}/void-on-zfs.md (98%) delete mode 100644 index.html delete mode 100644 pages/links.html delete mode 100644 posts/.gitattributes delete mode 100755 posts/gen.ml delete mode 100644 posts/introducing-tori.html delete mode 100644 posts/meeting-the-bsd-family.html delete mode 100644 posts/scripts-em-ocaml.html delete mode 100644 posts/template.html delete mode 100644 posts/unwinding.html delete mode 100644 posts/void-on-zfs.html delete mode 100755 posts/watch.sh rename CNAME => static/CNAME (100%) create mode 100644 static/assets/css/style.css create mode 100644 static/assets/css/syntax-dark.css create mode 100644 static/assets/css/syntax-light.css rename {assets/css => static/assets/fonts}/Mononoki.LICENSE (100%) rename {assets/css => static/assets/fonts}/Mononoki.ttf (100%) create mode 100644 static/assets/img/icon/icon.svg create mode 100644 static/assets/img/icon/icon_16.png create mode 100644 static/assets/img/icon/icon_192.png create mode 100644 static/assets/img/icon/icon_260.png create mode 100644 static/assets/img/icon/icon_32.png rename {assets => static/assets}/img/posts/void-on-zfs/desk.jpg (100%) rename {assets => static/assets}/img/posts/void-on-zfs/duo.jpg (100%) rename {assets => static/assets}/img/posts/void-on-zfs/karu-inside.jpg (100%) rename {assets => static/assets}/img/posts/void-on-zfs/notes.jpg (100%) create mode 100644 static/assets/rss/en.rss create mode 100644 static/assets/rss/pt.rss create mode 100644 static/favicon.ico create mode 100644 templates/404.html create mode 100644 templates/base.html create mode 100644 templates/index.html create mode 100644 templates/link-page.html create mode 100644 templates/links.html create mode 100644 templates/page.html create mode 100644 templates/post-page.html create mode 100644 templates/posts.html delete mode 100755 update-feed.zsh diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..9e5287d --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,14 @@ +on: push +name: Build and deploy to Pages +jobs: + build: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: checkout + uses: actions/checkout@v4 + - name: build_and_deploy + uses: shalzz/zola-deploy-action@v0.17.2 + env: + PAGES_BRANCH: gh-pages + TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 68452cd..2dd7a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +public ideas diff --git a/README.md b/README.md index 97aced4..35d137e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ A bare-bones personal website relying only on simple scripts. ## Next -- [ ] Light mode +- [ ] Improve responsiveness +- [x] Light mode - [x] Set page titles dynamically - [x] Handle header a11y - [x] Add post date - [x] Add post author - [ ] Add source code link on homepage -- [ ] Update data object programmatically on HTML post generation -- [ ] Style inline `` tags -- [ ] Create a custom syntax highlighting style +- [x] Style inline `` tags +- [x] Create a custom syntax highlighting style - See: - [x] Add an RSS feed - - [ ] Links RSS feed + - [x] Links RSS feed - [ ] Add tags -- [ ] No JavaScript browsing support -- [ ] Add a 404 page +- [x] No JavaScript browsing support +- [x] Add a 404 page diff --git a/assets/css/style.css b/assets/css/style.css deleted file mode 100644 index b257248..0000000 --- a/assets/css/style.css +++ /dev/null @@ -1,183 +0,0 @@ -* { margin: 0px; } - -@font-face { - font-family: 'Mononoki'; - src: url('Mononoki.ttf'), format('truetype'); -} - -html { - background-color: #222222; - font-family: 'Mononoki', monospace; - color: #F1E9E5; -} - -.header-art { - color: #888 -} - -#a11y-skip { - position: absolute; - left: -1000%; -} - -#a11y-skip:focus { - left: 5%; -} - -#nav-menu li { - display: inline-block; - margin-left: 20px; -} - -#nav-posts { - margin-left: 40px; - margin-top: 40px; - color: #F1E9E5; -} - -li { - margin-bottom: 15px; - line-height: 2em; -} -ul { margin-top: 15px; } - -p { - margin: 30px; - line-height: 1.7em; -} - -a { - text-decoration: underline dotted #888; - color: #AEDBCE; -} - -a:hover { - color: #39AEA9; - text-decoration: underline dotted #fff; - transition: 1500ms; -} - -h1 { - font-size: 25px; - font-weight: bold; - color: #ccc; - margin: 40px 0px 10px 20px; -} - -h2 { - font-size: 25px; - font-weight: bold; - color: #ccc; - margin: 20px 0px 10px 0px; -} - -h3 { - font-size: 21px; - font-weight: bold; - color: #ccc; - margin: 20px 0px 10px 0px; -} - -h4 { - font-size: 21px; - font-weight: bold; - color: #6a978b; - margin: 20px 0px 10px 0px; -} - -.article p { - margin: 25px 0px; -} - -.article h1 { - margin-left: 0px; -} - -.sourceCode pre { - color: #ccc; - padding: 20px; - font-size: 16px; -} - -img { - width: 100%; -} - -p code { - background-color: #444; - padding: 5px 6.5px; - margin-right: 2px; - border-radius: 6px; - font-size: 14px; -} - -li code { - background-color: #444; - padding: 5px 8px; - border-radius: 6px; - font-size: 14px; -} - -blockquote { - color: #888; - background-color: #1b1b1b; - padding: 10px 40px; - font-style: italic; - border-radius: 12px; -} - -blockquote p code { - color: #bbb; -} - -footer { - margin-top: 40px; -} - -.footer-text { - padding: 20px 20px; -} - -.footer-back { - float: right; -} - -/* tablet */ -@media (min-width: 401px) { - .article { - margin: 0 45px; - } - - h1 { - margin-left: 45px; - } -} - -/* widescreen */ -@media (min-width: 1000px) { - .article { - margin: 0 20%; - } - - h1 { - margin-left: 45px; - } -} - -/* fullscreen */ -@media (min-width: 1500px) { - .article { - margin: 0 30%; - } - - h1 { - margin-left: 45px; - } -} - -/* phone */ -@media (max-width: 400px) { - .article { - margin: 0 20px; - } -} diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico deleted file mode 100755 index 7a0986eb002d3b6785f37c909582490728d1a8c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15406 zcmeHOX>3);6@G3=)mClU#J(A9yc_Qr40r?VK(GO`n8gIJ4cHhj;0aLG*xqdau<%$Ch znxMr%IWkATDO0ATMMg%RL;B;?sZ$>^@fqnX>L5k`n>caew?W&7^mN*^X@)ML?g>&a z_@xZ<>@_Z2+-Gd7S>=RBFELPG z@P5*?v%**e`A52Tn0yKgb4(ry32{bV{wyzk)P?=QzLK$(l@*y7_V3?nw%PDfsrkNe z;ao2s>{Irw+&(@&*68i)G%;jmrWi#<^UU@g9aXya<`~KC`ApgD2g;65h&6fj_3t%O zQW7mZpaaMEvD$vk+Qnx30|#nN`ol+dnC~o?Y0>rzq(94Le2$5kZZx;NWNh0uFb{sH!`SZlCJ?oIX=8p-&{fGSleRT8p9PL%64aYP6Oe9i1 zQiS=0hY)_lhYueL{ntT<3rN?X?`@>V?sN-fzd`DUE^9}O81elOL|K}GXDrg2kn_N< z|J8EP-bb4Y6DCZUZebR{%eZmlz5^b|sGrK;={wp!LOM!23_!GtxFP#}r*iz!f!FUR zO_~(t1jFRXlhc9umOq|>)`RCw=w;4pI~>%Tvgwm|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3m>e;>9`13b_B?QuN;&+j(F?*0y5w*RN0$_@3MvLN$g*i5w^R$!&zGY34mR}t12 zL#HQXi1X9Dz)9Gac`tnX zl;DvC)N%;=iT`)hf)w!m4UQG?a{u)*+P5)&gmlk&L_kPFBaYzyJLHdpKKa11ANghA q`T*$;-g(c9_cQJweTcd%qyc>)+psOf+ny(e2JP$CU-y9j9{4YT=a=CC diff --git a/assets/js/data.js b/assets/js/data.js deleted file mode 100644 index 3bf0a5f..0000000 --- a/assets/js/data.js +++ /dev/null @@ -1,112 +0,0 @@ -function get_data() { - return { - "posts": { - "pt": [ - { - "title": "Scripts em OCaml", - "slug": "scripts-em-ocaml", - "date": "23/03/2024" - } - ], - "en": [ - { - "title": "Giving up simplicity", - "slug": "unwinding", - "date": "August 10, 2024" - }, - { - "title": "Introducing tori", - "slug": "introducing-tori", - "date": "July 6, 2024" - }, - { - "title": "Void on ZFS", - "slug": "void-on-zfs", - "date": "June 9, 2024" - }, - { - "title": "Meeting the BSD Family", - "slug": "meeting-the-bsd-family", - "date": "May 20, 2024" - } - ] - }, - "links": [ - { - "title": "mrusme/reader: for your command line what the 'readability view' is for browsers", - "url": "https://github.com/mrusme/reader", - "date": "06/08/2024", - }, - { - "title": "A handful of reasons JavaScript won’t be available - Piccalilli", - "url": "https://piccalil.li/blog/a-handful-of-reasons-javascript-wont-be-available/", - "date": "01/08/2024", - }, - { - "title": "jgs font - Adel Faure", - "url": "https://adelfaure.net/tools/jgs/", - "date": "02/07/2024" - }, - { - "title": "Differential Analysis: A Summary", - "url": "https://blog.brownplt.org/2024/06/27/differential-analysis.html", - "date": "28/06/2024" - }, - { - "title": "aryak/mozhi: Mozhi is an alternative-frontend for many translation engines. - Codeberg.org", - "url": "https://codeberg.org/aryak/mozhi", - "date": "27/06/2024" - }, - { - "title": "GitHub - JFryy/qq: jq multi-configuration format tool with interactive REPL.", - "url": "https://github.com/JFryy/qq/", - "date": "23/06/2024" - }, - { - "title": "UserLAnd | F-Droid - Free and Open Source Android App Repository", - "url": "https://f-droid.org/en/packages/tech.ula/", - "date": "21/06/2024" - }, - { - "title": "phyphox | F-Droid - Free and Open Source Android App Repository", - "url": "https://f-droid.org/packages/de.rwth_aachen.phyphox/", - "date": "21/06/2024" - }, - { - "title": "Sounds of the Forest - Soundmap Timber Festival", - "url": "https://timberfestival.org.uk/soundsoftheforest-soundmap/", - "date": "14/06/2024" - }, - { - "title": "Piku", - "url": "https://piku.github.io/", - "date": "10/06/2024" - }, - { - "title": "Effects Showroom - TerminalTextEffects Docs", - "url": "https://chrisbuilds.github.io/terminaltexteffects/showroom/", - "date": "10/06/2024" - }, - { - "title": "Share Paste O2 | F-Droid - Free and Open Source Android App Repository", - "url": "https://f-droid.org/en/packages/alt.nainapps.sharepaste.fdroid/", - "date": "08/06/2024" - }, - { - "title": "Moving Beyond Type Systems | Vhyrro's Digital Garden", - "url": "https://vhyrro.github.io/posts/effect-systems/", - "date": "06/06/2024" - }, - { - "title": "hackerb9/lsix Like ls, but for images. Shows thumbnails in terminal using sixel graphics.", - "url": "https://github.com/hackerb9/lsix", - "date": "06/06/2024" - }, - { - "title": "Capital Offense How to Handle Abbreviations in CamelCase - Approxion", - "url": "https://www.approxion.com/capital-offenses-how-to-handle-abbreviations-in-camelcase/", - "date": "05/06/2024" - }, - ] - } -} diff --git a/assets/js/links.js b/assets/js/links.js deleted file mode 100644 index 3920585..0000000 --- a/assets/js/links.js +++ /dev/null @@ -1,27 +0,0 @@ -const data = get_data() - -function populate_links() { - const links = document.getElementById('links') - links.innerHTML = '' - - data.links.forEach(link => { - const item = document.createElement('li') - const anchor = document.createElement('a') - const date = document.createElement('span') - anchor.innerText = link.title - anchor.href = link.url - date.innerText = `${parse_date(link.date)} - ` - item.appendChild(date) - item.appendChild(anchor) - links.appendChild(item) - }) -} - -function parse_date(date) { - current_year = new Date().getFullYear() - return date.replace(`/${current_year}`, '') -} - -document.addEventListener('DOMContentLoaded', () => { - populate_links() -}) diff --git a/assets/js/main-l10n.js b/assets/js/main-l10n.js deleted file mode 100644 index 5907a87..0000000 --- a/assets/js/main-l10n.js +++ /dev/null @@ -1,67 +0,0 @@ -const userLang = navigator.language || navigator.userLanguage -let lang = userLang.includes('pt') ? 'pt' : 'en' - -function localize_menu() { - const home = document.getElementById('nav-menu-home') - const rss = document.getElementById('nav-menu-rss') - - if (lang == 'pt') { - if (home) home.innerText = 'Início' - if (rss) rss.setAttribute('href', 'assets/rss/pt.rss') - } else { - if (home) home.innerText = 'Home' - if (rss) rss.setAttribute('href', 'assets/rss/en.rss') - } -} - -function localize_navigation() { - const skip = document.getElementById('a11y-skip') - const post_list = document.getElementById('nav-posts') - - if (lang == 'pt') { - if (skip) skip.innerText = 'Saltar para o conteúdo principal' - if (post_list) post_list.ariaLabel = 'Listagem de todas as postagens' - } else { - if (skip) skip.innerText = 'Skip to main content' - if (post_list) post_list.ariaLabel = 'Listing of all posts' - } -} - -function localize_footer() { - const footer_back = document.getElementById('footer-back-link') - - if (footer_back) { - if (lang == 'pt') { - footer_back.innerText = 'Voltar' - } else { - footer_back.innerText = 'Back' - } - } -} - -const en_lang_swapper = document.getElementById('lang-swap-en') -const pt_lang_swapper = document.getElementById('lang-swap-pt') - -if (en_lang_swapper) { - en_lang_swapper.addEventListener("click", () => { - lang = 'en' - populate_posts() - localize_navigation() - localize_menu() - }) -} - -if (pt_lang_swapper) { - pt_lang_swapper.addEventListener("click", () => { - lang = 'pt' - populate_posts() - localize_navigation() - localize_menu() - }) -} - -document.addEventListener('DOMContentLoaded', () => { - localize_navigation() - localize_menu() - localize_footer() -}) diff --git a/assets/js/main.js b/assets/js/main.js deleted file mode 100644 index a5d56fa..0000000 --- a/assets/js/main.js +++ /dev/null @@ -1,28 +0,0 @@ -const data = get_data() - -function populate_posts() { - const posts = document.getElementById('nav-posts') - posts.innerHTML = '' - - data.posts[lang].forEach(post => { - const item = document.createElement('li') - const anchor = document.createElement('a') - const date = document.createElement('span') - anchor.innerText = post.title - anchor.href = 'posts/' + post.slug + '.html' - date.innerText = `${parse_date(post.date)} - ` - item.appendChild(date) - item.appendChild(anchor) - posts.appendChild(item) - }) -} - -function parse_date(date) { - current_year = new Date().getFullYear() - return date.replace(`, ${current_year}`, '') - .replace(`/${current_year}`, '') -} - -document.addEventListener('DOMContentLoaded', () => { - populate_posts() -}) diff --git a/assets/js/post-l10n.js b/assets/js/post-l10n.js deleted file mode 100644 index 7016445..0000000 --- a/assets/js/post-l10n.js +++ /dev/null @@ -1,11 +0,0 @@ -const userLang = navigator.language || navigator.userLanguage -let lang = userLang.includes('pt') ? 'pt' : 'en' - -if (lang == 'pt') { - const footer_back = document.getElementById('footer-back-link') - const author_pre = document.getElementById('author-pre-text') - const date_pre = document.getElementById('date-pre-text') - footer_back.innerText = 'Voltar' - author_pre.innerText = 'Postado por' - date_pre.innerText = 'em' -} diff --git a/assets/rss/en.rss b/assets/rss/en.rss deleted file mode 100644 index bb217e7..0000000 --- a/assets/rss/en.rss +++ /dev/null @@ -1,40 +0,0 @@ - - - - jutty.dev: Blog - http://blog.jutty.dev/ - - jutty.dev: Blog - en-us - Sun, 9 Jun 2024 17:36:20 -0300 - https://www.rssboard.org/rss-specification - - Meeting the BSD Family - Mon, 20 May 2024 14:35:27 -0300 - https://blog.jutty.dev/posts/meeting-the-bsd-family.html - https://blog.jutty.dev/posts/meeting-the-bsd-family.html - juno@jutty.dev (Juno Takano) - - - Void on ZFS - Sun, 9 Jun 2024 17:36:20 -0300 - https://blog.jutty.dev/posts/void-on-zfs.html - https://blog.jutty.dev/posts/void-on-zfs.html - juno@jutty.dev (Juno Takano) - - - Introducing tori - Sat, 6 Jul 2024 11:16:39 -0300 - https://blog.jutty.dev/posts/introducing-tori.html - https://blog.jutty.dev/posts/introducing-tori.html - juno@jutty.dev (Juno Takano) - - - Giving up simplicity - Sun, 11 Aug 2024 00:02:44 -0300 - https://blog.jutty.dev/posts/unwinding.html - https://blog.jutty.dev/posts/unwinding.html - juno@jutty.dev (Juno Takano) - - - diff --git a/assets/rss/pt.rss b/assets/rss/pt.rss deleted file mode 100644 index 68d5ce4..0000000 --- a/assets/rss/pt.rss +++ /dev/null @@ -1,19 +0,0 @@ - - - - jutty.dev: Blog - http://blog.jutty.dev/ - - jutty.dev: Blog - pt-br - Mon, 20 May 2024 12:06:59 -0300 - https://www.rssboard.org/rss-specification - - Scripts em OCaml - Fri, 23 Feb 2024 21:23:00 -0300 - https://blog.jutty.dev/posts/scripts-em-ocaml.html - https://blog.jutty.dev/posts/scripts-em-ocaml.html - juno@jutty.dev (Juno Takano) - - - diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..84b7ceb --- /dev/null +++ b/config.toml @@ -0,0 +1,37 @@ +title = "jutty.dev" +description = "Just computer nerd things" +author = "Juno Takano" +base_url = "https://jultty.github.io/blog-zola" +default_language = "en" + +generate_feeds = true +feed_filenames = ["rss.xml", "atom.xml"] + +taxonomies = [ + { name = "tags", feed = true }, +] + +[translations] +[languages] + +[languages.pt] +generate_feeds = true +feed_filenames = ["rss.xml", "atom.xml"] +title = "jutty.dev" +description = "Nerdices, unix, computarias" + +[markdown] +smart_punctuation = true +bottom_footnotes = true + +highlight_code = true +highlight_theme = "css" +# highlight_themes_css = [ +# # base16-ocean-dark, material-dark, nord +# { theme = "material-dark", filename = "assets/css/syntax-dark.css" }, +# # dimmed-fluid, subway-moscow +# { theme = "dimmed-fluid", filename = "assets/css/syntax-light.css" }, +# ] + +[extra] +title_separator = "-" diff --git a/content/feeds.md b/content/feeds.md new file mode 100644 index 0000000..cd93be1 --- /dev/null +++ b/content/feeds.md @@ -0,0 +1,5 @@ ++++ ++++ + +- Posts: [RSS](https://blog.jutty.dev/rss.xml) [Atom](https://blog.jutty.dev/atom.xml) +- Links: [RSS](https://blog.jutty.dev/links/rss.xml) [Atom](https://blog.jutty.dev/links/atom.xml) diff --git a/content/feeds.pt.md b/content/feeds.pt.md new file mode 100644 index 0000000..48e1fed --- /dev/null +++ b/content/feeds.pt.md @@ -0,0 +1,5 @@ ++++ ++++ + +- Posts: [RSS](https://blog.jutty.dev/pt/rss.xml) [Atom](https://blog.jutty.dev/pt/atom.xml) +- Links: [RSS](https://blog.jutty.dev/pt/links/rss.xml) [Atom](https://blog.jutty.dev/pt/links/atom.xml) diff --git a/content/links/_index.md b/content/links/_index.md new file mode 100644 index 0000000..5240d9c --- /dev/null +++ b/content/links/_index.md @@ -0,0 +1,7 @@ ++++ +title = "Links" +sort_by = "date" +template = "links.html" +page_template = "link-page.html" +generate_feeds = true ++++ diff --git a/content/links/_index.pt.md b/content/links/_index.pt.md new file mode 100644 index 0000000..9f15c22 --- /dev/null +++ b/content/links/_index.pt.md @@ -0,0 +1,6 @@ ++++ +title = "Links" +sort_by = "date" +template = "links.html" +page_template = "link-page.html" ++++ diff --git a/content/links/mrusme-reader.md b/content/links/mrusme-reader.md new file mode 100644 index 0000000..f79a94f --- /dev/null +++ b/content/links/mrusme-reader.md @@ -0,0 +1,8 @@ ++++ +title = "mrusme/reader: for your command line what the 'readability view' is for browsers" +date = 2024-08-06 +[extra] +url = "https://github.com/mrusme/reader" ++++ + +Happy to see *any* tool that reduces having to open a browser. diff --git a/content/links/mrusme-reader.pt.md b/content/links/mrusme-reader.pt.md new file mode 100644 index 0000000..7c11ac4 --- /dev/null +++ b/content/links/mrusme-reader.pt.md @@ -0,0 +1,8 @@ ++++ +title = "mrusme/reader: pra sua linha de comando o que o 'readability view' é para navegadores" +date = 2024-08-06 +[extra] +url = "https://github.com/mrusme/reader" ++++ + +Bom ver *qualquer* ferramenta que evita precisar abrir um navegador. diff --git a/content/posts/_index.md b/content/posts/_index.md new file mode 100644 index 0000000..b6314da --- /dev/null +++ b/content/posts/_index.md @@ -0,0 +1,6 @@ ++++ +title = "Posts" +sort_by = "date" +template = "posts.html" +page_template = "post-page.html" ++++ diff --git a/content/posts/_index.pt.md b/content/posts/_index.pt.md new file mode 100644 index 0000000..b6314da --- /dev/null +++ b/content/posts/_index.pt.md @@ -0,0 +1,6 @@ ++++ +title = "Posts" +sort_by = "date" +template = "posts.html" +page_template = "post-page.html" ++++ diff --git a/posts/md/introducing-tori.md b/content/posts/introducing-tori.md similarity index 99% rename from posts/md/introducing-tori.md rename to content/posts/introducing-tori.md index 2f2bd39..8071ec4 100644 --- a/posts/md/introducing-tori.md +++ b/content/posts/introducing-tori.md @@ -1,8 +1,8 @@ ---- -title: Introducing tori -author: Juno Takano -date: June 30, 2024 ---- ++++ +title = "Introducing tori" +date = 2024-06-30 +aliases = ["posts/introducing-tori.html"] ++++ **[tori](https://tori.jutty.dev/)** is a tool to track your personal systems' configurations and replicate them. diff --git a/posts/md/meeting-the-bsd-family.md b/content/posts/meeting-the-bsd-family.md similarity index 97% rename from posts/md/meeting-the-bsd-family.md rename to content/posts/meeting-the-bsd-family.md index 65903be..40ce682 100644 --- a/posts/md/meeting-the-bsd-family.md +++ b/content/posts/meeting-the-bsd-family.md @@ -1,8 +1,8 @@ ---- -title: Meeting the BSD family -author: Juno Takano -date: May 20, 2024 ---- ++++ +title = "Meeting the BSD family" +date = 2024-05-20 +aliases = ["posts/meeting-the-bsd-family.html"] ++++ During this year I have been delving deeper and deeper in the BSD realm. Switching my home server to FreeBSD, trying NetBSD and OpenBSD on my backup machine, getting a cheap SSD to see how they'd all run on my main one, all beaming with the joy of tinkering and learning. diff --git a/posts/md/scripts-em-ocaml.md b/content/posts/scripts-em-ocaml.pt.md similarity index 94% rename from posts/md/scripts-em-ocaml.md rename to content/posts/scripts-em-ocaml.pt.md index f9cb212..c98dab2 100644 --- a/posts/md/scripts-em-ocaml.md +++ b/content/posts/scripts-em-ocaml.pt.md @@ -1,8 +1,8 @@ ---- -title: Scripts em OCaml -author: Juno Takano -date: 23 de fevereiro de 2024 ---- ++++ +title = "Scripts em OCaml" +date = 2024-02-23 +aliases = ["posts/scripts-em-ocaml.html"] ++++ Este blog gera suas postagens com o Pandoc, mas quem faz o trabalho lógico de identificar os arquivos e montar os comandos é um pequeno script em OCaml. diff --git a/posts/md/unwinding.md b/content/posts/unwinding.md similarity index 98% rename from posts/md/unwinding.md rename to content/posts/unwinding.md index 513691d..054928a 100644 --- a/posts/md/unwinding.md +++ b/content/posts/unwinding.md @@ -1,8 +1,8 @@ ---- -title: Giving up simplicity -author: Juno Takano -date: August 10, 2024 ---- ++++ +title = "Giving up simplicity" +date = 2024-08-10 +aliases = ["posts/unwinding.html"] ++++ _or_ diff --git a/posts/md/void-on-zfs.md b/content/posts/void-on-zfs.md similarity index 98% rename from posts/md/void-on-zfs.md rename to content/posts/void-on-zfs.md index 8a65748..2b87a2e 100644 --- a/posts/md/void-on-zfs.md +++ b/content/posts/void-on-zfs.md @@ -1,10 +1,10 @@ ---- -title: Void on ZFS -author: Juno Takano -date: June 9, 2024 ---- ++++ +title = "Void on ZFS" +date = 2024-06-09 +aliases = ["posts/void-on-zfs.html"] ++++ -![An L-shaped desk with two laptops, an external monitor, a router and a third headless computer in a tower case with several power cables connected to a power strip on top of it. Next to the power strip are two cellphones, a long red box, and a charging case for Bluetooth headphones with a red LED on. The tower case has three stickers on it: one with the machine specifications, one the FreeBSD logo, and one reading "platform feodalism (sic) is so 1492". Scattered around the machines are some office supplies, medicine containers, a screwdriver, a notepad, a small notebook, an NVMe SSD card on top of its packaging, a mug, a water bottle and a scarf. Hanging on the wall are a small painting of a dead tree before the twilight, prayer beads, a sunflower-pattern keychain and a calendar. Between the desk and the camera, a green plastic chair has a pillow and blanket on top of it. A few wires and cardboard boxes are visible under the desk.](../assets/img/posts/void-on-zfs/desk.jpg) +![An L-shaped desk with two laptops, an external monitor, a router and a third headless computer in a tower case with several power cables connected to a power strip on top of it. Next to the power strip are two cellphones, a long red box, and a charging case for Bluetooth headphones with a red LED on. The tower case has three stickers on it: one with the machine specifications, one the FreeBSD logo, and one reading "platform feodalism (sic) is so 1492". Scattered around the machines are some office supplies, medicine containers, a screwdriver, a notepad, a small notebook, an NVMe SSD card on top of its packaging, a mug, a water bottle and a scarf. Hanging on the wall are a small painting of a dead tree before the twilight, prayer beads, a sunflower-pattern keychain and a calendar. Between the desk and the camera, a green plastic chair has a pillow and blanket on top of it. A few wires and cardboard boxes are visible under the desk.](/assets/img/posts/void-on-zfs/desk.jpg) June is here. It brings the usual cold weather and some extra rhinitis complications. With that I find myself in a recovery mood Sunday, wrapped in a blanket with a mug of tea, a screwdriver, some notes on paper, a flash drive, a couple of NVMe cards and the trio of Unix-powered machines that will help me get this done. @@ -12,7 +12,7 @@ The mission is to get a root-on-ZFS EFI installation of Void Linux with ZFSBootM To my left, a ceiling-collapse-survivor Sony VAIO is running NetBSD with spectrwm. It's split with sakura and tmux on a terminal to one side, where Neovim is storing these words, and Firefox on the other, ready to fetch all the docs. In the middle, the object of today's operation. And to my right, a headless PC board runs FreeBSD with ZFS, holding all the backups needed for the post-install tasks. -![Two laptops side-by-side on a desk, each with a USB keyboard plugged in. Writing utensils inside a holder and post-its are between the two. A sunflower-patterned keychain and prayer beads hang from the wall. The computer on the left has a brown cloth for a wrist rest in front of its USB keyboard, to the left of which lies a small blue Campus notebook.](../assets/img/posts/void-on-zfs/duo.jpg) +![Two laptops side-by-side on a desk, each with a USB keyboard plugged in. Writing utensils inside a holder and post-its are between the two. A sunflower-patterned keychain and prayer beads hang from the wall. The computer on the left has a brown cloth for a wrist rest in front of its USB keyboard, to the left of which lies a small blue Campus notebook.](/assets/img/posts/void-on-zfs/duo.jpg) This lengthy post, written not after the fact but during it, is my way of documenting and also sharing how it all went. Additionally, it's a way to delve deeper into many of the things the ZFSBootMenu docs leave unexplained, an urge I already had yesterday as I just tried it out without much modification. @@ -58,7 +58,7 @@ While a bit dusty, the machine was overall in good state. The release date for t It has a single NVMe slot, one 16 GB RAM stick and one unused RAM slot. If you look closely, you can notice a dent on the vent tube connecting the cooler to the CPU. Despite this, it very rarely heats up. -![The Dell laptop seen from above, lid closed, with the screen against the desk and the bottom cover removed, exposing the motherboard.](../assets/img/posts/void-on-zfs/karu-inside.jpg) +![The Dell laptop seen from above, lid closed, with the screen against the desk and the bottom cover removed, exposing the motherboard.](/assets/img/posts/void-on-zfs/karu-inside.jpg) Next up is to boot up [hrmpf](https://github.com/leahneukirchen/hrmpf) in EFI mode. @@ -172,7 +172,7 @@ My target device is an NVMe at `nvme0n1`, so I'll have: - `BOOT_PART="1"` - `BOOT_DEVICE="${BOOT_DISK}p${BOOT_PART}"` - which evaluates to `/dev/nvme0n1p1` - +

- `POOL_DISK="/dev/nvme0n1"` - `POOL_PART="2"` - `POOL_DEVICE="${POOL_DISK}p${POOL_PART}"` @@ -187,10 +187,13 @@ At this point, we should be able to print something like this in our environment ```sh # env | grep ID ID=void + # hostid 00bab10c + # echo $BOOT_DEVICE /dev/nvme0n1p1 + # echo $POOL_DEVICE /dev/nvme0n1p2 ``` @@ -462,7 +465,7 @@ xchroot /mnt This is a good time to get back to the notes I mentioned taking the day before. -![A block of paper with some notes scribbled: "check connection first of all", "reconfigure after chroot", "see /usr/share/doc/efibootmgr/README.voidlinux for automatic EFI entry management", "superb docs", "take the first snapshot ASAP". An arrow points from the last note to "on chroot?" Visible above the block of paper is a keyboard. To the right, the tip of a notebook and a piece of brown cloth are visible. On top of the block, there is a mechanical pencil and a Tombow MONO One plastic eraser.](../assets/img/posts/void-on-zfs/notes.jpg) +![A block of paper with some notes scribbled: "check connection first of all", "reconfigure after chroot", "see /usr/share/doc/efibootmgr/README.voidlinux for automatic EFI entry management", "superb docs", "take the first snapshot ASAP". An arrow points from the last note to "on chroot?" Visible above the block of paper is a keyboard. To the right, the tip of a notebook and a piece of brown cloth are visible. On top of the block, there is a mechanical pencil and a Tombow MONO One plastic eraser.](/assets/img/posts/void-on-zfs/notes.jpg) #### Reconfiguring packages diff --git a/index.html b/index.html deleted file mode 100644 index 813faec..0000000 --- a/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - jutty.dev - - - - - - - - - - Skip to main content -
- -
- - - diff --git a/pages/links.html b/pages/links.html deleted file mode 100644 index 618bf5f..0000000 --- a/pages/links.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Links • jutty.dev - - - - - - - - -
- -
- -
-
- -
- diff --git a/posts/.gitattributes b/posts/.gitattributes deleted file mode 100644 index 7d60752..0000000 --- a/posts/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.html linguist-generated diff --git a/posts/gen.ml b/posts/gen.ml deleted file mode 100755 index 61d2f12..0000000 --- a/posts/gen.ml +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env utop - -let args = "--css ../assets/css/style.css --standalone " ^ - "--from markdown+yaml_metadata_block-implicit_figures " ^ "--to html5 " ^ - "--highlight-style zenburn " ^ "--template=template.html " - - -let vert md = begin - let filename_split = String.split_on_char '.' md in - Sys.command ( - "pandoc " ^ args ^ " md/" ^ md ^ " -o " ^ List.nth filename_split 0 ^ ".html" - ) -end ;; - -let contents = Sys.readdir "./md/" - |> Array.to_list - |> List.map vert diff --git a/posts/introducing-tori.html b/posts/introducing-tori.html deleted file mode 100644 index b5c9037..0000000 --- a/posts/introducing-tori.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - Introducing tori • jutty.dev - - - - - - - - -
-
-

Introducing tori

-
-
-
-

tori is a tool -to track your personal systems’ configurations and replicate them.

-

For the past 5 months, I’ve been simultaneously using and writing it -to manage my main machine’s configuration. By “manage the configuration” -what I mean is keeping track of installed packages, configuration files, -symlinks, and other settings that can be queried and set through command -line interfaces.

-

After installing a given system, I wanted to get it to the same -configuration state I was used to, or to a certain configuration -specific to its purpose. Just copying backups would certainly be a very -manual task, namely because:

-
    -
  • Not all settings live in /etc
  • -
  • Some settings must be set using a specific CLI utility
  • -
  • Backups usually carry an overwhelming amount of redundant default -configuration you never even touched
  • -
  • It does not track what is changing as you are still using the -system
  • -
  • I actually wanted to know what I was tracking
  • -
-

Configuring a system can become a very vague process as you start to -lose track of where the changes are being made and what is the specific -configuration needed for something to work.

-

Every time you change some configuration file, every time you create -a symlink somewhere, that’s all having effects on the system that you -may expect to be there in the future, but you may not remember how to -accomplish that. This drift between what you have and what you are able -to replicate only grows as you keep using your system.

-

To get a better idea, see the code snippet below. It’s from the main -file that I use to manage all function calls:

-
  xbps_get_many packages
-
-  check_service dbus
-  check_group audio
-  check_group video
-
-  copy dhcpcd.conf /etc/dhcpcd.conf
-  place kernel-cmd-line.conf /etc/dracut.conf.d
-  check_link /etc/localtime /usr/share/zoneinfo/America/Sao_Paulo
-
-  get_nix tailspin tspin
-  get_cargo taplo-cli taplo --locked
-  get_bun bash-language-server
-  get_bin 'https://raw.githubusercontent.com/hackerb9/lsix/master/lsix' lsix
-
-  check_gsettings gtk-theme 'Plata-Noir'
-  check_gsettings font-name 'Mononoki Nerd Font Regular'
-

What is happening here:

-
    -
  1. A file named packages containing package names is -parsed and all packages are queried and installed by the -xbps package manager, if not already installed
  2. -
  3. Service dbus is enabled if not already enabled
  4. -
  5. The user is added to groups audio and -video, unless already in them
  6. -
  7. File dhcpcd.conf from the configuration directory’s -base directory is checked against the one in the passed -path and overwrites it if the user chooses to do so
  8. -
  9. File kernel-cmd-line.conf from the configuration -directory’s base directory is copied into the passed path. -If the file already exists or differs, tori will present an error
  10. -
  11. A symlink is checked to be on /etc/localtime pointing -to the passed path. If it doesn’t, it is created or fixed
  12. -
  13. If not installed, a few packages are installed using different -package managers: tailspin, taplo and -bash-language-server
  14. -
  15. If absent, an executable for lsix is downloaded from a -URL and placed at ~/.local/bin
  16. -
  17. Some gsettings values are read and set if they differ: -gtk-theme and font-name
  18. -
-

Notice how everything is conditioned to the system not already -presenting that state? tori aims to be idempotent. Running it twice -should do nothing the second time it runs so you can run it multiple -times while making changes without any doubled effects.

-

I mentioned a base directory. This is what a sample tori -directory would look like in its present state:

-
.
-├── base
-│   ├── dhcpcd.conf
-│   ├── kernel-cmd-line.conf
-│   ├── packages
-│   └── vars.sh
-├── .bkp
-│   ├── canonical
-│   │   ├── etc
-│   │   └── opt
-│   └── ephemeral
-│       └── etc
-├── src
-│   ├── checks.sh
-│   ├── copy.sh
-│   └── get.sh
-└── strap
-

What you are seeing in this sample of the directory are the following -files and directories:

-
    -
  • base: Where you place the configuration files that -functions like copy and place will look for -and copy into the desired locations
  • -
  • .bkp/canonical: Where tori will look for initial -backups and create them if none exists
  • -
  • .bkp/ephemeral: Where tori will place timestamped -backups every time a file is modified or overwritten
  • -
  • src: Where the source files live, mostly containing -function definitions
  • -
  • strap: The main file used to call the functions
  • -
-

Because I developed tori for my own purposes initially, I didn’t -really care to separate the actual source files from the -context-sensitive data. While a mistake from a higher level, it allowed -me to just keep developing the whole system configuration and the code -that tracked it from a single, version-controlled location, amounting to -very little complexity. I can’t deny to have enjoyed it so far, but -going forward that is going to change.

-

Currently, tori is able to install several package managers and their -packages, including xbps, apt, nix, opam, stack, cargo, go, sdkmanager, -npm, flatpak and pipx.

-

It can also perform several other tasks:

-
    -
  • setup programming runtimes for OCaml, Scala (via Coursier), Go, -JavaScript (node and bun), Rust (via rustup)
  • -
  • generate GPG certificates
  • -
  • query and set options with update-alternatives and -gsettings
  • -
  • change the user shell
  • -
  • check and enable services (systemd and runit)
  • -
  • download pre-built binaries from tarballs and (g)zip files, -unpacking and making them executable
  • -
  • get files through the network using rsync
  • -
  • several other things likely not worth mentioning
  • -
-

The application slowly grew to accommodate many of my needs, but I -also made it very hard to share with the world in the process, since I -never really meant to go public with it.

-

Portability issues

-

Despite it being very useful to me in its current state and still -being something I actively use every day, a lot of it is hard-coded for -my very personal use. It was not written with portability in mind and -therefore requires a lot of source-code editing to use in a different -system.

-

For instance, when I switched from Debian to Void Linux, most of it -broke. I certainly would not expect the package list to be compatible -between them, but I realized at that point how tightly it was coupled to -Debian.

-

When I started delving deeper into FreeBSD and setting up the system, -I kept reaching out to something like tori. But it wasn’t there, and it -wouldn’t work even if it were.

-

Something that certainly influenced my desire to write tori was my -experience using NixOS, which was full of mixed feelings, but undeniably -had good feelings that stuck.

-

I really liked being able to manage the system configuration and -packages from a single file. But, at the same time, I felt it was -overkill. It was limiting because most of the time you were -forced to configure things through its interfaces. It -was basically incompatible with what every other Unix system expects, -and therefore what people who write software for these systems also -expect.

-

I appreciated bringing the system configuration to a centralized -file, but I certainly did not want to manage all my -~/.config configuration files from that same place. After -writing tori, I can choose what to place under its tracking and what not -to. Third-party software still works as both me and its creators expect -it to, instead of my system breaking things and needing them to work the -way it expects.

-

Glad to reinvent the wheel

-

While I understand there are very mature and powerful tools to manage -a system’s state and reproduce it, I am aiming here for a much simpler -use case. I have no intention to see it used in enterprise or -distributed systems. It is all about managing how your personal -computing is set up and having a backup of how you did it.

-

What I need is not a tool that can orchestrate a fleet of containers -running a given configuration. What I need is a tool that can run in a -bare system that just got installed and get it to a state that feels -useful to me. I do not want it to run instructions over a range of IPs, -I just want to be able to check at any time if the system state has -diverged from the configuration I am using to track it. I wanted a tool -that would help me develop a different habit when I need to make -system-level changes.

-

And finally, I suppose I just really wanted to build this. I really -enjoy the process of configuring operating systems and learning how they -work and differ. And I really wanted to learn more about portable, -POSIX-compatible shell scripting.

-

So I decided to rewrite it with portability in mind. I am doing this -rewrite in FreeBSD, to put the portability to the test. Once some basic -functionality is done, the next step will be bringing it to Void Linux, -Debian and NetBSD.

-

tori is a bird that has just hatched, so everything is still very, -very crude. At this stage, the docs often show intentions rather than -implemented functionality. Still, because it is something I’ve come to -depend on, it has this rewarding sense of usefulness behind it.

-

If it sounds interesting to you, take a look. You can follow -development at the main Git -repository in BSD.Cafe’s Git forge or through its mirrors on GitHub and Codeberg. Going forward, I -will also probably be talking a lot about it on my Mastodon profile.

-
- -
-
- -
- diff --git a/posts/meeting-the-bsd-family.html b/posts/meeting-the-bsd-family.html deleted file mode 100644 index ae6f19c..0000000 --- a/posts/meeting-the-bsd-family.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - Meeting the BSD family • jutty.dev - - - - - - - - -
-
-

Meeting the BSD family

-
-
-
-

During this year I have been delving deeper and deeper in the BSD -realm. Switching my home server to FreeBSD, trying NetBSD and OpenBSD on -my backup machine, getting a cheap SSD to see how they’d all run on my -main one, all beaming with the joy of tinkering and learning.

-

As a nerd who delights in reading documentation, manuals and -handbooks, I feel like I have found a gigantic library to lose myself -in. And to me the delight of such reading is in that it’s never a -passive learning experience, but something you can act on and bring to -fruition yourself.

-

While Linux-based operating systems, with all the popularity they -have gained, have developed into a complex and extremely active -ecosystem, the BSD operating systems feel less bloated and more focused -on whatever their specialty is.

-

You can’t really complain about software availability, given the -amount of pre-packaged binaries you will find. When trying FreeBSD, I -could not miss anything I needed. More recently, on NetBSD, I also found -most of the tools I reached for.

-

Though I have a mostly text-driven workflow, doing almost all things -with a browser and a terminal alone – which certainly helps in making -your stack more portable – I do rely on some GUI applications for the -domains where they excel.

-

What you might experience is a slower pace of change for major -things, such as on Wayland adoption, which like it or not is coming for -all of us with X deprecation looming.

-

Running BSD is an incredible opportunity to really learn about -UNIX-like systems and operating systems in general.

-

Recently, I’ve been learning more about NetBSD after spending some -time with FreeBSD. And this inner diversity of fully-independent -operating systems with their own kernels and perks keeps multiplying the -learning opportunities.

-

If you already learned a lot about whatever OS you currently use, I’d -say particularly if that OS is Linux-based, when you start to play with -a BSD system you are able to realize what is similar and what is -not.

-

Whatever is different is likely teaching you the more portable, UNIX -way of doing things. Even if it isn’t, it’s teaching you how a different -OS is designed and behaves.

-

Things that are the same, which are not few, also offer learning -opportunities. You get to see what parts of a Linux-based OS perhaps -didn’t really originate there, or aren’t in any way an exclusive feature -of it.

-

Now, to lay any zealousness aside and not make this a saccharine -one-sided tale, I’d also like to mention a certain social phenomenon -that this endeavour reminded me of.

-

This is certainly not something specific to BSD, but because it has -such an engaged and savvy community, you definitely get to notice it -sometimes. I’m talking about the tendency to identify with and then -indiscriminately defend the software you use.

-

One common meme you’ll find is people complaining about lack of -hardware support, especially wifi. In response, I’ve seen people stating -with little nuance that any difficulty to getting your hardware to work -on <insert a BSD OS here> is to be explained by poor skills or -lack of dedication in reading the documentation.

-

I see that as denial. When everyone around is just defending -something to no end, no critiques allowed, it starts to feel… awkward, -to say the least.

-

Conversely, when I see people openly pointing out weaknesses in -something I value and that I can tell they also care for, I feel relief -and admiration for that person and that community at large. And -thankfully I have also found a lot of this among the BSD folks.

-

Because running a given operating system on a machine you rely on is -such a big commitment, it intensifies this phenomenon where users start -to identify with the software they use and defend it beyond reason.

-

It happens with frameworks, desktop environments and window managers, -but operating systems require you to commit even more because you can’t -just swap them as easily, so my guess is we identify to compensate this -sense of being tied to it. And from this identification comes an urge to -deny any defect.

-

If you are cognizant of the perils, identifying with something is not -necessarily a bad thing, though. To some extent, it is inevitable, and -being really into something, caring about it, nurturing immense -curiosity and a desire to discuss it, are all sources of pleasure I do -not excuse myself from.

-

Software wars aside, getting to know this family of operating systems -better has been a joy. It opened up whole new avenues and perspectives -to understanding operating systems as a whole, and how beyond -Linux-based OSs there are numerous other free and open source operating -systems that strengthen the diversity in this field.

-
- -
-
- -
- diff --git a/posts/scripts-em-ocaml.html b/posts/scripts-em-ocaml.html deleted file mode 100644 index 7db7a96..0000000 --- a/posts/scripts-em-ocaml.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - Scripts em OCaml • jutty.dev - - - - - - - - -
-
-

Scripts em OCaml

-
-
-
-

Este blog gera suas postagens com o Pandoc, mas quem faz o trabalho -lógico de identificar os arquivos e montar os comandos é um pequeno -script em OCaml.

-

Descobri essa linguagem quando comecei a investigar como poderia -substituir o Bash como uma linguagem para scripts. Eu acho que o Bash é -excelente para cumprir essa função, apesar de bastante inseguro e -propenso a erros. O que me incomodava mesmo era ver que todo aquele -tempo escrevendo scripts com Bash poderia ser tempo aprendendo uma -linguagem cujo conhecimento se transferisse para muitas outras -aplicações.

-

O script se resume a:

-
let pandoc_params = 
-  "--css ../../assets/style.css -s --to html5 --metadata pagetitle='basename' "
-
-let vert md = begin
-  if md <> "gen.ml" && md <> "html" then
-    ignore( Sys.command (
-      "pandoc " ^ pandoc_params ^ md ^ " -o html/" ^ md ^ ".html "
-    ) )
-end ;;
-
-let contents = Array.to_list (Sys.readdir ".") in
-List.map vert contents ;;
-

Primeiro, armazeno em pandoc_params os parâmetros comuns -que serão passados ao Pandoc para gerar os arquivos HTML a partir dos -arquivos em Markdown.

-

Em seguida, defino a função vert, que, caso o arquivo -não se chame “gen.ml” (o próprio script) nem “html” (o diretório onde os -arquivos gerados ficam), o comando do Pandoc é chamado com os nomes dos -arquivos de entrada e saída.

-

Essa função então é aplicada com List.map vert contents -a cada arquivo do diretório atual.

-

Referências

- -
- -
-
- -
- diff --git a/posts/template.html b/posts/template.html deleted file mode 100644 index 5483537..0000000 --- a/posts/template.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - -$for(author-meta)$ - -$endfor$ -$if(date-meta)$ - -$endif$ -$if(keywords)$ - -$endif$ -$if(description-meta)$ - -$endif$ - $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ • jutty.dev - -$for(css)$ - -$endfor$ - - - - -$for(header-includes)$ - $header-includes$ -$endfor$ -$if(math)$ - $math$ -$endif$ - - -$for(include-before)$ -$include-before$ -$endfor$ -$if(title)$ -
-
-

$title$

-
-$if(subtitle)$ -

$subtitle$

-$endif$ -$if(abstract)$ -
-
$abstract-title$
-$abstract$ -
-$endif$ -
-$endif$ -$if(toc)$ - -$endif$ -
-$body$ -
-$for(include-after)$ -$include-after$ -$endfor$ - -
-
- -
- diff --git a/posts/unwinding.html b/posts/unwinding.html deleted file mode 100644 index eb03cc2..0000000 --- a/posts/unwinding.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - Giving up simplicity • jutty.dev - - - - - - - - -
-
-

Giving up simplicity

-
-
-
-

or

-

Unwinding

-

Due to a worker strike, the university semester ended late this year. -That meant everything had to be compressed into little more than a month -in order to wrap up what would have taken four. Now that we’re almost -through it, my mind wanders to writing. It is almost always what springs -from the void in me, what has been winded up loosens and the scattered -meaning starts to recollect into the drain of language and swirl through -the piping of my nervous system.

-

Wind is air that has been somehow compressed. If there was -no pressure pushing it anywhere, it would be just expansive air, -floating in peace with the atmosphere.

-

If you’d entertain this thought further, consider a work of visual -art. It can be more figurative, clearly depicting shapes that mean -something, and therefore able to convey an array of ideas to whatever -extent of detail the artist wants. Conversely, it can be more abstract, -where ideas will be a lot more sparse, possibly to the point where -nothing at all is conveyed other than the appearance, whatever aesthetic -is employed being the whole message in itself. Very little is packed -into the work, just like the air you can’t even feel weighing on -you.

-

In computing, and more specifically in the realm of programming – a -craft presently overshadowed by the semantically starved jargon of -whatever the department responsible for inflating public perception -numbers is called these days – simplicity is often emphasized. Code is -supposed to be clear, expressive and clean. A software application is -supposed to have as few dependencies as possible, and strive to keep it -simple, or risk stupidity.

-

While that is a lofty goal, and while clear, expressive and clean -code is a refreshing and tranquilizing sight, more often than not -software just can’t be simple.

-

Not having dependencies means implementing more and more yourself. -There are corner cases to cover, tests to run, different architectures -and operating systems to support. Even the simplest of software ideas, -say, a calculator, a program that prints back a sentence in reverse, -that displays a picture you give it, whatever you conceive as the -simplest use case, is hardly ever implemented with simplicity in the -naïve sense of something that is, quite literally, simplistic.

-

More often than not, simplicity is actually abstraction. The breaking -apart of complexity behind a simpler facade. More so a way to manage -complexity by conveying it simply than to enact simplicity in its actual -sense. Each step in abstraction is actually a layer deeper into -intricacy. And yet, it makes things immensely easier to manage and -understand.

-

For some reason, I have always felt very drawn to abstract works. -Staring into them, there is no expectation to understand, get, or argue -about. Interestingly, to me that also means they couldn’t be any more -clear. It does not mean a specific, intelligible message is conveyed -from the artist to me, rather, it means whatever impression is caused on -the viewer was never intended to reach too deep anyways. It never -intended to carry that much through its medium.

-

Sometimes, too much detail, no matter how specific, can draw an idea -so far out that it becomes harder and harder to grasp. In contrast to -that, a brisk exposition can get the message across like lightning.

-

So detail does not always convey meaning, although it can convey a -specific meaning to someone who will bear with you as you build the -context for it. Otherwise, you could convey your message just as -effectively in an abstract manner if your receiver already has that -context from the outset.

-

In computing, such possibility is simply absent from us. No context -whatsoever can be assumed, and if it is present, that is because some -other structure is providing it.

-

Complexity produces confusion, confusion produces frustration, and -frustration can lead to either surrender or a rebound. So the -interesting thing about this pressurizing of ideas is that it springs -back into action a process that may reverse it or deflect into something -else entirely.

-

Instead of surrendering to the frustration of complexity, sometimes I -actually take the time to recollect myself and analyze it into -understanding. This feeling of winning over something that had me on my -knees and ready to give up is a very gratifying one. It convinces me I -can squeeze grit from despair if I bet on it and willingly risk -desperation in order to see it through.

-

Yet, after chasing the deadline of effort all of it relaxes back into -this state. In it, the only way to rest is to embrace complexity as the -whole, and simplicity as one of its manifestations. It is so cold right -now in the south, but in the north it is not. Four days and nine hours -ago it was the peak of the winter. I’m wrapped in blankets and the room -is dark like the depths of a submarine cave, LED lights here and there -like fluorescent eyes blinking in silence.

-

The professor had us build games and then present them to the whole -faculty. Among the outputs, one algorithm I produced stuck with me for -what I deem is simplicity. It is responsible for causing an enemy to -chase the player by finding the difference between their positions and -lowering it:

-
func move_to(x, y):
-    var x_difference = self.global_position.x - x
-    var y_difference = self.global_position.y - y
-    
-    if abs(x_difference) > chase_speed:
-        if x_difference > 0:
-            self.global_position.x -= chase_speed
-        else:
-            self.global_position.x += chase_speed
-    else:
-        self.global_position.x += x_difference
-
-    if abs(y_difference) > chase_speed:
-        if y_difference > 0:
-            self.global_position.y -= chase_speed
-        else:
-            self.global_position.y += chase_speed
-    else:
-        self.global_position.y += y_difference
-

It could be further abstracted. The logic is repetitive. The math -could be condensed. But should it? Would that make it harder or easier -to understand? And to whom? There is no single answer, and yet I would -really appreciate knowing.

-
- -
-
- -
- diff --git a/posts/void-on-zfs.html b/posts/void-on-zfs.html deleted file mode 100644 index 9792338..0000000 --- a/posts/void-on-zfs.html +++ /dev/null @@ -1,849 +0,0 @@ - - - - - - - - - Void on ZFS • jutty.dev - - - - - - - - -
-
-

Void on ZFS

-
-
-
-

-

June is here. It brings the usual cold weather and some extra -rhinitis complications. With that I find myself in a recovery mood -Sunday, wrapped in a blanket with a mug of tea, a screwdriver, some -notes on paper, a flash drive, a couple of NVMe cards and the trio of -Unix-powered machines that will help me get this done.

-

The mission is to get a root-on-ZFS EFI installation of Void Linux -with ZFSBootMenu on a Dell Latitude 7480.

-

To my left, a ceiling-collapse-survivor Sony VAIO is running NetBSD -with spectrwm. It’s split with sakura and tmux on a terminal to one -side, where Neovim is storing these words, and Firefox on the other, -ready to fetch all the docs. In the middle, the object of today’s -operation. And to my right, a headless PC board runs FreeBSD with ZFS, -holding all the backups needed for the post-install tasks.

-

-

This lengthy post, written not after the fact but during it, is my -way of documenting and also sharing how it all went. Additionally, it’s -a way to delve deeper into many of the things the ZFSBootMenu docs leave -unexplained, an urge I already had yesterday as I just tried it out -without much modification.

-

Last night, I ran through the ZFSBootMenu -documentation guide for Void and followed it both on a VM and then -on an external SATA HDD plugged through a USB case, taking some notes -and getting a general idea of the process.

-

The Void installer does not support ZFS out of the box, so the Void Handbook itself recommends -the ZFSBootMenu documentation before its -own (a manual chroot installation) when it comes to doing a -ZFS-on-root install. This guide from ZFSBootMenu is what we’ll be -following throughout this post.

-

Do note that, while comprehensive, my account is no replacement for -the -original guide. Although more concise, it contains certain notes not -included in this post and covers a larger set of possibilities than I -did here. Some of the code blocks you’ll see here are identical to the -ones from the guide, but many others are specific to how I did things, -so keep that in mind and try things before going with your final -installation.

-

Why Void?

-

I don’t really enjoy distro-hopping. I usually will spend a few years -on the same OS and only switch for good reason and after some thorough -testing. And after some Debian time, I felt interested in trying Void -for a few reasons:

-
    -
  • rolling, but stable
  • -
  • runit init system
  • -
  • BSD-like rc files
  • -
  • BSD-like handbook documentation
  • -
  • numerous, up to date, but stable packages
  • -
-

After trying it, some other features made me settle:

-
    -
  • fast and feature-packed package manager
  • -
  • very fast startup time (kudos to runit)
  • -
  • first-class support in ZFSBootMenu
  • -
-

The Void package manager, xbps, has several -interesting features. One of my favorites, for a taste, is -xbps-query --cat, which shows the original contents of a -given file in a package.

-

For example, -xpbps-query --cat /etc/zfsbootmenu/config.yaml zfsbootmenu -will show you the original content of the config.yaml file -in the zfsbootmenu package. You can use it for very core -packages like base-system or runit-void to -determine the original version of files shipped by them.

-

And why ZFS?

-

My first contact with ZFS was when using FreeBSD, which provides it -as an option in its installer, making it a bit too easy not to try. -Having a server on ZFS means all the data it holds can be safeguarded -and transferred in robust ways, and mistakes are also easier to recover -from.

-

Aside from all the data integrity features and flexibility it brings, -the features that interest me the most are the ones for managing -snapshots.

-

ZFS snapshots allow you to store the filesystem state at a given -point in time, and to compare against, access the content of, and fully -revert to this state. After the guide has been followed throughout, an -extra section at the end of this post has some snapshot basics.

-

Getting in

-

So, first things first, open the machine up and swap the NVMe cards. -For me, that means getting my 128 GB NVMe stick, which I use basically -for tests, and replace it with the 256 GB one which currently has Debian -on it. Yes, I get by just fine with that much.

-

While a bit dusty, the machine was overall in good state. The release -date for the model is 2017, which for my computing standards is very -recent.

-

It has a single NVMe slot, one 16 GB RAM stick and one unused RAM -slot. If you look closely, you can notice a dent on the vent tube -connecting the cooler to the CPU. Despite this, it very rarely heats -up.

-

-

Next up is to boot up hrmpf in EFI -mode.

-

hrmpf is a Void-based rescue system maintained by a Void team member -and distributed as a bootable image that can accomplish many things, -some of them being a full Void installation, entering a proper chroot, -and being ZFS-ready with the needed drivers and tools.

-

Once booted into it, EFI support can be confirmed by filtering the -output of dmesg:

-
dmesg | grep -i efivars
-

The output should contain “Registered efivars operations”.

-

Make sure you have an Internet connection at this point. Most of the -following steps will run fine without one, but closer to the end, when -installing the Void base system, it will all go to waste if we can’t -reach a package mirror.

-

Setting up the -installation environment

-

The ZFSBootMenu guide uses some variables in order to avoid mistakes -and make the instructions more portable across the different storage -types and supported operating systems.

-

/etc/os-release

-

The /etc/os-release file typically contains information -on the operating system you are running.

-

In the hrmpf live system, these are its contents:

-
NAME="Void"
-ID="void"
-PRETTY_NAME="Void Linux"
-HOME_URL="https://voidlinux.org/"
-DOCUMENTATION="https://docs.voidlinux.org/"
-LOGO="void-logo"
-ANSI_COLOR="0;38;2;71;128;97"
-
-DISTRIB_ID="void
-

For comparison, here is FreeBSD’s os-release file:

-
NAME=FreeBSD
-VERSION="14.0-RELEASE"
-VERSION_ID="14.0"
-ID=freebsd
-ANSI_COLOR="0;31"
-PRETTY_NAME="FreeBSD 14.0-RELEASE"
-CPE_NAME="cpe:/o:freebsd:freebsd:14.0"
-HOME_URL="https://FreeBSD.org/"
-BUG_REPORT_URL="https://bugs.FreeBSD.org/"
-

In contrast, NetBSD has no such file.

-

For the purposes of the ZFSBootMenu guide, only the $ID -value appears to be used. And because the file already is structured as -shell-compatible variable assignments, we just source it:

-
source /etc/os-release
-export ID
-

hostid

-

Required by ZFS intallations, a host ID is a 32-bit hexadecimal value -that, supposedly, will uniquely identify a machine. Considering the -number of existing machines and the 32-bit range, you might guess why I -say supposedly.

-

If your machine has the hostid utilities, you can see -the host ID by simply running hostid. Prior to generation, -my hrmpf live system reports 00000000.

-

It can’t provide a real guarantee that it will be unique, so it’s up -to you to take care that it is unique among your machines. Read -on for why that’s hardly an issue.

-

From the gethostid(3) man page:

-
-

[…] a unique 32-bit identifier for the current machine. The 32-bit -identifier was intended to be unique among all UNIX systems in -existence. This normally resembles the Internet address for the local -machine, as returned by gethostbyname(3), and thus usually -never needs to be set.

-
-

This seems to be more or less a legacy feature. In Void’s man page -for gethostid(3), you see this in the history section:

-
-

4.2BSD; dropped in 4.4BSD. SVr4 and POSIX.1-2001 include gethostid() -but not sethostid().

-
-

Still, it is something that OpenZFS requires to be set:

-
-

At time of import or creation, the pool stores the system’s unique -host ID and for the purposes of supporting multipath, import into other -systems will fail unless forced.

OpenZFS -docs, Introduction to ZFS: Storage pools

-
-

zgenhostid, which is shipped by OpenZFS, according to -its man page “emulates the genhostid(1) utility and is -provided for use on systems which do not include the utility or do not -provide the sethostid(3) function.”

-

When used without arguments, these commands will generate a random -host ID. But they can also be passed a hexadecimal value, which gets -stored by default in /etc/hostid unless another path is -given with -o.

-

Considering this information, it threw me off a bit that the -ZFSBootMenu guide tells you to specify an arbitrary host ID rather than -generate a random one:

-
zgenhostid -f 0x00bab10c
-

If they must be unique, that seems odd.

-

The value 0x00bab10c actually has significance in the -context of OpenZFS as an identifier (and leetspeak) for its uberblock. -However, it apparently is totally unrelated to host IDs.

-

Should you be curious still, you can refer to this -GitHub discussion where a ZFSBootMenu user brought this exact -question to the developers.

-

According to the answer given above, the uniqueness of host IDs is -useful for “multipathed SAS enclosures with two discrete head unis -attached”, which is an enterprise-grade storage solution.

-

The value 0x00bab10c is indeed unrelated and chosen for -easy identification. Any value may be used, but when using the pre-built -ZFSBootMenu images it may make the process slightly slower (around -250ms) as ZFSBootMenu will have to “discover the hostid every boot”.

-

Disk variables

-

Here too, the ZFSBootMenu guide works -with a set of variables to make it easier covering different -possible storage types:

-
    -
  • BOOT_DISK, BOOT_PART and -BOOT_DEVICE
  • -
  • POOL_DISK, POOL_PART and -POOL_DEVICE
  • -
-

My target device is an NVMe at nvme0n1, so I’ll -have:

-
    -
  • BOOT_DISK="/dev/nvme0n1"
  • -
  • BOOT_PART="1"
  • -
  • BOOT_DEVICE="${BOOT_DISK}p${BOOT_PART}" -
      -
    • which evaluates to /dev/nvme0n1p1
    • -
  • -
  • POOL_DISK="/dev/nvme0n1"
  • -
  • POOL_PART="2"
  • -
  • POOL_DEVICE="${POOL_DISK}p${POOL_PART}" -
      -
    • which evaluates to /dev/nvme0n1p2
    • -
  • -
-

While this may seem silly at first, it allows using the values -separately in the next steps. It also makes the docs a lot more concise -while covering several possible disk setups.

-

Confirming the environment -setup

-

At this point, we should be able to print something like this in our -environment:

-
# env | grep ID
-ID=void
-# hostid
-00bab10c
-# echo $BOOT_DEVICE
-/dev/nvme0n1p1
-# echo $POOL_DEVICE
-/dev/nvme0n1p2
-

Take care to keep this same environment for all the next steps as -they depend on it. For instance, the hrmpf live system ships tmux. While -that is great and I have used it throughout, you must be careful to use -a single pane for all the actual steps, and the other panes just for -secondary things like looking up man pages or checking file -contents.

-

Filesystem setup

-

Wiping

-

The first step is to clear the current ZFS label information from the -device:

-
zpool labelclear -f "$POOL_DISK"
-

The -f option will “treat exported or foreign devices as -inactive”, per the man page.

-

This step fails consistenly for me, which I assume is because the -previous filesystem was not ZFS to begin with.

-

Next, we will use wipefs to erase the current filesystem -signature.

-

This command is not ZFS-specific, but part of the kernel utilities. -It does not erase the filesystems themselves, nor their content, but the -signatures that aid in their detection.

-

Without any options, it will list all the filesystems that are still -visible:

-
# wipefs "$BOOT_DISK"
-DEVICE  OFFSET          TYPE    UUID    LABEL
-nvme0n1 0x200           gpt
-nvme0n1 0x3d9e655e00    gpt
-nvme0n1 0x1fe           PMBR
-

The -a option is for erasing all signatures. This means -it will “scan the device again after each modification until no magic -string [signature] is found”, as per its man page.

-

In my case:

-
wipefs -a "$POOL_DISK"
-wipefs -a "$BOOT_DISK"
-

Along the guide, commands are sometimes repeated for both -$POOL_DISK and $BOOT_DISK. If you are using -the same disk for both, this may be redundant, although also -harmless.

-

This is my case, so I am not typically running it twice. I’ll still -leave it as is however, so as not to mislead the reader.

-

Now, when listing the signatures again with -wipefs "$BOOT_DISK", there should be no output.

-

Finally, the current MBR and GPT tables must be destroyed. For this, -the ZFSBootMenu guide uses sgdisk. This is also not -ZFS-specific.

-
sgdisk --zap-all "$POOL_DISK"
-sgdisk --zap-all "$BOOT_DISK"
-

The --zap-all option contrasts with --zap -in that it will destroy both MBR and GPT partition tables.

-

Partitioning

-

In the ZFSBootMenu guide, sgdisk is used again for -creating the partitions:

-
sgdisk \
-    -n "${BOOT_PART}:1m:+512m" \
-    -t "${BOOT_PART}:ef00" "$BOOT_DISK"
-
-sgdisk \
-    -n "${POOL_PART}:0:-10m" \
-    -t "${POOL_PART}:bf00" "$POOL_DISK"
-

In the commands above, option -n is short for ---new, and is specifying the start and end sectors by using -relative kibibyte measures. The format is ---new partnum:start:end.

-

Breaking it down:

-
    -
  • 1m 1 mebibyte from the start of the disk
  • -
  • +512m 512 mebibytes after the default start sector
  • -
  • -10m 10 mebibytes before the last available sector
  • -
  • 0 the default value
  • -
-

In the list above, “default” is “the start of the largest available -block for the start sector and the end of the same block for the end -sector”, as per the sgdisk man page.

-

1:1m:+512m, therefore, means that partition 1 will start -1 mebibyte from the start of the disk and end 512 mebibytes after the -start of the largest available block.

-

2:0:-10m, in turn, means partition 2 will begin at the -start of the largest available block and end 10 mebibytes before the -last available sector.

-

Option -t is for setting the typecode for each -partition. Typecode ef00 is for the EFI system partition, -and typecode bf00 is for “Solaris root”, the Unix system -upon whose ZFS implementation OpenZFS was based.

-

For a list of typecodes, see sgdisk -L.

-

While just running these commands as-is is your safest option, you -might have a different layout in mind or prefer an interactive UI.

-

For one thing, I’ve had issues in the past with the boot partition -being too small, so I’ll be using 2g instead of -512m for it.

-

sgdisk has a friendlier counterpart named -gdisk, which you can use just by passing it the disk path, -as in gdisk /dev/sda.

-

At this point, you should be safe to try partitioning and going back -to wiping as needed until you are satisfied.

-

When you are done, you can use lsblk to confirm the -results. The following will show you the options just configured:

-
lsblk -o NAME,SIZE,TYPE,PARTTYPENAME
-

Creating the pool

-

This part of the guide was the one that actually made me want to -delve deeper and understand what each option meant.

-

With little knowledge about ZFS still, I wanted to understand -precisely what was happening here, but also what a pool even is and what -its creation meant.

-

Here’s the zpool(8) man page:

-
-

A storage pool is a collection of devices that provides physical -storage and data replication for ZFS datasets. All datasets within a -storage pool share the same space.

-
-

The definition of a dataset is then indicated to be at -zfs(8):

-
-

A dataset is identified by a unique path within the ZFS namespace: -
pool[/component]/component for example: -rpool/var/log

-
-

Here, it’s also explained that a dataset can be a file system, -logical volume, snapshot or bookmark.

-

Further information is also hinted to be found at -zpoolconcepts(7).

-

At this point you start to notice the breadth of knowledge available -in the documentation. The man pages are not only comprehensible, but -sometimes contain several examples on how to apply their concepts. Each -command has their own man page named with a hyphen for separation, as in -zpool-create.

-

We’ll be exploring only the zpool-create(8) command in -depth, in particular the options used in the ZFSBootMenu guide:

-
    -
  • -f force the use of virtual devices, even if they -appear in use
  • -
  • -o feature=value set a pool feature
  • -
  • -O property=value set a file system property in the -root file system of the pool
  • -
  • -o compatibility=off|legacy|file[,file] specify a -compatibility feature set
  • -
  • -m mountpoint the mountpoint (default: -/pool)
  • -
  • pool the pool
  • -
  • vdev the virtual device
  • -
-

The listing with pool features (including compatibility feature sets) -is at zpool-features(7). Pool properties are at -zpoolprops(7) and file system properties at -zfsprops(7).

-

In the guide, these are the options given:

-
zpool create -f \
- -o ashift=12 \
- -O compression=lz4 \
- -O acltype=posixacl \
- -O xattr=sa \
- -O relatime=on \
- -o autotrim=on \
- -o compatibility=openzfs-2.1-linux \
- -m none zroot "$POOL_DEVICE"
-

Among the options above, several pool features and system properties -are set:

-
    -
  • -o ashift=12 “Alignment shift”, used to calculate -physical sector sizes.This is discussed at greater length in the online -documentation on Workload Tuning
  • -
  • -O compression=lz4 Sets the compression algorithm used -(LZ4)
  • -
  • -O acltype=posixacl Whether ACLs are -enabled and what type to use. The value posixacl is -equivalent to posix (default on Linux: off)
  • -
  • -O xattr=sa Enables extended attributes. If value is -on, uses directory-based extended attributes, while -sa uses system-attribute-based. The latter has performance -benefits, and is important for ACLs and SELinux usage
  • -
  • -O relatime=on “Causes the access time to be updated -relative to the modify or change time.” Also, “access time is only -updated if the previous access time was earlier than the current modify -or change time or if the existing access time hasn’t been updated within -the past 24hours”
  • -
  • -o autotrim=on Automatically reclaims unused blocks -from time to time. Can put the filesystem under some stress
  • -
-

The last option, the compatibility feature set, specifies in this -case a relative filename to -/usr/share/zfs/compatibility.d:

-
    -
  • -o compatibility=openzfs-2.1-linux
  • -
-

zpool-create(8) also states:

-
-

By default, all supported features are enabled on the new pool. The --d option and the -o compatibility property -[…] can be used to restrict the features that are enabled, so that the -pool can be imported on other releases of ZFS.

-
-

The compatibility option openzfs-2.1-linux is described -as a “conservative” choice in the ZFSBootMenu guide and in my tests had -little impact, so I decided to not use it for this installation.

-

Creating the filesystems

-

Once the pool is ready, the filesystems can be created.

-

For this task, the zfs command is used with -create:

-
zfs create -o mountpoint=none zroot/ROOT
-zfs create -o mountpoint=/ -o canmount=noauto zroot/ROOT/${ID}
-zfs create -o mountpoint=/home zroot/home
-

The ZFSBootMenu guide explains at this point that if -canmount=noauto is not set on file systems with the -/ mountpoint, the OS will try to mount them all and fail. -It goes on to say:

-
-

Automatic mounting of / is not required because the root file system -is explicitly mounted in the boot process.

-
-

After the filesystems have been created, the boot file system must be -set.

-
zpool set bootfs=zroot/ROOT/${ID} zroot
-

Essentially, this is saying “set zroot’s -bootfs property to zroot/ROOT/void

-

Export, reimport and mount

-

The next steps consist in exporting and then importing the pool with -a given mountpoint.

-
zpool export zroot
-zpool import -N -R /mnt zroot
-

From what I gather, exporting means putting the pool in a more -portable state. According to the zpool-export(8) man page, -“the devices [marked as exported] can be moved between systems […] and -imported as long as a sufficient number of devices are present.”

-

If zfs import is used without any arguments, it will -list the exported pools available to be imported.

-

The -N root option imports the pool without mounting any -of its file systems, the -R option “sets the -cachefile property to none and the -altroot property to root”. In this case, that -root will be /mnt.

-

altroot stands for the alternate root directory. In -zpoolprops(7), this becomes clearer when it is stated that -“this directory is prepended to any mount points within the pool.”

-

Once re-imported, we can mount:

-
zfs mount zroot/ROOT/${ID}
-zfs mount zroot/home
-

And verify that all is mounted correctly with -mount | grep mnt:

-
# mount | grep mnt
-zroot/ROOT/void on /mnt type zfs (rw,relatime,xattr,posixacl,casesensitive)
-zroot/home on /mnt/home type zfs (rw,relatime,xattr,posixacl,casesensitive)
-

Lastly, we request the device events from the kernel to update the -device symlinks:

-
udevadm trigger
-

Setting up Void

-

Installation

-

So far, not much here was Void-specific. This is when we start -bootstrapping the void system into the filesystem we laid out.

-
XBPS_ARCH=x86_64 xbps-install \
-  -S -R https://repo-fastly.voidlinux.org/current \
-  -r /mnt base-system
-

Here, we are passing an environment variable to set the architecture -to x86_64, then use xbps-install from the xbps -package manager to fetch the Void base system.

-

-S takes care of synchronizing the data from the mirror -so that package data is fetched, -R allows us to manually -specify the repository for this run, and -r allows choosing -a different root directory to act upon.

-

Here, I chose the Fastly mirror over the ServerCentral one. Any working mirror should -do.

-

Note that not all mirrors have the same content at the root of their -URL. Some point directly to a Void repo, some don’t. You can access the -mirror in a browser or otherwise inspect it to find the path to the -current directory.

-

With this done, we can copy the host ID file, which will also be -required in our final system, and we are ready to chroot.

-
cp /etc/hostid /mnt/etc
-

chrooting

-

We will chroot into the system mounted at the /mnt -directory using xchroot, which is part of the xbps -xtools package and should already be available on hrmpf. It -provides a more -sane chroot than the plain one, in particular regarding the required -mountpoints:

-
xchroot /mnt
-

This is a good time to get back to the notes I mentioned taking the -day before.

-

-

Reconfiguring packages

-

After chrooting, it may be a good idea to run -xbps-reconfigure to make sure packages are properly -configured. This is because in the bootstrap process some packets may -have tried to configure themselves while relying on directories that -were not mounted anywhere.

-

This is particularly true for dracut, -which is a tool that generates initramfs and initrd images, therefore -being critical to the early boot process. You might see error messages -related to it in your first run of xbps outside of the chroot, when -installing the base system.

-

To reconfigure all packages, just run -xbps-reconfigure -fa. If you’d rather only reconfigure -dracut, go with -xpbs-reconfigure -f dracut.

-

root password

-

As early as possible is a good time to run passwd and -set the root password.

-

rc.conf

-

runit reads the /etc/rc.conf file during -startup to configure the system, setting up things like the keymap, -hardware clock and terminal font.

-

For your reference, here is what I added to mine during the -installation:

-
HARDWARECLOCK="UTC"
-KEYMAP="br-abnt2"
-FONT="ter-120n"
-

Time zone and locale

-

To configure your local time zone, create a symlink at -/etc/localtime that points to the corresponding time zone -in the /usr/share/zoneinfo directory.

-
ln -sf /usr/share/zoneinfo/<timezone> /etc/localtime
-

Unless you are using musl, you also want to set and -generate the glibc locales. Edit -/etc/default/libc-locales and uncomment the desired -locales, then run xbps-reconfigure -f glibc-locales.

-

dracut

-

dracut generates file system images used by the kernel -at the very early stages of boot. We have to make it able to identify -our ZFS root filesystem by enabling the proper modules. This is -accomplished by creating /etc/dracut.conf.d/zol.conf -with:

-
nofsck="yes"
-add_dracutmodules+=" zfs "
-omit_dracutmodules+=" btrfs "
-

Notice the spaces surrounding the module names.

-

Installing and -configuring ZFSBootMenu

-

We are now ready to install both ZFS and ZFSBootMenu. Let’s start -with ZFS:

-
xbps-install -R https://repo-fastly.voidlinux.org/current zfs
-

Now, before installing ZFSBootMenu, we set the kernel commandline. -This is the command line that will be used by the Linux kernel, so any -options you are used to go here.

-

The ZFSBootMenu guide has only the quiet option. In my -case, I added net.ifnames=0 to have the classic -eth0, wlan0 network interface names, and -fbcon=nodefer video=efifb:nobgrt, which prevents the -manufacturer’s logo from showing after boot and sometimes obscuring the -boot process output.

-
zfs set org.zfsbootmenu:commandline="quiet net.ifnames=0 fbcon=nodefer video=efifb:nobgrt" zroot/ROOT
-

We also need a vfat filesystem on our boot device:

-
mkfs.vfat -F32 "$BOOT_DEVICE"
-

Now we can add an /etc/fstab entry pointing to it, and -mount:

-
echo "$(blkid | grep "$BOOT_DEVICE" | cut -d ' ' -f 2) /boot/efi vfat defaults 0 0" >> /etc/fstab
-
-mkdir -p /boot/efi
-mount /boot/efi
-

Into this directory we just mounted, we can now install -ZFSBootMenu.

-

The guide provides two different paths here: a prebuilt image or the -Void package, which you can get through xbps.

-

While there are advantages to both, I decided to go with the prebuilt -image since I’d rather the package manager not touch the boot manager on -updating. This has the downside of you having to take care of being -aware of any relevant versions and when to upgrade to them.

-
xbps-install curl
-mkdir -p /boot/efi/EFI/ZBM
-curl -o /boot/efi/EFI/ZBM/VMLINUZ.EFI -L https://get.zfsbootmenu.org/efi
-cp /boot/efi/EFI/ZBM/VMLINUZ.EFI /boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI
-

If you’d rather use the repository package, see the corresponding -instructions in the guide.

-

Finally, a second choice has to be made between rEFind -or plain efibootmgr for managing the boot entries. I prefer -to go with the simpler one, but you may find rEFind more -feature-packed.

-

First, install efibootmgr using -xbps-install efibootmgr, then run the following -commands:

-
efibootmgr -c -d "$BOOT_DISK" -p "$BOOT_PART" \
-  -L "ZFSBootMenu (Backup)" \
-  -l '\EFI\ZBM\VMLINUZ-BACKUP.EFI'
-
-efibootmgr -c -d "$BOOT_DISK" -p "$BOOT_PART" \
-  -L "ZFSBootMenu" \
-  -l '\EFI\ZBM\VMLINUZ.EFI'
-

If you’d prefer to use rEFInd, see the guide’s -relevant section.

-

zbm-kcl is mentioned here in passing. This utility -allows you, among other things, to set ZFSBootMenu options, such as the -delay before automatically booting. I am not sure if it comes included -with the ZFSBootMenu package, as I went for the pre-built image, but you -can nonetheless get it from GitHub:

-
curl -O https://raw.githubusercontent.com/zbm-dev/zfsbootmenu/master/bin/zbm-kcl
-chmod +x zbm-kcl
-

Now, if you want to change an option, you can use its -a -option to append an argument to the target image’s command line:

-
zbm-kcl -a 'zbm.timeout=2' /boot/efi/EFI/ZBM/VMLINUZ.EFI
-

In the example above, the timeout before automatically booting is set -from its 10 seconds default to 2 seconds.

-

Getting out

-

We are all done. It’s time to exit the chroot, unmount and export the -pool.

-
exit
-umount -n -R /mnt
-zpool export zroot
-

If all above went well, we can now run reboot, remove -the flash drive used for installation, and log in for the first time -into our new system.

-

ZFS snapshot basics

-

Something you might want to do at this point is to take a snapshot of -the current state, since it can serve as a baseline before any further -tweaking, allowing you to go back or access the files in this state as -you make important changes that could potentially break the system.

-
zfs snapshot -r zroot/ROOT/void@baseline
-

Note that, if you followed the ZFSBootMenu guide in creating a -separate dataset for your home directory, this snapshot will not include -the contents inside and under /home (which at this point -should be empty anyways).

-

You can access the contents of a snapshot at any time in the -.zfs directory at the root of a given dataset. For the ones -we previously set up, those would be /.zfs and -/home/.zfs. Note that these directories are not only hidden -in the traditional way, but they won’t show up even if you use -ls -a. You need to actually cd into the -apparently absent directory for it to work.

-

ZFS snapshots start taking virtually no space at all, but grow with -time as the snapshot drifts from the present system state. For that -reason, keeping a snapshot of the very first moment of your system can -take up significant space. Depending on your storage resources, you -might eventually decide to destroy this snapshot:

-
zfs destroy -r zroot/ROOT/void@baseline
-

You may also want to list your current snapshots. While typically you -can use zfs list -t snap, I tend to use the following -command in order to get more relevant output:

-
zfs list -t snap -o creation,name,used,written,referenced,refcompressratio -S creation
-

Finally, you might want to rename a snapshot:

-
zfs rename -r zroot/ROOT/void@baseline @day0
-

Combined, these commands can get you as far as an automatic, rolling -snapshot system. Say, for instance you add the following to -rc.local:

-
zfs destroy -r zroot/ROOT/void@fallbackBoot
-zfs rename -r zroot/ROOT/void@previousBoot @fallbackBoot
-zfs rename -r zroot/ROOT/void@currentBoot @previousBoot
-zfs snapshot -r zroot/ROOT/void@currentBoot
-

This would give you a per-boot snapshot trail to rely on.

-

The zfs-snapshot(8) man page provides a similar example -for daily snapshots. Considering how simple the zfs CLI is, scripting -several snapshot schemes can be quite easy, be them per boot, daily, or -even every so many minutes using cron. Because ZFS snapshots grow as -they drift from the present state, rotating them is optimal when storage -space is a concern.

-

That’s it! I hope this was helpful to you in either learning about -ZFS or about Void installations with Root on ZFS.

-
-

Originally written June 2nd, 2024

-
- -
-
- -
- diff --git a/posts/watch.sh b/posts/watch.sh deleted file mode 100755 index 60fef90..0000000 --- a/posts/watch.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -while true; do - ./gen.ml - echo - inotifywait -e modify -r md -done diff --git a/CNAME b/static/CNAME similarity index 100% rename from CNAME rename to static/CNAME diff --git a/static/assets/css/style.css b/static/assets/css/style.css new file mode 100644 index 0000000..db8b4de --- /dev/null +++ b/static/assets/css/style.css @@ -0,0 +1,288 @@ +@font-face { + font-family: 'Mononoki'; + src: url('../fonts/Mononoki.ttf'), format('truetype'); +} + +#theme { + background-color: #f1e9e5; + color: #222; +} + +html { + font-family: 'Mononoki', monospace; +} + +* { margin: 0px; } + +.header-art { + color: #888 +} + +#user-controls { + display: grid; + grid-template-columns: 8fr 1fr; + margin-top: 25px; +} + +nav { + justify-self: start; +} + +#language-selector { + justify-self: end; + margin-top: 7px; + margin-right: 20px; +} + +#nav-menu #home { + color: #353; + text-decoration: none; + font-weight: bold; +} + +#nav-menu li { + display: inline-block; + margin-left: 20px; +} + +#skip-to-main { + position: absolute; + left: -1000%; +} + +#skip-to-main:focus { + left: 40%; + background-color: #333; + padding: 10px; +} + +#posts { + margin-left: 20px; + margin-top: 20px; + font-size: 18px; +} + +.index-posts h2 { + margin-top: 80px; +} + +ul { + margin-top: 5px; + list-style: none; +} + +ol { + margin-top: 5px; + margin-left: 30px; +} + +li { + margin-bottom: 10px; + line-height: 1.5em; +} + +ul li:before { + content: "▫"; + padding-right: 10px; +} + +nav ul li:before { + content: ""; + padding-right: 0px; +} + +p { + margin: 30px; + line-height: 1.7em; +} + +a { + text-decoration: underline dotted #999; + text-decoration-thickness: 1.5px; + color: #276E6B; +} + +a:hover { + color: #007F80; + text-decoration: underline dotted #39959A; + transition: 1500ms; +} + +h1 { + font-size: 25px; + font-weight: bold; + color: #444; + margin: 40px 0px 10px 0px; +} + +h2,h3,h4 { + font-weight: bold; + margin: 20px 0px 10px 30px; + color: #444; +} + +h2 { font-size: 25px; } +h3 { font-size: 21px; } +h4 { font-size: 21px; color: #59978b; } + +.article p { + margin: 25px 0px; +} + +img { + width: 100%; +} + +p code { + background-color: #ccc; + padding: 5px 6.5px; + margin-right: 2px; + border-radius: 6px; + font-size: 14px; +} + +li code { + background-color: #ccc; + padding: 5px 8px; + border-radius: 6px; + font-size: 14px; +} + +blockquote { + color: #333; + background-color: #ddd; + padding: 10px 10px; + margin: 10px 20px; + font-style: italic; + border-radius: 12px; +} + +main pre { + margin: 30px; + border-color: #fff; + padding: 20px; + font-size: 16px; +} + +blockquote p code { + color: #222; +} + +table { + text-align: center; + margin: 30px; + border: 1px solid; + border-collapse: collapse; +} + +table th, td { + border: 1px dotted; + padding: 5px 10px; +} + +footer { + margin-top: 40px; +} + +.footer-text { + padding: 20px 20px; +} + +.footer-back { + float: right; +} + +/* tablet */ +@media (min-width: 401px) { + .article { + margin: 0 45px; + } + + h1 { + margin-left: 30px; + } +} + +.post-date { + color: #777; + font-size: 14px; + margin-top: 0px; + text-decoration-thickness: 0.1px; +} + +@media (prefers-color-scheme: dark) { + #theme { + background-color: #222222; + color: #F1E9E5; + } + + a { + color: #AEDBCE; + } + + a:hover { + color: #39AEA9; + } + + h1,h2,h3 { + color: #ccc; + } + + h4 { + color: #6a978b; + } + + p code { + background-color: #444; + } + + li code { + background-color: #444; + } + + blockquote { + color: #888; + background-color: #1b1b1b; + } + + blockquote p code { + color: #bbb; + } + + .post-date { + color: #888; + } + + #nav-menu #home { + color: #aaa; + } +} + +/* widescreen */ +@media (min-width: 1000px) { + .article { + margin: 0 20%; + } + + h1 { + margin-left: 30px; + } +} + +/* fullscreen */ +@media (min-width: 1500px) { + .article { + margin: 0 30%; + } + + h1 { + margin-left: 30px; + } +} + +/* phone */ +@media (max-width: 400px) { + .article { + margin: 0 20px; + } +} diff --git a/static/assets/css/syntax-dark.css b/static/assets/css/syntax-dark.css new file mode 100644 index 0000000..d4fa8cf --- /dev/null +++ b/static/assets/css/syntax-dark.css @@ -0,0 +1,265 @@ +/* + * theme "Material-Theme-Darker" generated by syntect + */ + +.z-code { + color: #eeffff; + background-color: #292929; +} + +.z-comment, .z-punctuation.z-definition.z-comment { + color: #7f7f7f; +font-style: italic; +} +.z-variable, .z-string .z-constant.z-other.z-placeholder { + color: #eeffff; +} +.z-constant.z-other.z-color { + color: #ffffff; +} +.z-invalid, .z-invalid.z-illegal, .z-invalid.z-broken { + color: #ffffff; + background-color: #ff5370; +} +.z-invalid.z-unimplemented { + color: #ffffff; + background-color: #aacaba; +} +.z-invalid.z-deprecated { + color: #ffffff; + background-color: #c792ea; +} +.z-keyword, .z-storage.z-type, .z-storage.z-modifier { + color: #c792ea; +} +.z-storage.z-type, .z-keyword.z-control { +font-style: italic; +} +.z-keyword.z-operator, .z-constant.z-other.z-color, .z-punctuation, .z-meta.z-tag, .z-punctuation.z-definition.z-tag, .z-punctuation.z-separator.z-inheritance.z-php, .z-punctuation.z-definition.z-tag.z-html, .z-punctuation.z-definition.z-tag.z-begin.z-html, .z-punctuation.z-definition.z-tag.z-end.z-html, .z-punctuation.z-section.z-embedded, .z-keyword.z-other.z-template, .z-keyword.z-other.z-substitution { + color: #aaaaff; +} +.z-entity.z-name.z-tag, .z-meta.z-tag.z-sgml, .z-markup.z-deleted.z-git_gutter { + color: #f07178; +} +.z-entity.z-name.z-function, .z-meta.z-function-call, .z-variable.z-function, .z-support.z-function, .z-keyword.z-other.z-special-method, .z-meta.z-block-level { + color: #aaaaaf; +} +.z-support.z-other.z-variable, .z-string.z-other.z-link { + color: #f07178; +} +.z-constant.z-numeric, .z-constant.z-language, .z-support.z-constant, .z-constant.z-character, .z-variable.z-parameter, .z-keyword.z-other.z-unit { + color: #6f67fe; +} +.z-string, .z-constant.z-other.z-symbol, .z-constant.z-other.z-key, .z-entity.z-other.z-inherited-class, .z-markup.z-heading, .z-markup.z-inserted.z-git_gutter, .z-meta.z-group.z-braces.z-curly .z-constant.z-other.z-object.z-key.z-js .z-string.z-unquoted.z-label.z-js { + color: #aacaba; +} +.z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class, .z-support.z-type, .z-support.z-class, .z-support.z-orther.z-namespace.z-use.z-php, .z-meta.z-use.z-php, .z-support.z-other.z-namespace.z-php, .z-markup.z-changed.z-git_gutter, .z-support.z-type.z-sys-types { + color: #ffcb6b; +} +.z-source.z-css .z-support.z-type, .z-source.z-sass .z-support.z-type, .z-source.z-scss .z-support.z-type, .z-source.z-less .z-support.z-type, .z-source.z-stylus .z-support.z-type { + color: #b2ccd6; +} +.z-entity.z-name.z-module.z-js, .z-variable.z-import.z-parameter.z-js, .z-variable.z-other.z-class.z-js { + color: #ff5370; +} +.z-variable.z-language { + color: #ff5370; +font-style: italic; +} +.z-entity.z-name.z-method.z-js { + color: #82aaff; +} +.z-meta.z-class-method.z-js .z-entity.z-name.z-function.z-js, .z-variable.z-function.z-constructor { + color: #82aaff; +} +.z-entity.z-other.z-attribute-name { + color: #c792ea; +} +.z-text.z-html.z-basic .z-entity.z-other.z-attribute-name.z-html, .z-text.z-html.z-basic .z-entity.z-other.z-attribute-name { + color: #ffcb6b; +font-style: italic; +} +.z-entity.z-other.z-attribute-name.z-class { + color: #ffcb6b; +} +.z-source.z-sass .z-keyword.z-control { + color: #82aaff; +} +.z-markup.z-inserted { + color: #aacaba; +} +.z-markup.z-deleted { + color: #ff5370; +} +.z-markup.z-changed { + color: #c792ea; +} +.z-string.z-regexp { + color: #89ddff; +} +.z-constant.z-character.z-escape { + color: #89ddff; +} +.z-*url*, .z-*link*, .z-*uri* { +text-decoration: underline; +} +.z-constant.z-numeric.z-line-number.z-find-in-files { + color: #c17e70; +} +.z-entity.z-name.z-filename.z-find-in-files { + color: #aacaba; +} +.z-tag.z-decorator.z-js .z-entity.z-name.z-tag.z-js, .z-tag.z-decorator.z-js .z-punctuation.z-definition.z-tag.z-js { + color: #82aaff; +font-style: italic; +} +.z-source.z-js .z-constant.z-other.z-object.z-key.z-js .z-string.z-unquoted.z-label.z-js { + color: #ff5370; +font-style: italic; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #aacaba; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #c792ea; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #f07178; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #82aaff; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #c17e70; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #ff5370; +} +.z-source.z-json .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #f78c6c; +} +.z-source.z-json .z-meta .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #ffcb6b; +} +.z-source.z-json .z-meta.z-structure.z-dictionary.z-json .z-string.z-quoted.z-double.z-json, .z-source.z-json .z-meta.z-structure.z-dictionary.z-json .z-punctuation.z-definition.z-string { + color: #c792ea; +} +.z-text.z-html.z-markdown, .z-punctuation.z-definition.z-list_item.z-markdown { + color: #eeffff; +} +.z-text.z-html.z-markdown .z-markup.z-raw.z-inline { + color: #c792ea; +} +.z-text.z-html.z-markdown .z-punctuation.z-definition.z-raw.z-markdown { + color: #65737e; +} +.z-markdown.z-heading, .z-markup.z-heading, .z-markup.z-heading .z-entity.z-name, .z-markup.z-heading.z-markdown .z-punctuation.z-definition.z-heading.z-markdown { + color: #aacaba; +} +.z-markup.z-italic { + color: #f07178; +font-style: italic; +} +.z-markup.z-bold, .z-markup.z-bold .z-string { + color: #f07178; +font-weight: bold; +} +.z-markup.z-bold .z-markup.z-italic, .z-markup.z-italic .z-markup.z-bold, .z-markup.z-quote .z-markup.z-bold, .z-markup.z-bold .z-markup.z-italic .z-string, .z-markup.z-italic .z-markup.z-bold .z-string, .z-markup.z-quote .z-markup.z-bold .z-string { +font-weight: bold; +font-style: italic; +} +.z-markup.z-underline { + color: #f78c6c; +text-decoration: underline; +} +.z-markup.z-quote .z-punctuation.z-definition.z-blockquote.z-markdown { + color: #65737e; + background-color: #65737e; +} +.z-string.z-other.z-link.z-title.z-markdown { + color: #82aaff; +} +.z-string.z-other.z-link.z-description.z-title.z-markdown { + color: #c792ea; +} +.z-constant.z-other.z-reference.z-link.z-markdown { + color: #ffcb6b; +} +.z-markup.z-raw.z-block { + color: #c792ea; +} +.z-markup.z-raw.z-block.z-fenced.z-markdown { + background-color: #000000; +} +.z-punctuation.z-definition.z-fenced.z-markdown { + background-color: #000000; +} +.z-markup.z-raw.z-block.z-fenced.z-markdown, .z-variable.z-language.z-fenced.z-markdown, .z-punctuation.z-section.z-class.z-end { + color: #eeffff; +} +.z-variable.z-language.z-fenced.z-markdown { + color: #65737e; +} +.z-text.z-html.z-markdown .z-punctuation.z-definition { + color: #4a4a4a; +} +.z-text.z-html.z-markdown .z-meta.z-disable-markdown .z-punctuation.z-definition { + color: #89ddff; +} +.z-meta.z-separator { + color: #65737e; + background-color: #000000; +font-weight: bold; +} +.z-acejump.z-label.z-blue { + color: #ffffff; + background-color: #82aaff; +} +.z-acejump.z-label.z-green { + color: #ffffff; + background-color: #aacaba; +} +.z-acejump.z-label.z-orange { + color: #ffffff; + background-color: #f78c6c; +} +.z-acejump.z-label.z-purple { + color: #ffffff; + background-color: #c792ea; +} +.z-sublimelinter.z-mark.z-warning { + color: #ffcb6b; +} +.z-sublimelinter.z-gutter-mark { + color: #ffffff; +} +.z-sublimelinter.z-mark.z-error { + color: #ff5370; +} +.z-sublimelinter.z-annotations { + background-color: #c17e70; +} +.z-markup.z-ignored.z-git_gutter { + color: #65737e; +} +.z-markup.z-untracked.z-git_gutter { + color: #65737e; +} +.z-markup.z-inserted.z-git_gutter { + color: #aacaba; +} +.z-markup.z-changed.z-git_gutter { + color: #ffcb6b; +} +.z-markup.z-deleted.z-git_gutter { + color: #ff5370; +} +.z-brackethighlighter.z-default { + color: #b2ccd6; +} +.z-brackethighlighter.z-quote { + color: #aacaba; +} +.z-brackethighlighter.z-unmatched { + color: #ff5370; +} diff --git a/static/assets/css/syntax-light.css b/static/assets/css/syntax-light.css new file mode 100644 index 0000000..a82a91c --- /dev/null +++ b/static/assets/css/syntax-light.css @@ -0,0 +1,61 @@ +/* + * theme "Dimmed Fluid" generated by syntect + */ + +.z-code { + color: #4d4d4c; + background-color: #ffffff; +} + +.z-comment { + color: #999999; +} +.z-keyword.z-operator.z-class, .z-constant.z-other, .z-source.z-php.z-embedded.z-line { + color: #666666; +} +.z-variable, .z-support.z-other.z-variable, .z-string.z-other.z-link, .z-string.z-regexp, .z-entity.z-name.z-tag, .z-entity.z-other.z-attribute-name, .z-meta.z-tag, .z-declaration.z-tag { + color: #77c; +} +.z-constant.z-numeric, .z-constant.z-language, .z-support.z-constant, .z-constant.z-character, .z-variable.z-parameter, .z-punctuation.z-section.z-embedded, .z-keyword.z-other.z-unit { + color: #b77; +} +.z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class, .z-support.z-type, .z-support.z-class { + color: #f0ae00; +} +.z-string, .z-constant.z-other.z-symbol, .z-entity.z-other.z-inherited-class, .z-markup.z-heading { + color: #699200; +} +.z-keyword.z-operator, .z-constant.z-other.z-color { + color: #1aa7b0; +} +.z-entity.z-name.z-function, .z-meta.z-function-call, .z-support.z-function, .z-keyword.z-other.z-special-method, .z-meta.z-block-level { + color: #777; +} +.z-keyword, .z-storage, .z-storage.z-type { + color: #8e44be; +} +.z-meta.z-separator { + color: #ffffff; + background-color: #2169c7; +} +.z-invalid.z-deprecated { + color: #ffffff; + background-color: #8e44be; +} +.z-markup.z-inserted.z-diff, .z-markup.z-deleted.z-diff, .z-meta.z-diff.z-header.z-to-file, .z-meta.z-diff.z-header.z-from-file { + color: #ffffff; +} +.z-markup.z-inserted.z-diff, .z-meta.z-diff.z-header.z-to-file { + background-color: #008f00; +} +.z-markup.z-deleted.z-diff, .z-meta.z-diff.z-header.z-from-file { + background-color: #ef0000; +} +.z-meta.z-diff.z-header.z-from-file, .z-meta.z-diff.z-header.z-to-file { + color: #ffffff; + background-color: #333333; +} +.z-meta.z-diff.z-range { + color: #333333; +font-style: italic; +} diff --git a/assets/css/Mononoki.LICENSE b/static/assets/fonts/Mononoki.LICENSE similarity index 100% rename from assets/css/Mononoki.LICENSE rename to static/assets/fonts/Mononoki.LICENSE diff --git a/assets/css/Mononoki.ttf b/static/assets/fonts/Mononoki.ttf similarity index 100% rename from assets/css/Mononoki.ttf rename to static/assets/fonts/Mononoki.ttf diff --git a/static/assets/img/icon/icon.svg b/static/assets/img/icon/icon.svg new file mode 100644 index 0000000..868bf31 --- /dev/null +++ b/static/assets/img/icon/icon.svg @@ -0,0 +1,51 @@ + + + + + + + diff --git a/static/assets/img/icon/icon_16.png b/static/assets/img/icon/icon_16.png new file mode 100644 index 0000000000000000000000000000000000000000..986c844f945c10d3c67160fa1b5f49e42e976f83 GIT binary patch literal 449 zcmV;y0Y3hTP)h13?gmpV>Ps0!ab_3?Bjnfq)@}U=TG8p=l|aAQAis42~3qxHgAIAW$eE zd?a89njpa-X?ic>uGcFR5>mmanVo0eo!y-^N%Uf_r)t1&ITi%Nc-{uiovT>9=muLD z&Lib$HfyR>o;w8aydz+VD8j<<1ULoylk7XNij{}Xbx!F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Kv2`ysze%8cU# zeIFonZ~5Lt#DQ1@anHc$ta#;UEUohXLoM?Lhi?Od9#0*_063&N^TqCWa=0MAiyZcf zIX3~jJmWZmQ#rCr+fC{<>b%>;X&E(QLcBB~jn=`-n(lKA(*JOL9JdEKOYiKu{TLOo zi`mlG`Bxf|fxp1uyAo!8wg$($Ym_Bp0Yp^1dxi1**Nst>@In8~Z915q%wqb||7<1p eclEY#Mg9qgVw>w;NG0tL0X=P~R-K0Z>;D5SStw-y literal 0 HcmV?d00001 diff --git a/static/assets/img/icon/icon_260.png b/static/assets/img/icon/icon_260.png new file mode 100644 index 0000000000000000000000000000000000000000..bbb5069245fab1624c5ecfc7c59b800771b178b9 GIT binary patch literal 7246 zcmdUUS6I_Q({F&#TSAR=LPrGwDI$nKkdBlnDj>Z{54{KJ(hNmFn)D(>5m6&mL3)uA zdQ*BRp$JGnf8Y09p4;<0-*>S$JG=YL%+CJiH?#4E2AcFV95f&hh+bO@VGIJ1fd36D z3See{O6Q+|+EeSXHweUi{%?@%BpNgWlUIB+9{HGfIQaNmqwGQc{{9lq?k?W8)}Hnf z9w^70Z6yv6h;v#Sp^6O1-I@(dH@DBb+&wya=r0lxrF_jA%5N<~RgAtt26cq(Qoc~k z@R=nfOWADjKU8&bw#xS6@`wBuatuH$WX(OYhZgbVOA{ z5~cXBf^GG>XuiRiKm1RhDij_kDH8r+L%Y0(so;rRl@;P3eN%$_fp z+SLt;S1e8l^OwAJ34gvoG*sppoTkLjMmQ|ES;_9u?2uNaK*1?4!KaGl5dy+hNtX?L z`>RBRZm-?~-2z$bVOzlI)w|Fy7NM6z3VYdhX==Y9NXJ4&T8w(^?ikY!=K@bqFs)+n z;cymwOkbV-`L#!$;L1^m&Ra#*v-wlKGIZo`t#gGM1hRL$kG_hI_nlZ0M_`L9*MqLcbjZD-k{~~P+a?@r zbk27DdZx3YMOE7&eCS3r-~Nie&DmcfnKNaMC2dHo@%pno8OQp_tsIVnJUe&tW;(7l zzVF1H#*d#qHE&u?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VVac_nsyqy zk>Y94N&27)UuZ+%l3d-MUeMeN*X74!^q7X#Xik tCFl`9%vR0sxc7g-FVz3z!>sU<1jek1NO7KC1pWd++8PE3teVyH{{xb2u7dyo literal 0 HcmV?d00001 diff --git a/static/assets/img/icon/icon_32.png b/static/assets/img/icon/icon_32.png new file mode 100644 index 0000000000000000000000000000000000000000..646db4a4ef35125f81e86ca6c8007aa931d5e243 GIT binary patch literal 845 zcmV-T1G4;yP)j$s(bf7iXeBSuDIwF3_3BU-*rl+ObxXJmMucU!_HDF;G1kS66LDJ6wS znfHBt#DOCpWhY7$n;mIQPOR)mm@VEte+Q3gvwM4AY)$b$db;oH`v3nu*Zo}g^_V0^ z6K+)1{~O3g z1C~y2Lc0D_oRDr}c2HsXI*0HKqUac~8L<8=N-CL5^Y0b6(ISrI}lVdnwk!QUav(h2*Vn|bbgrkbT(17%51ob}THemK- z#N<8P0}T`wo&lbZfOs?A-KTRK=;T%0X@cd2yVcgQoew(e!ttc{+#q8C-Pwx%gBKLPCX?DqhT zNEhksysf&ruSO~rAe{ut1|jW>55UA>hyiFv+F!ti4VQqqKsRRBi0eC;nK6ByUjb(^ zdxSI{v#Fk#pYaU156l53{?XM;0g`?k`!))+q=cK;O@>pkM-!z^obPmLV+%-VB5I8=PB-b4!U^d?8U(+`HMo z1Pu+Pw6(p{;lmMtUAZ!rqN1I|HLmzY;TELJ6cwFUWn~wD)z>>_&MZ|;&0DX5p + + + jutty.dev + http://blog.jutty.dev + Just computer nerd things + en + + Sun, 18 Aug 2024 00:00:00 +0000 + + The jutty.dev feed has moved + Sun, 18 Aug 2024 15:52:11 +0000 + Juno Takano + http://blog.jutty.dev/en/rss.xml + http://blog.jutty.dev/en/rss.xml + This RSS feed has moved to: blog.jutty.dev/rss.xml. More feed options are available at blog.jutty.dev/feeds. Update your RSS reader to continue receiving new entries. + + + diff --git a/static/assets/rss/pt.rss b/static/assets/rss/pt.rss new file mode 100644 index 0000000..49ddfd3 --- /dev/null +++ b/static/assets/rss/pt.rss @@ -0,0 +1,19 @@ + + + + jutty.dev + http://blog.jutty.dev + Nerdices, unix, computarias + pt + + Sun, 18 Aug 2024 00:00:00 +0000 + + O feed para jutty.dev mudou + Sun, 18 Aug 2024 15:52:11 +0000 + Juno Takano + http://blog.jutty.dev/pt/rss.xml + http://blog.jutty.dev/pt/rss.xml + O endereço deste feed RSS mudou para: blog.jutty.dev/pt/rss.xml. Mais opções de feeds estão disponíveis em blog.jutty.dev/pt/feeds (Português) e blog.jutty.dev/feeds (Inglês). Atualize seu leitor de RSS para continuar recebendo atualizações. + + + diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..335a7e618c9a51b4ba4a37cf7ea290f211a7f00a GIT binary patch literal 4286 zcmds*O=uHA6vwB%DF_OFftOx{im3PjB8XJ<;L$@B1U>0N&mw{co6t4{+JKa_Y1*3Z z)*_)P#TI&KL+PcI9;6?%LaF2=1gta|lhDmJ$vAJC8P?s+?(Aku!3qDF$=iMJHy^t* znIP0aK21#sauh#~&}oEFGZ8VN79z0IM6Nw;+}FMVp+Eqg^7&B0??)R%e~8or7BDt| zNpzB^l?Z#SMB*`?nR$)l@rO7NI94k@uwQ!3?&vsz6(x&V%IAOLo}Tk&Z2-2c=TA;P z$I0Yd91b^|`PkZ`(Q9~hRl>{5A8{_1rp;Je`()-Px3!^ZJ%4-q8}%6*dt~P0$Tl(Y zjKpiYI&;%qG+F z2M2Ff`Ng{Uf&d#HCtuG>L6EIjm^!)z*t90HDG6O~}eplBS!*5Fc zZ%p=maWTZ333X<-D}kZqle*#j!LD1Ck;rAv@9Vq7V_Nx`T$9_|(JK?XZM>0@`GD3q{b}2LJ#7 literal 0 HcmV?d00001 diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..b75dc4c --- /dev/null +++ b/templates/404.html @@ -0,0 +1,6 @@ +{% block content %} + +

404

+

Page not found

+ +{% endblock content %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..eda7915 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,80 @@ + +{% if lang == "pt" %} + +{% else %} + +{% endif %} + + + + + + + {%- set title_tail = " ~ " ~ config.title %} + + {%- if page.title %} + {%- set title = page.title ~ title_tail %} + {%- elif section.title %} + {%- set title = section.title ~ title_tail %} + {%- else %} + {%- set title = config.title %} + {%- endif %} + + {{ title }} + + + + + + + + + + {%- set description = page.content | default(value=config.description) | striptags | truncate(length=120) %} + + + + + + + + {% block rss %} + {% endblock %} + + + + + {% if lang == "pt" %} +
Saltar para o conteúdo + {% else %} + Skip to content + {% endif %} + + {% block header %}{% endblock %} + +
+ +
+ {% set prepared_path = current_path | replace(from="pt/", to="") %} + {% if lang == "pt" %} + English + {% else %} + Português + {% endif %} +
+
+ +
+ {% block content %} {% endblock %} +
+ + + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..f39bd64 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,42 @@ +{% extends "base.html" %} + +{% block header %} +
+ +
+{% endblock header %} + +{% block content %} + + {% if lang == "pt" %} + {% set posts = get_section(path="posts/_index.pt.md") %} + {% else %} + {% set posts = get_section(path="posts/_index.md") %} + {% endif %} + + + +{% endblock content %} diff --git a/templates/link-page.html b/templates/link-page.html new file mode 100644 index 0000000..5939c3f --- /dev/null +++ b/templates/link-page.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} + +

+ {{ page.title }} +

+ + {% if page.extra.comment %} +

{{ page.extra.comment }}

+ {% endif %} + {{ page.content | safe }} + +{% endblock content %} diff --git a/templates/links.html b/templates/links.html new file mode 100644 index 0000000..559112a --- /dev/null +++ b/templates/links.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block content %} +{% set english_section = get_section(path="links/_index.md", lang="en") %} + +

+ {{ section.title }} +

+
    + {% for page in english_section.pages %} +
  • + + {{ page.title }} + {% if page.content %} + {% set portuguese_page = get_page(path="links/" ~ page.slug ~ ".pt.md") %} + {% if lang == "pt" %} + {{ portuguese_page.content | replace(from="

    ", to="") | safe }} + {% else %} + {{ page.content | replace(from="

    ", to="") | safe }} + {% endif %} + {% endif %} +

  • + {% endfor %} +
+{% endblock content %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..a4788e5 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} + {{ page.content | safe }} +{% endblock content %} diff --git a/templates/post-page.html b/templates/post-page.html new file mode 100644 index 0000000..c59274b --- /dev/null +++ b/templates/post-page.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} + +

+ {{ page.title }} +

+ + {{ page.content | safe }} + +{% endblock content %} diff --git a/templates/posts.html b/templates/posts.html new file mode 100644 index 0000000..6fef8fd --- /dev/null +++ b/templates/posts.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block content %} +

+ {{ section.title }} +

+
    + {% for page in section.pages %} +
  • + + {{ page.title }} +
  • + {% endfor %} +
+{% endblock content %} diff --git a/update-feed.zsh b/update-feed.zsh deleted file mode 100755 index cc7634c..0000000 --- a/update-feed.zsh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env zsh -# dependencies: zsh, xmlstarlet, xmllint - -date="$(date +'%a, %d %b %Y %H:%M:%S %z')" -data='assets/js/data.js' - -function subnode { - local -r tag="${1}" - local -r value="${2}" - local path="${3:-rss/channel/new}" - local -r file="${4:-tmp.rss}" - - if [[ -n $value ]]; then - /usr/bin/xmlstarlet ed -L --subnode "$path" -t elem -n "$tag" -v "$value" "$file" - else - /usr/bin/xmlstarlet ed -L --subnode "$path" -t elem -n "$tag" "$file" - fi -} - -function insert { - local -r title="$1" - local -r slug="${2}.html" - local -r file="${3}" - local -r url_root='https://blog.jutty.dev/posts' - local -r author='juno@jutty.dev (Juno Takano)' - - if grep -q "$url_root/$slug" "$file"; then - return 0 - fi - - xmlstarlet ed --update rss/channel/lastBuildDate --value "$date" "$file" > tmp.rss - - subnode new '' rss/channel - subnode title "$title" - subnode pubDate "$date" - subnode link "$url_root/$slug" - subnode guid "$url_root/$slug" - subnode author "$author" - - sed -i 's///g' tmp.rss - sed -i 's/<\/new>/<\/item>/g' tmp.rss - - if xmllint --noout tmp.rss; then - mv -v tmp.rss "$file" - else - echo 'Generated an invalid feed, not overwriting' - rm -v tmp.rss - return 1 - fi - -} - -function assemble_index { - local -r lang="$1" - - cat "$data" | - grep -v function | - sed 's/ *return //' | - sed -E ':a;N;$!ba; s/(.*)\}(.*)/\1\2/' | - jq ".$lang" | - grep 'title\|slug' | - grep '.' -} - -index_en=$(assemble_index en) -index_pt=$(assemble_index pt) - -function insert_from { - local -r index="$1" - local -r file="$2" - local -r total=$(echo $index | wc -l) - local title - local slug - - current=2 - while [[ $current -le $total ]]; do - lines=$(echo $index | tail -$((current)) | head -2) - title=$(echo $lines | grep title | cut -d'"' -f 4 | xargs) - slug=$(echo $lines | grep slug | cut -d'"' -f 4 | xargs) - insert "$title" "$slug" "$file" - ((current+=2)) - done -} - -insert_from "$index_pt" assets/rss/pt.rss -insert_from "$index_en" assets/rss/en.rss