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
xquery version "1.0-ml"; | |
(: This script looks for forests configured as master on this host that | |
are currently acting as a replica. This implies that a failover has | |
occurred and a replica for the forest has taken over as master, and | |
also that the master is now back online but is in the role of replica. | |
Restarting the acting master will cause the configured master to | |
resume its role as master. That will allow the server node that | |
owns the master forest to resume handling query load for it. |
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
grep -vE '(\ to\ domestic\ forest\ |\ to\ domestic\ replica\ forest\ |Info:\ Unmounted\ forest|Info:\ Mounted\ forest|Info:\ Merging|Info:\ Merged|Info:\ Saving|Info:\ Saved|Info:\ Deleted)' supportDumpFileName > newFileName |
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
cut -d " " -f 3- filename.txt | sort -n | uniq -c |
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
grep "STRING" FILENAME | cut -d " " -f4 | awk '{total = total + $1}END{print total}' |
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
(: From Filesystem :) | |
xdmp:document-insert("/zip-test.zip", | |
xdmp:external-binary("C:\Users\ableasdale\Downloads\downloaded.zip") | |
) | |
(: From a Variable - it's this simple! :) | |
xdmp:document-insert("/binary", $var) |
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
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 := "[email protected]"; | |
declare variable $TO-NAME as xs:string := "Example Recipient"; | |
declare variable $TO-EMAIL as xs:string := "[email protected]"; | |
declare variable $EMAIL-BODY as element(div) := <div>This email was sent from an <strong>amped</strong> function</div>; |
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
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 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
rsync -ruv Music /Volumes/Public/iTunes\ Backup |
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
for /r %x in (*) do if exist "%x" ren "%x" *.xml |
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
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 { |