Skip to content

Instantly share code, notes, and snippets.

View d-oderbolz's full-sized avatar

Dr. Daniel C. Oderbolz d-oderbolz

  • SBB CFF FFS
  • Switzerland
View GitHub Profile
#/etc/logrotate.d/backup_sh
/var/services/homes/admin/log/backup*.log {
missingok
}
#!/bin/bash
# Simple Backup Script (inspried by https://zarino.co.uk/post/synology-rsync-backup/)
rsync -a -v --log-file="/var/services/homes/admin/log/backup.$(date +%Y-%m-%d-%H%M).log" \
--exclude '*@SynoResource' \
--exclude '@eaDir' \
--exclude '*.vsmeta' \
--exclude '.DS_Store' \
/volume1/data/ /volumeUSB2/usbshare/data
0 22 * * * root flock -n /var/services/homes/admin/lock/backup.lock /var/services/homes/admin/bin/backup.sh
getActiveProductsManagedByUser: function(user_sys_id){
try
{
if (! this.checkSysId(user_sys_id))
{
throw("getProductsManagedByUser: Not a valid sys_id - " + user_sys_id);
}
// Rest of code here
}
// This is a gist to show how to write a Service Now Script Include to return an array with
// the results of a query
// As an example, I use the sys_properties table, but of course, any table will do
var Toolbox_Functions = Class.create();
Toolbox_Functions.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getPropertyList: function (prefix)
{
// 06.11.2017 - Return a list of System Properties whose name starts with prefix
// This is a gist to show how NOT to write a Service Now Script Include to return an array with
// the results of a query
// As an example, I use the sys_properties table, but of course, any table will do (AKA: not work)
var Toolbox_Functions = Class.create();
Toolbox_Functions.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getPropertyList: function (prefix)
{
// 06.11.2017 - Return a list of System Properties whose name starts with prefix
## This scipt does a check of all the email adresses given in a CSV File
# See also http://www.govcert.admin.ch/blog/20/leaked-mail-accounts
# Written by Daniel C. Oderbolz, 2016 using code by Jon Gurgul
# Blessing from https://github.com/endlesssoftware/sqlite3/blob/master/btree.c
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give
# When resulting page contains
# <center><h1>Email Address <b>NOT</b> in Database</h1><br /></center>