Compare commits

...

7 Commits

7 changed files with 70 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ docker images --format='{{.Repository}};{{.Tag}};{{.ID}}' | grep '<none>;<none>'
# Get all used images tag in dir $PATH_ANALYSE # Get all used images tag in dir $PATH_ANALYSE
find $PATH_ANALYSE -name 'Dockerfile*' | while read file; do cat $file; echo ''; done | grep -e FROM | cut -d ' ' -f 2 | sed $'s/[^[:print:]\t]//g' | sort -u | xargs -n1 docker pull find $PATH_ANALYSE -name 'Dockerfile*' | while read file; do cat $file; echo ''; done | grep -e FROM | cut -d ' ' -f 2 | sed $'s/[^[:print:]\t]//g' | sort -u | xargs -n1 docker pull
# Calculate total docker images size # Calculate total docker images size
docker images --format {{.ID}} | xargs -n1 docker inspect | jq '.[0]["Size"]' | paste -sd + | bc | format_bytes_str docker images --format {{.ID}} | xargs -n1 docker inspect | jq '.[0]["Size"]' | paste -sd + | bc | format_bytes
``` ```
## Remove every user R packages ## Remove every user R packages

View File

@@ -1,6 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
# Print out escape sequences usable for coloured text on tty. # Print out escape sequences usable for coloured text on tty.
# shellcheck disable=2016
printf 'Colour escapes are %s\n' '\e[${value};...;${value}m' printf 'Colour escapes are %s\n' '\e[${value};...;${value}m'
printf 'Values 30..37 are \e[33mforeground colours\e[m\n' printf 'Values 30..37 are \e[33mforeground colours\e[m\n'
printf 'Values 40..47 are \e[43mbackground colours\e[m\n' printf 'Values 40..47 are \e[43mbackground colours\e[m\n'
@@ -17,17 +20,58 @@ for fgc in {30..37}; do
fgc=${fgc#37} # white fgc=${fgc#37} # white
bgc=${bgc#40} # black bgc=${bgc#40} # black
vals="${fgc:+$fgc;}${bgc}" vals="${fgc:+$fgc};${bgc}"
vals=${vals%%;} vals=${vals%%;}
seq0="${vals:+\e[${vals}m}" seq0="${vals:+\e[${vals}m}"
printf " %-9s" "${seq0:-(default)}" printf " %-9s" "${seq0:-(default)}"
echo -e -n " ${seq0}TEXT\e[m" echo -en " ${seq0}TEXT\e[m"
echo -e -n " \e[${vals:+${vals+$vals;}}1mBOLD\e[m" echo -en " \e[${vals:+${vals+$vals}};1mBOLD\e[m"
echo -e -n " \e[${vals:+${vals+$vals;}}2mDIM\e[m" echo -en " \e[${vals:+${vals+$vals}};2mDIM\e[m"
echo -e -n " \e[${vals:+${vals+$vals;}}3mITA\e[m" echo -en " \e[${vals:+${vals+$vals}};3mITA\e[m"
echo -e -n " \e[${vals:+${vals+$vals;}}4mUND\e[m" echo -en " \e[${vals:+${vals+$vals}};4mUND\e[m"
echo -e -n " \e[${vals:+${vals+$vals;}}5mBLI\e[m" echo -en " \e[${vals:+${vals+$vals}};5mBLI\e[m"
done done
echo; echo echo; echo
done done
rainbowColor() {
local h=$(($1 / 43))
local f=$(($1 - 43 * h))
local t=$((f * 255 / 43))
local q=$((255 - t))
if [ $h -eq 0 ]
then
echo "255 $t 0"
elif [ $h -eq 1 ]
then
echo "$q 255 0"
elif [ $h -eq 2 ]
then
echo "0 255 $t"
elif [ $h -eq 3 ]
then
echo "0 $q 255"
elif [ $h -eq 4 ]
then
echo "$t 0 255"
elif [ $h -eq 5 ]
then
echo "255 0 $q"
else
# execution should never reach here
echo '0 0 0'
fi
}
rf(){ echo "$1" 0 0; }; gf(){ echo 0 "$1" 0; }; bf(){ echo 0 0 "$1"; }
for f in rf gf bf rainbowColor; do
for s in "$(seq 0 127)" "$(seq 255 -1 128)"; do
for i in $s; do
# shellcheck disable=2183,2046
printf '\x1b[48;2;%s;%s;%sm ' $($f "$i")
done
echo -en "\x1b[0m\n"
done
done

9
compare_world.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -e
rsync mainpc:/var/lib/portage/world /tmp/mainpc
rsync streampc:/var/lib/portage/world /tmp/streampc
cp /var/lib/portage/world /tmp/framework
exec nvim -d /tmp/framework /tmp/mainpc /tmp/streampc

View File

@@ -44,7 +44,7 @@ if ! rc-service docker status > /dev/null; then
return 1 return 1
fi fi
build /home/_aspil0w/git/3d-playground build /home/_aspil0w/git/Byron
build /home/_aspil0w/git/CoverLetter build /home/_aspil0w/git/CoverLetter
build /home/_aspil0w/git/CurriculumVitae build /home/_aspil0w/git/CurriculumVitae
build /home/_aspil0w/git/dotfiles build /home/_aspil0w/git/dotfiles

View File

@@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
set -e
__r__(){ __r__(){
end="$1" end="$1"
for _ in $(seq 1 "$end"); do for _ in $(seq 1 "$end"); do

View File

@@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
set -e
__r__(){ __r__(){
end="$1" end="$1"
for _ in $(seq 1 "$end"); do for _ in $(seq 1 "$end"); do

View File

@@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
set -e
repeat_char(){ repeat_char(){
end="$1" end="$1"
for _ in $(seq 1 "$end") ; do for _ in $(seq 1 "$end") ; do
@@ -15,7 +17,8 @@ header(){
VENV_PATH='./.venv' VENV_PATH='./.venv'
python3.12 -m venv --upgrade-deps "$VENV_PATH" python -m venv --upgrade-deps "$VENV_PATH"
# shellcheck disable=1091
if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate if [ -f "$VENV_PATH"/Scripts/activate ]; then . "$VENV_PATH"/Scripts/activate
elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate elif [ -f "$VENV_PATH"/bin/activate ]; then . "$VENV_PATH"/bin/activate
else exit 1; fi else exit 1; fi