This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 22 * * * root flock -n /var/services/homes/admin/lock/backup.lock /var/services/homes/admin/bin/backup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/logrotate.d/backup_sh | |
/var/services/homes/admin/log/backup*.log { | |
missingok | |
} |