Skip to content

Instantly share code, notes, and snippets.

View novoid's full-sized avatar

Karl Voit novoid

View GitHub Profile
@novoid
novoid / vk-get-crontab-and-misc.sh
Created August 24, 2020 09:44
vk-get-crontab-and-misc.sh
#!/bin/sh
## this script saves crontabs and misc things to a file
readonly SCRIPTNAME=$(basename $0)
readonly HOST=$(hostname)
OUTPUTDIR="${HOME}/archive/backup/"
[ "x$HOST" = "xHOSTX" ] && OUTPUTDIR="${HOME}/hosts/HOSTX/archive"
[ "x$HOST" = "xHOSTBUSINESS" ] && OUTPUTDIR="${HOME}/share/backup"
@novoid
novoid / vkbackup
Created August 29, 2020 10:30
Backup shell script using rsnapshot (rsync)
#!/bin/sh
## My one and only backup script for the future :-)
## Uses rsnapshot.
##
## Please do read this blog article about that script: https://Karl-Voit.at/2020/08/29/vkbackup/
##
## ---------------------------------------------------
##
## Initial setup:
@novoid
novoid / vk-cronjob-anyhost-appendorgheading-if-syncconflict.sh
Created December 2, 2020 20:24
Checking for syncthing conflict files and adding them to my Org mode agenda
#!/bin/bash
## This script appends to ORGFILE when syncthing conflict files are located on the host.
## setup:
## 1. pip3 install appendorgheading https://github.com/novoid/appendorgheading
## 2. modify ORFGILE to match an Org mode file which is part of your agenda (in order to get notified).
## 3. create a cronjob entry for this script to run, e.g., daily.
HOSTNAME=$(uname -n)
@novoid
novoid / vkrename_according_to_dirname.py
Created July 24, 2022 15:23
This tool renames a file according to its parent directory name
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
PROG_VERSION = "Time-stamp: <2022-03-13 22:56:40 vk>"
# TODO:
# - fix parts marked with «FIXXME»
# ===================================================================== ##
# You might not want to modify anything below this line if you do not ##