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
xquery version "1.0-ml"; | |
module namespace amped = "http://marklogic.com/kb/amp"; | |
declare variable $SUBJECT as xs:string := "Email from a Module"; | |
declare variable $FROM-NAME as xs:string := "MarkLogic (AMPED)"; | |
declare variable $FROM-EMAIL as xs:string := "marklogic@example.com"; | |
declare variable $TO-NAME as xs:string := "Example Recipient"; | |
declare variable $TO-EMAIL as xs:string := "recipient@example.com"; | |
declare variable $EMAIL-BODY as element(div) := <div>This email was sent from an <strong>amped</strong> function</div>; |
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
xquery version "1.0-ml"; | |
(: | |
Step 1 | |
Get the necessary data - around the two times where we see Journal Errors getting logged. | |
To extract all the nodes from the text files, | |
do something like this on the Performance Monitor output files: | |
grep -B3 -A7 "of_Day>8:48:54" Logfile-scrubbed > cut3.txt | |
grep -B3 -A7 "of_Day>7:34:28" Logfile-scrubbed > cut4.txt | |
:) |
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
rsync -ruv Music /Volumes/Public/iTunes\ Backup |
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
for /r %x in (*) do if exist "%x" ren "%x" *.xml |
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
xquery version "1.0-ml"; | |
declare private function local:random-hex($length as xs:integer) as xs:string { | |
fn:string-join(for $n in 1 to $length | |
return xdmp:integer-to-hex(xdmp:random(15)), | |
"" | |
) | |
}; | |
declare function local:generate-uuid-v4() as xs:string { |
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 | |
IP_ADDR=$(/sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}') | |
echo -e "\033[1;32m | |
____ _ ___ ____ __ ____ __ | |
/ ___|___ _ __ | |_ / _ \/ ___| \ \ / / \/ | | |
| | / _ \ '_ \| __| | | | \___ \ \ \ / /| |\/| | | |
| |__| __/ | | | |_ | |_| |___) | \ V / | | | | | |
\____\___|_| |_|\__| \___/|____/ \_/ |_| |_| | |
\033[0;35m+++++++++++++++++: \033[0;37mSystem Data\033[0;35m :+++++++++++++++++++ | |
+ \033[0;37mHostname \033[0;35m= \033[1;32m`hostname` |
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
xquery version "1.0-ml"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $config := admin:get-configuration(); | |
let $config := admin:group-add-trace-event($config, admin:group-get-id($config, "Default"), | |
( | |
admin:group-trace-event("TRACE EVENT I"), | |
admin:group-trace-event("TRACE EVENT II"), |
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
xquery version "1.0-ml"; | |
declare function local:get-document-collections-ordered($uri as xs:string) as xs:string { | |
for $i in xdmp:quote(xdmp:document-get-collections($uri)) | |
order by $i | |
return $i | |
}; | |
declare function local:calculate-md5-checksum($uri as xs:string) as xs:string { | |
xdmp:md5(fn:concat( |
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
xquery version "1.0-ml"; | |
declare variable $URIS as xs:string+ := (cts:uris()); | |
declare function local:create-parts-manifest($items) { | |
<parts xmlns="xdmp:zip"> | |
{ | |
for $item in $items | |
return element part {$item} | |
} |
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
# XQSync Security Database backup script | |
# Takes a backup of the Security database on a given system and creates | |
# a zip file containing all the necessary data for restoring. | |
# GLOBAL VARIABLES | |
CONNECTION_URI=xcc://admin:admin@localhost:8010 | |
TSTAMP=`date +"%H%M%S-%m-%d-%Y"` | |
echo ******************************** | |
echo Script started on $TSTAMP |
OlderNewer