Skip to content

Instantly share code, notes, and snippets.

View hannesbe's full-sized avatar
🏠
Working from home

Hannes Van de Vel hannesbe

🏠
Working from home
View GitHub Profile
@hannesbe
hannesbe / syno-vpn-keepalive.sh
Last active December 11, 2024 23:23
Script to keep VPN alive on Synology DSM. Checks if IP is pingable and if not: disconnect VPN, reconnect VPN & add routes
# syno-vpn-keepalive.sh
# ---
# Script to keep VPN alive on Synology DSM.
# Checks if IP is pingable and if not:
# disconnect VPN, reconnect VPN & add routes
# ---
# Modify vars:
# - CHECKIP: IP to check to be pingable before reconnecting VPN
# - NAME (Synology VPN name),
# - ID (Synology VPN ID), SSH to NAS & run this to find ID
@hannesbe
hannesbe / install-google-drive-ocamlfuse-debian.sh
Last active September 6, 2023 15:01 — forked from OneCDOnly/gist:972755c5c5825ddd819cb2729a52b646
Install 'google-drive-ocamlfuse' on Debian Stretch & Buster
#/bin/bash
# Installs google-drive-ocamlfuse on Debian (Stretch & Buster)
#
# Run this oneliner to make it happen
# bash <(curl -sSL https://gist.github.com/hannesbe/6c110e9de6644f07a48eecfdbe6b728d/raw)
sudo apt install -y software-properties-common dirmngr
sudo cat > /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa-bionic.list << EOF
deb http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
@hannesbe
hannesbe / hass-upgrade.sh
Created December 4, 2017 06:00
Upgrade Home Assistant in virtualenv
function hass-upgrade {
echo "Stopping homeassistant"
sudo systemctl stop home-assistant@homeassistant.service
sudo -u homeassistant -H /bin/bash <<EOF
echo "Activating virtualenv"
source /srv/homeassistant/bin/activate
@hannesbe
hannesbe / Using icons on Markdown.md
Last active November 27, 2020 00:41
Using icons in Markdown

Using icons in Markdown

Icons are known to be supported in editors StackEdit & Marxico.

Base icons

Show an icon .

@hannesbe
hannesbe / conf\conf.user.json
Last active November 18, 2020 12:53
Typora user config (goes in %USERPROFILE%\Roaming\Typora\conf\conf.user.json) & base theme css (goes in %USERPROFILE%\Roaming\Typora\themes)
/**
Typora user config
C:\Users\hava\AppData\Roaming\Typora\conf\conf.user.json */
{
"width" : null, // Integer - Window's width in pixels. Default is null (last window width)
"height" : null, // Integer - Window's height in pixels. Default is null (last window height)
"directWrite": true, // Boolean - Enables DirectWrite font rendering system on Windows. Default is true.
"defaultFontFamily": {
"standard": null, //String - Defaults to "Times New Roman".
"serif": null, // String - Defaults to "Times New Roman".
@hannesbe
hannesbe / fail2ban-csf-install.sh
Last active February 28, 2020 16:00
Install script fail2ban with action to csf | CentOS/EL 7
#!/bin/sh
#
# Shell script to install & configure fail2ban with firewalld actions
# Just one command to install & configure in a few seconds.
# CentOS/EL7+ required.
#
# Run this command to execute the script in one go
# curl -sSL https://gist.github.com/hannesbe/893476e23e637701fd88/raw/fail2ban-csf-install.sh | bash -s
#
set -e
@hannesbe
hannesbe / csf-install.sh
Created January 14, 2016 09:57
csf installer
#!/bin/bash
#
# <c> Copyright 2012 SolidShellSecurity, LLC
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
@hannesbe
hannesbe / gmailAutoArchive.js.gs
Created December 28, 2019 00:21
Auto Archive Gmail script
// Original author fwed (contact@fwed.fr)
// Modified from
// https://gist.github.com/anonymous/2cca33d376f7f924fdaa67891ad098cc
// https://medium.com/@fw3d/auto-archive-emails-in-gmail-after-2-days-1ebf0e076b1c
function gmailAutoArchive() {
gmailAutoarchiveHelper(30);
}
{
"menulanguage": "English",
"name": "zzz55PUS7600/12",
"country": "Belgium",
"serialnumber_encrypted": "LLfxI4h9qmyYM2Uh0nzY18h34e4/dM07hCxEtOYsefg=\n",
"softwareversion_encrypted": "L+93GMOWgt1v09BCJBNdI9gZ0qeZOirAHsayGqoB7/E=\n",
"model_encrypted": "dFuoHbIninStfq5kYJS5ocpqNgrlAtvi4voV8778kiw=\n",
"deviceid_encrypted": "HgAs8D/KmX5LNOMnVUEiUTVqFQWdLCkhvEnrhb8yZ1k=\n",
"nettvversion": "5.2.0",
"epgsource": "ip",
@hannesbe
hannesbe / crontab
Created September 19, 2019 00:24
cron
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system