This file contains hidden or 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
# @see https://gist.github.com/d-oderbolz/bfcd2c9ac1b02a9ab632c0ebf5a4bccf | |
# We have a list of Markdown files in a directory. | |
# We want to convert them to Confluence format and export them to a Confluence space. | |
# The file names start with an ISO date in the format YYYY-MM-DD, followed by a hyphen delimited name and end with .md. | |
# We want to loop through each file, convert it to Confluence format, and then create a row in a Confluence table. | |
# I want to be able to choose the start date and end date for the files to be processed. | |
# Usage: .\Export-to-Confluence.ps1 -StartDate "2023-01-01" -EndDate "2023-12-31" -Directory "C:\Path\To\MarkdownFiles" -Pattern "^(\d{4}-\d{2}-\d{2})-(.+)\.md$" |
This file contains hidden or 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 | |
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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> |