Devboot update: 23-10-04-23-06-58

This commit is contained in:
Matheus Albino
2023-10-04 23:06:58 -03:00
parent cc4f9d7245
commit bb97b733fb
8 changed files with 90 additions and 49 deletions

View File

@@ -0,0 +1,31 @@
#!/bin/bash
my_timers_dir=${HOME}/repos/personal-devboot/my-scripts/arch/timers
system_timers_dir=/etc/systemd/system/
createSymLink() {
link_from=$1
link_to=$2
sudo ln --symbolic --force ${link_from} ${link_to}
}
startTimer() {
timer_name=$1
sudo systemctl enable ${timer_name}
sudo systemctl start ${timer_name}
}
timers_files=($(find ~+ -type f -name '*.timer'))
services_files=($(find ~+ -type f -name '*.service'))
for timer_file in ${timers_files[@]}; do
createSymLink ${timer_file} ${system_timers_dir}
# startTimer "$(basename ${timer_file})"
done
for service_file in ${services_files[@]}; do
createSymLink ${service_file} ${system_timers_dir}
# startTimer "$(basename ${service_file})"
done

View File

@@ -0,0 +1,6 @@
[Unit]
Description=Run rclone-syncs.sh
[Service]
ExecStart=rclone-syncs.sh

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Run rclone-syncs.sh every 10 minutes
[Timer]
OnBootSec=5min
OnUnitActiveSec=10min
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
# https://github.com/lextm/windowsterminal-shell.git
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; .\install.ps1 mini

View File

@@ -1,35 +0,0 @@
#!/bin/bash
# Function to display usage information
# show_help() {
# echo "Usage: $0 [options]"
# echo "Options:"
# echo " --compose Start compose containers"
# echo " --help Display this help message"
# exit 1
# }
# docker without docker desktop yippie!!!
# source: https://gbbigardi.medium.com/wsl-2-arch-docker-e-um-pouco-mais-do-meu-ambiente-de-desenvolvimento-42adc48368d4
if [ ! -S "$DOCKER_SOCK" ]; then
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
chgrp docker "$DOCKER_DIR"
sudo /mnt/c/Windows/System32/wsl.exe -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd < /dev/null > $DOCKER_DIR/dockerd.log 2>&1"
fi
# Check for options
# case "$1" in
# --compose)
# sleep 2
# cd ~/documents/repos/zaks-clouds-manager/
# docker compose up -d
# ;;
# --help)
# show_help
# ;;
# *)
# echo "Unknown option: $1"
# show_help
# ;;
# esac

View File

@@ -1,10 +1,12 @@
#!/bin/bash
# docker
DOCKER_DISTRO="Arch"
DOCKER_DIR=/mnt/wsl/shared-docker
DOCKER_SOCK="$DOCKER_DIR/docker.sock"
export DOCKER_HOST="unix://$DOCKER_SOCK"
if [ ! -S "$DOCKER_SOCK" ]; then
mkdir -pm o=,ug=rwx "$DOCKER_DIR"
chgrp docker "$DOCKER_DIR"
/mnt/c/Windows/System32/wsl.exe -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd < /dev/null > $DOCKER_DIR/dockerd.log 2>&1"
fi
# if [ ! -S "$DOCKER_SOCK" ]; then
# mkdir -pm o=,ug=rwx "$DOCKER_DIR"
# chgrp docker "$DOCKER_DIR"
# /mnt/c/Windows/System32/wsl.exe -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd < /dev/null > $DOCKER_DIR/dockerd.log 2>&1"
# fi