Skip to content

Instantly share code, notes, and snippets.

View toodooleedoo's full-sized avatar

Eric Soukenka toodooleedoo

View GitHub Profile
@toodooleedoo
toodooleedoo / json_copy_node.sh
Last active August 29, 2015 14:14
#AEM #CQ #CURL copy a node with json
HOSTNAME="localhost"
CONTENTPATH="/content/test/jcr:content/topwidecopy/itemlist_7fbd"
curl "http://admin:admin@${HOSTNAME}:4502/${CONTENTPATH}.json" -o body.json
curl "http://admin:admin@${HOSTNAME}:4502/${CONTENTPATH}" -F":operation=import" -F":contentType=json" -F":content=@body.json"
@toodooleedoo
toodooleedoo / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@toodooleedoo
toodooleedoo / upload_to_cq.sh
Created February 2, 2015 02:57
AEM:CQ:Linux: Upload a file into the Repository
curl -u admin:PASSWORD -T FILENAMETOUPLOAD http://HOSTNAME.bestwestern.com:4505/PATHONSERVER
@toodooleedoo
toodooleedoo / mountdav.txt
Last active August 29, 2015 14:14
#CQ #AEM Mount the DAM repository in windows
- Set user password in CQ WCM
- Open Explorer --> Right click Computer --> Map Network Drive
- Enter http://<<<CUT>>>:4502/crx/repository/crx.default/var/dam/01 and Select Connect using different credentials
Log Sample
> <<<CUT>>> - - [17/Jun/2014:15:34:26 -0700] "PROPFIND /crx/repository/crx.default/var/dam/01 HTTP/1.1" 401 - "-" "Microsoft-WebDAV-MiniRedir/6.1.7601"
> <<<CUT>>> - - [17/Jun/2014:15:35:57 -0700] "PROPFIND /crx/repository/crx.default/var/dam/01 HTTP/1.1" 207 0 "-" "Microsoft-WebDAV-MiniRedir/6.1.7601"
@toodooleedoo
toodooleedoo / somename.vbs
Created February 2, 2015 02:47
Widows: Run a bat program without having a popup. Save something like this as a somename.vbs
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "V:\Goodsync\Development\startvpn.bat" & Chr(34), 0
Set WshShell = Nothing
@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#CQ #AEM #LINUX Get performance details by hour

Parses the timings from the request log and gives a report by hour.

@toodooleedoo
toodooleedoo / find_and_replace_snippets.js
Last active August 29, 2015 14:14
#CQ Find & Replace fix not working due to "publish" set in server.xml.
Inside FindReplaceDialog.js
//RFC27135
var _env=window.location.pathname.split( '/' )[1];
var action = '/'+_env+this .getField("s").getValue() +
CQ.wcm.FindReplaceDialog.SUFFIX_REPLACE;
this.form.baseParams = {"p" :[]};
Inside BulkEditor.js
@toodooleedoo
toodooleedoo / cheat.py
Created February 2, 2015 02:42
Eventghost Python Cheatsheet including sending Pushover
###Run a shell or dos command and get the output
eg.result = None
from subprocess import Popen, PIPE, STDOUT, SW_HIDE
def popen(cmd):
proc = Popen(cmd.split(),stdout = PIPE,stderr = STDOUT,creationflags = SW_HIDE, shell = True)
data = proc.communicate()[0]
return (proc.returncode, data)
ret, data = popen("ipconfig")
print data
@toodooleedoo
toodooleedoo / delete_aem_file.sh
Created February 2, 2015 02:40
AEM:CQ:Linux: Delete any file from CRX with curl.
curl -u "admin:admin" "http://<<<CUT>>>:4505/crx/browser/delete_recursive.jsp?action=delete&Path=/apps/test/install/apps-src.jar"
@toodooleedoo
toodooleedoo / create_cq_user.sh
Created February 2, 2015 02:38
AEM:CQ:Linux: Create a user from the command line.
curl -u admin:admin
'http://<<<CUT>>>:4502/libs/cq/security/authorizables/POST' -d 'status=browser' -d 'email=' -d
'familyName=asdf1012' -d 'givenName=asdf1012' -d 'intermediatePath=' -d 'rep:password=bwi123' -d
'rep:password=bwi123' -d 'rep:userId=asdf1012'