Skip to content

Instantly share code, notes, and snippets.

View toodooleedoo's full-sized avatar

Eric Soukenka toodooleedoo

View GitHub Profile
@toodooleedoo
toodooleedoo / blueprintrollout.sh
Last active August 29, 2015 14:14
#AEM #CQ #CURL Rollout from a master from the command line
CHILDPAGES1="/content/00" #add more paths if needed however will require multiple msm:masterPages
CHILDPAGES2="/content/01"
BLUEPRINT="/etc/blueprints/blueprintname"
ROLLOUTTITLE="00000"
ROLLOUTNAME="00000"
HOSTNAME="localhost"
USERPASS="admin:admin"
DESTPATH="/content/destpath"
curl -u "${USERPASS}" "http://${HOSTNAME}:4502/bin/wcmcommand" -d "cmd=createSite" -d "_charset_=utf-8" -d ":status=browser" -d "destPath=${DESTPATH}" -d "srcPath=${BLUEPRINGNAME}" -d "./jcr:title=${ROLLOUTTITLE}" -d "label=${ROLLOUTNAME}" -d "msm=masterPages@Delete:true" -d "msm:masterPages=${CHILDPAGES1}" -d "msm:masterPages=${CHILDPAGES2}" -w '%{http_code}'
@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#AEM #CQ #PHP Parse Dispatcher Agent logs then flush Akamai via SOAP

##Purge Akamai via SOAP by parsing out activated pages from an AEM/CQ Replication Agent.

Since Production Akamai could not be flushed globally we needed a job which could flush only today's Author activated pages.

@toodooleedoo
toodooleedoo / siteminder_checkloginpage.sh
Created February 3, 2015 21:48
Login through Siteminder to AEM and report landing page.
curl --dump-header headers.txt --silent 'https://<<<CUT>>>/siteminderagent/forms/login.fcc' -H 'Host: <<<CUT>>>' -d "target=http%3A%2F%2F<<<CUT>>>%2Fpublish%2F" -d "USER=soukene" -d "PASSWORD=<<CUT>>>" -o /dev/null
SESSION=`grep SMSESSION headers.txt |sed -e 's/.*SMSESSION=//g;s/;.*//g;'`
curl --silent -k -H "Cookie: SMSESSION=${SESSION}" "https://<<<CUT>>>/publish" -L -w 'Last URL was: %{url_effective}\n' -o /dev/null
@toodooleedoo
toodooleedoo / bitcoin_rate.sh
Last active August 29, 2015 14:14
#CURL Bitcoin Rate to Pushover
USER="<<<CUT>>>"
TOKEN="<<<CUT>>>"
rate=`curl --silent 'http://www.bitcoinexchangerate.org/' |grep "#36" |sed -e 's/&#36;//g;s/ .*//g;'`
#rate=`curl --silent -k "https://www.mtgox.com" |grep "Weighted Avg:" |sed -e 's/.*<span>//g;s/<\/span>.*//g;s/\..*$//g;'`
echo "Rate: ${rate}"
curl --silent -k "https://api.pushover.net/1/messages.json" -d "token=${TOKEN}" -d "user=${USER}" -d "title=Bitcoin Exchange Rate" -d "message=${rate}" -d "url_title=MtGox" "url=https://www.mtgox.com" -d "priority=-1" -d "device=edroid" -d "url=tasker://action bitcoin" -d "url_title=Repeat"
##
@toodooleedoo
toodooleedoo / viewcontentjson.md
Last active August 29, 2015 14:14
#AEM #CQ View Site in JSON

##Any page extenstion can be changed from .html to .json eg: /content/site/en.json

##You can get all pages recursively /content/site/en.infinity.json

##Or specficy depth level /content/site/en.2.json

##If you want it to be more legible and maybe only 2 deep

@toodooleedoo
toodooleedoo / firewall_update.txt
Last active August 29, 2015 14:14
#Linux Update Firewall / IPtables
sudo vi /etc/sysconfig/iptables
Eg opening port
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8118 -j ACCEPT
sudo service iptables restart
@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#AEM #CQ: Copy/Clone Content recursively with #VLT

This can be used to copy for example the DAM to another server.

Requires vlt to be setup and in path. ###Installation

  • vault.zip
  • Set JAVA_HOME and update PATH to vlt.bat

###Usage Just call script with a root path and wait.

@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#AEM #CQ #LINUX Shutdown Script Enhancement

#Append this to bottom of AEM or CQ's stops script.

@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#AEM #CQ #LINUX Validate Application Running + Login Page

A quick way to login and validate AEM or CQ.

@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#AEM #CQ #LINUX Startup Script Enhancement

#Place at the bottom of the AEM or CQ Start script.