From 0e97f4e9e7672743bc9b04a2efa0b68d7f9bfa14 Mon Sep 17 00:00:00 2001 From: b4rkod Date: Wed, 15 May 2024 23:50:36 +0300 Subject: redid everything, not at the documentation stage --- add_to_rss.sh | 9 +++++---- basics.sh | 5 +++-- compile.sh | 10 ++++++++++ copy.sh | 3 +++ formatter.sh | 4 ++-- pages/blogposts.sh | 4 ++-- pages/index.sh | 13 +++++++------ pages/tools_i_use.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ rss_compile.sh | 27 +++++++++++++++++++++++++++ 9 files changed, 107 insertions(+), 16 deletions(-) create mode 100755 compile.sh create mode 100755 copy.sh create mode 100755 pages/tools_i_use.sh create mode 100755 rss_compile.sh diff --git a/add_to_rss.sh b/add_to_rss.sh index 0c4e0b3..c829f9f 100755 --- a/add_to_rss.sh +++ b/add_to_rss.sh @@ -1,7 +1,8 @@ -BASE=$(basename $1|sed s/txt$/html/) -FILE=$(cat $1|sed -E ':a;N;$!ba; s/\/\/\///g ;s/\//\\\//g ; s/\r{0,1}\n/<\\\/p>/g;s/^/

/;') -echo $BASE +FILE=$(cat $1 | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g'| sed "s#\/#\\\/#g" ) -sed -i "/<\!--item-->/s/$/\n\<\/pubDate>https:\/\/b4rkod.net.tr\/$BASE<\/guid>$BASE<\/title><link>https:\/\/b4rkod.net.tr\/blogposts\/$BASE<\/link><description><![CDATA[$FILE]]><\/description><\/item>/" "$HOME/www/source/rss.xml" +BASE=$(basename $1) + +RSS_DATE=$(date -d "$(stat -c %w $1)" -R) +sed -i "/<\!--item-->/s/$/\n<item>\n<pubDate>$RSS_DATE<\/pubDate>\n<guid>https:\/\/b4rkod.net.tr\/$BASE<\/guid>\n<title>$BASE<\/title>\n<link>https:\/\/b4rkod.net.tr\/blogposts\/$BASE<\/link>\n<description><![CDATA[$FILE]]><\/description>\n<\/item>/" "$HOME/www/source/rss.xml" diff --git a/basics.sh b/basics.sh index 21e255e..1c01c42 100755 --- a/basics.sh +++ b/basics.sh @@ -29,10 +29,11 @@ header() { <div id="menu" > <a href="/index.html" >Main</a> <a href="/blogposts.html" >Blogposts</a> - <a href="https://b4rkod.net.tr/avatar.html" >avatar</a> + <a href="/tools_i_use.html" >tools i use</a> <a href="https://git.b4rkod.net.tr" >git</a> - <a href="https://b4rkod.net.tr/rss.xml" >RSS</a> <a href="https://b4rkod.net.tr/#webrings" >webrings</a> + <a href="https://b4rkod.net.tr/avatar.html" >avatar</a> + <a href="https://b4rkod.net.tr/rss.xml" >RSS</a> </div> <br> <div id="main"> diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..51869b2 --- /dev/null +++ b/compile.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +. ~/.config/b4rcms/basics.sh + +for f in $(ls $ROOT/sh/pages) ; do + $ROOT/sh/pages/$f ; +done + +copy.sh + diff --git a/copy.sh b/copy.sh new file mode 100755 index 0000000..d7ca8ca --- /dev/null +++ b/copy.sh @@ -0,0 +1,3 @@ +#!/bin/sh +. ~/.config/b4rcms/basics.sh +rsync -al ~/www/source/* $SERVERFILE diff --git a/formatter.sh b/formatter.sh index d498b28..c5fa98e 100755 --- a/formatter.sh +++ b/formatter.sh @@ -1,8 +1,8 @@ #!/bin/sh . $HOME/www/sh/basics.sh -header $(basename $1|sed s/txt$/html/) +header $(basename $1) printf "<p> date : $(stat -c '%w' $1| cut -d " " -f 1)\n " -sed "/\/\/\//s/$/<\/p>/;/\/\/\//s/\/\/\//<p> /" $1 +cat $1 footer diff --git a/pages/blogposts.sh b/pages/blogposts.sh index 81242f0..33ba683 100755 --- a/pages/blogposts.sh +++ b/pages/blogposts.sh @@ -3,7 +3,7 @@ . ~/.config/b4rcms/basics.sh #compile the blogposts -for FILE in $(ls --time=creation -t $ROOT/blogposts) ; do +for FILE in $(ls -t $ROOT/blogposts) ; do mkdir -p $SOURCE/blogposts echo "$(header $FILE; cat $ROOT/blogposts/$FILE; footer)" >| $SOURCE/blogposts/$FILE done @@ -14,7 +14,7 @@ printf "$( printf \ " <h1> Here is all the blogposts i have posted about</h1> <ul> "; - for FILE in $(ls --time=creation -t $ROOT/blogposts) ; do + for FILE in $(ls -t $ROOT/blogposts) ; do echo "<li> <a href="blogposts/$FILE">$FILE</a> </li>" done footer diff --git a/pages/index.sh b/pages/index.sh index 1ee499c..754e09a 100755 --- a/pages/index.sh +++ b/pages/index.sh @@ -13,19 +13,20 @@ echo "$( <img src="/files/b4rkod_avatar.png" align="right"> <p>Anyways!<p> <p>In this site i will post crazy weird ramblings about technology with maybe my awful c practices scattered here and there.</p> - <p>I know my website doesn\'t look like much right now but i am stable and can be trusted with long, tedious labour with no immediate returns soo i will fill it with thingies and stuff. Pinkie promise...</p> + <p>I know my website doesn't look like much right now but i am stable and can be trusted with long, tedious labour with no immediate returns soo i will fill it with thingies and stuff. Pinkie promise...</p> <h2 > Contents </h2> " echo \ " <ul id="contents"> - <li><a href="//git.b4rkod.net.tr">git</a></li> - <li><a href=blogposts.html >Blogposts</a></li> + <li><a href=/blogposts.html >Blogposts</a></li> + <li><a href="https://git.b4rkod.net.tr">git</a></li> + <li><a href=/tools_i_use.html >Tools i use</a></li> + <li><a href=https://b4rkod.net.tr/#webrings >webrings</a></li> <li><a href=https://b4rkod.net.tr/avatar.html >avatar</a></li> - <li><a href=files/files.html >Library</a></li> - <li><a href=https://git.b4rkod.net.tr >git</a></li> <li><a href=https://b4rkod.net.tr/rss.xml >RSS</a></li> - <li><a href=https://b4rkod.net.tr/#webrings >webrings</a></li> + <li><a href=/twtxt.txt >twtxt</a></li> + <li><a href=files/files.html >Library</a></li> <li><a href=/trash/trash.html >Trash</a></li> </ul> " diff --git a/pages/tools_i_use.sh b/pages/tools_i_use.sh new file mode 100755 index 0000000..2240821 --- /dev/null +++ b/pages/tools_i_use.sh @@ -0,0 +1,48 @@ +#!/bin/sh +#compile the tools_i_use.html + +. ~/.config/b4rcms/basics.sh + +echo "$( + header + echo \ " + <h3>Hardware i use</h3> + + <dl> + + <dt>Hardware + + <dd>I currently use a <a href="https://www.thinkwiki.org/wiki/Category:X201"> Thinkpad X201 M540</a> named Asena. Linux runs on any hardware soo i don't really care about the performance and the keyboard and the trackpoint just makes her perfect for me. I maxxed out everything i could on her, the only thing i could upgrade is a msata drive, which is on the list. + + </dl> + + <h3>Software i use</h3> + + <dl> + <dt>Distro + + <dd> I use<a href="https://artixlinux.org"> Artix Gnu/Linux</a> for desktop but i have no hard feeling about distros. + <dd> my servers run the latest version of debian, i don't remember which version. + + <dt>WM + + <dd>I use <a href="https://dwm.suckless.org">DWM</a> because it is just great. I use it without any patches, disabled layouts, can't change the number of windows in the left side and deleted all code related to starting other programs. I like it more when sxhkd starts my programs, not dwm. + + <dt>Init + + <dd>I use <a href="http://smarden.org/runit">Runit</a> because as far as my limited linux experience goes, it is the most stable one. It is also simple stupid if you spare 5 minutes to read the manual. + + <dt>Terminal Emulator + + <dd>I use <a href="https://st.suckless.org">St</a> as you would expect, i just have scrollback and anysize patches for it. + + <dt>Editor + + <dd>I use <a href="https://neovim.io">Neovim</a>, i don't even remember why i use nvim instead of vim directly but i do. Vim is just soo much better, anyone that says it isn't that good or efficient is lying to themselves. You can only gain from using vim. + + <dt>Shell + + <dd>I use bash as interactive shell because it was the one the system came with. I try to keep the shell close to default,my .bashrc is only 66 lines. /bin/sh is symlinked to dash. + " + footer +)" >| $SOURCE/tools_i_use.html diff --git a/rss_compile.sh b/rss_compile.sh new file mode 100755 index 0000000..3650502 --- /dev/null +++ b/rss_compile.sh @@ -0,0 +1,27 @@ + +#!/bin/sh + +. ~/.config/b4rcms/basics.sh + + echo \ " + <?xml version="1.0" encoding="UTF-8" ?> + <rss version="2.0"> + + <channel> + " + echo "<title>b4rkod's Basement" + echo " https://b4rkod.net.tr/rss.xml " + echo "My Basement's Window" + echo ' ' + + for FILE in $(ls --time=creation -t $ROOT/blogposts) ; do + RSS_DATE=$(date -d "$(stat -c %w $ROOT/blogposts/$FILE)" -R) + echo \ " + + $RSS_DATE<\/pubdate> + https:\/\/b4rkod.net.tr\/$FILE<\/guid> + $FILE<\/title> + <link>https:\/\/b4rkod.net.tr\/blogposts\/$FILE<\/link> + <description><![cdata[$FILE]]><\/description> + <\/item>/" + done -- cgit v1.2.3