eonn-site

scripts and documents that generate eonn.xyz
git clone git://git.eonn.xyz/eonn-site.git
Log | Files | Refs

commit 6d623254a3eae3375bf0891dd2662067bf4858cb
Author: iressa <ian@eonn.xyz>
Date:   Thu, 20 Jan 2022 06:18:08 -0500

initial commit

Diffstat:
Abin/indexgen | 18++++++++++++++++++
Abin/publish | 16++++++++++++++++
Abin/rssg | 188+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/ssg5 | 278+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/_footer.html | 6++++++
Asrc/_header-index.html | 12++++++++++++
Asrc/_header.html | 12++++++++++++
Asrc/blog-index.md | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/eonn.gpg | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/fonts/DejaVuMathTeXGyre.ttf | 0
Asrc/fonts/DejaVuSans-Bold.ttf | 0
Asrc/fonts/DejaVuSans-BoldOblique.ttf | 0
Asrc/fonts/DejaVuSans-ExtraLight.ttf | 0
Asrc/fonts/DejaVuSans-Oblique.ttf | 0
Asrc/fonts/DejaVuSans.ttf | 0
Asrc/fonts/DejaVuSansMono-Bold.ttf | 0
Asrc/fonts/DejaVuSansMono-BoldOblique.ttf | 0
Asrc/fonts/DejaVuSansMono-Oblique.ttf | 0
Asrc/fonts/DejaVuSansMono.ttf | 0
Asrc/ico.png | 0
Asrc/ico_large.png | 0
Asrc/index.md | 14++++++++++++++
Asrc/post/2020/01/31-why-i-dont-use-snapchat.md | 32++++++++++++++++++++++++++++++++
Asrc/post/2020/02/04-freedom-in-self-hosting.md | 17+++++++++++++++++
Asrc/post/2020/02/04-on-covering-laptop-cameras.md | 9+++++++++
Asrc/post/2020/03/20-notes-without-paper-can-it-be-done.md | 17+++++++++++++++++
Asrc/post/2020/05/22-beautify-your-bin-login.md | 6++++++
Asrc/post/2020/06/03-becoming-my-own-package-maintainer.md | 13+++++++++++++
Asrc/post/2020/06/06-my-first-pull-request.md | 35+++++++++++++++++++++++++++++++++++
Asrc/post/2020/06/figure1.png | 0
Asrc/post/2020/06/figure2.png | 0
Asrc/post/2020/06/figure3.png | 0
Asrc/post/2020/08/07-website-generation-with-unix-coreutils.md | 45+++++++++++++++++++++++++++++++++++++++++++++
Asrc/post/2020/08/indexgen.sh | 13+++++++++++++
Asrc/post/2021/01/02-sxmo-brings-suckless-philosophy-to-mobile.md | 30++++++++++++++++++++++++++++++
Asrc/post/2021/05/27-text-interfaces-are-the-most-user-friendly.md | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/post/2021/08/20-you-cant-have-your-cake.md | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/post/2022/01/16-updates-to-the-website.md | 12++++++++++++
Asrc/styles.css | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39 files changed, 1148 insertions(+), 0 deletions(-)

diff --git a/bin/indexgen b/bin/indexgen @@ -0,0 +1,18 @@ +#!/bin/sh +cd dst +FILES="$(find post/ -type f -name "*.html" | sort)" +TITLES="$(cat $FILES | grep h1 | sed 's|</*h1>||g')" +DATES="$(cat $FILES | grep h2 | sed 's|</*h2>||g')" + +FILESHTML="$(printf %b "$FILES" | sed 's|^|<a href="/|g;s/$/" /g')" +DATESPREPEND="$(printf %b "$DATES" | sed 's/^/<li>/g;s/$/ /g')" +DATESHTML="$(printf %b "$DATES" | sed 's/^/title="/g;s/$/"/g')" +TITLESHTML="$(printf %b "$TITLES" | sed 's/^/>/g;s|$|</a></li>|g')" + +echo $FILESHTML +echo $DATESPREPEND +echo $DATESHTML +echo $TITLESHTML + +paste -d "" <(echo "$DATESPREPEND") <(echo "$FILESHTML") <(echo "$DATESHTML") <(echo "$TITLESHTML") | tac +printf %b "<a href=\"https://eonn.xyz/rss.xml\">rss</a>" diff --git a/bin/publish b/bin/publish @@ -0,0 +1,16 @@ +#!/bin/sh + +die(){ + echo "$1"; exit 1 +} + +([[ -d bin ]] && [[ -d src ]]) || die "must run within base folder" + +echo "generating website..." +mkdir dst +bin/ssg5 ~/web/src ~/web/dst 'eonn' 'https://eonn.xyz' || die "ssg5 exited with an error" +echo "generating RSS..." +bin/indexgen > dst/rssindex.html +bin/rssg dst/rssindex.html 'eonn blog' > dst/rss.xml || die "rssg exited with an error" +echo "copying files..." +rsync -rvPz --delete dst/ ssg@eonn.xyz:/var/www/html/ || die "rsync exited with an error" diff --git a/bin/rssg b/bin/rssg @@ -0,0 +1,188 @@ +#!/bin/sh +# +# https://www.romanzolotarev.com/bin/rssg +# Copyright 2018 Roman Zolotarev <hi@romanzolotarev.com> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +set -e + + +main () { + test -n "$1" || usage + test -n "$2" || usage + test -f "$1" || no_file "$1" + + + index_file=$(readlink -f "$1") + test -z "${index_file##*html}" && html=$(cat "$index_file") + test -z "${index_file##*md}" && html=$(md_to_html "$index_file") + test -n "$html" || usage + + base="${index_file%/*}" + base_url="$(echo "$html" | get_url | sed 's#\(.*\)/[^/]*#\1#')" + + url=$( echo "$html" | get_url) + + title="$2" + + description=$( echo "$html" | get_description | + remove_tags | + remove_nbsp ) + + items=$( echo "$html" | get_items) + + rss=$( echo "$items" | + render_items "$base" "$base_url" | + render_feed "$url" "$title" "$description") + + >&2 echo "[rssg] ${index_file##$(pwd)/} $(echo "$rss" | grep -c '<item>') items" + echo "$rss" +} + + +usage() { + echo "usage: ${0##*/} index.{html,md} title > rss.xml" >&2 + exit 1 +} + + +no_file() { + echo "${0##*/}: $1: No such file" >&2 + exit 2 +} + + +md_to_html() { + test -x "$(which lowdown)" || exit 3 + lowdown \ + -D html-skiphtml \ + -D smarty \ + -d metadata \ + -d autolink "$1" +} + + +get_title() { + awk 'tolower($0)~/^<h1/{gsub(/<[^>]*>/,"",$0);print;exit}' +} + + +get_url() { + grep -i '<a .*rss.xml"' | head -1 | + sed 's#.*href="\(.*\)".*#\1#' +} + + +get_items() { + grep -i 'href=".*" title="' | + sed 's#.*href="\(.*\)" title="\(.*\)">\(.*\)</a>.*#\1 \2 \3#' +} + + +get_description() { + start='sub("^.*<"s"*"t"("s"[^>]*)?>","")' + stop='sub("</"s"*"t""s"*>.*","")&&x=1' + awk -v 's=[[:space:]]' -v 't=[Pp]' "$start,$stop;x{exit}" +} + +remove_tags() { + sed 's#<[^>]*>##g;s#</[^>]*>##g' +} + + +remove_nbsp() { + sed 's#\&nbsp;# #g' +} + + +rel_to_abs_urls() { + site_url="$1" + base_url="$2" + + abs='s#(src|href)="/([^"]*)"#\1="'"$site_url"/'\2"#g' + rel='s#(src|href)="([^:/"]*)"#\1="'"$base_url"/'\2"#g' + sed -E "$abs;$rel" +} + + +date_rfc_822() { + date -Rd "$1" +} + + +render_items() { + while read -r i + do render_item "$1" "$2" "$i" + done +} + + +render_item() { + base="$1" + base_url="$2" + item="$3" + + site_url="$(echo "$base_url"| sed 's#\(.*//.*\)/.*#\1#')" + + date=$(echo "$item"|awk '{print$2}') + url=$(echo "$item"|awk '{print$1}') + + f="$base/$url" + test -f "$f" && html=$(cat "$f") + test -f "${f%\.html}.md" && html=$(md_to_html "${f%\.html}.md") + + description=$( + echo "$html" | + rel_to_abs_urls "$site_url" "$base_url" | + remove_nbsp + ) + title=$(echo "$description" | get_title) + guid="$base_url/$(echo "$url" | sed 's#^/##')" + + echo ' +<item> +<guid>'"$guid"'</guid> +<link>'"$guid"'</link> +<pubDate>'"$(date_rfc_822 "$date")"'</pubDate> +<title>'"$title"'</title> +<description><![CDATA[ + +'"$description"' + +]]></description> +</item>' +} + + +render_feed() { + url="$1" + title=$(echo "$2" | remove_nbsp) + description="$3" + + base_url="$(echo "$url" | cut -d '/' -f1-3)" + + echo '<?xml version="1.0" encoding="UTF-8"?> +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> +<channel> +<atom:link href="'"$url"'" rel="self" type="application/rss+xml" /> +<title>'"$title"'</title> +<description>'"$description"'</description> +<link>'"$base_url"'/</link> +<lastBuildDate>'"$(date_rfc_822 "$date")"'</lastBuildDate> +'"$(cat)"' +</channel></rss>' +} + + +main "$@" diff --git a/bin/ssg5 b/bin/ssg5 @@ -0,0 +1,278 @@ +#!/bin/sh -e +# +# https://rgz.ee/bin/ssg5 +# Copyright 2018-2019 Roman Zolotarev <hi@romanzolotarev.com> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +main() { + test -n "$1" || usage + test -n "$2" || usage + test -n "$3" || usage + test -n "$4" || usage + test -d "$1" || no_dir "$1" + test -d "$2" || no_dir "$2" + + src=$(readlink_f "$1") + dst=$(readlink_f "$2") + + IGNORE=$( + if ! test -f "$src/.ssgignore" + then + printf ' ! -path "*/.*"' + return + fi + while read -r x + do + test -n "$x" || continue + printf ' ! -path "*/%s*"' "$x" + done < "$src/.ssgignore" + ) + + # files + + title="$3" + + h_file="$src/_header.html" + h_index_file="$src/_header-index.html" + f_file="$src/_footer.html" + test -f "$f_file" && FOOTER=$(cat "$f_file") && export FOOTER + test -f "$h_file" && DEFHEADER=$(cat "$h_file") && export DEFHEADER + test -f "$h_index_file" && INDEXHEADER=$(cat "$h_index_file") && export INDEXHEADER + + list_dirs "$src" | + (cd "$src" && cpio -pdu "$dst") + + fs=$( + if test -f "$dst/.files" + then list_affected_files "$src" "$dst/.files" + else list_files "$1" + fi + ) + + if test -n "$fs" + then + echo "$fs" | tee "$dst/.files" + + if echo "$fs" | grep -q '\.md$' + then + if test -x "$(which lowdown 2> /dev/null)" + then + echo "$fs" | grep '\.md$' | + render_md_files_lowdown "$src" "$dst" "$title" + else + if test -x "$(which markdown 2> /dev/null)" + then + echo "$fs" | grep '\.md$' | + render_md_files_markdown "$src" "$dst" "$title" + else + echo "couldn't find lowdown nor markdown" + exit 3 + fi + fi + fi + + echo "$fs" | grep '\.html$' | + render_html_files "$src" "$dst" "$title" + + echo "$fs" | grep -Ev '\.md$|\.html$' | + (cd "$src" && cpio -pu "$dst") + fi + + printf '[ssg] ' >&2 + print_status 'file, ' 'files, ' "$fs" >&2 + + + # sitemap + + base_url="$4" + date=$(date +%Y-%m-%d) + urls=$(list_pages "$src") + + test -n "$urls" && + render_sitemap "$urls" "$base_url" "$date" > "$dst/sitemap.xml" + + print_status 'url' 'urls' "$urls" >&2 + echo >&2 +} + + +readlink_f() { + file="$1" + cd "$(dirname "$file")" + file=$(basename "$file") + while test -L "$file" + do + file=$(readlink "$file") + cd "$(dirname "$file")" + file=$(basename "$file") + done + dir=$(pwd -P) + echo "$dir/$file" +} + + +print_status() { + test -z "$3" && printf 'no %s' "$2" && return + + echo "$3" | awk -v singular="$1" -v plural="$2" ' + END { + if (NR==1) printf NR " " singular + if (NR>1) printf NR " " plural + }' +} + + +usage() { + echo "usage: ${0##*/} src dst title base_url" >&2 + exit 1 +} + + +no_dir() { + echo "${0##*/}: $1: No such directory" >&2 + exit 2 +} + +list_dirs() { + cd "$1" && eval "find . -type d ! -name '.' ! -path '*/_*' $IGNORE" +} + + +list_files() { + cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE" +} + + +list_dependant_files () { + e="\\( -name '*.html' -o -name '*.md' -o -name '*.css' -o -name '*.js' \\)" + cd "$1" && eval "find . -type f ! -name '.' ! -path '*/_*' $IGNORE $e" +} + +list_newer_files() { + cd "$1" && eval "find . -type f ! -name '.' $IGNORE -newer $2" +} + + +has_partials() { + grep -qE '^./_.*\.html$|^./_.*\.js$|^./_.*\.css$' +} + + +list_affected_files() { + fs=$(list_newer_files "$1" "$2") + + if echo "$fs" | has_partials + then list_dependant_files "$1" + else echo "$fs" + fi +} + + +render_html_files() { + while read -r f + do + if $(echo "$1/$f" | grep "index.html" > /dev/null); then + HEADER="$INDEXHEADER" && export HEADER + else + HEADER="$DEFHEADER" && export HEADER + fi + render_html_file "$3" < "$1/$f" > "$2/$f" + done +} + + +render_md_files_lowdown() { + while read -r f + do + lowdown \ + -D html-skiphtml \ + -d metadata \ + -d autolink < "$1/$f" | + render_html_file "$3" \ + > "$2/${f%\.md}.html" + done +} + + +render_md_files_markdown() { + while read -r f + do + if $(echo "$1/$f" | grep "index.md" > /dev/null); then + HEADER="$INDEXHEADER" && export HEADER + else + HEADER="$DEFHEADER" && export HEADER + fi + markdown < "$1/$f" | + render_html_file "$3" \ + > "$2/${f%\.md}.html" + done +} + + +render_html_file() { + # h/t Devin Teske + awk -v title="$1" ' + { body = body "\n" $0 } + END { + body = substr(body, 2) + if (body ~ /<[Hh][Tt][Mm][Ll]/) { + print body + exit + } + if (match(body, /<[[:space:]]*[Hh]1(>|[[:space:]][^>]*>)/)) { + t = substr(body, RSTART + RLENGTH) + sub("<[[:space:]]*/[[:space:]]*[Hh]1.*", "", t) + gsub(/^[[:space:]]*|[[:space:]]$/, "", t) + if (t) title = t " &mdash; " title + } + n = split(ENVIRON["HEADER"], header, /\n/) + for (i = 1; i <= n; i++) { + if (match(tolower(header[i]), "<title></title>")) { + head = substr(header[i], 1, RSTART - 1) + tail = substr(header[i], RSTART + RLENGTH) + print head "<title>" title "</title>" tail + } else print header[i] + } + print body + print ENVIRON["FOOTER"] + }' +} + + +list_pages() { + e="\\( -name '*.html' -o -name '*.md' \\)" + cd "$1" && eval "find . -type f ! -path '*/.*' ! -path '*/_*' $IGNORE $e" | + sed 's#^./##;s#.md$#.html#;s#/index.html$#/#' +} + + +render_sitemap() { + urls="$1" + base_url="$2" + date="$3" + + echo '<?xml version="1.0" encoding="UTF-8"?>' + echo '<urlset' + echo 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' + echo 'xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' + echo 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"' + echo 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + echo "$urls" | + sed -E 's#^(.*)$#<url><loc>'"$base_url"'/\1</loc><lastmod>'\ +"$date"'</lastmod><priority>1.0</priority></url>#' + echo '</urlset>' +} + +main "$@" diff --git a/src/_footer.html b/src/_footer.html @@ -0,0 +1,6 @@ +<hr> +<a href="https://eonn.xyz">home</a> | <a href="https://eonn.xyz/blog-index.html">blog index</a> | <a href="https://eonn.xyz/rss.xml">rss</a> | <a href="mailto:ian@eonn.xyz">contact me</a> | <a href="https://eonn.xyz/eonn.gpg">PGP public key</a><sub><a href="https://emailselfdefense.fsf.org/en/">?</a></sub> +</div> +</div> +</body> +</html> diff --git a/src/_header-index.html b/src/_header-index.html @@ -0,0 +1,12 @@ +<html> + <head> + <link rel="shortcut icon" href="/ico.png" type="image/ico"> + <title> + eonn + </title> + <link rel="stylesheet" href="/styles.css"> + </head> + + <body> + <div class="short"> + <div class="border"> diff --git a/src/_header.html b/src/_header.html @@ -0,0 +1,12 @@ +<html> + <head> + <link rel="shortcut icon" href="/ico.png" type="image/ico"> + <title> + eonn + </title> + <link rel="stylesheet" href="/styles.css"> + </head> + + <body> + <div class=post> + <div class=border> diff --git a/src/blog-index.md b/src/blog-index.md @@ -0,0 +1,49 @@ +# blogposts + +- [Updates to The Website | 01/16/2022](https://eonn.xyz/post/2022/01/16-updates-to-the-website.html) + + eonndev.com -> eonn.xyz ! +<hr> +- [You Can't Have Your Cake And Eat it Too With GNU/Linux Distributions | 08/20/2021](https://eonn.xyz/post/2021/08/20-you-cant-have-your-cake.html) + + It just works! +<hr> +- [Text Interfaces Are The Most User Friendly | 05/27/2021](https://eonn.xyz/post/2021/05/27-text-interfaces-are-the-most-user-friendly.html) + + The future of I/O is already here! +<hr> +- [Sxmo Brings Suckless Philosophy to Mobile | 01/02/2021](https://eonn.xyz/post/2021/01/02-sxmo-brings-suckless-philosophy-to-mobile.html) + + Mobile computing like it's supposed to be. +<hr> +- [Website Generation With Unix Coreutils | 08/05/2020](https://eonn.xyz/post/2020/08/07-website-generation-with-unix-coreutils.html) + + Static websites don't have to be a hassle! +<hr> +- [My First Pull Request | 06/16/2020](https://eonn.xyz/post/2020/06/06-my-first-pull-request.html) + + Indentation, indentation, indentation. +<hr> +- [Becoming my Own Package Maintainer (the portage way) | 06/03/2020](https://eonn.xyz/post/2020/06/03-becoming-my-own-package-maintainer.html) + + Compile once +<hr> +- [Beautify your /bin/login | 05/22/2020](https://eonn.xyz/post/2020/05/22-beautify-your-bin-login.html) + + You don't need a display manager to have a good time! +<hr> +- [Notes Without Paper- Can it be Done? | 02/20/2020](https://eonn.xyz/post/2020/03/20-notes-without-paper-can-it-be-done.html) + + Paper is deprecated. +<hr> +- [On Covering Laptop Cameras | 02/04/2020](https://eonn.xyz/post/2020/02/04-on-covering-laptop-cameras.html) + + A short thought. +<hr> +- [Freedom in Self Hosting | 02/04/2020](https://eonn.xyz/post/2020/02/04-freedom-in-self-hosting.html) + + Become the breadwinner of your own cloud. +<hr> +- [Why I don't Use Snapchat | 01/31/2020](https://eonn.xyz/post/2020/01/31-why-i-dont-use-snapchat.html) + + It's actually because I'm a hipster who makes things difficult. diff --git a/src/eonn.gpg b/src/eonn.gpg @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBF8biMcBEACkV+SPUUJx3ngXRee1V31OF0J8fFoZ51cqYNXDTR/sJ2paOmv8 +Hrh1jhb3f20ylM8kSbIsblnAOMFpOLQGWK34VZmQiciTgoEL3+CeefuWEm9eOkOo +ddjqg4WdpA3rOU6hSAFJIF2h34Nja8ajfireMDHPgTkPsaFropjyVw+v8X+mp9A9 +Zyt83FVIFQvO6BCA7G0ktNfttQ28gG5aeOD68eV7UWFxAsEssnW222diykDCf1WG +rvEz4JomDuQxjOPbuu28G1VxGKgU6BfzihvZVpIZ5iTgw6nbqgHz8ZuLNfcCbgw0 +wxINdjyBeaHcg8DkvoToocV/DYa8PwArkbeA0Fwo4PGCeAqAXmpLghUAlPUZY/3a +EWyh/X9BfKEMwhdVXn++8Yx1TvIjivejPTyTVjE/nYa9keWgb7H9qlxO+0tbqcCT +mN6TfIfWYLo8+pl22vUZdLuqkTkBm7cQ7A8lmsZCmSZwzz336uI643u2ltX5EKBI +bxYz99qNHm9G+h6Gc/SZzS7RpBIbGmafiznvJnlWjyp4vrde374keqJdETJfFNX0 +f7kwJt87UQWjOSza0/joa5+mX/nbrZS9nZgkTvGC1XtG2t5LF4jDTHPJzuxbHCx7 +RFIvkrQoylJJe+FW5qccODrv/uwaArb+QXztDUCpvddPwXWOCPEDIRFnaQARAQAB +tBtJYW4gUmVzc2EgPGlhbkBlb25uZGV2LmNvbT6JAksEMAEIADUWIQRvLJN1bsKR +vJ+0+1Yde8jpaZ9fwQUCYdtoEBc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/33essof279GoWD7SXdSd8H9ArvcjNK0F3+tqbyNqrdM +G6N6zhHzBsRvVaKbsYw4vh3nvLl7bevqHklyDqWLtRhgbL/HGcWMFU3OZs8ENxPC +HMQgNnlF6KTh3lpCADvVDLi67TwxpKYdz8as9DT0UyMqQ9TDxZqKcW3WulZrTbCo +QIfbr4CgtefgBBmOmZiazICugp1CNndP7wY7WNIrQS8VpP7Bjk6r9zbWH117x58G +jq/6/BJfLJn9/uUt1TFNlDS2unymrThAPOUlx6RWnQHIgR2WnSo/Pc1qNmCgntIf +k2OziRuapNLHVU4itmWaKQwdxgP9FnmhMjMiBshBP7z9QRV+t+EL/PHdpC9FfKCp +8izDov9sda7U1RbfvcwfJMC7kqqOHuuGd2Vl/f9pFG5XgawJiHUILh1aHvfwOQCA ++ntyvdr1hI/uWel1qm7Ih1aaLCfqwHulaENK5E2yjlYzb77MCv/CdBEvHtKjTITD +JmLYxr4yRvVUNYxG6+0E584H1HLMrQVsR2NzED0cCcF2RyCtyXKYsWgSE+ZCQw/e +d5iZYcKNKoOPSz9KdGGm7/bO5zQt06wgy38iP83d7vIbFqNOcgQ1S0jhVCpMVmwr +bpH7HIsy1BH2iVI5dOMcqcuGrs0ZRU3Q0kXapjfm1H2N37U5RU20DfXvTRpVobN3 +=5jAb +-----END PGP PUBLIC KEY BLOCK----- diff --git a/src/fonts/DejaVuMathTeXGyre.ttf b/src/fonts/DejaVuMathTeXGyre.ttf Binary files differ. diff --git a/src/fonts/DejaVuSans-Bold.ttf b/src/fonts/DejaVuSans-Bold.ttf Binary files differ. diff --git a/src/fonts/DejaVuSans-BoldOblique.ttf b/src/fonts/DejaVuSans-BoldOblique.ttf Binary files differ. diff --git a/src/fonts/DejaVuSans-ExtraLight.ttf b/src/fonts/DejaVuSans-ExtraLight.ttf Binary files differ. diff --git a/src/fonts/DejaVuSans-Oblique.ttf b/src/fonts/DejaVuSans-Oblique.ttf Binary files differ. diff --git a/src/fonts/DejaVuSans.ttf b/src/fonts/DejaVuSans.ttf Binary files differ. diff --git a/src/fonts/DejaVuSansMono-Bold.ttf b/src/fonts/DejaVuSansMono-Bold.ttf Binary files differ. diff --git a/src/fonts/DejaVuSansMono-BoldOblique.ttf b/src/fonts/DejaVuSansMono-BoldOblique.ttf Binary files differ. diff --git a/src/fonts/DejaVuSansMono-Oblique.ttf b/src/fonts/DejaVuSansMono-Oblique.ttf Binary files differ. diff --git a/src/fonts/DejaVuSansMono.ttf b/src/fonts/DejaVuSansMono.ttf Binary files differ. diff --git a/src/ico.png b/src/ico.png Binary files differ. diff --git a/src/ico_large.png b/src/ico_large.png Binary files differ. diff --git a/src/index.md b/src/index.md @@ -0,0 +1,14 @@ +# eonn + +I am a computer programmer, [Free Software advocate](https://www.fsf.org/about/what-is-free-software), and an undergraduate Computer Science and Mathematics student from the Midwestern United States. I'm a fan of Emacs, Gentoo GNU/Linux, and various teas. + +<img src="ico_large.png" style="float: right; margin-left: 20px; margin-right: 20px; margin-bottom: 5px;"> + +Here's some of my work around the web: + +- [My git server](https://git.eonn.xyz) +- [github](https://github.com/iressa) +- [gitlab](https://gitlab.com/iressa) +- [sourcehut](https://lists.sr.ht/~iressa) +- I am **eonn** on libera.chat and oftc.net, and **iressa** most other places. +- I also publish my thoughts and experiences on a [blog](https://eonn.xyz/blog-index.html) diff --git a/src/post/2020/01/31-why-i-dont-use-snapchat.md b/src/post/2020/01/31-why-i-dont-use-snapchat.md @@ -0,0 +1,32 @@ +# Why I don't Use Snapchat + +## 01/31/2020 + +Over the past few years, I've been met with questions regarding my decision to not opt-in to certain commonly used software, with Snapchat being the biggest deal. Unfortunately, I historically reach for bad answers, such as "I don't like it" and "It creates a bad habit". Now that I have an outlet to concisely and clearly punch words in an HTML box, I will outline the exact reasons I do not use Snapchat, for my personal record keeping. + +The reasons why I refuse to opt-in can be put in bullet points. + +- The software itself and the means it uses to get messages to people are proprietary. This enough is generally reason alone for me to decide to not use something. +- Snapchat is made of bad UI design. +- Snapchat restricts user choice in a hilariously bad fashion. +- Snapchat is riddled with ads. +- It isn't platform friendly. I have to use a cell phone to chat. + +Those second and third reasons offer me the most to talk about. As soon as you open the Snapchat app, you are booted straight to the camera, whether you want to take a picture or not. There are no configuration options to tell the app where you want to start the app, so you end up opening your camera repeatedly just to look at a text message. + +From the camera, you're able to swipe left-to-right to reveal the text chat menu. The gimmick of Snapchat is that messages are "deleted" by default and the user is told if anything they have uploaded has been seen, saved, or screenshotted by the hands of another user. This feature is useless, since screen-recording software can be used to record posts without detection, and the animation between the message log and a chat allows the user to read the message before actually entering the chat screen, thus not alerting the sender of something being read. + +If you swipe towards the left from the camera, you're brought to a weird page that shows a list of your friends' Stories - public posts (that must be pictures or video) and also an endless feed of Snapchat-ified news. The "news" ranges from BIG WORD CLICKBAIT to a cartoon about Fortnite or an account that exclusively posts "satisfying things." + +If you want to access the streamlined list of Stories, you must go to this page. You cannot opt out of recieving news, and you cannot even give Snapchat a list of feeds that you want to see. You may long-tap a media-Story and proclaim that you wish to see less of that type of news, and pray to the black box of Snapchat that you will someday use CPU cycles to recieve news that you might actually want to look at instead of cheap clickbait. A news/media feed on a chatting app is already doing more than I asked it to, since I just want to see the list of Stories. + +Since Snaps (videos) can only be several seconds at a time, and must be portrait oriented, all news is either: + +- butchered into several jump-cuts and ads every (not exaggerating) 10 seconds. +- serving as a flashy cover to an article that you have to open up in the web browser supplied by Snapchat. + +Snapchat also offers side-services, like a find-my-friends-esque service that pings your location to your friends when you log in, and a avatar system that can only be used if you download a separate app. On top of that they offer small games ala Apple iMessage and other superfluous stuff. + +I cannot simply message people I have on my friends list, I must also deal with a UI that works against me and constantly changes in its own interests instead of the user's, a bloated mess of filters (that you must download per-use) and services that I don't want to use and will instead be advertised to me like I'm stupid. It's insulting software that pretends it knows what you want better than you do, all on top of a proprietary protocol and a nightmare of a [privacy policy](https://snap.com/en-US/privacy/privacy-policy) that reserves the right to do ridiculous things with vague wording. A fun activity is plugging "snapchat privacy policy" into a search engine and seeing just how many results are articles attempting to explain away scares. + +All these things people are willing to compromise with because of the ubiquity of Snapchat. Nobody downloaded Snapchat because they heard it was the best and safest thing around, they downloaded it because their friend told them to. Here we have software that holds its users in the grip of its culture and familiarity deciding to use its powers for evil. This reinvention of the wheel into a square isn't the treatment a user deserves, especially when there are better, safer, platform friendly, FOSS, and brand-independent technologies already out there that do the chat thing just fine. diff --git a/src/post/2020/02/04-freedom-in-self-hosting.md b/src/post/2020/02/04-freedom-in-self-hosting.md @@ -0,0 +1,17 @@ +# Freedom in Self-Hosting + +## 02/04/2020 + +I find often that a computer user carries the attitude that daily computing is kind of whimsical, in the sense that it might seem like a computer does what it wants, and when it doesn't want something to work one day, it won't work. The user works for the computer, and not the other way around. + +>"I don't know why it's loading so slow. I guess the computer is deciding to throw a fit." + +Today, I believe that we only encourage that attitude by diverting most of the computing to centralized servers and bottlenecking performance based on how good a user's internet connection is. These servers may be run by large companies, but their uptime will never be indefinite nor guaranteed. + +Most of the apps that do this diversion of computation do it in irresponsible ways, creating software that relies on one provider and stops working once the provider decides to end service. An imperfect example is video games without available server hosting software or always-on DRM. + +The industry seems to think the only way to make money is to charge a service cost for unicorn software that can only be hosted by themselves. + +Now is a better time than ever to take control of the services you use and see the end of "whimsical" computing in an afternoon with software we have right now, available gratis. It doesn't take a lot of computing power to host a server for single person use, especially when you need a replacement for simple things such as cloud storage and cross-device syncing. You can get a cheap device such as a Raspberry Pi for about 30-300 USD depending on your needs and you can start to build your own services that you can be more confident in the performance of, because you host them yourself. [Nextcloud](https://nextcloud.com) is a great example. It's a Google Drive-like suite of self-hosted services that provide an easy setup for a multitude of use cases. + +The modern cycle of SaaS is "users trusting tyranical software that do not guarantee anything," "software breaks users' trust," "users pick new company with a cleaner name to trust." When you self host, you don't have to worry about the whim of whatever company you're submitting to, especially when most of the things you trust them for are really simple. When there is an issue, you can immediately start to consult the issue yourself, instead of waiting for a company to get their servers back up. If you want to amend your service and add your own special functionality, you can, instead of waiting for a company to decide what you want. Packaged in this is the added plus of knowing exactly what your server is running, and what computations you are doing with your data. Have a blog, cloud, or chat service without being blasted by the standards of providers and forces that bend the web for the interests of the hand that force-feeds you. diff --git a/src/post/2020/02/04-on-covering-laptop-cameras.md b/src/post/2020/02/04-on-covering-laptop-cameras.md @@ -0,0 +1,9 @@ +# On Covering Laptop Cameras + +## 02/04/2020 + +Front-facing cameras (face-facing?) on laptops are grossly ubiquitous. When was the last time you actually used it? It serves a low quality picture, and you usually just opt to use your phone for that kind of face-technology stuff for a less cumbersome experience. The only purpose they serve is to remind the user that there's secretly a personal FBI agent watching you do homework. So users cover them up with tape. + +It's a weird mixture of the rejection of gross privacy invasion and the acceptance that the software that they're using has the possibility of spying on them, or something. I see the practice as a kind of user complacency. A rejection of WYSIWYG but also agreeing that there's nothing one can do about it. That's how computers work. It's a kind of hopelessness that I hate to see people bear. I don't cover up my laptop camera, because I am comfortable with my computer. Yes, I use some proprietary firmware blobs and such, but if I really want to disable the use of my camera, I can. It doesn't really matter whether there really is an FBI guy on the other end, becuase it's an issue of a userbase not feeling empowered by their computers. The most you can possibly do is to politely ask "please don't." + +To many, I believe computers seem like magical black boxes that you have to go to college for to use to their full extent. diff --git a/src/post/2020/03/20-notes-without-paper-can-it-be-done.md b/src/post/2020/03/20-notes-without-paper-can-it-be-done.md @@ -0,0 +1,17 @@ +# Notes Without Paper- Can it be Done? + +## 03/02/2020 + +Being a student in mathematics, I took all my notes on paper during my first semester. I can't type math, and even if I could, why would I tie all of my personal reference to a digital format on a machine that could run out of battery? Paper is cool because it doesn't run out of battery. It's also not cool because I can't rice my paper and have a browser open on the side. I also can't sync paper across interfaces or conveniently copy it. + +So now- paper is deprecated. The goto for writing notes was simply sorted text files that I edited with LibreOffice Writer. I could do bullet points easily enough and organize things just about as quickly as writing. The issue is that LibreOffice Writer doesn't expect you to need to quicly write math repetitively and uniformly. I couldn't go back to paper now, I had only just started. + +So I go to find a way to write math on a computer. Interestingly enough, I was able to integrate it into my workflow pretty gracefully without a whole bunch of extra software. The key is a combination of LaTeX and some vim-fu. + +What I personally do is reminiscent of [this blogpost](https://castel.dev/post/lecture-notes-1/), which combines the use of vim snippets and a lightweight LaTeX editing suite. [Vimtex](https://github.com/lervag/vimtex) lets you compile your work in to a PDF on the fly with your preferred viewer, and [UltiSnips](https://github.com/sirver/UltiSnips) for auto-completion of repetitive LaTeX syntax. I also use [Vundle](https://github.com/VundleVim/Vundle.vim) for my plugin management. + +I'm still working to get my note-taking to be as quick as writing, but math looks so much more elegant when it isn't in my poor penmanship. The blogpost I linked has a lot more information on how to use snippets to your advantage, so I won't go over it here. The curve is really learning LaTeX and knowing what you should automate. I still have a reference sheet open for some classes, but it doesn't detract too much from what I manage to get down. You'll hit a wall if you find yourself with a document that doesn't compile. You kind of just have to keep going and get to fixing your problem later. + +My reason for posting is to simply say this- after my first couple of months of giving it a shot- it is more than possible (dare I say, fun?) to write mathematics notes on the computer. Don't doom yourself to clicking special symbols in GSuite or whatever. + +Also, [Here's a list of TeX editors in case you're curious.](https://wikipedia.org/wiki/Comparison_of_TeX_editors) diff --git a/src/post/2020/05/22-beautify-your-bin-login.md b/src/post/2020/05/22-beautify-your-bin-login.md @@ -0,0 +1,6 @@ +# Beautify Your /bin/login +## 05/22/2020 + +I'd been looking for a bit to stop using a display manager for my main, single user computer, since there isn't a lot of use for a complicated login manager when all I'm going to do is type in my password. This means that I would need to have X (or my desktop environment of choice) start automatically when I log into tty1. You can put this check in your ~/.bash_profile with a good example on the [Gentoo wiki](https://wiki.gentoo.org/wiki/X_without_Display_Manager#Starting_X11_automatically). The only issue I had migrating from lightdm was that there were a couple environment variables not set properly at first when starting X in this fashion, but it was easy to find out what with set or env. + +Since /etc/inittab is going to be the file your init will read off after "starting" (this is what calls agetty), you can tweak it to personalize its behavior. The cool bit is the ability to login in style by telling /etc/inittab to run your own login wrapper script. You can do this by passing the program to agetty [like this](https://wiki.gentoo.org/wiki/X_without_Display_Manager#Custom_text_in_console_logon), and now you suddenly have free reign to run some nice programs as you log in. Since agetty opens a tty port and then simply invokes /bin/login, passing an alternative program to it with --login-program works as long as you remember to run /bin/login. Pretty cool, right? Right now I just do a funny cowsay before my password prompt, for that authentic hacker aesthetic. I really recommend this method for single user systems, since it allows you a lot of freedom of what you can do with your login. Just make sure you're either invoking your desktop environment directly in your ~/.bash_profile hack, or if you're using a window manager, invoking your startup programs in your ~/.xinitrc. diff --git a/src/post/2020/06/03-becoming-my-own-package-maintainer.md b/src/post/2020/06/03-becoming-my-own-package-maintainer.md @@ -0,0 +1,13 @@ +# Becoming my Own Package Maintainer (the Portage way) + +## 06/03/2020 + +I was frustrated with my update flow. For all my computers, I would essentially be installing the same things on different systems manually with different package managers. I use Gentoo and Portage on my "faster" machines, but usually leave less powerful computers on systems that rely on binary package providers. Loving the Portage philosophy and hating redundancy, I wanted to reduce the number of different tools I was using to keep all of my systems up-to-date. Did I really need apt, pacman, etc, etc, to install slightly different builds of ffmpeg on similar systems? I already configure most of my systems to operate similarly for simplicity, but I wanted to automate it. + +My solution, luckily, was already implemented in a severely underrated feature in Portage. Portage allows you to build your own packages and then package them into binaries for you to distribute to other computers, given that there won't be any compile or USE flag conflicts, with support for ftp, ssh, and http transfer. Since a lot of my posts just involve pointing at a wiki page, I'll go ahead and provide it [here](https://wiki.gentoo.org/wiki/Binary_package_guide). + +To test how this could work, I wiped a cheap laptop clean and started a Gentoo Linux installation. A key part of the way binary packages work in Portage is the quickpkg program, which translates installed atoms to binaries. By default, generation via quickpkg enables CONFIG_PROTECT, which obfuscates the configuration files in your system related to a package (see "equery f"). What went over my head, however, is that enabling CONFIG_PROTECT doesn't obfuscate your configuration file by generating a skeleton file on installation, but rather *omits* a configuration file altogether. This can make installing critical system packages for the first time via binary dangerous. Even if you disable CONFIG_PROTECT, you risk writing configuration files that are incorrect for your system. This means that you should still compile most mission critical programs if you're installing them for the first time. If you still want to write out / overwrite configuration files in a case where you're absolutely sure, you can set CONFIG_PROTECT="-{atom}" to (as per the manpage) "mercilessly auto-update your config files." + +As for server configuration, I settled with ssh, with a user dedicated to serving packages. Setting --getbinpkg in EMERGE_DEFAULT_OPTS on the client lets you seamlessly and automatically pull binaries of the same atom when you use emerge. I tend to include configuration files on build for builds that write trivial configuration files, like the GIMP or Libreoffice, since for those, something is better than nothing on first install. + +I'm surprised this isn't noted more when I hear discussions about Portage. You get to make your own ecosystem of specialized packages that you distribute to yourself, to keep low-power systems updated but also optimized. The only thing you might be giving up is a bit of specialization, since the distributor needs to be using the same USE and compile options as the client. Save for a kernel upgrade, the updates to my old machine take less time than on my high-power machines, and I can trust all my computers to behave similarly. diff --git a/src/post/2020/06/06-my-first-pull-request.md b/src/post/2020/06/06-my-first-pull-request.md @@ -0,0 +1,35 @@ +# My First Pull Request + +## 06/16/2020 + +I was finally ready to make my first pull request. After double checking, and checking again, I knew my changes were ready to merge. I typed up a short summary of what I did, and how it was implemented. I refreshed the pull request page on Github every ten minutes for a few hours until I finally got the response I was waiting for: + +>"Please fix the indentation problems. Github diff page should show you." + +Oops. + +### Finding My First Project, or The First Victim of my Bad Convention-Following + +The project I contributed to was [nnn](https://github.com/jarun/nnn), a nifty little file manager written with C and Curses for Vim-like browsing and keyboard-oriented navigation. I'd never actually used nnn prior to contributing, but the especially easy to read code let me discover and contribute pretty much within the same day. + +### Tackling The Issue + +The issue at hand had to do with how Curses handled the hardware cursor. Text is drawn by Curses based on where the cursor is, but upon the refresh of the screen, the cursor always gets placed at the bottom of the screen, with the status bar. Normally, the cursor is invisible, since we don't use it in the program, but we can see it if we recompile the program with curs_set(TRUE) instead of curs_set(FALSE). + +![figure1](figure1.png) ![figure2](figure2.png) + +See the difference between the selected item and where the cursor "actually is"? + +This happens since the status bar is drawn last, and since it isn't important where the cursor is, then we can leave it where it got sent last. The problem is that some accessibility tools like screen readers rely on the cursor's position to detect what someone is looking at. The simple solution is to add a launch option, and then simply move the cursor to the selected item automatically when it's enabled, specifically after Curses is done drawing all the text onscreen. Since the currently selected item's line was already defined, this was easy. + +![figure3](figure3.png) + +Much better. + +### Code Quality + +My changes were eventually merged, but my indentation and ignorance of conventions within the project got slammed. Pretty much every line I added had to be sanitized of silly mistakes. Oops. The kind maintainer was willing to fix my changes and push to master. + +### My Tips for New Open Source Contributors, Like Myself + +You probably want to contribute to a project you're already fond of. This project was particularly well documented and minimalistic, with only one C file to keep track of. Knowing a program well in usage will let you be more pragmatic when deciphering code. Also, follow code conventions. You might be able to implement a requested feature or fix, but you want to know you're doing it the best way possible. At the end of the day, you're deciding to contribute to software that helps out everyone. Keep at it. diff --git a/src/post/2020/06/figure1.png b/src/post/2020/06/figure1.png Binary files differ. diff --git a/src/post/2020/06/figure2.png b/src/post/2020/06/figure2.png Binary files differ. diff --git a/src/post/2020/06/figure3.png b/src/post/2020/06/figure3.png Binary files differ. diff --git a/src/post/2020/08/07-website-generation-with-unix-coreutils.md b/src/post/2020/08/07-website-generation-with-unix-coreutils.md @@ -0,0 +1,45 @@ +# Website Generation With Unix Coreutils +## 08/05/2020 + +As a newbie website author, my process of post-writing consisted of: + +- Copying the last post I made in raw HTML +- Erasing the paragraphs and writing new ones +- Pushing to my server with scp + +I'm serious! + +I knew about static site generators, but they all seemed unpleasant and bloated, and not worth the trouble if I'm just going to be writing plain HTML blog posts every few weeks or so. I was on the search for something better, though, since this bad workflow discouraged me from writing. If I wanted to make a change to the footer of my website, I'd have to come up with a clever sed command to add what I wanted to every page, and then re-push. I even wrote out most of the rss feed by hand! + +I came across [this post](https://momi.ca/posts/2020-07-21-ssg.html) by [Anjandev Momi](https://momi.ca/index.html), which inspired me to take my own dive into a new blogging setup that this site is being built with as of now. + +Momi's post was a huge help in getting me set up and guiding me around some of the nuances of the tools I used. + +[ssg5](https://www.romanzolotarev.com/ssg.html) is a static site generator made with 180 lines of shell script. I would have never thought I could simply read my site generator. I'll document my experience porting my site over here similarly to Momi's post. + +### rssg + +To generate an rss feed, [rssg](https://www.romanzolotarev.com/rssg.html) is a companion script that generates a feed from your webpages. rssg is kind of finicky, though, and needs a list of posts laid out a certain way to generate correctly. I took a trick out of Anjan's book and wrote my own [script](indexgen.sh) to generate a list for rssg to use. Figuring out what rssg was looking for was definitely the hardest part of the setup, and it took me a few tries to wrap my head around how it was generating. + +Anjan's post mentions having to change the date_rfc_822() function in rssg to fit his date format / keep compatibility with GNU coreutils. Since my dates were already in MM-DD-YYYY format, I was able to pretty much omit the function from my copy. + +### ssg5 + +Since I wanted a different header based on whether the user was looking at a blogpost or the index, I made some small changes to ssg5. I separated the header definition into a "default header" and an "index header" in main(): + +``h_file="$src/_header.html" +h_index_file="$src/_header-index.html" +f_file="$src/_footer.html" +test -f "$f_file" && FOOTER=$(cat "$f_file") && export FOOTER +test -f "$h_file" && DEFHEADER=$(cat "$h_file") && export DEFHEADER +test -f "$h_index_file" && INDEXHEADER=$(cat "$h_index_file") && export INDEXHEADER`` + +Then in render_md_files_markdown_pl(), I added a check to match the filename with index.md. This change is also pretty similar to the one in Momi's post. + +``if $(echo "$1/$f" | grep "index.md" > /dev/null); then +HEADER="$INDEXHEADER" && export HEADER +else +HEADER="$DEFHEADER" && export HEADER +fi`` + +To push my website, I wrote a script that just runs the programs in order and then rsyncs it to my server. It makes and deploys super quick, and has really gotten me back in the groove of writing again. Thanks again to [Anjandev Momi](https://momi.ca/index.html) for writing a great introduction to something I probably would never have heard of otherwise. diff --git a/src/post/2020/08/indexgen.sh b/src/post/2020/08/indexgen.sh @@ -0,0 +1,13 @@ +#!/bin/bash +cd dst +FILES="$(find post/ -type f -name "*.html" | sort)" +TITLES="$(cat $FILES | grep h1 | sed 's|</*h1>||g')" +DATES="$(cat $FILES | grep h2 | sed 's|</*h2>||g')" + +FILESHTML="$(printf %b "$FILES" | sed 's|^|<a href="/|g;s/$/" /g')" +DATESPREPEND="$(printf %b "$DATES" | sed 's/^/<li>/g;s/$/ /g')" +DATESHTML="$(printf %b "$DATES" | sed 's/^/title="/g;s/$/"/g')" +TITLESHTML="$(printf %b "$TITLES" | sed 's/^/>/g;s|$|</a></li>|g')" + +paste -d "" <(echo "$DATESPREPEND") <(echo "$FILESHTML") <(echo "$DATESHTML") <(echo "$TITLESHTML") | tac +printf %b "<a href=\"https://eonndev.com/rss.xml\">rss</a>" diff --git a/src/post/2021/01/02-sxmo-brings-suckless-philosophy-to-mobile.md b/src/post/2021/01/02-sxmo-brings-suckless-philosophy-to-mobile.md @@ -0,0 +1,30 @@ +# Sxmo brings suckless philosophy to mobile +## 01/02/2021 + +One of the aspects of computing that I lament most is the current state of the mobile smart phone market. +Nearly all cell phones are made to limit the user's capabilities and freedoms. +Most phones are designed to be replaced later, and restrict the user with an operating system that limits what the user can do with the computer they've just bought. +[Pine64's Pinephone](https://pine64.org/pinephone) and [Purism's Librem 5](https://puri.sm/products/librem-5) are examples of some products that are designed with extensibility or freedom in mind. + +Whenever I hear discussion about one of these products, I hear a phrase that rings similarly to + +"It's not ready yet," + +"I'll consider it when there's more polish," or + +"It needs more time to be usable as a daily driver." + +I can say, at least, with my experience with Pine64's Pinephone, that using a Pinephone as a day-to-day device is definitely possible, right now. +While I haven't tried many of the interfaces available for the Pinephone yet, I can say without a doubt that my favorite is [Sxmo: Simple X Mobile](https://sr.ht/~mil/Sxmo). +I've done some work with the project last year, but I've just now gotten back to giving it a try after letting my Pinephone collect dust for a few months, and the improvements made in my absense prompted me to write this post. + +Sxmo is built on top of [PostmarketOS](https://postmarketos.org), and exists as a collection of programs to build an interface that truly follows the Unix and suckless philosophies. +Sxmo takes GNU, suckless utilities, and the tools on-hand to create a sleek, working environment. +The fact that it's made up of common GNU utilities and suckless software makes it extremely user friendly to those already versed in their usage. +For example, window managment is done with a modified [dwm](https://dwm.suckless.org), and most of the utilities that are custom-made for the environment are shell scripts that take advantage of the GNU coreutils. + +Because of this, it's very easy to say, open an SSH server on the device, or set up a file-sharing job, since OpenSSH and rsync already exist here. +This also makes the source code of the included utilities easy to read, understand, and modify. +If I were to attempt some of these things on a stock Android installation, they would become much more difficult and at times seemingly impossible. +I'm finally able to treat my mobile device as the computer it is, and I'm able to extend it for any purpose with the freedom I'm given. +If you have a Pinephone on-hand, or are considering the benefits of having one, I recommend this environment to enjoy along with the other liberties you'd be gaining from these devices, like removable batteries and network kill-switches. diff --git a/src/post/2021/05/27-text-interfaces-are-the-most-user-friendly.md b/src/post/2021/05/27-text-interfaces-are-the-most-user-friendly.md @@ -0,0 +1,60 @@ +# Text Interfaces Are The Most User Friendly +## 05/27/21 + +The situation I was in had me dealing with a set of about 550k png images in a single directory extracted from a recovery image. +The images were extracted by Foremost on a partition that used to contain a root filesystem. +Since filenames weren't preserved, they weren't named in any way I could pick out the ones I wanted, and I could only go off of image metadata. +There was only a small portion of this massive library of images I needed to recover, and there was no way I could browse that many pictures to pick what I wanted. +Anything I was looking for was randomly placed in a sea of UI images or browser-cached icons. + +I knew the images I wanted were likely to be larger than the majority of the rest, and listing images by size decreasing is simple. +However, PCManFM couldn't read the massive directory, and trying to browse it with Geeqie was also unusably slow on my old disk. + +I was willing to sift through maybe a few thousand pictures, and I only needed to see the largest ones - maybe over 300x300 in resolution. +I realized I didn't really need a conventional file manager to do this. + +``$ feh -p --min-dimension 300x300 $(find . -maxdepth 1 -type f -printf '%s\t%p\n' | sort -n | tail -n $TOLERABLE_NUMBER | cut -f2)`` + +It's not the most radical example of shell magic, +but it made me appreciate that a bash interpreter allowed me to make my own rules and answer to a dynamic query. +That snippet is equivalent to the statement: + +``In this directory, use an image viewer to show me a slideshow of the largest X images that are 300x300 or larger. With the smallest ones first, please.`` + +Or, more literally: + +``In this directory, find files, and give me two fields, their size and name. Sort the entries numerically and give me the first X of those inputs. Now take the name field of each of these and pass them as arguments to the image viewer feh, truncating images whose resolutions are smaller than 300x300.`` + +With Bash (or most shell language) syntax, the query could go on and on with manipulations or sorts I could do to arbitrary input. +The best part about this is that I don't have to wonder if something's a 'feature' of the program I'm using - it's a matter of using the tools in my toolbox to explain what I want to happen in an exact fashion. + +A misnomer I hear all the time is that users are "scared away from using Linux (sic.)" +because there's something terribly awful and *un*intuitive about "the command line" that will cause a new user to suddenly go mad and have no choice but to quit before psychosis sets in. + +This post is an argument to the contrary - the text interface of a shell is one of the most ingenious and user-*friendly* interfaces I can think of. + ++ Small programs that do one thing allow you to intuitively do nuanced things. ++ Text is the most accessible medium - there are many ways to enter text. ++ It's easy to share text with my friend. If he wants to do what I did, I can send him verbatim what I've just done. ++ If the only I/O you have to worry about is text streams, then it's easier to extend scripts. ++ Since Bash (or similar shell) is a programming language itself, I can save the text as a script and run it. ++ I can access every one of my tools from the same interface. I don't have to learn a new button layout or general syntax to do something else. ++ As long as a program takes input, and puts something out, it's useful. + +These points might seem obvious, but I've never heard these points brought up from a UX perspective. +If you don't know what something does, you can peruse the manual and see exactly how you can use a program with no ambiguity. +The only real learning hurdle happens when you don't know something exists on your machine, +but most interfaces struggle with that problem somewhat. +Once you add a tool to your mental toolbox, you can use it forever. +I can use grep to apply a regular expression to input. +That input could be a file, but it could be input from anything else. +You kind of get this natural-language feel to it all. +grep is logically less a program and more a verb. +You don't have to be computer-savvy or a programmer to construct a query with some semantics that would be hard or almost impossible to do in an application where the developer has to attempt to accomodate each use case. + +There are definitely programs that benefit from not being driven by a text interface, +and they mostly happen to be that way because the core of the purpose of the program can't be practically protrayed by text. +I'll never use GIMP with a CLI, nor will I play SuperTuxKart in the buffer - they are obvious cases. + +However, there is still something to be said about the massive versatility of the text interface that can't quite be replicated by any interface that takes pride in their ease of use. +The definition of 'ease' in many minds is not "let the user easily do what they want" but rather "let the user easily do what we think they want." diff --git a/src/post/2021/08/20-you-cant-have-your-cake.md b/src/post/2021/08/20-you-cant-have-your-cake.md @@ -0,0 +1,108 @@ +# You Can't Have Your Cake And Eat it Too With GNU/Linux Distributions +## 08/20/2021 + +The reason that "The Year of The 'Linux Desktop'" is mostly a meme and +thrown around as a buzzword in blogs is because we fundamentally +misunderstand the meaning of the phrase 'Linux Desktop'. The 'Linux +Desktop' as most people think of it is a myth and something that will +never happen, not because the open model of the Free Software desktop +isn't viable, but rather because most have the wrong idea of how a +desktop that affords you freedom should be. + +Tell me if you've heard an anecdote of this type somewhere: + +_...So I went to try out Linux, mostly because I was sick of +$PROPRIETARYOS. I installed $POPULARDISTRIBUTION since the desktop +looked nice and people said it was 'easy'. I had to do a weird thing +to get my graphics working, but I followed a guide online so it was +O.K. I was smooth sailing, until +about a week ago when a system update broke my graphics. I don't know +what happened, but I went back to $PROPRIETARYOS because it never +breaks like that. Guess Linux isn't ready for 'prime-time' yet._ + +_Hmm... What could have happened? It broke during an update? Jeez, +these distribution maintainers are awfully irresponsible for not being +able to maintain a system that "works"._ + +It's understandable for a new GNU/Linux user to be confused that a +component of his operating system seemed to have stopped +working. However, notice the order of things that happened. + ++ A user picks a distribution filled with pre-loaded software and +configuration, ++ The user has a special case where they need to change a default +configuration to suit their needs, ++ This modification was the probable cause of some trouble brewing outside +of the user's awareness, and so he chalks it up to lack of polish. + +A key difference between a proprietary operating system and one that +affords you freedom is the fact that you have the ability to choose +how your computer works, and change any aspect you'd like. For some +reason, though, distribution projects pride themselves on piling on as +much of their own configuration into the disk image as possible, for +the _out of the box_ experience. + +Issues usually come about when you then try to change something about +your system. What's fine and dandy at first turns into a maintenance nightmare when +you're trying to figure out what those default configurations are, and +you suddenly need to distinguish between general-purpose software +documentation, distribution-specific documentation, and forum posts +that may or may not be relevant to your problem, because you have no +idea what software your computer is running, for the most part. + +This is the phase where most new users get too frustrated, and quit. + +The problem lies in wanting to have your cake and eat it too. _I want +an operating system that is libre and configurable to the highest +level,_ but also, _I want an operating system that makes every decision +for me, except when I want to, but also never collides with my +actions. It should always do what I want and never do what I don't +expect._ +The trouble that distribution projects often come to face +with is the sheer amount of directions they're being pulled into in +order to appease "the user" and make sure they never have to learn +anything about the software they're running. They market themselves on +being "hassle-free", when it's never further from the truth with those +projects. All of the sudden, you see users "distro-hopping" and +getting frustrated because they can't find an image of GNU with +everything they want and nothing of what they don't want. + +No more telling people to blindly install Mint because "it's easy and works". +The standard needs to be set for users to configure their own systems, +so that they can choose the software they want. At the very least, a +user needs to know what programs they want to install. Less decisions +made by distribution developers and more decisions made by the +computer user himself. This way, a user can usually diagnose a +problem with his GNU system, or change his system to his specific needs, +because he knows how he's configured his computer to work. Even +if they can't solve general software problems, they'll surely have a +better idea of how to explain it to somebody who can. The user can get +the full benefits of a GNU/Linux system without compromises for the +illusion of ease. + +Distributions that embody this idea are usually called "minimal", +but are also wrongly classified as "for advanced users" or "only if +you want to know under the hood stuff" + +_You're an elitist! You think computer users want to live in the +command line all day! I've got a job, buddy!_ + +The thing I don't understand about this argument is that you actually +_save_ time in the long-run by choosing your configuration when you +install your operating system, which maybe takes an afternoon, +max. You don't need to be a programmer or a command-line wiz to type a +command to install your audio server. Taking the time _now_ beats +taking even more time _later_ when you're doing something +mission-critical and suddenly need to figure out why running 'apt +upgrade' broke your special manually-installed driver. Then, once you +have that configuration, it isn't like you need to re-write it every +day or something. You can back it up and save it, and share it with +other people. You can modify it to suit new hardware or different +needs. All of the sudden, you've harnessed the power of a truly Free +operating system. This is what users coming from proprietary and evil +operating systems don't understand, and at no fault of their own. You +can't promise a lifelong Windows user Windows if you're giving them GNU +instead. They will be frustrated when they mistake design paradigm for +instability. + +tl;dr: RTFM +\ No newline at end of file diff --git a/src/post/2022/01/16-updates-to-the-website.md b/src/post/2022/01/16-updates-to-the-website.md @@ -0,0 +1,12 @@ +# Updates to The Website + +## 01/16/2022 + ++ You might have noticed already that I've changed the domain of the website (and links in pages) to https://eonn.xyz some time ago. +For the time being https://eonndev.com will redirect to https://eonn.xyz, maybe the next year or so, but from now on I will use eonn.xyz as my domain for mail and my website. + ++ I've also redone the git server from scratch (I will post about it soon) since I haven't touched it in a long time. +The dotfiles repo was outdated since my migration from Gentoo to GuixSD on most of my systems (I'll also post about this soon). + ++ There was also an issue with how my rss feed generator was formatting publish dates. +If you're using newsboat and dates don't look right, clear the cache and re-download the feed. diff --git a/src/styles.css b/src/styles.css @@ -0,0 +1,81 @@ +@font-face { + font-family: 'DejaVu'; + src: url('/fonts/DejaVuSansMono.ttf') format('truetype'); + text-rendering: optimizeLegibility; +} + +body { + font-family: 'DejaVu'; + color: black; + background-color: #254; + font-size: 12px; +} + +.short { + max-width: 40em; + margin: 75 auto; + left: 50%; +} + +.post { + max-width: 110em; + margin: 75 auto; + left: 50%; +} + +.border { + padding: 12px; + box-shadow: 6px 7px 10px 0px #000000; + color: black; + border-color: #dabe71; + border-style: ridge; + border-width: 4px; + background-color: #e5d19a; + margin-bottom: 10px; + overflow: auto; +} + +ul{ + max-width: 50em; + margin: 20 auto; + left: 50%; +} + +h1{ + font-size: 1.5em; + text-align: center; +} + +h2{ + font-size:1.3em; + color:black; + text-align: center; +} + +a:link{ + color:#294957; +} + +a:visited{ + color:#294957; +} + +a:hover{ + color:white; + background:#5961b5; +} + +::selection{ + color:white; + background:#5961b5; +} + +code{ + width:750px; + margin:10 auto; + padding:20px; + display:block; + white-space: pre-wrap; + background-color:#333333; + color: #ffffff; +}