Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
87edd1c4d1 |
16 changed files with 40 additions and 340 deletions
17
check_wip.sh
17
check_wip.sh
|
@ -1,17 +0,0 @@
|
|||
#!/bin/bash
|
||||
# check for WIP commits
|
||||
wips=$(git log --oneline --no-decorate | grep -i wip )
|
||||
wips_n=$(echo "$wips" | wc -l)
|
||||
LOCKFILE="$PWD/.git/.githook.allow_wip"
|
||||
|
||||
# This checks if neither lockfile exists AND wips is non-empty
|
||||
if [[ ! -f $LOCKFILE && -n "$wips" ]]; then
|
||||
# Allows us to read user input below, assigns stdin to keyboard
|
||||
exec < /dev/tty
|
||||
echo "contains $wips_n WIP commit(s)"
|
||||
read -p "Really push? (Y/N) " -n 1 -r
|
||||
case "$REPLY" in
|
||||
y|Y ) echo -e "\ncontinuing..."; touch $LOCKFILE;;
|
||||
* ) echo -e "\naborting."; exit 1;;
|
||||
esac
|
||||
fi
|
|
@ -1,8 +1,9 @@
|
|||
#!/bin/bash
|
||||
echo "To be executed: $@"
|
||||
read -p "Confirm (Y/N): " -n 1 -r
|
||||
case "$REPLY" in
|
||||
case "$REPLY" in
|
||||
y|Y ) echo "es"; eval $@;;
|
||||
n|N ) echo "o";;
|
||||
* ) echo -e "\ninvalid";;
|
||||
esac
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
export COUCHDB_HOST=couchdb.homeserver.box
|
||||
export COUCHDB_USER=admin
|
||||
export COUCHDB_PASSWORD=setme
|
||||
export COUCHDB
|
||||
function couchdb() {
|
||||
if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -n "$3" ]]; then
|
||||
echo "USAGE: $0 METHOD URI"
|
||||
return 1
|
||||
fi
|
||||
method=$1
|
||||
local="https://${COUCHDB_USER}:${COUCHDB_PASSWORD}@${COUCHDB_HOST}/${2}"
|
||||
echo "request: $method $local"
|
||||
curl -X $method "$local"
|
||||
}
|
86
debpkg.sh
86
debpkg.sh
|
@ -1,86 +0,0 @@
|
|||
# Create a Debian package from a binary
|
||||
# Usage: make_binary_deb binary_path package_name version
|
||||
make_binary_deb() {
|
||||
local binary="$1"
|
||||
local pkgname="$2"
|
||||
local version="$3"
|
||||
local maintainer="Christoph J. Scherr <software@cscherr.de>"
|
||||
|
||||
# Check if all arguments are provided
|
||||
if [ -z "$binary" ] || [ -z "$pkgname" ] || [ -z "$version" ]; then
|
||||
echo "Usage: make_binary_deb binary_path package_name version"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check if binary exists
|
||||
if [ ! -f "$binary" ]; then
|
||||
echo "Error: Binary $binary not found"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Create package directory structure
|
||||
local pkgdir="${pkgname}_${version}"
|
||||
mkdir -p "${pkgdir}/usr/local/bin"
|
||||
mkdir -p "${pkgdir}/DEBIAN"
|
||||
|
||||
# Copy and set permissions
|
||||
cp "$binary" "${pkgdir}/usr/local/bin/"
|
||||
chmod 755 "${pkgdir}/usr/local/bin/$(basename "$binary")"
|
||||
|
||||
# Create control file
|
||||
cat > "${pkgdir}/DEBIAN/control" << EOF
|
||||
Package: $pkgname
|
||||
Version: $version
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: $maintainer
|
||||
Description: Binary package for $(basename "$binary")
|
||||
Automatically packaged binary for $(basename "$binary")
|
||||
EOF
|
||||
|
||||
# Build package
|
||||
dpkg-deb --build "$pkgdir"
|
||||
|
||||
# Clean up
|
||||
rm -rf "$pkgdir"
|
||||
|
||||
echo "Package created: ${pkgdir}.deb"
|
||||
}
|
||||
|
||||
# Install a downloaded binary as a Debian package
|
||||
# Usage: install_binary_as_deb binary_url package_name version
|
||||
install_binary_as_deb() {
|
||||
local url="$1"
|
||||
local pkgname="$2"
|
||||
local version="$3"
|
||||
|
||||
if [ -z "$url" ] || [ -z "$pkgname" ] || [ -z "$version" ]; then
|
||||
echo "Usage: install_binary_as_deb binary_url package_name version"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Create temp directory
|
||||
local tmpdir=$(mktemp -d)
|
||||
cd "$tmpdir"
|
||||
|
||||
# Download and extract if it's a tar.gz
|
||||
if [[ "$url" == *".tar.gz" ]]; then
|
||||
wget "$url" -O "${pkgname}.tar.gz"
|
||||
tar xf "${pkgname}.tar.gz"
|
||||
# Assume binary has same name as package
|
||||
local binary="$pkgname"
|
||||
else
|
||||
wget "$url" -O "$pkgname"
|
||||
chmod +x "$pkgname"
|
||||
local binary="$pkgname"
|
||||
fi
|
||||
|
||||
# Create and install package
|
||||
make_binary_deb "$binary" "$pkgname" "$version"
|
||||
sudo dpkg -i "${pkgname}_${version}.deb"
|
||||
|
||||
# Clean up
|
||||
cd - > /dev/null
|
||||
rm -rf "$tmpdir"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
for dir in $(ls); do
|
||||
cd $dir;
|
||||
eval "$@";
|
||||
cd ..
|
||||
done
|
|
@ -1,29 +0,0 @@
|
|||
set -e
|
||||
# list all
|
||||
# gsettings list-recursively org.gnome.desktop.wm.keybindings
|
||||
|
||||
# switch to workspace
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Primary><Alt>1']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Primary><Alt>2']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Primary><Alt>3']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Primary><Alt>4']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Primary><Alt>5']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Primary><Alt>6']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['<Primary><Alt>7']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['<Primary><Alt>8']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-9 "['<Primary><Alt>9']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-10 "['<Primary><Alt>0']"
|
||||
|
||||
# move to workspace
|
||||
# same but with shift for qwertz
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<Shift><Primary><Alt>1']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<Shift><Primary><Alt>2']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<Shift><Primary><Alt>3']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<Shift><Primary><Alt>4']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Shift><Primary><Alt>5']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-6 "['<Shift><Primary><Alt>6']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-7 "['<Shift><Primary><Alt>7']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-8 "['<Shift><Primary><Alt>8']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-9 "['<Shift><Primary><Alt>9']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-10 "['<Shift><Primary><Alt>0']"
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
set -e
|
||||
# list all
|
||||
# gsettings list-recursively org.gnome.desktop.wm.keybindings
|
||||
|
||||
# switch to workspace
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Primary><Alt>1']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Primary><Alt>2']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Primary><Alt>3']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Primary><Alt>4']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Primary><Alt>5']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Primary><Alt>6']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['<Primary><Alt>7']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['<Primary><Alt>8']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-9 "['<Primary><Alt>9']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-10 "['<Primary><Alt>0']"
|
||||
|
||||
# move to workspace
|
||||
# same but with shift for qwertz
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-1 "['<Shift><Primary><Alt>1']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-2 "['<Shift><Primary><Alt>2']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-3 "['<Shift><Primary><Alt>3']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-4 "['<Shift><Primary><Alt>4']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-5 "['<Shift><Primary><Alt>5']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-6 "['<Shift><Primary><Alt>6']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-7 "['<Shift><Primary><Alt>7']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-8 "['<Shift><Primary><Alt>8']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-9 "['<Shift><Primary><Alt>9']"
|
||||
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-10 "['<Shift><Primary><Alt>0']"
|
||||
|
||||
# use touchscreen areas instead of needing 2 fingies for secondary click
|
||||
gsettings set org.gnome.desktop.peripherals.touchpad \
|
||||
click-method areas
|
|
@ -1,44 +0,0 @@
|
|||
set -e
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install \
|
||||
zsh curl wget vim fd-find bat git keepassxc-full borgbackup vorta kitty \
|
||||
guake flatpak chromium python3 python-is-python3 tmux borgbackup \
|
||||
lsd fzf btop htop tldr gnome-software-plugin-flatpak syncthing-gtk \
|
||||
syncthing lutris krita gimp fprintd libpam-fprintd git-lfs locate \
|
||||
deb-gview gconf2 geary bvi xxd gnome-applets gnome-colors \
|
||||
gnome-remote-desktop gnome-shell-extension-gsconnect \
|
||||
gnome-shell-extension-manager gnome-shell-extension-runcat binutils \
|
||||
build-essential linux-base lolcat gdb hunspell debian-keyring checkinstall \
|
||||
zoxide wl-clipboard libasound2-dev libdbus-1-dev software-properties-gtk \
|
||||
trash-cli gnome-shell-extension-manager fuse fonts-firacode \
|
||||
fastfetch ripgrep wget gnupg2 gnupg-agent dirmngr cryptsetup scdaemon pcscd \
|
||||
tree gnupg gnupg-agent scdaemon \
|
||||
wine dpf-plugins-vst3 dragonfly-reverb-vst3 lsp-plugins-vst3 \
|
||||
zam-plugins ibus-anthy python3-venv debian-keyring steam-devices \
|
||||
plymouth plymouth-themes polari how-can-i-help nmap \
|
||||
eza devscripts mmdebstrap sbuild uidmap \
|
||||
autopkgtest quilt reprepro aptitude gawk moreutils \
|
||||
git-buildpackage python3-pip python3-venv python3-virtualenv \
|
||||
gnome-shell-extension-gpaste gpaste-2 whois winbind util-linux \
|
||||
uuid-runtime python3-autopep8 python3-flake8 pre-commit python3-poetry \
|
||||
bsdgames vitetris wireguard wireshark virt-manager rustup \
|
||||
fonts-noto* cmake libgtk-3-dev
|
||||
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install \
|
||||
md.obsidian.Obsidian \
|
||||
org.signal.Signal \
|
||||
org.libretro.RetroArch \
|
||||
org.inkscape.Inkscape \
|
||||
com.rustdesk.RustDesk \
|
||||
dev.deedles.Trayscale \
|
||||
com.valvesoftware.Steam.CompatibilityTool.Proton-GE \
|
||||
com.valvesoftware.Steam \
|
||||
dev.vencord.Vesktop \
|
||||
org.gnome.Fractal \
|
||||
org.prismlauncher.PrismLauncher \
|
||||
org.kiwix.desktop \
|
||||
com.transmissionbt.Transmission
|
||||
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get autoremove
|
|
@ -1,7 +0,0 @@
|
|||
set -e
|
||||
apt-get update
|
||||
apt-get install git curl wget vim neovim fd-find bat python3 \
|
||||
python-is-python3 tmux btop htop fzf lsd tldr trash-cli \
|
||||
ripgrep tree nmap unzip
|
||||
apt-get upgrade
|
||||
apt-get autoremove
|
0
mail-script
Normal file → Executable file
0
mail-script
Normal file → Executable file
47
monitoweb.sh
47
monitoweb.sh
|
@ -1,47 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
url="$1"
|
||||
interval="${2:-60}" # Default to 60 seconds if not specified
|
||||
|
||||
if [ -z "$url" ]; then
|
||||
echo "Usage: $0 <url> [interval_seconds]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test if notify-send is available
|
||||
if ! command -v notify-send >/dev/null 2>&1; then
|
||||
echo "notify-send not found. Installing libnotify-bin..."
|
||||
sudo apt-get install libnotify-bin
|
||||
fi
|
||||
|
||||
# Test notification
|
||||
notify-send "Test" "Testing notifications..."
|
||||
echo "If you didn't see a notification, there might be an issue with your notification daemon"
|
||||
|
||||
old_hash=""
|
||||
|
||||
while true; do
|
||||
new_hash=$(curl -s "$url" | sha256sum | cut -d' ' -f1)
|
||||
|
||||
if [ -n "$old_hash" ] && [ "$old_hash" != "$new_hash" ]; then
|
||||
echo "CHANGE DETECTED! $(date)"
|
||||
|
||||
# Try multiple notification methods
|
||||
notify-send -u critical "Website Changed!" "Changes detected at $url"
|
||||
|
||||
# # Alternative: Use zenity if available
|
||||
# if command -v zenity >/dev/null 2>&1; then
|
||||
# zenity --info --text="Website changed: $url" &
|
||||
# fi
|
||||
#
|
||||
# Also try to make a sound
|
||||
if command -v paplay >/dev/null 2>&1; then
|
||||
paplay --volume=17000 /usr/share/sounds/freedesktop/stereo/complete.oga &
|
||||
elif command -v spd-say >/dev/null 2>&1; then
|
||||
spd-say "Website changed"
|
||||
fi
|
||||
fi
|
||||
|
||||
old_hash=$new_hash
|
||||
sleep $interval
|
||||
done
|
0
qemu-spice.sh
Executable file → Normal file
0
qemu-spice.sh
Executable file → Normal file
29
shutdown-notify
Executable file
29
shutdown-notify
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail # Strikte Fehlerbehandlung
|
||||
|
||||
# Check für Parameter
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <minutes>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MINS="$1" # Quote für safety
|
||||
CREDS=$(cat /root/secret/ntfy.txt || exit 1) # Explizites error handling
|
||||
TOPIC="KX8E5dbho7Q4VUVi-feed"
|
||||
|
||||
# Sende Notification
|
||||
if ! curl -f -s \
|
||||
-u "$CREDS" \
|
||||
-d "Homeserver fährt in $MINS Minuten runter." \
|
||||
-H "Title: Server Shutdown" \
|
||||
-H "Priority: high" \
|
||||
https://ntfy.sh/$TOPIC; then
|
||||
echo "Failed to send notification"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Warte auf Zustellung
|
||||
sleep 5
|
||||
|
||||
# Führe Shutdown aus
|
||||
shutdown "$MINS"
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/false
|
||||
# on target
|
||||
python -c "import pty; pty.spawn('/bin/bash')"
|
||||
|
||||
# background with <C-z>
|
||||
|
||||
stty raw -echo && fg
|
||||
export TERM=xterm-256-color
|
|
@ -15,8 +15,14 @@ if [[ "$oldhash" = "$newhash" ]]; then
|
|||
exit
|
||||
else
|
||||
echo "[$(eval $date)]: setting wallpaper..." | tee -a $logfile
|
||||
gsettings set org.gnome.desktop.background picture-uri file://${filelocation}
|
||||
gsettings set org.gnome.desktop.background picture-uri-dark file://${filelocation}
|
||||
gsettings set org.gnome.desktop.background picture-options 'stretched'
|
||||
dbus-send --session --dest=org.kde.plasmashell --type=method_call \
|
||||
/PlasmaShell org.kde.PlasmaShell.evaluateScript 'string:
|
||||
var Desktops = desktops();
|
||||
for (i=0;i<Desktops.length;i++) {
|
||||
d = Desktops[i];
|
||||
d.wallpaperPlugin = "org.kde.image";
|
||||
d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");
|
||||
d.writeConfig("Image", "file://'$filelocation'");
|
||||
}'
|
||||
echo "[$(eval $date)]: done" | tee -a $logfile
|
||||
fi
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
base_config="wg0.conf"
|
||||
base_ip="192.168.57."
|
||||
start_ip=110
|
||||
server_config="wg0-server.conf"
|
||||
|
||||
# First create server base config
|
||||
cat > "$server_config" << 'EOF'
|
||||
[Interface]
|
||||
Address = 192.168.57.2/24
|
||||
SaveConfig = false
|
||||
PostUp = ip route add 192.168.56.0/24 dev vboxnet0; iptables -A FORWARD -i wg0 -o vboxnet0 -j ACCEPT; iptables -A FORWARD -i vboxnet0 -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o vboxnet0 -j MASQUERADE
|
||||
PostDown = ip route del 192.168.56.0/24 dev vboxnet0; iptables -D FORWARD -i wg0 -o vboxnet0 -j ACCEPT; iptables -D FORWARD -i vboxnet0 -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o vboxnet0 -j MASQUERADE
|
||||
ListenPort = 51820
|
||||
PrivateKey = SJuOEDojaWclA3vyq1tI3fKv+Phs9QdvUFG7mZj23VU=
|
||||
|
||||
EOF
|
||||
|
||||
# Create 30 configs
|
||||
for i in {1..30}; do
|
||||
ip=$((start_ip + i))
|
||||
new_config="wg0_$ip.conf"
|
||||
wg genkey | tee "${ip}privatekey" | wg pubkey | tee "${ip}publickey"
|
||||
pub=$(cat ${ip}publickey)
|
||||
priv=$(cat "${ip}privatekey")
|
||||
echo $pub
|
||||
|
||||
# Create new client config with all replacements
|
||||
sed -E "s#(Address = ${base_ip})[0-9]+#\1${ip}#;
|
||||
s#(PrivateKey = ).*#\1${priv}#" "$base_config" > "$new_config"
|
||||
|
||||
# Add peer to server config with the new public key
|
||||
cat >> "$server_config" << EOF
|
||||
[Peer]
|
||||
PublicKey = $pub
|
||||
AllowedIPs = 192.168.57.${ip}/32
|
||||
|
||||
EOF
|
||||
|
||||
echo "Created $new_config with IP ${base_ip}${ip}"
|
||||
done
|
||||
|
||||
echo "Created $server_config with all peer public keys"
|
Loading…
Add table
Reference in a new issue