diff --git a/blog/.backup.tar.gz b/blog/.backup.tar.gz index d672844..1cb180f 100644 Binary files a/blog/.backup.tar.gz and b/blog/.backup.tar.gz differ diff --git a/blog/.yesterday.tar.gz b/blog/.yesterday.tar.gz index 279b319..7421933 100644 Binary files a/blog/.yesterday.tar.gz and b/blog/.yesterday.tar.gz differ diff --git a/blog/all_posts.html b/blog/all_posts.html index a2ce6fa..84b238a 100644 --- a/blog/all_posts.html +++ b/blog/all_posts.html @@ -17,6 +17,7 @@
line 1
\n\nline 2
' ]] || - [[ $("$markdown_bin" <<< $'line 1\n\nline 2') == $'line 1
\nline 2
' ]] - ) -} - - -# Parse a Markdown file into HTML and return the generated file -markdown() { - out=${1%.md}.html - while [[ -f $out ]]; do out=${out%.html}.$RANDOM.html; done - $markdown_bin "$1" > "$out" - echo "$out" -} - -# Reads HTML file from stdin, prints its content to stdout -# $1 where to start ("text" or "entry") -# $2 where to stop ("text" or "entry") -# $3 "cut" to remove text from$template_tags_line_header/ ) print
- }
- }
- }"
-}
-
-# Edit an existing, published .html file while keeping its original timestamp
-# Please note that this function does not automatically republish anything, as
-# it is usually called from 'main'.
-#
-# Note that it edits HTML file, even if you wrote the post as markdown originally
-# Note that if you edit title then filename might also change
-#
-# $1 the file to edit
-# $2 (optional) edit mode:
-# "keep" to keep old filename
-# "full" to edit full HTML, and not only text part (keeps old filename)
-# leave empty for default behavior (edit only text part and change name)
-edit() {
- [[ ! -f "${1%%.*}.html" ]] && echo "Can't edit post "${1%%.*}.html", did you mean to use \"bb.sh post $template_tags_line_header/s|\\1|\\1|g" >> "$TMPFILE"
- $EDITOR "$TMPFILE"
- filename=$1
- fi
- rm "$filename"
- if [[ $2 == keep ]]; then
- parse_file "$TMPFILE" "$edit_timestamp" "$filename"
- else
- parse_file "$TMPFILE" "$edit_timestamp" # this command sets $filename as the html processed file
- [[ ${1##*.} == md ]] && mv "$1" "${filename%%.*}.md" 2>/dev/null
- fi
- rm "$TMPFILE"
- fi
- touch -t "$touch_timestamp" "$filename"
- touch -t "$touch_timestamp" "$1"
- chmod 644 "$filename"
- echo "Posted $filename"
- tags_after=$(tags_in_post "$filename")
- relevant_tags=$(echo "$tags_before $tags_after" | tr ',' ' ' | tr ' ' '\n' | sort -u | tr '\n' ' ')
- if [[ ! -z $relevant_tags ]]; then
- relevant_posts="$(posts_with_tags $relevant_tags) $filename"
- rebuild_tags "$relevant_posts" "$relevant_tags"
- fi
-}
-
-# Create a Twitter summary (twitter "card") for the post
-#
-# $1 the post file
-# $2 the title
-twitter_card() {
- [[ -z $global_twitter_username ]] && return
-
- echo ""
- echo ""
- echo "" # Twitter truncates at 70 char
- description=$(grep -v "^ $template_tags_line_header" "$1" | sed -e 's/<[^>]*>//g' | head -c 250 | tr '\n' ' ' | sed "s/\"/'/g")
- echo ""
- image=$(sed -n 's/.* $template_comments $template_twitter_button "
- echo " $template_comments ";
- fi
-
- echo "$template_twitter_button "
- echo " 's on the title because of markdown conversion
- title=${title// /}
- title=${title//<\/p>/}
- echo "$title"
- echo ' and $template_tags_line_header"* ]]; then
- tags=$(echo "$line" | cut -d ":" -f 2- | sed -e 's/<\/p>//g' -e 's/^ *//' -e 's/ *$//' -e 's/, /,/g')
- IFS=, read -r -a array <<< "$tags"
-
- echo -n " $template_tags_line_header " >> "$content"
- for item in "${array[@]}"; do
- echo -n "$item, "
- done | sed 's/, $/<\/p>/g' >> "$content"
- else
- echo "$line" >> "$content"
- fi
- done < "$1"
-
- # Create the actual html page
- create_html_page "$content" "$filename" no "$title" "$2" "$global_author"
- rm "$content"
-}
-
-# Manages the creation of the text file and the parsing to html file
-# also the drafts
-write_entry() {
- test_markdown && fmt=md || fmt=html
- f=$2
- [[ $2 == -html ]] && fmt=html && f=$3
-
- if [[ -n $f ]]; then
- TMPFILE=$f
- if [[ ! -f $TMPFILE ]]; then
- echo "The file doesn't exist"
- delete_includes
- exit
- fi
- # guess format from TMPFILE
- extension=${TMPFILE##*.}
- [[ $extension == md || $extension == html ]] && fmt=$extension
- # but let user override it (`bb.sh post -html file.md`)
- [[ $2 == -html ]] && fmt=html
- # Test if Markdown is working before re-posting a .md file
- if [[ $extension == md ]]; then
- test_markdown
- if (($? != 0)); then
- echo "Markdown is not working, please edit HTML file directly."
- exit
- fi
- fi
- else
- TMPFILE=.entry-$RANDOM.$fmt
- echo -e "Title on this line\n" >> "$TMPFILE"
-
- [[ $fmt == html ]] && cat << EOF >> "$TMPFILE"
- The rest of the text file is an html blog post. The process will continue as soon
-as you exit your editor. $template_tags_line_header keep-this-tag-format, tags-are-optional, example $template_tags_line_header/{s/^ $template_tags_line_header//;s/<[^>]*>//g;s/[ ,]\+/ /g;p;}" "$1" | tr ', ' ' '
-}
-
-# Finds all posts referenced in a number of tags.
-# Arguments are tags
-# Prints one line with space-separated tags to stdout
-posts_with_tags() {
- (($# < 1)) && return
- set -- "${@/#/$prefix_tags}"
- set -- "${@/%/.html}"
- sed -n '/^ I found out why olibc wasn’t giving correct return value after program is executed. It was because
+liblinux wasn’t exiting correctly, so it received some random return values from stack. Also a lot of testing were done. I have found out that several functions wasn’t working correctly
+and fixed it. We have shell script for testing that compares results from our libc and libc that
+installed on user’s machine. It prints a diff output if test was failed. It also have other
+features, if you want you can check it by running Because of it I have found that several functions were wrong implemented. But now finally
+everything is working and strtok is correctly implemented! Also this blog finally moved totally from my webpage, so we can move this site on different
+server just by cloning it from codeberg or tildegit Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) My current goal is to implement <string.h> and after that I am planning to publish it.
Currently most of funcs are implemented. Making strtok now but all other functions need
-locale.h and I don’t know yet how I will be implemented. But it is already cool that we
+locale.h and I don’t know yet how it will be implemented. But it is already cool that we
have most of functions that should be in <string.h>! Also we now have gru webpage on codeberg! Maybe next week I
@@ -24,8 +53,6 @@ will move all devlogs to gru webpage so it will be easier to move. Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) My current goal is to implement <string.h> and after that I am planning to publish it.
Currently most of funcs are implemented. Making strtok now but all other functions need
-locale.h and I don’t know yet how I will be implemented. But it is already cool that we
+locale.h and I don’t know yet how it will be implemented. But it is already cool that we
have most of functions that should be in <string.h>! Also we now have gru webpage on codeberg! Maybe next week I
@@ -39,8 +39,6 @@ will move all devlogs to gru webpage so it will be easier to move. Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) This week I also was making olibc. Now it is published! I have mostly implemented <string.h>, but there
+still some funcs that require <locale.h>, so they are not implemented yet. I found out why olibc wasn’t giving correct return value after program is executed. It was because
+liblinux wasn’t exiting correctly, so it received some random return values from stack. Also a lot of testing were done. I have found out that several functions wasn’t working correctly
+and fixed it. We have shell script for testing that compares results from our libc and libc that
+installed on user’s machine. It prints a diff output if test was failed. It also have other
+features, if you want you can check it by running Because of it I have found that several functions were wrong implemented. But now finally
+everything is working and strtok is correctly implemented! Also this blog finally moved totally from my webpage, so we can move this site on different
+server just by cloning it from codeberg or tildegit Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) This week I also was making olibc. Now it is published! I have mostly implemented <string.h>, but there
+still some funcs that require <locale.h>, so they are not implemented yet. I found out why olibc wasn’t giving correct return value after program is executed. It was because
+liblinux wasn’t exiting correctly, so it received some random return values from stack. Also a lot of testing were done. I have found out that several functions wasn’t working correctly
+and fixed it. We have shell script for testing that compares results from our libc and libc that
+installed on user’s machine. It prints a diff output if test was failed. It also have other
+features, if you want you can check it by running Because of it I have found that several functions were wrong implemented. But now finally
+everything is working and strtok is correctly implemented! Also this blog finally moved totally from my webpage, so we can move this site on different
+server just by cloning it from codeberg or tildegit Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) My current goal is to implement <string.h> and after that I am planning to publish it.
Currently most of funcs are implemented. Making strtok now but all other functions need
-locale.h and I don’t know yet how I will be implemented. But it is already cool that we
+locale.h and I don’t know yet how it will be implemented. But it is already cool that we
have most of functions that should be in <string.h>! Also we now have gru webpage on codeberg! Maybe next week I
@@ -38,8 +68,6 @@ will move all devlogs to gru webpage so it will be easier to move. Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) Hooray! Today is 10’s GRU Devlog! :) This week i was trying to make notes to org document, to not forget something and put TODOs
-there for future weeks. First several days was the most valuable - readline support and signal handling!
-This means you can use emacs-like bindings there (but i think readline also supports vi bindings,
-so maybe i will add them too!) Also we now have very minimal completion support there :), but still proper function need to be added
-for that (currently only filenames completion) Orsh also has one session history, so you don’t need to rewrite command from scratch now And I have started to use it as my main (but had some problems after chsh, so currently is autostarts after bash
-and i can exit from there any time i will need) Then I have started making our own assembler - gasm. Currently it only supports NOP, so i haven’t published it yet. This week I also registered to ~news and shared devlog there (i think this devlog also will be there ;) )
-If you have lobste.rs account please contact me to invite me, if you can, because it may advertize GRU more! Today (Sunday) we had first testing GRU meeting via Jitsi. Thanks to r1k for joining.
-We need to make something like plan our schedule (to know about what to speak) and discuss meeting time better. Hope you liked this post and you will join our XMPP muc (if you are not already there) :).
-If you would like to help me, contact me via email, xmpp or irc :) tags: gru, org-mode, gasm, orsh, meeting, lobste.rs, tilde.news This week I also was making olibc. Now it is published! I have mostly implemented <string.h>, but there
+still some funcs that require <locale.h>, so they are not implemented yet. I found out why olibc wasn’t giving correct return value after program is executed. It was because
+liblinux wasn’t exiting correctly, so it received some random return values from stack. Also a lot of testing were done. I have found out that several functions wasn’t working correctly
+and fixed it. We have shell script for testing that compares results from our libc and libc that
+installed on user’s machine. It prints a diff output if test was failed. It also have other
+features, if you want you can check it by running Because of it I have found that several functions were wrong implemented. But now finally
+everything is working and strtok is correctly implemented! Also this blog finally moved totally from my webpage, so we can move this site on different
+server just by cloning it from codeberg or tildegit Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) My current goal is to implement <string.h> and after that I am planning to publish it.
Currently most of funcs are implemented. Making strtok now but all other functions need
-locale.h and I don’t know yet how I will be implemented. But it is already cool that we
+locale.h and I don’t know yet how it will be implemented. But it is already cool that we
have most of functions that should be in <string.h>! Also we now have gru webpage on codeberg! Maybe next week I
@@ -38,8 +68,6 @@ will move all devlogs to gru webpage so it will be easier to move. Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) This week I also was making olibc. Now it is published! I have mostly implemented <string.h>, but there
+still some funcs that require <locale.h>, so they are not implemented yet. I found out why olibc wasn’t giving correct return value after program is executed. It was because
+liblinux wasn’t exiting correctly, so it received some random return values from stack. Also a lot of testing were done. I have found out that several functions wasn’t working correctly
+and fixed it. We have shell script for testing that compares results from our libc and libc that
+installed on user’s machine. It prints a diff output if test was failed. It also have other
+features, if you want you can check it by running Because of it I have found that several functions were wrong implemented. But now finally
+everything is working and strtok is correctly implemented! Also this blog finally moved totally from my webpage, so we can move this site on different
+server just by cloning it from codeberg or tildegit Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) My current goal is to implement <string.h> and after that I am planning to publish it.
Currently most of funcs are implemented. Making strtok now but all other functions need
-locale.h and I don’t know yet how I will be implemented. But it is already cool that we
+locale.h and I don’t know yet how it will be implemented. But it is already cool that we
have most of functions that should be in <string.h>! Also we now have gru webpage on codeberg! Maybe next week I
@@ -38,8 +68,6 @@ will move all devlogs to gru webpage so it will be easier to move. Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) This week I also was making olibc. Now it is published! I have mostly implemented <string.h>, but there
+still some funcs that require <locale.h>, so they are not implemented yet. I found out why olibc wasn’t giving correct return value after program is executed. It was because
+liblinux wasn’t exiting correctly, so it received some random return values from stack. Also a lot of testing were done. I have found out that several functions wasn’t working correctly
+and fixed it. We have shell script for testing that compares results from our libc and libc that
+installed on user’s machine. It prints a diff output if test was failed. It also have other
+features, if you want you can check it by running Because of it I have found that several functions were wrong implemented. But now finally
+everything is working and strtok is correctly implemented! Also this blog finally moved totally from my webpage, so we can move this site on different
+server just by cloning it from codeberg or tildegit Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :) My current goal is to implement <string.h> and after that I am planning to publish it.
Currently most of funcs are implemented. Making strtok now but all other functions need
-locale.h and I don’t know yet how I will be implemented. But it is already cool that we
+locale.h and I don’t know yet how it will be implemented. But it is already cool that we
have most of functions that should be in <string.h>! Also we now have gru webpage on codeberg! Maybe next week I
@@ -38,8 +68,6 @@ will move all devlogs to gru webpage so it will be easier to move. Hope you liked this post! If you would like to help us, contact me via email, xmpp or irc :)"
- # remove possible
'
- if [[ -z $timestamp ]]; then
- echo ""
- else
- echo ""
- fi
- if [[ -z $timestamp ]]; then
- echo -n "$template_archive_title
"
- prev_month=""
- while IFS='' read -r i; do
- is_boilerplate_file "$i" && continue
- echo -n "." 1>&3
- # Month headers
- month=$(LC_ALL=$date_locale date -r "$i" +"$date_allposts_header")
- if [[ $month != "$prev_month" ]]; then
- [[ -n $prev_month ]] && echo "" # Don't close ul before first header
- echo "$month
"
- echo ""
- prev_month=$month
- fi
- # Title
- title=$(get_post_title "$i")
- echo -n "
"
- echo ""
- } 3>&1 >"$contentfile"
-
- create_html_page "$contentfile" "$archive_index.tmp" yes "$global_title — $template_archive_title" "$global_author"
- mv "$archive_index.tmp" "$archive_index"
- chmod 644 "$archive_index"
- rm "$contentfile"
-}
-
-# Create an index page with all the tags
-all_tags() {
- echo -n "Creating an index page with all the tags "
- contentfile=$tags_index.$RANDOM
- while [[ -f $contentfile ]]; do
- contentfile=$tags_index.$RANDOM
- done
-
- {
- echo "$template_tags_title
"
- echo ""
- for i in $prefix_tags*.html; do
- [[ -f "$i" ]] || break
- echo -n "." 1>&3
- nposts=$(grep -c "<\!-- text begin -->" "$i")
- tagname=${i#"$prefix_tags"}
- tagname=${tagname%.html}
- case $nposts in
- 1) word=$template_tags_posts_singular;;
- 2|3|4) word=$template_tags_posts_2_4;;
- *) word=$template_tags_posts;;
- esac
- echo "
"
- echo ""
- } 3>&1 > "$contentfile"
-
- create_html_page "$contentfile" "$tags_index.tmp" yes "$global_title — $template_tags_title" "$global_author"
- mv "$tags_index.tmp" "$tags_index"
- chmod 644 "$tags_index"
- rm "$contentfile"
-}
-
-# Generate the index.html with the content of the latest posts
-rebuild_index() {
- echo -n "Rebuilding the index "
- newindexfile=$index_file.$RANDOM
- contentfile=$newindexfile.content
- while [[ -f $newindexfile ]]; do
- newindexfile=$index_file.$RANDOM
- contentfile=$newindexfile.content
- done
-
- # Create the content file
- {
- n=0
- while IFS='' read -r i; do
- is_boilerplate_file "$i" && continue;
- if ((n >= number_of_index_articles)); then break; fi
- if [[ -n $cut_do ]]; then
- get_html_file_content 'entry' 'entry' 'cut' <"$i" | awk "/$cut_line/ { print \"\" ; next } 1"
- else
- get_html_file_content 'entry' 'entry' <"$i"
- fi
- echo -n "." 1>&3
- n=$(( n + 1 ))
- done < <(ls -t ./*.html) # sort by date, newest first
-
- feed=$blog_feed
- if [[ -n $global_feedburner ]]; then feed=$global_feedburner; fi
- echo ""
- } 3>&1 >"$contentfile"
-
- echo ""
-
- create_html_page "$contentfile" "$newindexfile" yes "$global_title" "$global_author"
- rm "$contentfile"
- mv "$newindexfile" "$index_file"
- chmod 644 "$index_file"
-}
-
-# Finds all tags referenced in one post.
-# Accepts either filename as first argument, or post content at stdin
-# Prints one line with space-separated tags to stdout
-tags_in_post() {
- sed -n "/^/{s/.*href="\([^"]*\)">.*/\1/;p;}' "$@" 2> /dev/null
-}
-
-# Rebuilds tag_*.html files
-# if no arguments given, rebuilds all of them
-# if arguments given, they should have this format:
-# "FILE1 [FILE2 [...]]" "TAG1 [TAG2 [...]]"
-# where FILEn are files with posts which should be used for rebuilding tags,
-# and TAGn are names of tags which should be rebuilt.
-# example:
-# rebuild_tags "one_post.html another_article.html" "example-tag another-tag"
-# mind the quotes!
-rebuild_tags() {
- if (($# < 2)); then
- # will process all files and tags
- files=$(ls -t ./*.html)
- all_tags=yes
- else
- # will process only given files and tags
- files=$(printf '%s\n' $1 | sort -u)
- files=$(ls -t $files)
- tags=$2
- fi
- echo -n "Rebuilding tag pages "
- n=0
- if [[ -n $all_tags ]]; then
- rm ./"$prefix_tags"*.html &> /dev/null
- else
- for i in $tags; do
- rm "./$prefix_tags$i.html" &> /dev/null
- done
- fi
- # First we will process all files and create temporal tag files
- # with just the content of the posts
- tmpfile=tmp.$RANDOM
- while [[ -f $tmpfile ]]; do tmpfile=tmp.$RANDOM; done
- while IFS='' read -r i; do
- is_boilerplate_file "$i" && continue;
- echo -n "."
- if [[ -n $cut_do ]]; then
- get_html_file_content 'entry' 'entry' 'cut' <"$i" | awk "/$cut_line/ { print \"\" ; next } 1"
- else
- get_html_file_content 'entry' 'entry' <"$i"
- fi >"$tmpfile"
- for tag in $(tags_in_post "$i"); do
- if [[ -n $all_tags || " $tags " == *" $tag "* ]]; then
- cat "$tmpfile" >> "$prefix_tags$tag".tmp.html
- fi
- done
- done <<< "$files"
- rm "$tmpfile"
- # Now generate the tag files with headers, footers, etc
- while IFS='' read -r i; do
- tagname=${i#./"$prefix_tags"}
- tagname=${tagname%.tmp.html}
- create_html_page "$i" "$prefix_tags$tagname.html" yes "$global_title — $template_tag_title \"$tagname\"" "$global_author"
- rm "$i"
- done < <(ls -t ./"$prefix_tags"*.tmp.html 2>/dev/null)
- echo
-}
-
-# Return the post title
-#
-# $1 the html file
-get_post_title() {
- awk '/
/, /<\/a><\/h3>/{if (!/
/ && !/<\/a><\/h3>/) print}' "$1"
-}
-
-# Return the post author
-#
-# $1 the html file
-get_post_author() {
- awk '/
$global_title
"
- echo "test.sh --help
by yourself.GRU's blog
+
+GRU Devlog 21 - olibc
+
+
+test.sh --help
by yourself.
+GRU Devlog 21 - olibc
+
+
+test.sh --help
by yourself.
GRU Devlog 20 - olibc
@@ -29,7 +59,7 @@ with it and also fixed them.
GRU Devlog 19 - gic and several libs
@@ -272,49 +300,6 @@ very success, but I hope to do it more often :)
-
-
-GRU Devlog 10 - orsh now like proper shell and gasm
-
-
-
+GRU Devlog 21 - olibc
+
+
+test.sh --help
by yourself.
GRU Devlog 20 - olibc
@@ -29,7 +59,7 @@ with it and also fixed them.
GRU Devlog 19 - gic and several libs
diff --git a/blog/tag_liblinux.html b/blog/tag_liblinux.html
index 627840b..bc62a53 100644
--- a/blog/tag_liblinux.html
+++ b/blog/tag_liblinux.html
@@ -14,6 +14,36 @@
+GRU Devlog 21 - olibc
+
+
+test.sh --help
by yourself.
GRU Devlog 20 - olibc
@@ -29,7 +59,7 @@ with it and also fixed them.
GRU Devlog 19 - gic and several libs
diff --git a/blog/tag_olibc.html b/blog/tag_olibc.html
index 069af16..79e7820 100644
--- a/blog/tag_olibc.html
+++ b/blog/tag_olibc.html
@@ -14,6 +14,36 @@
+GRU Devlog 21 - olibc
+
+
+test.sh --help
by yourself.
GRU Devlog 20 - olibc
@@ -29,7 +59,7 @@ with it and also fixed them.
GRU Devlog 19 - gic and several libs