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 | |
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 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"; | |
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 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 | |
# root check | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
# default argument check | |
if [[ -z $1 ]]; then |
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 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 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 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 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
# 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 |
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"; | |
import module namespace sec="http://marklogic.com/xdmp/security" at | |
"/MarkLogic/security.xqy"; | |
(xdmp:set-response-content-type("text/html; charset=utf-8"), | |
'<!DOCTYPE html>', | |
element html { | |
element head { | |
element title {"Role / Privilege mappings for security database version: ", xs:string(//sec:version)} |
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
aws ec2 run-instances --image-id ami-XXXXXXX --instance-type m3.medium --security-groups XXXXX --key-name XXXXXX --monitoring Enabled=true --iam-instance-profile Name=MarkLogic --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"Ebs\":{\"VolumeSize\":10,\"VolumeType\":\"gp2\" }}]" |
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"; | |
(: | |
: Example for locally loading a MarkLogic support dump as a sequence | |
: of document-node() elements for reporting and analysis | |
:) | |
declare variable $path as xs:string := 'C:\Users\ableasdale\Desktop\dump.txt'; | |
declare variable $support as document-node()* := xdmp:document-get ( |
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"; | |
(: | |
: Parse a support dump, extract a single database (by name), remove all associated forest data and return the database element | |
:) | |
declare namespace db="http://marklogic.com/xdmp/database"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
import module namespace mem = "http://xqdev.com/in-mem-update" at "/MarkLogic/appservices/utils/in-mem-update.xqy"; |