From 1d4435089fbe4f0ec82eb610036bfe051a8a47a2 Mon Sep 17 00:00:00 2001 From: journal_froid Date: Fri, 23 Jan 2026 09:59:19 +0100 Subject: [PATCH] rebasing .git --- .gitignore | 0 dock/alpine/Dockerfile | 0 dock/alpine/docker-compose.yml | 0 dock/arch/Dockerfile | 0 dock/arch/docker-compose.yml | 0 dock/librewolf/docker-compose.yml | 0 dock/librewolf/run_librewolf.sh | 0 git_to_group.sh | 0 install/apt.sh | 17 ++- install/arch.sh | 7 +- install/chmod.sh | 3 +- install/config.sh | 18 ++- install/debian.sh | 20 +-- install/openwrt.sh | 11 ++ install/pacman.sh | 77 +++++------ install/tree_cpy.sh | 7 +- net/blacklist.txt | 41 +++++- net/cidr_list.txt | 0 net/nft_setup.sh | 0 net/torrent_list.md | 0 net/virtnat.xml | 0 net/whitelist.txt | 59 +++++++++ usr/bin/honey | 25 ++++ usr/etc/apk/repositories | 0 usr/etc/env | 2 + usr/etc/iwd/main.conf | 0 usr/etc/openvpn/.pot.swp | 2 + .../client/ca-free-4.protonvpn.tcp.ovpn | 0 .../client/ch-free-2.protonvpn.tcp.ovpn | 0 .../client/ch-free-6.protonvpn.tcp.ovpn | 0 usr/etc/openvpn/client/client.conf | 0 .../client/jp-free-33.protonvpn.tcp.ovpn | 0 .../client/no-free-4.protonvpn.tcp.ovpn | 0 .../client/us-free-74.protonvpn.tcp.ovpn | 0 .../openvpn/scripts/update-systemd-resolved | 0 usr/etc/openvpn/update-resolv-conf | 0 usr/etc/pam.d/login | 13 ++ usr/etc/resolv.conf | 1 + usr/etc/systemd/resolved.conf | 6 +- usr/etc/systemd/system/tcpd.service | 1 - .../systemd/system/tcpd_bkup.service.legacy | 11 ++ usr/etc/systemd/system/tcpd_bkup.sh | 17 +-- usr/etc/systemd/system/tcpd_bkup.timer.legacy | 10 ++ usr/home/.bash_aliases | 0 usr/home/.bashrc | 0 usr/home/.config/qtile/config.py | 0 usr/home/.inputrc | 0 usr/home/.profile | 0 usr/home/.vim/.netrwhist | 0 usr/home/.vim/templates/template.c | 0 usr/home/.vim/templates/template.h | 0 usr/home/.vim/templates/template.my_aliases | 0 usr/home/.vim/templates/template.py | 0 usr/home/.vim/templates/template.sh | 0 usr/home/.vim/templates/template.yaml | 0 usr/home/.vimrc | 0 usr/lib/c/curl-homemade.c | 125 ++++++++++++++++++ usr/lib/systemd/system/nftables.service | 0 usr/sbin/alpine-qemu-install | 63 --------- usr/share/nmap/scripts/check-port.nse | 0 60 files changed, 382 insertions(+), 154 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 dock/alpine/Dockerfile mode change 100644 => 100755 dock/alpine/docker-compose.yml mode change 100644 => 100755 dock/arch/Dockerfile mode change 100644 => 100755 dock/arch/docker-compose.yml mode change 100644 => 100755 dock/librewolf/docker-compose.yml mode change 100644 => 100755 dock/librewolf/run_librewolf.sh mode change 100644 => 100755 git_to_group.sh create mode 100644 install/openwrt.sh mode change 100644 => 100755 net/blacklist.txt mode change 100644 => 100755 net/cidr_list.txt mode change 100644 => 100755 net/nft_setup.sh mode change 100644 => 100755 net/torrent_list.md mode change 100644 => 100755 net/virtnat.xml mode change 100644 => 100755 net/whitelist.txt create mode 100755 usr/bin/honey mode change 100644 => 100755 usr/etc/apk/repositories mode change 100644 => 100755 usr/etc/env mode change 100644 => 100755 usr/etc/iwd/main.conf create mode 100755 usr/etc/openvpn/.pot.swp mode change 100644 => 100755 usr/etc/openvpn/client/ca-free-4.protonvpn.tcp.ovpn mode change 100644 => 100755 usr/etc/openvpn/client/ch-free-2.protonvpn.tcp.ovpn mode change 100644 => 100755 usr/etc/openvpn/client/ch-free-6.protonvpn.tcp.ovpn mode change 100644 => 100755 usr/etc/openvpn/client/client.conf mode change 100644 => 100755 usr/etc/openvpn/client/jp-free-33.protonvpn.tcp.ovpn mode change 100644 => 100755 usr/etc/openvpn/client/no-free-4.protonvpn.tcp.ovpn mode change 100644 => 100755 usr/etc/openvpn/client/us-free-74.protonvpn.tcp.ovpn mode change 100644 => 100755 usr/etc/openvpn/scripts/update-systemd-resolved mode change 100644 => 100755 usr/etc/openvpn/update-resolv-conf create mode 100755 usr/etc/pam.d/login mode change 100644 => 100755 usr/etc/resolv.conf mode change 100644 => 100755 usr/etc/systemd/system/tcpd.service create mode 100755 usr/etc/systemd/system/tcpd_bkup.service.legacy create mode 100755 usr/etc/systemd/system/tcpd_bkup.timer.legacy mode change 100644 => 100755 usr/home/.bash_aliases mode change 100644 => 100755 usr/home/.bashrc mode change 100644 => 100755 usr/home/.config/qtile/config.py mode change 100644 => 100755 usr/home/.inputrc mode change 100644 => 100755 usr/home/.profile mode change 100644 => 100755 usr/home/.vim/.netrwhist mode change 100644 => 100755 usr/home/.vim/templates/template.c mode change 100644 => 100755 usr/home/.vim/templates/template.h mode change 100644 => 100755 usr/home/.vim/templates/template.my_aliases mode change 100644 => 100755 usr/home/.vim/templates/template.py mode change 100644 => 100755 usr/home/.vim/templates/template.sh mode change 100644 => 100755 usr/home/.vim/templates/template.yaml mode change 100644 => 100755 usr/home/.vimrc create mode 100755 usr/lib/c/curl-homemade.c mode change 100644 => 100755 usr/lib/systemd/system/nftables.service delete mode 100755 usr/sbin/alpine-qemu-install mode change 100644 => 100755 usr/share/nmap/scripts/check-port.nse diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/dock/alpine/Dockerfile b/dock/alpine/Dockerfile old mode 100644 new mode 100755 diff --git a/dock/alpine/docker-compose.yml b/dock/alpine/docker-compose.yml old mode 100644 new mode 100755 diff --git a/dock/arch/Dockerfile b/dock/arch/Dockerfile old mode 100644 new mode 100755 diff --git a/dock/arch/docker-compose.yml b/dock/arch/docker-compose.yml old mode 100644 new mode 100755 diff --git a/dock/librewolf/docker-compose.yml b/dock/librewolf/docker-compose.yml old mode 100644 new mode 100755 diff --git a/dock/librewolf/run_librewolf.sh b/dock/librewolf/run_librewolf.sh old mode 100644 new mode 100755 diff --git a/git_to_group.sh b/git_to_group.sh old mode 100644 new mode 100755 diff --git a/install/apt.sh b/install/apt.sh index d158531..2e83ad3 100755 --- a/install/apt.sh +++ b/install/apt.sh @@ -4,11 +4,14 @@ #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 git +apt install -y ip +apt install -y setxkbmap +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 @@ -28,6 +31,10 @@ apt install -y pip apt install -y curl apt install -y tree apt install -y ffmpeg +apt install -y ffmpeg +apt install -y nft +apt install -y openvpn + #apt install -y vlc #apt install -y terminator #apt install -y gimp diff --git a/install/arch.sh b/install/arch.sh index a10af0c..edacbcf 100755 --- a/install/arch.sh +++ b/install/arch.sh @@ -12,14 +12,15 @@ fi MACHINE_DIR=${1:-"svr"} bash tree_cpy.sh $MACHINE_DIR/usr -# append sources +source /home/.bashrc bash config.sh source /home/.bashrc -bash python.sh -source /home/.bashrc +#bash python.sh +#source /home/.bashrc bash chmod.sh bash pacman.sh +source /home/.bashrc bash network.sh diff --git a/install/chmod.sh b/install/chmod.sh index 111b7dd..354ea5c 100755 --- a/install/chmod.sh +++ b/install/chmod.sh @@ -1,13 +1,14 @@ #!/usr/bin/bash groupadd $MACHINE +usermod -aG svr $SUDO_USER +chmod -R g+s $MACHINE_DIR 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 diff --git a/install/config.sh b/install/config.sh index eac305e..21bc0ab 100755 --- a/install/config.sh +++ b/install/config.sh @@ -3,23 +3,21 @@ #bash tree_cpy.sh ../usr SKEL=/etc/skel - mkdir $SKEL FILE=".vimrc" -echo "source /home/$FILE" > $HOME/$FILE -cat $HOME/$FILE > $SKEL/$FILE +echo "source /home/$FILE" > $SUDO_HOME/$FILE +cat $SUDO_HOME/$FILE > $SKEL/$FILE FILE=".profile" -echo "source /home/$FILE" > $HOME/$FILE -cat $HOME/$FILE > $SKEL/$FILE +echo "source /home/$FILE" > $SUDO_HOME/$FILE +cat $SUDO_HOME/$FILE > $SKEL/$FILE FILE=".bashrc" -echo "source /home/$FILE" > $HOME/$FILE -cat $HOME/$FILE > $SKEL/$FILE +echo "source /home/$FILE" > $SUDO_HOME/$FILE +cat $SUDO_HOME/$FILE > $SKEL/$FILE -source /home/.bashrc -git config --global user.email "$EMAIL" -git config --global user.name "$HOST" +groupadd svr +usermod -aG svr $SUDO_USER diff --git a/install/debian.sh b/install/debian.sh index 014b895..446a9ec 100755 --- a/install/debian.sh +++ b/install/debian.sh @@ -4,17 +4,21 @@ 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 +MACHINE_DIR=/svr -bash apt_install.sh +bash tree_cpy.sh $MACHINE_DIR/usr +bash config.sh +source /home/.bashrc +bash python.sh +source /home/.bashrc + +bash chmod.sh + +bash apt.sh + +bash network.sh diff --git a/install/openwrt.sh b/install/openwrt.sh new file mode 100644 index 0000000..b80a8a6 --- /dev/null +++ b/install/openwrt.sh @@ -0,0 +1,11 @@ +#copy paste in device terminal + +opkg update +opkg install luci-ssl +#activate https for LuCI web interface +uci set uhttpd.main.redirect_https=1 +uci commit uhttpd && service uhttpd reload + +#uci set system.@system[0].ttylogin="1" +#uci commit system +#service system restart diff --git a/install/pacman.sh b/install/pacman.sh index bf55be5..336106d 100755 --- a/install/pacman.sh +++ b/install/pacman.sh @@ -4,49 +4,36 @@ # 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 +pacman --noconfirm -S git +pacman --noconfirm -S mtr +pacman --noconfirm -S traceroute +pacman --noconfirm -S makepkg +pacman --noconfirm -S nftables +pacman --noconfirm -S bc +pacman --noconfirm -S ctags +pacman --noconfirm -S firefox +pacman --noconfirm -S unzip +pacman --noconfirm -S vlc +pacman --noconfirm -S tcpdump +pacman --noconfirm -S moreutils +pacman --noconfirm -S net-tools +pacman --noconfirm -S make +pacman --noconfirm -S whois +pacman --noconfirm -S nmap +pacman --noconfirm -S man-db +pacman --noconfirm -S openvpn +pacman --noconfirm -S wireguard-tools +pacman --noconfirm -S proton-vpn-gtk-app +pacman --noconfirm -S systemd-resolvconf +pacman --noconfirm -S cronie +pacman --noconfirm -S docker +pacman --noconfirm -S makepkg +pacman --noconfirm -S tree +pacman --noconfirm -S vim +pacman --noconfirm -S iwctl +pacman --noconfirm -S pciutils +pacman --noconfirm -S git-filter-repo +pacman --noconfirm -S xorg-setxkbmap +pacman --noconfirm -S xorg-xhost +pacman --noconfirm -S xorg-xhost 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 diff --git a/install/tree_cpy.sh b/install/tree_cpy.sh index f9c68ce..70093b2 100755 --- a/install/tree_cpy.sh +++ b/install/tree_cpy.sh @@ -4,7 +4,8 @@ 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 + +#uses ssymbolic link otherwise crossdevice troubles +cp -s -p -r -f -t / $USR_DIR/. diff --git a/net/blacklist.txt b/net/blacklist.txt old mode 100644 new mode 100755 index 3016a91..7b39724 --- a/net/blacklist.txt +++ b/net/blacklist.txt @@ -1,26 +1,54 @@ 34.0.0.0/8 35.0.0.0/8 -#SKYCA-3#Owner:Fastly -#151.101.0.0/16 +#OVH +37.59.32.0/19 + +#Hetzner (arch install) +46.62.192.0/22 + +#Microsoft +#40.114.177.156 -> lilie.duckdns.org, holland +40.96.0.0/12 + +#Staples us (arch install) +50.74.152.24/29 + +# apparait apres avoir bloque 2 adresses google intrusives sud firefox +95.216.0.0/16 #NETBLK Cox #98.174.32.0/19 #OVH #37.59.32.0/19 + +#Cloud flare chatgpt +#104.16.0.0/12 + #oman#mobile #134.0.192.0/20 +#cloudflare eu (arch install) # RIPE # http addr #141.0.0.0/8 +#Google +142.250.0.0/15 + +#Fastly ip geolocalisation (arch install) +146.75.0.0/20 + +#SKYCA-3#Owner:Fastly #pip atproto ? #151.101.0.0/16 -#Cloud flare chatgpt -#104.16.0.0/12 +#OVH france +188.165.192.0/18 + +#Amsterdam, possiblement a Linz il y a quelques annees +193.0.0.0/20 #Umea ftp archive (debian) #194.71.11.0/24 @@ -36,3 +64,8 @@ #212.227.232.0/24 1.0.0.1 + +#lancement firefox +fe80::b08c:e0ff:fe6d:542c/64 +ff02::0/48 +#ff02::1:ffbc:c929/120 diff --git a/net/cidr_list.txt b/net/cidr_list.txt old mode 100644 new mode 100755 diff --git a/net/nft_setup.sh b/net/nft_setup.sh old mode 100644 new mode 100755 diff --git a/net/torrent_list.md b/net/torrent_list.md old mode 100644 new mode 100755 diff --git a/net/virtnat.xml b/net/virtnat.xml old mode 100644 new mode 100755 diff --git a/net/whitelist.txt b/net/whitelist.txt old mode 100644 new mode 100755 index 57ce1ff..6156c97 --- a/net/whitelist.txt +++ b/net/whitelist.txt @@ -35,3 +35,62 @@ 185.70.42.0/24 185.70.41.0/24 185.70.40.0/24 +##Paypal +#151.101.129.21 +# +##microsoft (github) +##20.0.0.0/11 +# +##Paypal +##34.107.221.82 +# +##ipinfo.io +#34.117.59.81 +# +##ifconfig.me +#34.160.111.145 +# +##gitea +#34.217.253.146 +# +##gitea docker +#35.91.213.186 +# +# +##docker +#34.107.221.82 +# +##dns +#66.28.0.61 +# +##infomaniac +#95.216.195.133 +# +##ChatGpt +#104.18.32.47 +# +##openwrt.org +#151.101.130.132 +#151.101.2.132 +# +# +##firefox extentions +#151.101.1.91 +# +##sigmanet#codium +#178.238.223.0/24 +# +##whois +#199.212.0.0/24 +# +##Umea ftp archive (debian) +#194.71.11.0/24 +# +##GitHub +#185.199.111.0/24 +# +##infomaniac shop +#142.250.178.136 +# +##dns +#209.244.0.3 diff --git a/usr/bin/honey b/usr/bin/honey new file mode 100755 index 0000000..c5db6d6 --- /dev/null +++ b/usr/bin/honey @@ -0,0 +1,25 @@ +#!/usr/bin/bash + +if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then + echo "Usage: $0 arg1 [arg2] [arg3]" + exit 1 +fi + +# interactive session check +if [ -t 0 ]; then + echo -n "Delete existing output files? [y/N]: " + read ans + case "$ans" in + y|Y) rm -f *.school ;; + *) echo "Aborted"; exit 0 ;; + esac +fi + +# process input file +while IFS= read -r line; do + new_f="${line%.*}.school" + f > "$new_f" +done < "$FILE" + +exit 0 + diff --git a/usr/etc/apk/repositories b/usr/etc/apk/repositories old mode 100644 new mode 100755 diff --git a/usr/etc/env b/usr/etc/env old mode 100644 new mode 100755 index 28d48c9..70eedf1 --- a/usr/etc/env +++ b/usr/etc/env @@ -22,3 +22,5 @@ BIN=$MACHINE_DIR/usr/bin SBIN_DIR=$MACHINE_DIR/usr/sbin BIN_DIR=$BIN PY_ENV=$BIN/py-env + +VPS=83.228.219.61 diff --git a/usr/etc/iwd/main.conf b/usr/etc/iwd/main.conf old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/.pot.swp b/usr/etc/openvpn/.pot.swp new file mode 100755 index 0000000..2bb2d3a --- /dev/null +++ b/usr/etc/openvpn/.pot.swp @@ -0,0 +1,2 @@ +Gtd5u0nRC3vf1oRt +RUWJhKHulxLjfg8jDqvDncC5DMq6lZRE diff --git a/usr/etc/openvpn/client/ca-free-4.protonvpn.tcp.ovpn b/usr/etc/openvpn/client/ca-free-4.protonvpn.tcp.ovpn old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/client/ch-free-2.protonvpn.tcp.ovpn b/usr/etc/openvpn/client/ch-free-2.protonvpn.tcp.ovpn old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/client/ch-free-6.protonvpn.tcp.ovpn b/usr/etc/openvpn/client/ch-free-6.protonvpn.tcp.ovpn old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/client/client.conf b/usr/etc/openvpn/client/client.conf old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/client/jp-free-33.protonvpn.tcp.ovpn b/usr/etc/openvpn/client/jp-free-33.protonvpn.tcp.ovpn old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/client/no-free-4.protonvpn.tcp.ovpn b/usr/etc/openvpn/client/no-free-4.protonvpn.tcp.ovpn old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/client/us-free-74.protonvpn.tcp.ovpn b/usr/etc/openvpn/client/us-free-74.protonvpn.tcp.ovpn old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/scripts/update-systemd-resolved b/usr/etc/openvpn/scripts/update-systemd-resolved old mode 100644 new mode 100755 diff --git a/usr/etc/openvpn/update-resolv-conf b/usr/etc/openvpn/update-resolv-conf old mode 100644 new mode 100755 diff --git a/usr/etc/pam.d/login b/usr/etc/pam.d/login new file mode 100755 index 0000000..f073226 --- /dev/null +++ b/usr/etc/pam.d/login @@ -0,0 +1,13 @@ +#%PAM-1.0 + +auth requisite pam_nologin.so +auth include system-local-login +auth optional pam_gnome_keyring.so + +account include system-local-login + +session include system-local-login +session optional pam_gnome_keyring.so auto_start + +password include system-local-login + diff --git a/usr/etc/resolv.conf b/usr/etc/resolv.conf old mode 100644 new mode 100755 index b61303e..d09b2cf --- a/usr/etc/resolv.conf +++ b/usr/etc/resolv.conf @@ -1,4 +1,5 @@ nameserver 1.1.1.1 +nameserver 0.0.0.0 nameserver 8.26.56.26 nameserver 208.67.222.222 nameserver 209.244.0.3 diff --git a/usr/etc/systemd/resolved.conf b/usr/etc/systemd/resolved.conf index 68fcb8d..d7828f8 100644 --- a/usr/etc/systemd/resolved.conf +++ b/usr/etc/systemd/resolved.conf @@ -18,9 +18,9 @@ [Resolve] # Some examples of DNS servers which may be used for DNS= and FallbackDNS=: -DNS=1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001 #cloudflare-dns.com +DNS=1.1.1.1 2606:4700:4700::1111 2606:4700:4700::1001 # Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net -FallbackDNS=193.110.81.0 185.253.5.0 2a0f:fc80:: 2a0f:fc81:: #dns0.eu +FallbackDNS=185.253.5.0 2a0f:fc80:: 2a0f:fc81:: # # Using DNS= configures global DNS servers and does not suppress link-specific # configuration. Parallel requests will be sent to per-link DNS servers @@ -30,7 +30,7 @@ FallbackDNS=193.110.81.0 185.253.5.0 2a0f:fc80:: 2a0f:fc81:: #dns0.eu #DNS= #FallbackDNS=9.9.9.9#dns.quad9.net 2620:fe::9#dns.quad9.net 1.1.1.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 8.8.8.8#dns.google 2001:4860:4860::8888#dns.google #Domains= -DNSSEC=yes +DNSSEC=allow-downgrade DNSOverTLS=yes MulticastDNS=yes LLMNR=yes diff --git a/usr/etc/systemd/system/tcpd.service b/usr/etc/systemd/system/tcpd.service old mode 100644 new mode 100755 index 9689c83..53c711e --- a/usr/etc/systemd/system/tcpd.service +++ b/usr/etc/systemd/system/tcpd.service @@ -4,7 +4,6 @@ After=network-online.target [Service] ExecStart=/bin/bash /etc/systemd/system/tcpd.sh -After=tcpd-bkup.service Type=simple [Install] diff --git a/usr/etc/systemd/system/tcpd_bkup.service.legacy b/usr/etc/systemd/system/tcpd_bkup.service.legacy new file mode 100755 index 0000000..3e79fec --- /dev/null +++ b/usr/etc/systemd/system/tcpd_bkup.service.legacy @@ -0,0 +1,11 @@ +[Unit] +Description=backups tcpd log file, keeping ip adresses only + +[Service] +ExecStart=/bin/bash /etc/systemd/system/tcpd_bkup.sh +Restart=on-failure +RestartSec=121s +Type=oneshot + +[Install] +WantedBy=multi-user.target diff --git a/usr/etc/systemd/system/tcpd_bkup.sh b/usr/etc/systemd/system/tcpd_bkup.sh index f341507..07a2163 100755 --- a/usr/etc/systemd/system/tcpd_bkup.sh +++ b/usr/etc/systemd/system/tcpd_bkup.sh @@ -1,21 +1,22 @@ -#!/usr/bin/bash +#!/bin/bash #run from crontab + . /home/.bashrc +[ -f "$LOG_CONN" ] || exit 0 + . refresh_time -STATUS=ronron +STATUS=network.conns if [ -f $NET_STATUS ] ; then STATUS=$(cat $NET_STATUS) fi -DIR=$LOG_CONN_DIR/$STATUS +DIR="$LOG_CONN_DIR/$STATUS" mkdir -p $DIR -grepip $LOG_CONN > $DIR/${DATE}_${TIME}.conn -mv -f $LOG_CONN $LOG_CONN_DIR/prev.log +grepip "$LOG_CONN" > "$DIR/${DATE}_${TIME}.conn" +mv -f "$LOG_CONN" "$LOG_CONN_DIR/prev.log" + systemctl restart tcpd -exit 0 - - diff --git a/usr/etc/systemd/system/tcpd_bkup.timer.legacy b/usr/etc/systemd/system/tcpd_bkup.timer.legacy new file mode 100755 index 0000000..f2a1583 --- /dev/null +++ b/usr/etc/systemd/system/tcpd_bkup.timer.legacy @@ -0,0 +1,10 @@ +[Unit] +Description=Run tcpd_bkup.service every 2 minutes + +[Timer] +OnBootSec=2min +OnUnitActiveSec=2min +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/usr/home/.bash_aliases b/usr/home/.bash_aliases old mode 100644 new mode 100755 diff --git a/usr/home/.bashrc b/usr/home/.bashrc old mode 100644 new mode 100755 diff --git a/usr/home/.config/qtile/config.py b/usr/home/.config/qtile/config.py old mode 100644 new mode 100755 diff --git a/usr/home/.inputrc b/usr/home/.inputrc old mode 100644 new mode 100755 diff --git a/usr/home/.profile b/usr/home/.profile old mode 100644 new mode 100755 diff --git a/usr/home/.vim/.netrwhist b/usr/home/.vim/.netrwhist old mode 100644 new mode 100755 diff --git a/usr/home/.vim/templates/template.c b/usr/home/.vim/templates/template.c old mode 100644 new mode 100755 diff --git a/usr/home/.vim/templates/template.h b/usr/home/.vim/templates/template.h old mode 100644 new mode 100755 diff --git a/usr/home/.vim/templates/template.my_aliases b/usr/home/.vim/templates/template.my_aliases old mode 100644 new mode 100755 diff --git a/usr/home/.vim/templates/template.py b/usr/home/.vim/templates/template.py old mode 100644 new mode 100755 diff --git a/usr/home/.vim/templates/template.sh b/usr/home/.vim/templates/template.sh old mode 100644 new mode 100755 diff --git a/usr/home/.vim/templates/template.yaml b/usr/home/.vim/templates/template.yaml old mode 100644 new mode 100755 diff --git a/usr/home/.vimrc b/usr/home/.vimrc old mode 100644 new mode 100755 diff --git a/usr/lib/c/curl-homemade.c b/usr/lib/c/curl-homemade.c new file mode 100755 index 0000000..f7d69a3 --- /dev/null +++ b/usr/lib/c/curl-homemade.c @@ -0,0 +1,125 @@ +#include +#include +#include +#include +#include +#include + +#define BUFFER_CHUNK 4096 + +/* ---------------------- URL PARSING ---------------------- */ +void parse_url(const char *input, char *host, size_t hsz, char *path, size_t psz) +{ + const char *slash = strchr(input, '/'); + + if (slash) { + size_t host_len = slash - input; + if (host_len >= hsz) host_len = hsz - 1; + strncpy(host, input, host_len); + host[host_len] = '\0'; + snprintf(path, psz, "%s", slash); + } else { + snprintf(host, hsz, "%s", input); + snprintf(path, psz, "/"); + } +} + +/* ---------------------- CONNECT TO HOST ---------------------- */ +int connect_to_host(const char *host) +{ + struct addrinfo hints = {0}, *res; + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + + getaddrinfo(host, "80", &hints, &res); + + + int sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (sock < 0) { + perror("socket"); + freeaddrinfo(res); + return -1; + } + + if (connect(sock, res->ai_addr, res->ai_addrlen) < 0) { + perror("connect"); + close(sock); + freeaddrinfo(res); + return -1; + } + + freeaddrinfo(res); + return sock; +} + +/* ---------------------- SEND HTTP GET REQUEST ---------------------- */ +int send_request(int sock, const char *host, const char *path) +{ + char req[1024]; + snprintf(req, sizeof(req), + "GET %s HTTP/1.0\r\n" + "Host: %s\r\n" + "User-Agent: basic-c-client\r\n" + "\r\n", + path, host); + + return send(sock, req, strlen(req), 0); +} + +/* ---------------------- DOWNLOAD RESPONSE ---------------------- */ +char *download_response(int sock, size_t *out_size) +{ + char *filedata = NULL; + *out_size = 0; + + char buffer[BUFFER_CHUNK]; + ssize_t bytes; + + while ((bytes = recv(sock, buffer, sizeof(buffer), 0)) > 0) { + char *newbuf = realloc(filedata, *out_size + bytes + 1); + if (!newbuf) { + fprintf(stderr, "Out of memory\n"); + free(filedata); + return NULL; + } + + filedata = newbuf; + memcpy(filedata + *out_size, buffer, bytes); + *out_size += bytes; + filedata[*out_size] = '\0'; + } + + return filedata; +} + +/* ---------------------- MAIN PROGRAM ---------------------- */ +int main(int argc, char **argv) +{ + if (argc < 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return 1; + } + + char host[256]; + char path[512]; + parse_url(argv[1], host, sizeof(host), path, sizeof(path)); + + int sock = connect_to_host(host); + if (sock < 0) return 1; + + send_request(sock, host, path); + + size_t filesize; + char *filedata = download_response(sock, &filesize); + close(sock); + + if (!filedata) return 1; + + printf("Received %zu bytes:\n\n%s\n", filesize, filedata); + f = open(argv[2], "w"); + write(f, filedata, filesize); + + free(filedata); + return 0; +} + diff --git a/usr/lib/systemd/system/nftables.service b/usr/lib/systemd/system/nftables.service old mode 100644 new mode 100755 diff --git a/usr/sbin/alpine-qemu-install b/usr/sbin/alpine-qemu-install deleted file mode 100755 index 8d98b34..0000000 --- a/usr/sbin/alpine-qemu-install +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -set -eux - -ISO_URL="https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/alpine-virt-3.22.2-x86_64.iso" - -# from vm to make a shared folder -if [ $# -lt 1 ] ; then - echo """ - ISO=${1:-$(basename $ISO_URL)} - IMG=${2:-disc_alpine.qcow2} - SIZE=${3:-16G} - RAM=${4:-2G} - CPUS=${5:-2} - SHARE=${6:-$PWD/share} - """ - echo "cheat sheet: mount -t 9p -o trans=virtio hostshare /mnt" -fi - -# --- Configurable defaults --- -ISO=${1:-$(basename $ISO_URL)} -IMG=${2:-disc_alpine.qcow2} -SIZE=${3:-16G} -RAM=${4:-2G} -CPUS=${5:-2} -SHARE=${6:-$PWD/share} - -# --- Setup --- -mkdir -p "$SHARE" -echo "iso = $ISO" -[ -f "$ISO" ] || wget "$ISO_URL" -[ -f "$IMG" ] || qemu-img create -o nocow=on -f qcow2 "$IMG" "$SIZE" - -# --- Optional install script --- -# Drop any file named install.sh in ./share to execute it inside the VM later: -# e.g. `bash /mnt/share/install.sh` after mounting - - - -qemu-system-x86_64 \ - -m $RAM \ - -boot once=d \ - -cdrom $ISO \ - -drive file=$IMG \ - -device virtio-vga \ - -enable-kvm \ - -display default,show-cursor=on \ - -nic user,hostfwd=tcp::2222-:22 \ - -virtfs local,id=share,path="$SHARE",security_model=none,mount_tag=hostshare - -## --- Run QEMU with graphics + shared folder --- -#qemu-system-x86_64 \ -# -enable-kvm \ -# -m "$RAM" \ -# -cpu host \ -# -smp "$CPUS" \ -# -boot d \ -# -cdrom "$ISO" \ -# -drive file="$IMG",format=qcow2 \ -# -device virtio-vga \ -# -display default,show-cursor=on \ -# -nic user,hostfwd=tcp::2222-:22 \ -# -virtfs local,id=share,path="$SHARE",security_model=none,mount_tag=hostshare - diff --git a/usr/share/nmap/scripts/check-port.nse b/usr/share/nmap/scripts/check-port.nse old mode 100644 new mode 100755