Compare commits

...
43 Commits
Author SHA1 Message Date
me e0ffe060b6 ollama, devices are actually faster without iGPU enabled. 2026-10-24 17:36:36 -07:00
me f9de5682a6 bashrc, enable Vulkan and iGPU for ollama. 2026-10-24 10:56:22 -07:00
me b3ea91f3a7 setup, install ollama and vulkan components. 2026-10-24 10:56:06 -07:00
me fed005d70d setup, fix typo. 2026-09-12 07:39:47 -07:00
me 9d86aa1585 setup, add jq. 2026-09-12 07:39:18 -07:00
me 29fe9343e9 Change the exits to returns. Fix typo. 2026-08-26 16:08:35 -07:00
me fc9db88670 Ensure that bashrc gets copied after a successful pull every time, whether or not reload-termux succeeds. 2026-08-26 16:08:05 -07:00
me 0c7adfadcb pull-plex, automatically remove empty directories. 2026-08-26 12:48:50 -07:00
me 10b33b023c pull-plex, fix rm command, change the catted file to be the dirname, and add better output. 2026-08-25 14:44:43 -07:00
me 500db502cc reload-termux, add header output for each git command. 2026-08-25 08:45:43 -07:00
me 4f28529537 termux-reload, since the setup.sh file keeps getting deleted by git for unknown reasons, ensure it gets restored automatically. 2026-08-25 08:43:39 -07:00
me 4c5f9eca37 setup, add installation of which. 2026-08-25 08:41:20 -07:00
me 6b8e9c0596 Merge branch 'dev-device-offline' into dev. 2026-08-24 15:36:03 -07:00
me 76fa85cbc0 plex, tested the code on local machine. 2026-08-18 14:12:58 -07:00
me dc3bdb1c82 plex, add automatic cleanup of the chunk files since this is not their source location. 2026-08-18 13:58:42 -07:00
me 17fe6ba2a4 plex, add test code for automatically concatting chunks. 2026-08-18 13:54:52 -07:00
me d905cb1474 Change how the cd to Plex works since su just opens a new session and su -c closes the new session. Tried all combinations of -i -l -m -p with -c and none drop the user in a root shell after the command has been run. 2026-08-15 14:41:37 -07:00
me eedc765074 Alter root workflows to use su -c. 2026-08-15 14:16:12 -07:00
me 7d693a9186 Correct the plex URI. 2026-08-14 13:13:06 -07:00
me 3119920c9f Begin adding a few root workflows, such as pulling Plex downloads. 2026-08-14 13:09:41 -07:00
me 4a641adb03 Also pull video files from OpenCamera. 2026-06-16 17:41:39 -07:00
me c62c47dc7e Fix indent of function. 2026-05-12 05:51:37 -07:00
me d154171f33 Meme photos have dashes in the name. 2026-05-12 05:29:19 -07:00
me 1cd5a4789c Add quotes to variable in conditional. 2026-05-08 10:39:25 -07:00
me 6caa36a09d Change log files to txt files because Android file haanddler is dumb. 2026-05-06 17:55:10 -07:00
me 6834d85fc2 Add automatic updates for env-termuc now that it's working in env-shared. 2026-05-06 17:52:02 -07:00
me 2de6e77d40 Fix another branch casing. 2026-05-06 17:44:54 -07:00
me cfd18df2c5 Add actual commands to update the env-shared project. 2026-05-06 17:41:53 -07:00
me 604639033b Uppercase the branch variable for consistency; unsure why it was lower. 2026-05-06 17:31:17 -07:00
me 3d0347e41a Add a Reports folder for Android. 2026-05-06 17:29:00 -07:00
me 4a9b4353d4 Fix variable which did not get switched over. 2026-05-06 17:17:23 -07:00
me fd238ddf2d Fix typo in Update. 2026-05-06 15:30:42 -07:00
me 864e8fa8db Fix the '$project' variable being shared across environments incorrectly. 2026-05-06 15:24:28 -07:00
me 7b62b21da9 Shorten the update message. 2026-05-06 15:07:28 -07:00
me 53d2587756 Add the fork back for updater. 2026-05-06 15:05:45 -07:00
me 2c1fba93d9 Fix the shared env project path. 2026-05-06 14:56:39 -07:00
me 5c12ff4a3b No longer push the update information to the screen, use notifications. 2026-05-06 14:50:49 -07:00
me 1c32aa3658 Remove the chmod as to not alter the project and prevent futuire pulls. 2026-05-06 10:15:38 -07:00
me f2c658a4f1 Set the BASH files to be executable. 2026-05-06 09:52:43 -07:00
me 65bdce1a8c Add prefix of git to env-shared project. 2026-05-06 09:28:08 -07:00
me 07ca4beacf Always update the critical software, check for skip in a better way. 2026-05-06 09:21:24 -07:00
me ba465cdece Fix encoding for echo. Add a reload-shared if the project a;ready exists. 2026-05-06 09:17:12 -07:00
me eda63610ad Simplify verbiage and shorten the length. 2026-05-05 15:24:44 -07:00
2 changed files with 192 additions and 81 deletions

No files matched your search

Regular → Executable
+162 -61
View File
@@ -123,20 +123,24 @@ function commit {
# Easily test this project after committing changes.
# Otherwise can just source this file unless testing setup.sh.
project="$HOME/.git-env-termux"
export PROJECT_TERMUX="$HOME/.git-env-termux"
function test-termux {
if [[ -d "$project" ]]; then
log "`date` - Updating '$project'.\n"
git -C "$project" switch "$branch"
git -C "$project" pull --recurse-submodules || \
if [[ -d "$PROJECT_TERMUX" ]]; then
log "`date` - Updating '$PROJECT_TERMUX'.\n"
echo " Switching to '$BRANCH'."
git -C "$PROJECT_TERMUX" switch "$BRANCH"
echo " Pulling with submodules."
git -C "$PROJECT_TERMUX" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 )
# Something above is doing a 'D setup.sh', so ensure it gets recreated.
echo " Ensuring setup.sh exists."
git -C "$PROJECT_TERMUX" restore setup.sh
else
log "`date` - Downloading '$project'.\n"
log "`date` - Downloading '$PROJECT_TERMUX'.\n"
git clone https://git.hyperling.com/me/env-termux \
--branch=$BRANCH "$project"
--branch=$BRANCH "$PROJECT_TERMUX"
fi
chmod 755 "$project"/*.sh
"$project"/setup.sh "$@"
"$PROJECT_TERMUX"/setup.sh "$@"
}
alias reload-termux="test-termux "
alias termux-test="test-termux "
@@ -148,56 +152,56 @@ alias update-termux="reload-termux "
# Pulled from /me/env-ansible, need to make a shared library between it and Termux.
# Change a branch to point at another.
function load-branch {
rcvr="$1" # branch which we want to modify
base="$2" # branch with the changes we want
rcvr="$1" # branch which we want to modify
base="$2" # branch with the changes we want
if [[ "$rcvr" == "main" ]]; then
echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***"
return 1
fi
if [[ -z "$base" ]]; then
if [[ "$rcvr" == "prod" ]]; then
base="stage"
elif [[ "$rcvr" == "stage" ]]; then
base="dev"
else
echo "* Unsure which branch to use for '$rcvr'. Please specify."
if [[ "$rcvr" == "main" ]]; then
echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***"
return 1
fi
echo "* Base was not specified, using '$base' for '$rcvr'."
else
echo "* Requested pointing '$rcvr' branch to '$base'."
fi
echo -e "\n* Ensuring we are on base branch '$base'." &&
git switch "$base" &&
echo -e "\n* Changing pointer for '$rcvr' to '$base'." &&
git branch -f "$rcvr" "$base" &&
#echo -e "\n* Switching to branch '$rcvr'." &&
#git switch "$rcvr" &&
echo -e "\n* Forcing push on branch '$rcvr'." &&
git push --force --set-upstream origin "$rcvr" &&
echo -e "\n* Done! Displaying list of remote branches." &&
git ls-remote --heads | sort
if [[ "$base" != "dev" ]]; then
echo -e "\n* Checking if a dev branch exists."
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
echo -e "\n* Switching back to dev."
git switch dev
elif [[ "$dev_exists" == 2 ]]; then
echo -e "\n* Switching back to main."
git switch main
if [[ -z "$base" ]]; then
if [[ "$rcvr" == "prod" ]]; then
base="stage"
elif [[ "$rcvr" == "stage" ]]; then
base="dev"
else
echo "* Unsure which branch to use for '$rcvr'. Please specify."
return 1
fi
echo "* Base was not specified, using '$base' for '$rcvr'."
else
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***"
echo "* Requested pointing '$rcvr' branch to '$base'."
fi
fi
echo -e "\n* Verifying which branch we're on."
git branch
echo -e "\n* Ensuring we are on base branch '$base'." &&
git switch "$base" &&
echo -e "\n* Changing pointer for '$rcvr' to '$base'." &&
git branch -f "$rcvr" "$base" &&
#echo -e "\n* Switching to branch '$rcvr'." &&
#git switch "$rcvr" &&
echo -e "\n* Forcing push on branch '$rcvr'." &&
git push --force --set-upstream origin "$rcvr" &&
echo -e "\n* Done! Displaying list of remote branches." &&
git ls-remote --heads | sort
if [[ "$base" != "dev" ]]; then
echo -e "\n* Checking if a dev branch exists."
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
echo -e "\n* Switching back to dev."
git switch dev
elif [[ "$dev_exists" == 2 ]]; then
echo -e "\n* Switching back to main."
git switch main
else
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***"
fi
fi
echo -e "\n* Verifying which branch we're on."
git branch
}
alias load-prod="load-branch prod"
alias load-stage="load-branch stage"
@@ -235,7 +239,7 @@ alias goodbye="update -y && bye"
## Video Related ##
alias pull-content="mv -v $SS/DCIM/Camera/`date +"%Y-%m-%d"`* ./raw/"
alias pull-content="mv -v $SS/DCIM/Camera/`date +"%Y-%m-%d"`* $SS/DCIM/OpenCamera/`date +"%Y%m%d"`* ./raw/"
alias pull-screenshots="mv -v $SS/Pictures/Screenshots/*`date +"%Y%m%d"`* ./raw/"
alias pull-screenshot="pull-screenshots"
@@ -247,7 +251,7 @@ alias pull-youcuts="mv -v $SS/Movies/youcut/*`date +"%Y%m%d"`* ./raw/"
alias pull-youcut="pull-youcuts"
alias pull-yc="pull-youcut"
alias pull-memes="mv -v $SS/Pictures/memetastic/memes/*`date +"%Y%m%d"`*.jpg ./"
alias pull-memes="mv -v $SS/Pictures/memetastic/memes/*`date +"%Y-%m-%d"`*.jpg ./"
alias pull-meme="pull-memes"
alias pull-icon="pull-meme"
@@ -355,19 +359,116 @@ alias pull-prod="pull_prod_backups"
alias prod-pull="pull_prod_backups"
## Root Workflows ##
function go-root {
command="$1"
if [[ -z "$command" ]]; then
su
else
su -c "$command"
fi
}
alias root="go-root "
alias doas-root="go-root "
plex_dir='/data/user/0/com.plexapp.android/Plex Media Server/Sync/1'
plex_movie_dir="$plex_dir"/1
plex_series_dir="$plex_dir"/2
function plex {
if [[ "$LOGNAME" == "root" ]]; then
cd "$plex_dir"
else
echo "Hopping into root, use this to go to plex's directory: "
echo "cd '$plex_dir'"
su
fi
}
function pull-plex {
dest="$1"
if [[ -z "$dest" ]]; then
dest=/sdcard/Movies/
fi
echo "`date` - Copying files from '$plex_dir' to '$dest'."
su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'"
echo -e "\n`date` - Combining videos split into chunks."
cd "$dest"
ls | while read dir; do
echo -e "\n\n`date` - Checking '$dir'"
ls -lh "$dir"/*.mkv 2>/dev/null ||
ls -lh "$dir"/* 2>/dev/null ||
{
echo " Directory is empty, removing."
rmdir -v "$dir"
echo " Skipping to next directory."
continue
}
cd "$dir"
# Unsure why -e and -f don't work here. Spaces in filenames? Globs?
if [[ `ls *.chunk0 2>/dev/null` ]]; then
final="$dir.mkv"
echo -e "\n Catting files together to make '$final'."
cat *.chunk* > "$final"
ls -lh "$final"
mv -v *.chunk* ~/TRASH/
fi
echo "`date` - Done."
cd ..
done
}
alias get-plex="pull-plex"
## End Root ##
## LLMs ##
export OLLAMA_VULKAN=1
export OLLAMA_IGPU_ENABLE=0
## End LLMs ##
## Finalize ##
# Export all functions! #
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
# Run update checker in background.
( if [[ -d "$project" ]]; then
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \
| while read status; do
log "\n\n`date` - Updates to env-termux are available via 'reload-termux'."
log " '$status'"
done
fi & )
(
(
if [[ -d "$PROJECT_TERMUX" ]]; then
git -C "$PROJECT_TERMUX" fetch >/dev/null 2>&1 \
&& git -C "$PROJECT_TERMUX" status \
| grep "is behind" \
| while read status; do
title=TBD
message=TBD
success=0
cp "$PROJECT_TERMUX"/bashrc.sh ~/.bashrc
reload-termux || success=1
if [[ "$success" == 0 ]]; then
title="env-termux Updated"
message="Reloaded automatically, please reload BASH. :)"
else
title="env-termux Updates Available"
message="Update with 'reload-termux'."
fi
if [[ -d /sdcard ]]; then
termux-notification \
-t "$title" \
-c "$message"
else
notify-send "$title" "$message"
fi
done
fi
) >> "$HOME"/Reports/env-termux.log.txt 2>&1 &
)
# Complete!
PROG="$(basename -- "${BASH_SOURCE[0]}")"
Regular → Executable
+30 -20
View File
@@ -11,12 +11,12 @@ echo "Working in '$DIR'."
skip="false"
if [[ "$1" == "skip" || "$2" == "skip" || "$3" == "skip" ]]; then
if [[ "$@" == *"skip"* || "$@" == *"-s"* ]]; then
skip="true"
fi
if [[ "$skip" == "true" ]]; then
echo "\n`date` - Skipping Updates"
echo -e "\n`date` - Skipping Updates"
else
echo -e "\n`date` - Upgrade Package Repos"
pkg update &&
@@ -33,23 +33,20 @@ if [[ ! -e ~/storage/shared ]]; then
echo "~/storage/shared/ now exists. :)"
else
echo "ERROR: Something ain't right, Jim! Abort!" >&2
exit 1
return 1
fi
else
echo "Everything looks good already, pal."
fi
if [[ "$skip" == "true" ]]; then
echo "\n`date` - Skipping Installs"
else
echo -e "\n`date` - Install Software"
pkg install -y \
openssh tsu vim htop git cronie man zip ncurses-utils \
nmap traceroute wget rsync \
ffmpeg imagemagick \
kotlin php nodejs python libllvm hugo
fi
echo -e "\n`date` - Install & Update Critical Software"
pkg install -y \
openssh tsu vim htop git cronie man zip ncurses-utils which \
nmap traceroute wget rsync \
ffmpeg imagemagick \
kotlin php nodejs python libllvm hugo jq \
ollama ollama-backend-vulkan vulkan-tools vulkan-loader-android
echo -e "\n`date` - BASH Environment"
@@ -86,21 +83,34 @@ if [[ ! -d ~/Code && ! -d ~/sdcard/Code ]]; then
ln -s ~/Code /sdcard/Code
fi
if [[ -d /sdcard && ! -d "$HOME"/Reports ]]; then
mkdir -pv /sdcard/Reports
ln -s /sdcard/Reports "$HOME"/Reports
fi
env_shared_dir="$HOME/.env-shared"
echo -e "\n`date` - env-shared"
env_shared_dir="$HOME/.git-env-shared"
if [[ ! -d "$env_shared_dir" ]]; then
echo -e "\n`date` - env-shared"
echo -e "`date` - Not installed, downloading."
if [[ -z "$BRANCH" ]]; then
export BRANCH="dev"
fi
git clone https://git.hyperling.com/me/env-shared \
--branch=$BRANCH ~/$env_shared_dir
cp -v ~/$env_shared_dir/rc_shared.sh ~/.rc_shared
cp -v ~/$env_shared_dir/vimrc.vim ~/.vimrc
--branch=$BRANCH "$env_shared_dir"
cp -v "$env_shared_dir"/rc_shared.sh ~/.rc_shared
cp -v "$env_shared_dir"/vimrc.vim ~/.vimrc
if [[ ! -d ~/bin ]]; then
mkdir -pv ~/bin
fi
cp -v ~/$env_shared_dir/bin-shared/* ~/bin/
cp -v "$env_shared_dir"/bin-shared/* ~/bin/
else
echo -e "`date` - Already installed, updating."
git -C "$env_shared_dir" switch "$BRANCH"
git -C "$env_shared_dir" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 )
cp -v "$env_shared_dir"/rc_shared.sh ~/.rc_shared
cp -v "$env_shared_dir"/vimrc.vim ~/.vimrc
fi
@@ -125,4 +135,4 @@ echo "*******"
PROG="$(basename -- "${BASH_SOURCE[0]}")"
echo -e "\n`date` - Finished $PROG"
exit 0
return 0