Skip to content

Instantly share code, notes, and snippets.

View lucarin91's full-sized avatar

Luca Rinaldi lucarin91

View GitHub Profile
@lucarin91
lucarin91 / sync.sh
Last active December 20, 2022 14:09
Synchronize a local folder with a remote server in a bidirectional way.
#!/bin/sh
set -e
### Configuration ###
SERVER=luca@example.com
REMOTE_FOLDER=my_folder
REMOTE_RESULTS=results
EXCLUDE_FILES="--exclude=.*\
--exclude=build/"
@lucarin91
lucarin91 / install-omzfish.sh
Created September 11, 2018 16:31
Install oh-my-zsh with fish-like plugins.
#!/bin/sh
set -ex
## install oh-my-zsh ##
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
## install fish-like plugins ##
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
@lucarin91
lucarin91 / nextcloud_backup.sh
Created May 24, 2019 09:47
Simple script for backup Nextcloud data.
#!/bin/sh
set -x
NC_PATH="/var/www/nextcloud"
DST_PATH="/tmp"
DATE=$(date +"%Y%m%d")
# start maintenance
sudo -u www-data php "$NC_PATH/occ" maintenance:mode --on
@lucarin91
lucarin91 / sendlog
Created April 20, 2020 13:25
Simple sh script to send out log to a telegram chat.
#!/bin/sh
#####################################################
# CONFIGURATION #
#####################################################
TOKEN=1233445ASDKLSJDASASDDASBJHBEUBSAÀÒBDFASOFADBSDF
CHAT_ID=12312354
#####################################################