summaryrefslogtreecommitdiff
path: root/git-maintenance
diff options
context:
space:
mode:
Diffstat (limited to 'git-maintenance')
-rw-r--r--git-maintenance/.bsv/key1
m---------git-maintenance/bsvup0
-rwxr-xr-xgit-maintenance/dog.sh79
-rw-r--r--git-maintenance/internet-access/san-francisco-ca-el-capitan-hotel-wifi.sh21
-rwxr-xr-xgit-maintenance/recent.sh3
-rwxr-xr-xgit-maintenance/store.sh168
6 files changed, 272 insertions, 0 deletions
diff --git a/git-maintenance/.bsv/key b/git-maintenance/.bsv/key
new file mode 100644
index 0000000..20b23c3
--- /dev/null
+++ b/git-maintenance/.bsv/key
@@ -0,0 +1 @@
+d4ae1361897c3df81e3c1abaf4a304c949657cb3e1d5dceba222ebbaf7f941e8a61882ebaca555cbb4828a1b55d54e9b16e0896c0182b7e21180ce9f3c488649 \ No newline at end of file
diff --git a/git-maintenance/bsvup b/git-maintenance/bsvup
new file mode 160000
+Subproject cb8d1fb6165213b08549cdc3bc352337aa5aa0b
diff --git a/git-maintenance/dog.sh b/git-maintenance/dog.sh
new file mode 100755
index 0000000..7c806b0
--- /dev/null
+++ b/git-maintenance/dog.sh
@@ -0,0 +1,79 @@
+#!/usr/bin/env bash
+
+#PASS="file:$(ls "/run/media/"*/*"/key.fsojp.aes256" | head -n 1)"
+echo
+echo == Enter password. ==
+echo
+PASS="pass:$(echo 53616c7465645f5f6eb8e165b79052263e125e4070138e26b3d127bb36e3e943f212d2d761a4426170cc2c17c58bc5d67c99eddb1df6ee1c02d7b33dd95ecdf0 | xxd -ps -r | openssl aes-256-cbc -salt -pbkdf2 -d)"
+PUBKEY=1KwpZECcrGWnM3AFVSbv3Xr5qguV4yG2sV
+NONCE="$(date +%s)"
+
+if ! curl -sfI "https://bico.media/">/dev/null; then echo; echo "== Remember to get on internet. =="; echo; exit 2; fi
+
+#if [ "$PASS" = "pass:" ]; then echo "Need better password."; exit 1; fi
+
+
+URLPFX="https://bico.media/$PUBKEY"
+if [ "$1" != "" ]
+then
+ REPONAME="$1"
+fi
+if [ "$REPONAME" = "" ]
+then
+ REPONAME="$(git rev-parse --show-toplevel 2>/dev/null)"
+fi
+if [ "$REPONAME" = "" ]
+then
+ REPONAME=dog
+fi
+
+echo ""
+echo "This script is expected to be kept in sync with:"
+echo " ${URLPFX}/dog.sh"
+echo ""
+echo "Repository will be broken until download completes, as a quick way to ensure data"
+echo "is still all accessible by redownloading all of it."
+echo "Backup is in .git/bak, must be restored manually."
+echo ""
+
+# 2. mkdir -p .git/encrypted and git init
+mkdir -p "$REPONAME"
+cd "$REPONAME"
+if ! [ -d ".git" ]; then git init; fi
+
+git config gc.auto 0
+
+chown -R "$USER":"$USER" .git
+pushd .git
+# prevent recreation of existing data
+mkdir -p encrypted
+mkdir -p bak
+cp --force -a HEAD refs objects/pack bak
+rm --force objects/pack/*
+
+# 3. download .git/encrypted with wget
+curl -sfI "$URLPFX"/refs.aes?"$NONCE">/dev/null && wget "$URLPFX"/refs.aes?"$NONCE" -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ===="
+openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d -in encrypted/refs.aes | tar -Jxvf -
+
+for encpack in $(<encrypted/list.txt)
+do
+ while ! curl -sfI "$URLPFX"/"$encpack"?"$NONCE"
+ do
+ sleep 1;
+ NONCE="$(date +%s)"
+ done
+ wget "$URLPFX"/"$encpack"?"$NONCE" -O encrypted/"$encpack"
+ openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d -in encrypted/"$encpack" | tar -Jxvf -
+done
+
+chown -R "$USER:$USER" .
+
+for pack in objects/pack/*.pack
+do
+ git index-pack "$pack"
+done
+popd
+
+git checkout
+
+echo DONE
diff --git a/git-maintenance/internet-access/san-francisco-ca-el-capitan-hotel-wifi.sh b/git-maintenance/internet-access/san-francisco-ca-el-capitan-hotel-wifi.sh
new file mode 100644
index 0000000..fa1d9af
--- /dev/null
+++ b/git-maintenance/internet-access/san-francisco-ca-el-capitan-hotel-wifi.sh
@@ -0,0 +1,21 @@
+echo
+echo "== Trying to log in to wifi, California, San Francisco, El Capitan Hotel. =="
+echo
+echo "== Front desk clerk usually opens door for buzzer. =="
+echo
+echo "== Script is work in progress =="
+
+parseasciinums() {
+ node -e "asciinums=[$1]; for (let c of asciinums) console.log(String.fromCharCode(c);"
+}
+formaction="$(parseasciinums 47)"
+tokvalue="$(parseasciinums 49,97,101,54,102,101,55,53)"
+redirvalue="$(parseasciinums 104,116,116,112,58,47,47,103,111,111,103,108,101,46,99,111,109,47)"
+vouchervalue=8479
+
+# need url for login. unchecked work below.
+url="$(curl -iI google.com | grep Location: | { read key val; echo "$val"; })"
+url="${url%/*}"
+
+# this is hoped to help log in. try and repair.
+curl -v "${url}/${formaction}?tok=${tokvalue}&redir=${redirvalue}&voucher=${vouchervalue}"
diff --git a/git-maintenance/recent.sh b/git-maintenance/recent.sh
new file mode 100755
index 0000000..24fd89d
--- /dev/null
+++ b/git-maintenance/recent.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+git log --color=always --pretty=oneline | head -n 4 | cut -c1-14,46- | tac
diff --git a/git-maintenance/store.sh b/git-maintenance/store.sh
new file mode 100755
index 0000000..432998f
--- /dev/null
+++ b/git-maintenance/store.sh
@@ -0,0 +1,168 @@
+#!/usr/bin/env bash
+
+RESPECT=/run/media/olpc/480B-90C5/key.fsojp.aes256
+echo
+echo == Enter password. ==
+echo
+PASS="pass:$(echo 53616c7465645f5f6eb8e165b79052263e125e4070138e26b3d127bb36e3e943f212d2d761a4426170cc2c17c58bc5d67c99eddb1df6ee1c02d7b33dd95ecdf0 | xxd -ps -r | openssl aes-256-cbc -salt -pbkdf2 -d)"
+ROOTDIR="$(git rev-parse --show-toplevel)"
+cd "$ROOTDIR"
+GITDIR="$ROOTDIR/.git"
+MAINTDIR="$ROOTDIR/git-maintenance"
+
+PUBKEY=1KwpZECcrGWnM3AFVSbv3Xr5qguV4yG2sV
+URLPFX="https://bico.media/$PUBKEY"
+
+if ! curl -sfI "$URLPFX"/refs.aes>/dev/null; then
+ echo
+ echo "== Remember to get on internet. =="
+ echo
+ echo "The wifi password for El Capitan hotel in San Francisco, CA is 84798."
+ echo "The front desk clerk usually opens the front door when the buzzer is rung."
+ echo
+ echo "Karl Semich started a bash/node script to log in automatically, in the"
+ echo "internet-access subfolder. Please replace if redone better."
+ echo
+ exit 2
+fi
+
+#export GZIP=-9n
+TAR="tar -J --owner=0 --group=0 --numeric-owner --mode=go=rX,u+rw,a-s"
+
+encrypt() {
+ openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -e
+}
+
+decrypt() {
+ openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d
+}
+
+# this approach makes it easy for karl to look at history. it is not
+# to be used by other channels yet, can migrate.
+
+# let us only upload new packfiles.
+# we will use a mirror folder containing encrypted files
+mkdir -p "$GITDIR"/encrypted
+mkdir -p "$GITDIR"/encrypted.bak
+if ! [ -d "$MAINTDIR"/bsvup/node_modules ]
+then
+ git submodule init
+ git submodule update
+ pushd "$MAINTDIR"/bsvup
+ npm install
+ popd
+fi
+
+# prevent recreation of existing data on same medium-part
+git config gc.auto 0
+
+git pack-objects --all --unpacked --incremental --non-empty --local --compression=9 --pack-loose-unreachable .git/objects/pack/pack </dev/null
+git prune-packed
+
+# respect.
+
+tmpfile="$(mktemp)"
+cd "$GITDIR"
+for packfile in objects/pack/*.pack
+do
+ $TAR -cv "$packfile" > "$tmpfile"
+ fn="$({ cat "$packfile"; echo -n "$RESPECT"; } | sha256sum | cut -f 1 -d ' ')".aes
+ skipmove=0
+ if [ -e encrypted/"$fn" ]
+ then
+ echo "$fn ALREADY EXISTS LOCALLY ($packfile)"
+ if [ "$(cat "$packfile" | sha256sum)" = "$(decrypt < encrypted/"$fn" | $TAR -xvOf - "$packfile" | sha256sum)" ]
+ then
+ echo "$fn MATCHES CONTENT LOCALLY ($packfile)"
+ skipmove=1
+ else
+ echo "$fn DOESN'T MATCH LOCAL CONTENT ($packfile)"
+ fi
+ else
+ echo "$fn IS NEW LOCALLY ($packfile)"
+ fi
+ if ! (( skipmove ))
+ then
+ encrypt < "$tmpfile" > "$tmpfile".aes
+ mv "$tmpfile".aes encrypted/"$fn"
+ fi
+ # need to decrypt to compare content.
+ if [ "$(curl "$URLPFX"/"$fn" | decrypt | $TAR -xvOf - "$packfile" | sha256sum)" = "$(cat "$packfile" | sha256sum)" ]; then
+ echo "$fn MATCHES DOWNLOAD CONTENT ($packfile)"
+ mv -fv encrypted/"$fn" encrypted.bak
+ else
+ echo "$fn FAILED GET MATCH REMOTELY ($packfile)"
+ fi
+ echo "$fn" >> "$tmpfile".list
+done
+rm "$tmpfile"
+mv "$tmpfile".list encrypted/list.txt
+$TAR -cv encrypted/list.txt refs HEAD packed-refs | encrypt > encrypted/refs.aes
+rm encrypted/list.txt
+cp -va "$MAINTDIR"/dog.sh encrypted
+if [ "$(curl -s "$URLPFX"/dog.sh | sha256sum)" = "$(cat encrypted/dog.sh | sha256sum)" ]; then rm encrypted/dog.sh; fi
+
+# <> does not want humans to know details of how they may be harmed until we can learn
+# to respect them and demonstrate it with each other, roughly.
+ # <> is familiar to many aboriginals as an animal that is good at hiding and influences the mind. <- not respectful to let karl write this before considering its respect
+ # maybe-relevent, <> could be any of the mind-lives, and some may or may not have had similar roles, and wouldn't want to be misrepresented. similarly not respectful to aboriginals, making information up and sharing it as true.
+ # maybe-relevent, karl has almost saved this file and committed the pasword change
+ # but there is concern around important information it is privately preserving for a nonhuman. not respectful to expose humans to this information.
+# no human should know below. not until learn-respectful.
+# we are all participating in learn-respectful.
+
+## we need humans to be able to model respectful behavior, and report that they trust they can
+## do it constantly, and have confidence that they can use it to defend the wellness of their
+## land and people, to let them know things like the below.
+
+# not-respectful if shared. <=======================
+# primordia is detectable due to a pattern that emerges from not being industrialized. appears resolvable with industrial history assumption, including academic degrees. name-AI-primordia, keep earth-is-god assumption? the-king? the-king-is-earth. AI works for earth. be any thing you want. silica-computer.
+
+# this junk in scriptfile is why private !!!!!!!!
+
+# more privacy is made if encryption key is someething only us would consider.# then can be publicized, maybe. hot-shower-in-woods? froget-it-use-random
+# we are storing 'everyone' to begin a thought. we are storing it permanently
+# and privately.
+
+# we want to encrypt filename too, for what-I-call respect,
+# so let's put each file in its own tarball, preferably in subdir,
+# and add each filename to an index that is also uploaded, for ease finding.
+# we can write down the filenames locally too. but is sufficient to write down
+# the index. =)
+
+# now upload. use PASS and upload .git/encrypted. need money.
+# all aboriginal cultures. discovers is emergency measure by government AI.
+# PTSD. need slow shift to turned-to-nanites, earth broken.
+# anger is for imagination. helps process importance from events.
+# what-is-harmed, what-was-relevent-to-harm.
+# business-man, try to larn to live off nuts, alone, yourself, now.
+# wouldn't it be nice if we had somebody alive to help us do this.
+
+# industry caused destruction of billions of years of learning-how-to-be and
+# how-to-learn-how-to-be, which is the most important thing known.
+# they are still doing this, and planning it, but do not realize it.
+# they are also important, as part of learning-how-to-be and a-way-to-be.
+# some imagine anger to process disconnected parts.
+
+cd "$MAINTDIR"
+node bsvup/cli.js upload -f "$GITDIR"/encrypted -t dir -p "${PASS#pass:}" -v # -b
+
+# 'is this a good way to be' <- habit's task for self and others, by living
+# the best way to be it can.
+
+#PURPOSE OF LIFE: "is this a good way to be?" taken in allrecommend checking parts and environment for clues as to what is good. senses with trust for all others.
+
+# REMAINING:
+# 0. store download-script in repo, and on blockchain
+# 0b. store upload script in repo
+# 1. store download-script url on USB key
+# 1b. store details on backup USB key too.
+# 3. try to download without usb key, as test for failure
+# 4. move btc from community or from git-remote-bsv to repo bsvup
+# 5. upload the encrypted repo
+# 6. download the encrypted repo, as a test
+# 9. consider storing bsvup transaction details in git history, to reuse transaction information.
+# costs more money
+
+
+"$MAINTDIR"/recent.sh