diff --git a/customscripts/dump_compressed_img_file (# Edit conflict 2026-05-15 jfr3w5C #).sh b/customscripts/dump_compressed_img_file (# Edit conflict 2026-05-15 jfr3w5C #).sh new file mode 100644 index 0000000..3945647 --- /dev/null +++ b/customscripts/dump_compressed_img_file (# Edit conflict 2026-05-15 jfr3w5C #).sh @@ -0,0 +1,36 @@ +#!/bin/bash +# todo: +# offline option +## dd raw .img +## enum partitions +### file zero fill empty space of good partitions +### dd zero fill unformatted space and such +### xz compress +# online option +## enum partitions +## attempt to mount all possible +## file zero fill them +## dd zero fill unformatted space +## take offline for xz inline rip + +set -e # fail explicitly on any error + +# todo: interactive, cli options +# disk=/dev/sda +outname="$HOME/$(date +%Y-%m-%d-%H%M-%Z)" + +outname="$outname.img.xz" + +# do the disk image dump using inline xz +echo "runnin inline xz on $disk to file $outname" +sudo dd if=$disk status=progress bs=1M | xz -c > "$outname" + +# test xz integrity +echo "testing disk image integrity" +xz -t -v "$outname" + +# make the sha256 file +echo "generating sha256 checksum file" +sha256sum "$outname" | tee "$outname.sha256" + +echo "all donesies :3" diff --git a/customscripts/dump_compressed_img_file.sh b/customscripts/dump_compressed_img_file.sh index 470bd44..16143ea 100644 --- a/customscripts/dump_compressed_img_file.sh +++ b/customscripts/dump_compressed_img_file.sh @@ -16,20 +16,25 @@ set -e # fail explicitly on any error # todo: interactive, cli options -disk=/dev/sda -outname="test_disk_image_post0_$(date +%Y-%m-%d-%H%M-%Z)" +# disk=/dev/sda +user=princesspi +# outname="test_disk_image_post0_$(date +%Y-%m-%d-%H%M-%Z)" outname="$outname.img.xz" +zerofile="/home/$user/0.0" + +echo "zeroing out empty space" +sudo if=/dev/zero of="$zerofile" bs=4M status=progress || sudo rf -f "$zerofile" # do the disk image dump using inline xz -echo "runnin inline xz on $disk to file $outname" -sudo dd if=$disk status=progress bs=1M | xz -c > "$outname" +# echo "runnin inline xz on $disk to file $outname" +# sudo dd if=$disk status=progress bs=4M | xz -c > "$outname" # test xz integrity -echo "testing disk image integrity" -xz -t -v "$outname" +# echo "testing disk image integrity" +# xz -t -v "$outname" # make the sha256 file -echo "generating sha256 checksum file" -sha256sum "$outname" | tee "$outname.sha256" +# echo "generating sha256 checksum file" +# sha256sum "$outname" | tee "$outname.sha256" echo "all donesies :3" diff --git a/customscripts/prepare_for_release_img,sh b/customscripts/prepare_for_release_img,sh index 0b67408..2ee7041 100644 --- a/customscripts/prepare_for_release_img,sh +++ b/customscripts/prepare_for_release_img,sh @@ -1,6 +1,15 @@ #!/bin/bash +# updoot and clean up package shit +# notably not upgrading for stability +sudo apt update +sudo apt autoremove -y + +user=princesspi +userhome=/home/$princesspi +zero_file_path="$userhome/0.0" + echo "nukan .ssh and github token" -rm -rf $HOME/.ssh $HOME/.gh_token +rm -rf "$userhome/.ssh" "$userhome/.gh_token" echo "logging out of github" gh auth logout @@ -9,15 +18,19 @@ echo "removing user.name and user.email from git configs" git config --unset user.name git config --unset user.email -echo "change pass to princesspi" -passwd +echo "change pass to $user" +passwd $user echo "now to set pw to be reset on first login" -sudo passwd -e princesspi +sudo passwd -e $user echo "zeroing out all da fuckin space fuuck" -zero_file_path="$HOME/0.0" -sudo dd if=/dev/zero bs=4M status=progress > "$zero_file_path" || echo -e "$zero_file_path file reached max size, deleting"; sudo rm -f "$zero_file_path"; echo -e "retcode: $?" +zero_file_path="$userhome/0.0" +if ! sudo dd if=/dev/zero bs=4M status=progress > "$zero_file_path"; then + echo -e "$zero_file_path file reached max size, deleting" + sudo rm -f "$zero_file_path" + echo -e "delete file retcode: retcode: $?" +fi echo "thank fuck that fucking ended" diff --git a/customscripts/xrdp_cmd b/customscripts/xrdp_cmd new file mode 100644 index 0000000..4aecb92 --- /dev/null +++ b/customscripts/xrdp_cmd @@ -0,0 +1,22 @@ +#!/bin/bash +port=3389 + +if systemctl is-active --quiet xrdp; then + echo "Running XRDP Service Found Running, Stopping..." + sudo systemctl stop xrdp && echo "OK! XRDP Stopped!" || echo "ERROR: XRDP Failed To Start! Retcode: $?" +fi + +if systemctl is-active --quiet lightdm; then + echo "Window Manager Found Running, Stopping It..." + sudo systemctl stop lightdm && "OK! lightdm Stopped!" || echo "ERROR! Lightdm Did Not Stop! Retcode $?" # lightdm is xfce default +fi + +echo "Starting XRDP..." +sudo systemctl start xrdp && echo "OK! XRDP Running!" || echo "ERROR: XRDP Failed To Start Retcode: $?" + +echo "Starting Window Manager..." +sudo nohup startxfce4 > /dev/null 2>&1 & # fork dis to da background, alsooo use nohup to keep it live if terminal closes + +echo "should be on RDP $(hostname -I | awk '{print $1}'):${port}" +echo -e "\n\ndonesizessn nyaa~ :3\n\t$(hostname -I | awk '{print $1}'):${port}"\n\n" +