Skip to content

Commit

Permalink
OcttKB Cross-Repo Sync (HTML to Raw)
Browse files Browse the repository at this point in the history
  • Loading branch information
octospacc committed Dec 20, 2023
1 parent 009f2b3 commit b25cc0a
Showing 16 changed files with 88 additions and 66 deletions.
10 changes: 10 additions & 0 deletions Wiki-OcttKB/tiddlers/Normal/Saved/Sites/_Sysadmin.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
created: 20231220192251148
creator: Octt
modified: 20231220192612107
modifier: Octt
tags:
title: Saved/Sites/Sysadmin

Saved sites that are mainly about miscellaneous system administration (mainly devlogs, project showcases, or tips+tricks, and online tools). (Some are in other Saved pages and should be moved here.)

...
3 changes: 2 additions & 1 deletion Wiki-OcttKB/tiddlers/Normal/Saved/_Sites.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20230223222804008
creator: Octt
modified: 20231220003130385
modified: 20231220192502457
modifier: Octt
tags:
title: Saved/Sites
@@ -24,6 +24,7 @@ Note: "[property]-leaning" means the majority of the content of the site, or the
* <<httpL iter.ca>>
* [[koyu's personal website|https://web.koyu.space/]]
* [[l33t.codes|https://l33t.codes]] --- Nice emulated retro-style with CRT effects and monospace text of many colors.
* [[LarrySanger.org|https://larrysanger.org/]] --- "//Technology, philosophy, and more//"
* [[Leo3418's Personal Site|https://leo3418.github.io/]] --- <<[# Git"https://github.com/Leo3418/leo3418.github.io">>
* [[Lily's Things at The Cool Site|https://www.lilysthings.org/]]
* [[Lyosha Cluster (Лёша Кластер)|https://cluster.wtf/]]
3 changes: 2 additions & 1 deletion Wiki-OcttKB/tiddlers/Normal/_Data storage.tid
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
created: 20231104231609952
creator: Octt
modified: 20231104231812092
modified: 20231220183517988
modifier: Octt
tags:
title: Data storage

<<^wikipediaframe "Data storage">>

* <<linkdescgit "f3 - Fight Flash Fraud" "https://fight-flash-fraud.readthedocs.io/en/stable/" "simple tool that tests flash cards capacity and performance to see if they live up to claimed specifications" "https://github.com/AltraMayor/f3">>
* [[Storj|https://storj.io]] --- //Decentralized cloud object storage that is affordable, easy to use, private, and secure.// --- <<[# Git"https://github.com/storj">>
3 changes: 2 additions & 1 deletion Wiki-OcttKB/tiddlers/Normal/_Nginx.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20230207185112276
creator: Octt
modified: 20230817232253417
modified: 20231220183101374
modifier: Octt
tags:
title: Nginx
@@ -13,6 +13,7 @@ title: Nginx
* [[How to set up Nginx as a caching reverse proxy?|https://serverfault.com/questions/30705/how-to-set-up-nginx-as-a-caching-reverse-proxy]]
* Nginx reverse proxy + URL rewrite: [[most correct way and best practice is usually...|https://serverfault.com/a/870620]]
* [[If is Evil… when used in location context|https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/]] --- (always dangerous in locations, except when doing `return ...;` or `rewrite ... last;`)
* [[How to reply with 200+content from Nginx, without serving a file?|https://serverfault.com/questions/196929/how-to-reply-with-200-from-nginx-without-serving-a-file]]

* [[Install more_set_headers in nginx for Debian-based distro|https://serverfault.com/questions/954708/install-more-set-headers-in-nginx-1-15-8]] --- `apt install nginx-extras`, keeping in mind that it will rewrite the nginx core package, so any active nginx daemon will crash and need to be restarted.
** Apparently all extra modules get enabled by default after this installation, and some might crash on some systems: if so, delete their symlinks from `/etc/nginx/modules-enabled`.
Original file line number Diff line number Diff line change
@@ -6,55 +6,10 @@ set -x # Echo all commands
TargetWiki="OcttKB"
TargetRepo="OcttKB"

git clone --depth 1 "https://gitlab.com/octtspacc/$TargetRepo" "./Repo-$TargetRepo"
cd "./Repo-$TargetRepo"
rm -rf "./Wiki-$TargetWiki" || true
git clone --depth 1 "https://gitlab.com/octtspacc/${TargetRepo}" "./Repo-${TargetRepo}"
cd "./Repo-${TargetRepo}"
rm -rf "./Wiki-${TargetWiki}" || true

tiddlywiki \
--verbose \
--load "../$TargetWiki.html" \
--output "./Wiki-$TargetWiki" \
--savewikifolder "./Wiki-$TargetWiki"
sh ../WikiFileToFolder.sh "${TargetWiki}"

cd "./Wiki-$TargetWiki/tiddlers"

for Dir in Normal System
do mkdir -vp "../${Dir}" "../${Dir}.tmp"
done

mv \$__* ../System.tmp/ || true
mv * ../Normal.tmp/ || true
#mv .* ../Normal.tmp/ || true
cd ..

# Note: if the hell happens again:
# find -type f -name .tid -exec sh -c 'OldFile="{}"; Ext="$(echo "${OldFile}" | rev | cut -d"." -f1 | rev)"; NewFile="$(echo "${OldFile}" | sed -e "s|_|/|g" | rev | cut -d"." -f2- | rev)_.${Ext}"; mv "$OldFile" "$NewFile"; ' \;

for TypeDir in System Normal
do
cd "./${TypeDir}.tmp"
for OldFile in *
do
#Ext="$(echo "${OldFile}" | rev | cut -d"." -f1 | rev)"
#NewFile="$(echo "${OldFile}" | sed -e 's|_|/|g' | rev | cut -d"." -f2- | rev)_.${Ext}"
NewPath="$(echo "${OldFile}" | sed -e 's|_|/|g')"
NewName="$(basename "${NewPath}")"
NewParent="$(echo "${NewPath}" | rev | cut -d"/" -f2- | rev)"
{ [ "${NewPath}" = "${NewName}" ] && [ "${NewPath}" = "${NewParent}" ] ;} \
&& NewFile="_${NewPath}" \
|| NewFile="${NewParent}/_${NewName}"
#[ "$(basename "${NewFile}") | cut -b1" = . ]
mkdir -p "../${TypeDir}/${NewFile}"
rm -rf "../${TypeDir}/${NewFile}"
mv "./${OldFile}" "../${TypeDir}/${NewFile}"
done
cd ..
done

mv ./System ./System.tmp/System
mv ./System.tmp/System/\$ ./System
mv ./System ./Normal ./tiddlers
rm -rf ./System.tmp ./Normal.tmp

cd ..
GitPush "OcttKB Cross-Repo Sync (HTML to Raw)"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20230611200714094
creator: Octt
modified: 20230611213201141
modified: 20231220190816419
modifier: Octt
title: $:/OcttKB/Repo/GitLab.CrossRepoSync.sh
type: text/plain
48 changes: 48 additions & 0 deletions Wiki-OcttKB/tiddlers/System/OcttKB/Repo/_WikiFileToFolder.sh.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh
set -e # Exit on any error
set -x # Echo all commands
TargetWiki="$1"

tiddlywiki \
--verbose \
--load "../${TargetWiki}.html" \
--output "./Wiki-${TargetWiki}" \
--savewikifolder "./Wiki-${TargetWiki}"

cd "./Wiki-${TargetWiki}/tiddlers"

for Dir in Normal System
do mkdir -vp "../${Dir}" "../${Dir}.tmp"
done

mv \$__* ../System.tmp/ || true
mv * ../Normal.tmp/ || true
cd ..

# Note: if the hell happens again, run:
# find -type f -name .tid -exec sh -c 'OldFile="{}"; Ext="$(echo "${OldFile}" | rev | cut -d"." -f1 | rev)"; NewFile="$(echo "${OldFile}" | sed -e "s|_|/|g" | rev | cut -d"." -f2- | rev)_.${Ext}"; mv "${OldFile}" "${NewFile}"; ' \;

for TypeDir in System Normal
do
cd "./${TypeDir}.tmp"
for OldFile in *
do
NewPath="$(echo "${OldFile}" | sed -e 's|_|/|g')"
NewName="$(basename "${NewPath}")"
NewParent="$(echo "${NewPath}" | rev | cut -d"/" -f2- | rev)"
{ [ "${NewPath}" = "${NewName}" ] && [ "${NewPath}" = "${NewParent}" ] ;} \
&& NewFile="_${NewPath}" \
|| NewFile="${NewParent}/_${NewName}"
mkdir -p "../${TypeDir}/${NewFile}"
rm -rf "../${TypeDir}/${NewFile}"
mv "./${OldFile}" "../${TypeDir}/${NewFile}"
done
cd ..
done

mv ./System ./System.tmp/System
mv ./System.tmp/System/\$ ./System
mv ./System ./Normal ./tiddlers
rm -rf ./System.tmp ./Normal.tmp

cd ..
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
created: 20231220185529849
creator: Octt
modified: 20231220191122279
modifier: Octt
title: $:/OcttKB/Repo/WikiFileToFolder.sh
type: text/plain
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/_HistoryList.json.meta
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20231220005258685
created: 20231220200755642
current-tiddler: GettingStarted
modified: 20231220005258685
modified: 20231220200755642
title: $:/HistoryList
type: application/json
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/_StoryList.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20231219155706359
created: 20231220200703107
creator: Octt
list:
modified: 20231220004850449
modified: 20231220200720061
modifier: Octt
title: $:/StoryList
4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/_showeditpreview.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20220920140732083
creator: Octt
modified: 20231203235213426
modified: 20231220184116843
modifier: Octt
title: $:/state/showeditpreview

yes
no
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20220920092307479
creator: Octt
modified: 20231220004843615
modified: 20231220200726244
modifier: Octt
title: $:/state/tab/sidebar--595412856

4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/Macros/_.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20221108155618185
creator: Octt
modified: 20231107213421541
modified: 20231220183958793
modifier: Octt
title: $:/state/tree/$:/Macros/

show
hide
2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlers/System/state/tree/$/OcttKB/Repo/_.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20230219190716748
creator: Octt
modified: 20231103222548896
modified: 20231220200723587
modifier: Octt
title: $:/state/tree/$:/OcttKB/Repo/

2 changes: 1 addition & 1 deletion Wiki-OcttKB/tiddlers/System/state/tree/$/OcttKB/_.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
created: 20230111084703963
creator: Octt
modified: 20231105151708695
modified: 20231220200724835
modifier: Octt
title: $:/state/tree/$:/OcttKB/

4 changes: 2 additions & 2 deletions Wiki-OcttKB/tiddlers/System/state/tree/$/Styles/_.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
created: 20230108193801573
creator: Octt
modified: 20231107223043873
modified: 20231220183957474
modifier: Octt
title: $:/state/tree/$:/Styles/

show
hide

0 comments on commit b25cc0a

Please sign in to comment.