.git broken, restart

This commit is contained in:
dangerboot
2026-01-23 08:55:18 +01:00
commit d1be8ebdca
206 changed files with 8431 additions and 0 deletions
Executable
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/bash
MACHINE_DIR="$HOME/machine"
FILES_TO_LINK="$MACHINE_DIR/.vim $MACHINE_DIR/.vimrc $MACHINE_DIR/.bashrc $MACHINE_DIR/.bash_aliases"
for F in $FILES_TO_LINK; do
BASENAME=$(basename $F)
mv $HOME/$BASENAME $HOME/$BASENAME.original
ln -s $F $HOME/$BASENAME
done;
#chsh -s /usr/bin/bash
#echo '. ~/.bash_aliases' >> $HOME/.zshrc
#echo '. ~/.bashrc' >> $HOME/.zshrc
bash apt_install.sh
python3 -m pip install --upgrade pip setuptools
python3 -m pip install norminette
git clone https://github.com/cacharle/c_formatter_42
cd c_formatter_42
pip3 install -e .
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/bash
#if [[ "$EUID" -ne "0" ]]; then
# echo "This script must be run as root"
# exit 1
#fi
# append sources
H=$(find / -type d -name home | head -1)
source $H/.bashrc
bash tree_cpy.sh $MACHINE_DIR/usr
bash config.sh
bash python.sh
bash chmod.sh
# append sources
bash apk.sh
bash network.sh
#systemctl enable --now NetworkManager #enable dongle
#pacman --noconfirm -Syu ulogd
#NETWORKDIR="$MACHINE_DIR/networking"
##TOR_LIST=$NETWORKDIR/tor_list.txt
##curl https://www.dan.me.uk/torlist/?full= > $TOR_LIST
#systemctl enable ulogd
#systemctl start ulogd
#bash $NETWORKDIR/iptables_script.sh -f $NETWORKDIR/ip_to_ban.txt -r
Executable
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/bash
#if [ "$UEID" -ne "0" ] ; then
# echo "This script must be run as root"
#fi
apk add git
apk add nftables
apk add tcpdump
apk add make
apk add whois
apk add nmap
apk add man-db
apk add vim
apk add git-filter-repo
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/bash
wget https://github.com/obsidianmd/obsidian-releases/releases/download/v1.9.14/Obsidian-1.9.14.AppImage
Executable
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/bash
#apt install -y ufw
#curl -fsS https://dl.brave.com/install.sh | sh
apt install -y bc
apt install -y virt-viewer
apt install -y gawk
apt install -y exuberant-ctags
apt install -y cmake
apt install -y unzip
apt install -y tcpdump
apt install -y moreutils
apt install -y net-tools
apt install -y make
apt install -y whois
apt install -y nmap
apt install -y lldb
apt install -y man-db
apt install -y gdb
apt install -y docker
apt install -y makepkg
apt install -y vim
apt install -y gcc
apt install -y make
apt install -y pip
apt install -y curl
apt install -y tree
apt install -y ffmpeg
#apt install -y vlc
#apt install -y terminator
#apt install -y gimp
#apt install -y redshift
#apt install -y snap
#curl -fsSL "https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/windsurf.gpg" | sudo gpg --dearmor -o /usr/share/keyrings/windsurf-stable-archive-keyring.gpg
#echo "deb [signed-by=/usr/share/keyrings/windsurf-stable-archive-keyring.gpg arch=amd64] https://windsurf-stable.codeiumdata.com/wVxQEIWkwPUEAGf3/apt stable main" | sudo tee /etc/apt/sources.list.d/windsurf.list > /dev/null
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/bash
if [[ "$EUID" -ne "0" ]]; then
echo "This script must be run as root"
exit 1
fi
if [ $# -ne 1 ] ; then
echo usage $0 MACHINE_DIR
exit 0
fi
MACHINE_DIR=${1:-"svr"}
bash tree_cpy.sh $MACHINE_DIR/usr
# append sources
bash config.sh
source /home/.bashrc
bash python.sh
source /home/.bashrc
bash chmod.sh
bash pacman.sh
bash network.sh
+122
View File
@@ -0,0 +1,122 @@
#!/usr/bin/bash
set -euo pipefail
cleanup() {
set +e
umount -l "$MOUNT_DIR/dev" "$MOUNT_DIR/sys" "$MOUNT_DIR/proc" 2>/dev/null
umount -l "$MOUNT_DIR/boot" "$MOUNT_DIR" 2>/dev/null
[ -n "${LOOPDEV:-}" ] && losetup -d "$LOOPDEV" 2>/dev/null
}
trap cleanup EXIT
IMG_URL="https://downloads.raspberrypi.org/raspios_lite_armhf_latest"
IMG_FILE="raspios_lite.img"
COMPR_IMG="raspios_lite.img.xz"
MOUNT_DIR="/mnt/rpi"
SSH_PORT=888
WIFI_SSID="$1"
WIFI_PASS="$2"
ROOT_PASS="$3"
if [ ! -e $IMG_FILE ] ; then
if [ ! -e $COMPR_IMG ] ; then
wget -O ${COMPR_IMG} "$IMG_URL"
wget -O "${IMG_FILE}.sha256" "${IMG_URL}.sha256"
cd $(dirname "$IMG_FILE")
sha256sum -c "${COMPR_IMG}.sha256" --status
if [ $? -ne 0 ]; then
echo "SHA256 mismatch ! Aborting."
exit 1
else
echo "shasum ok"
fi
cd -
fi
unxz -f "$COMPR_IMG"
fi
apt-get install qemu-user-static binfmt-support
cp /usr/bin/qemu-arm-static $MOUNT_DIR/usr/bin/
# 2. Associer limage à un loop device
LOOPDEV=$(losetup --find --partscan --show "$IMG_FILE")
BOOTPART="${LOOPDEV}p1"
ROOTPART="${LOOPDEV}p2"
parted --script "$LOOPDEV" resizepart 2 100%
e2fsck -f -y "$ROOTPART"
resize2fs "$ROOTPART"
mkdir -p "$MOUNT_DIR"
mount "$ROOTPART" "$MOUNT_DIR"
mount "$BOOTPART" "$MOUNT_DIR/boot"
mount --bind /dev "$MOUNT_DIR/dev"
mount --bind /sys "$MOUNT_DIR/sys"
mount --bind /proc "$MOUNT_DIR/proc"
cp /etc/resolv.conf "$MOUNT_DIR/etc/"
chroot "$MOUNT_DIR" /bin/bash <<EOF
set -e
# Paquets nécessaires
apt-get update
apt-get install -y docker.io docker-compose ufw
# Dossier deb_dock
mkdir -p /root/machine
# (copie depuis lextérieur faite plus tard)
# SSH
echo "root:${ROOT_PASS}" | chpasswd
sed -i "s/^#Port.*/Port ${SSH_PORT}/" /etc/ssh/sshd_config
sed -i "s/^#PermitRootLogin.*/PermitRootLogin yes/" /etc/ssh/sshd_config
sed -i "s/^#PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config
# UFW
ufw --force reset
ufw default deny incoming
ufw allow ${SSH_PORT}/tcp
ufw --force enable
# Wi-Fi
cat > /etc/wpa_supplicant/wpa_supplicant.conf <<WIFI
country=FR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="${WIFI_SSID}"
psk="${WIFI_PASS}"
}
WIFI
# Service run_ssh
cat > /etc/systemd/system/run_ssh.service <<SERV
[Unit]
Description=Run SSH init docker
After=network.target
[Service]
ExecStart=/root/machine/deb_dock/run_ssh.sh
Restart=always
[Install]
WantedBy=multi-user.target
SERV
systemctl enable run_ssh.service
EOF
# 6. Copier deb_dock
rsync -a machine/deb_dock/ "$MOUNT_DIR/root/machine/deb_dock/"
# 7. Nettoyage
umount -l "$MOUNT_DIR/dev" "$MOUNT_DIR/sys" "$MOUNT_DIR/proc"
umount -l "$MOUNT_DIR/boot" "$MOUNT_DIR"
losetup -d "$LOOPDEV"
echo "Image prête. Écrivez-la sur SSD avec: sudo dd if=${IMG_FILE%.xz} of=/dev/sdX bs=4M status=progress"
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/bash
groupadd $MACHINE
chown -R root $MACHINE_DIR
chgrp -R $MACHINE $MACHINE_DIR
chmod -R 771 $MACHINE_DIR/install
chmod -R 771 $BIN_DIR
chmod -R 751 $SBIN_DIR
find $MACHINE_DIR -type d -exec chmod 775 {} \;
chmod -R g+s $MACHINE_DIR
exit 0
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/bash
#bash tree_cpy.sh ../usr
SKEL=/etc/skel
mkdir $SKEL
FILE=".vimrc"
echo "source /home/$FILE" > $HOME/$FILE
cat $HOME/$FILE > $SKEL/$FILE
FILE=".profile"
echo "source /home/$FILE" > $HOME/$FILE
cat $HOME/$FILE > $SKEL/$FILE
FILE=".bashrc"
echo "source /home/$FILE" > $HOME/$FILE
cat $HOME/$FILE > $SKEL/$FILE
source /home/.bashrc
git config --global user.email "$EMAIL"
git config --global user.name "$HOST"
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
./config_install.sh
#apt instll -y ulogd
NETWORKDIR="$MACHINE_DIR/networking"
#systemctl enable ulogd
#systemctl start ulogd
#bash $NETWORKDIR/iptables_script.sh -f $NETWORKDIR/ip_to_ban.txt -r
bash apt_install.sh
+14
View File
@@ -0,0 +1,14 @@
sudo dnf -y install make
sudo dnf -y install gcc
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh --dry-run
rm get-docker.sh
curl -fsSL https://test.docker.com -o test-docker.sh
sudo sh test-docker.sh
sudo usermod -aG docker presk0
newgrp docker
#https://docs.docker.com/engine/install/linux-postinstall/
sudo yum install ruby
sudo yum install ruby-devel
gem update
Executable
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/bash
# Quite a succefull ctf...
J_K=$MACHINE_DIR/.vim/pack/Exafunction/start/windsurf.vim/.soul-pot
eval "$(ssh-agent -s)"
ssh-add $J_K
git clone git@github.com:pain-pin/journal.git $JOURNAL_DIR
$P_K=$JOURNAL_DIR/2025/10/10/systemd/deactivated/.k-p.swp
eval "$(ssh-agent -s)"
ssh-add $P_K
git clone git@github.com:pain-pin/perso.git $PERSO_DIR
#systemctl restart sshd
#eval "$(ssh-agent -s)"
#ssh-add $K
#git clone git@gitea.com:pain/perso.git
#cd perso
#git clone git@gitea.com:pain/perso_old.git
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/bash
cat $MACHINE_DIR/usr/etc/resolv.conf > /etc/resolv.conf
cat $MACHINE_DIR/usr/etc/systemd/resolved.conf > /etc/systemd/resolved.conf
bash $NETWORK_DIR/nft_setup.sh
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/bash
#if [ "$UEID" -ne "0" ] ; then
# echo "This script must be run as root"
#fi
pacman --noconfirm -Sy git
pacman --noconfirm -Sy makepkg
pacman --noconfirm -Sy nftables
pacman --noconfirm -Sy bc
pacman --noconfirm -Sy ctags
pacman --noconfirm -Sy firefox
pacman --noconfirm -Sy unzip
pacman --noconfirm -Su vlc
pacman --noconfirm -Sy tcpdump
pacman --noconfirm -Sy moreutils
pacman --noconfirm -Sy net-tools
pacman --noconfirm -Sy make
pacman --noconfirm -Sy whois
pacman --noconfirm -Sy nmap
pacman --noconfirm -Sy man-db
pacman --noconfirm -Sy openvpn
pacman --noconfirm -Sy bitwarden
pacman --noconfirm -Sy wireguard-tools
pacman --noconfirm -Sy proton-vpn-gtk-app
pacman --noconfirm -Sy systemd-resolvconf
pacman --noconfirm -Sy cronie
pacman --noconfirm -Sy docker
pacman --noconfirm -Sy makepkg
pacman --noconfirm -Sy tree
pacman --noconfirm -Sy vim
pacman --noconfirm -Sy iwctl
pacman --noconfirm -Sy pciutils
pacman --noconfirm -Sy git-filter-repo
pacman --noconfirm -Sy xorg-setxkbmap
pacman --noconfirm -Sy xorg-xhost
pacman --noconfirm -Sy bind
mandb #rend possible la commande apropos
##git clone https://github.com/Exafunction/codeium.vim ~/.vim/pack/Exafunction/start/codeium.vim
#sudo -i -u $SUDO_USER bash << EOF
#
#git config --global user.email "contact@presko.info"
#git config --global user.name "prsko_$HOST"
#EOF
#su $SUDO_USER
#git clone https://aur.archlinux.org/yay.git
#cd yay/
#makepkg -si
#cd ..
#rm -rf yay
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/bash
set -e
python3 -m venv $PY_ENV
source $PY_ENV/bin/activate
pip install requests
pip install atproto
#pip install pandas
#pip install keyring
exit 0
Executable
+29
View File
@@ -0,0 +1,29 @@
251114
10:00:52
painpain
cmb2roc
###############################################
test
== ls ==
42.sh
alpine.sh
apk.sh
app.sh
apt.sh
arch.sh
arm_install.sh
chmod.sh
config.sh
debian.sh
fedora.sh
j.sh
network.sh
pacman.sh
python.sh
share
test
tree_cpy.sh
yay.sh
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/bash
USR_DIR=${1:-"no_dir"}
[[ $USR_DIR == "no_dir" ]] && \
echo "usage $0 usr_dir" && \
exit 1
USR_DIR=$(realpath $USR_DIR)
cp -l -p -r $USR_DIR/* /
# cannot hardlink (invaliv cross device)
ln -s $USR_DIR/home/.* /home
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/bash
git clone https://aur.archlinux.org/yay.git
cd yay/
makepkg -si
cd ..
rm -rf yay