Skip to content

Instantly share code, notes, and snippets.

View ivanmorenoj's full-sized avatar
🎯
Focusing

Iván Moreno ivanmorenoj

🎯
Focusing
View GitHub Profile
@ivanmorenoj
ivanmorenoj / git_pull.sh
Created November 8, 2019 05:17
Update all git repos in one folder
#!/bin/sh
#
# Author: Ivan Moreno
# Novemver 2019
DIRS=(~/WorkSpace)
for folder in ${DIRS[@]}; do
echo ">>>>>>>>>>>>>>>>> Find git repos in $folder"
find $folder -name .git -type d -prune | while read dir; do
@ivanmorenoj
ivanmorenoj / dynamic-tunnel@.service
Last active May 5, 2023 09:07
Systemd template for local ssh port forwarding at startup
[Unit]
Description=Setup a dynamic tunnel to %I
After=network.target
[Service]
EnvironmentFile=/etc/default/dynamic-tunnel@%i
ExecStart=/usr/bin/ssh -i ${PATH_TO_KEY} -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -nNT -D ${LOCAL_PORT} ${REMOTE_USER}@${REMOTE_HOST}
RestartSec=15
Restart=always
KillMode=mixed