workan on image dump tools and xrdp a desktop over windows
This commit is contained in:
@@ -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"
|
||||||
@@ -16,20 +16,25 @@
|
|||||||
set -e # fail explicitly on any error
|
set -e # fail explicitly on any error
|
||||||
|
|
||||||
# todo: interactive, cli options
|
# todo: interactive, cli options
|
||||||
disk=/dev/sda
|
# disk=/dev/sda
|
||||||
outname="test_disk_image_post0_$(date +%Y-%m-%d-%H%M-%Z)"
|
user=princesspi
|
||||||
|
# outname="test_disk_image_post0_$(date +%Y-%m-%d-%H%M-%Z)"
|
||||||
outname="$outname.img.xz"
|
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
|
# do the disk image dump using inline xz
|
||||||
echo "runnin inline xz on $disk to file $outname"
|
# echo "runnin inline xz on $disk to file $outname"
|
||||||
sudo dd if=$disk status=progress bs=1M | xz -c > "$outname"
|
# sudo dd if=$disk status=progress bs=4M | xz -c > "$outname"
|
||||||
|
|
||||||
# test xz integrity
|
# test xz integrity
|
||||||
echo "testing disk image integrity"
|
# echo "testing disk image integrity"
|
||||||
xz -t -v "$outname"
|
# xz -t -v "$outname"
|
||||||
|
|
||||||
# make the sha256 file
|
# make the sha256 file
|
||||||
echo "generating sha256 checksum file"
|
# echo "generating sha256 checksum file"
|
||||||
sha256sum "$outname" | tee "$outname.sha256"
|
# sha256sum "$outname" | tee "$outname.sha256"
|
||||||
|
|
||||||
echo "all donesies :3"
|
echo "all donesies :3"
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/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"
|
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"
|
echo "logging out of github"
|
||||||
gh auth logout
|
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.name
|
||||||
git config --unset user.email
|
git config --unset user.email
|
||||||
|
|
||||||
echo "change pass to princesspi"
|
echo "change pass to $user"
|
||||||
passwd
|
passwd $user
|
||||||
|
|
||||||
echo "now to set pw to be reset on first login"
|
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"
|
echo "zeroing out all da fuckin space fuuck"
|
||||||
zero_file_path="$HOME/0.0"
|
zero_file_path="$userhome/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: $?"
|
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"
|
echo "thank fuck that fucking ended"
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
Reference in New Issue
Block a user