diff --git a/docker/composes/syncthing/docker-compose.yml b/docker/composes/syncthing/docker-compose.yml new file mode 100644 index 0000000..f614132 --- /dev/null +++ b/docker/composes/syncthing/docker-compose.yml @@ -0,0 +1,18 @@ +--- +version: "3" +services: + syncthing: + image: syncthing/syncthing + container_name: syncthing + hostname: my-syncthing + environment: + - PUID=1000 + - PGID=1000 + volumes: + - ./volumes/syncthing:/var/syncthing + ports: + - 8384:8384 # Web UI + - 22000:22000/tcp # TCP file transfers + - 22000:22000/udp # QUIC file transfers + - 21027:21027/udp # Receive local discovery broadcasts + restart: unless-stopped diff --git a/dot-conf/.zshrc b/dot-conf/.zshrc index 5b75938..0670cfa 100644 --- a/dot-conf/.zshrc +++ b/dot-conf/.zshrc @@ -43,6 +43,10 @@ alias rld="source ${HOME}/.zshrc" alias zshrc="lvim ${HOME}/.zshrc && rld" alias tm="tmux" alias tmf="tmuxifier" +alias d="docker" +alias dc="docker compose" +alias k="kubectl" +alias mk="minikube" # paths export PATH=${PATH}:${HOME}/.local/bin @@ -51,15 +55,17 @@ export PATH="$HOME/.tmuxifier/bin:$PATH" # docker # https://gbbigardi.medium.com/wsl-2-arch-docker-e-um-pouco-mais-do-meu-ambiente-de-desenvolvimento-42adc48368d4 -# 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 +dockerRun() { + 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 +} eval "$(tmuxifier init -)" eval "$(zoxide init zsh)" diff --git a/my-scripts/arch/timers/createSymLinks.sh b/my-scripts/arch/timers/createSymLinks.sh new file mode 100755 index 0000000..723f576 --- /dev/null +++ b/my-scripts/arch/timers/createSymLinks.sh @@ -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 diff --git a/my-scripts/arch/timers/rclone-syncs.service b/my-scripts/arch/timers/rclone-syncs.service new file mode 100644 index 0000000..47a24d2 --- /dev/null +++ b/my-scripts/arch/timers/rclone-syncs.service @@ -0,0 +1,6 @@ +[Unit] +Description=Run rclone-syncs.sh + +[Service] +ExecStart=rclone-syncs.sh + diff --git a/my-scripts/arch/timers/rclone-syncs.timer b/my-scripts/arch/timers/rclone-syncs.timer new file mode 100644 index 0000000..30e3d6a --- /dev/null +++ b/my-scripts/arch/timers/rclone-syncs.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Run rclone-syncs.sh every 10 minutes + +[Timer] +OnBootSec=5min +OnUnitActiveSec=10min + +[Install] +WantedBy=multi-user.target + diff --git a/my-scripts/pshell/AddOpenTerminalHereContextMenu.txt b/my-scripts/pshell/AddOpenTerminalHereContextMenu.txt new file mode 100644 index 0000000..44e5bcb --- /dev/null +++ b/my-scripts/pshell/AddOpenTerminalHereContextMenu.txt @@ -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 diff --git a/my-scripts/shell/dockerStart.sh b/my-scripts/shell/dockerStart.sh deleted file mode 100755 index 5467d4c..0000000 --- a/my-scripts/shell/dockerStart.sh +++ /dev/null @@ -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 diff --git a/my-scripts/shell/runDockerWsl.sh b/my-scripts/shell/runDockerWsl.sh index 41e6d27..73faec3 100755 --- a/my-scripts/shell/runDockerWsl.sh +++ b/my-scripts/shell/runDockerWsl.sh @@ -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