This commit is contained in:
Maurice
2025-10-01 13:44:10 +02:00
parent fcca20714e
commit 6c3919d860
8 changed files with 97 additions and 4 deletions

84
config/.profile Normal file
View File

@@ -0,0 +1,84 @@
alias vim="nvim"
# Linux
alias ip="ip --color=auto"
alias la="ls -lah"
# git helpers
alias gf="git fetch --prune"
alias gs="git status"
alias gsw="git switch"
alias ga="git add -A"
alias gb="git branch -v"
alias grh="git add -A; git reset --hard"
alias grr="git restore"
alias gp="git pull"
alias gpp="git push"
alias grsf="git reset --soft HEAD~1"
alias grhf="git reset --hard HEAD~1"
alias grhk="git reset HEAD^" # keep changes
alias gc="git commit -m"
alias grep="grep --color=auto"
alias gd="git diff"
alias gcl="git clean -dfx"
gpu() {
current_branch="$(git rev-parse --abbrev-ref HEAD)"
echo "Pushing to origin $current_branch"
git push -u origin $current_branch
}
gmm() {
current_branch="$(git rev-parse --abbrev-ref HEAD)"
echo "Merging master into $current_branch"
gpl
gsw master
gp
gsw $current_branch
git merge origin master
}
# Other
alias dcl="dotnet clean && dotnet restore"
alias random="tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo"
# Plabble
clip() {
url=$(curl -sF 'content=<-' https://paste.plabble.org/$1 -w '\n')
echo $url
echo $url | pbcopy
}
unclip() {
curl https://paste.plabble.org/$1
}
# NNN
n() {
if [[ "${NNNLVL:-0}" -ge 1 ]]; then
echo "nnn is already running"
return
fi
# export to always-cd
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
nnn "$@"
if [ -f "$NNN_TMPFILE" ]; then
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
fi
}
add_to_path() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
# PATH
add_to_path "$HOME/.cargo/bin"
export EDITOR="nvim"

View File

@@ -2,6 +2,8 @@
clear
echo "Starting installation..."
cp -f ./config/.profile /root/.profile
# Install podman-openrc tool
apk add cargo
cargo install podman-openrc

View File

@@ -5,6 +5,9 @@ echo "Basic setup..."
sed -i 's|^#\(http.*/community\)$|\1|' /etc/apk/repositories
apk update
# Install basic packages
apk add neovim nnn kitty-terminfo curl
# Cron jobs
rc-update add crond
cat << EOF > /etc/periodic/daily/chrony

View File

@@ -6,7 +6,7 @@ rc-update add cgroups
rc-service cgroups start
# Rootless mode
adduser -D podman
adduser -DH podman
modprobe tun
echo tun >> /etc/modules
echo podman:100000:65536 > /etc/subuid

View File

@@ -1,3 +1,5 @@
#!/bin/sh
mkdir -p /var/containers/adguard
cp -f $(pwd)/AdGuardHome.yaml /var/containers/adguard/AdGuardHome.yaml
cp -f $(pwd)/AdGuardHome.yaml /var/containers/adguard/AdGuardHome.yaml
chmod +x /etc/init.d/adguard.service
rc-update add adguard.service default

View File

@@ -2,6 +2,8 @@
mkdir -p /var/containers/caddy
cp -f $(pwd)/Caddyfile /var/containers/caddy/Caddyfile
chown -R podman:podman /var/containers/caddy
chmod +x /etc/init.d/caddy.service
rc-update add caddy.service default
if [ "$1" = "reload" ]; then
podman exec caddy caddy reload -c /etc/caddy/Caddyfile

View File

@@ -37,7 +37,7 @@ define icmpv6_slaac = {
}
# Clients that are allowed to access the LAN network
define lan_clients = { 10.0.0.3 }
define lan_clients = { 10.0.0.2 }
table inet firewall {
chain postrouting {

View File

@@ -2,7 +2,7 @@
base_dir=$(pwd)
echo "Updating service scripts..."
podman-openrc ./services /etc/init.d/
/root/.cargo/bin/podman-openrc ./services /etc/init.d/
# Update services (awall policies, scripts)
for service in "./services"/*/; do