Skip to content

Instantly share code, notes, and snippets.

View toodooleedoo's full-sized avatar

Eric Soukenka toodooleedoo

View GitHub Profile
@toodooleedoo
toodooleedoo / listthreads.sh
Created February 2, 2015 01:51
AEM/CQ Monitoring Linux list all threads
while [ 1 ]; do
date |tee -a listthreads.log
ps -eLf |grep -c -E "^adobe " |tee -a listthreads.log
sleep 5
done;
@toodooleedoo
toodooleedoo / workchecker.sh
Created February 2, 2015 01:54
Linux runs on always on desktop at work to log my working hours by pinging laptop each minute from a cron. Then sends message to my mobile through autoremote.
function sendToEDROID {
MESSAGE="${1}"
HTMLSAFE_MESSAGE=`perl -MURI::Escape -e ' print uri_escape($ARGV[0]);' "${1}"`
if [ ! -z "${MESSAGE}" ]; then
echo "`date` ||| SENDING ||| EDROID ||| ${MESSAGE}" |tee -a logs/workchecker.autoremote.log
curl --silent "https://autoremotejoaomgcd.appspot.com/sendmessage?key=<<<CUT>>>&message=${HTMLSAFE_MESSAGE}&sender=${0}" -o /dev/null -w "HTTPCODE: %{http_code}\n"
else
echo "`date` ||| SENDING ||| EDROID ||| emptymesage" |tee -a logs/workchecker.autoremote.log
curl --silent "https://autoremotejoaomgcd.appspot.com/sendmessage?key=<<<CUT>>>&message=emptymessage&sender=${0}" -o /dev/null -w "HTTPCODE: %{http_code}\n"
@toodooleedoo
toodooleedoo / README.md
Last active December 19, 2016 15:42
AEM/CQ AEM Java LDAP Proxy

Inside your AEM bin folder you will find a proxy.jar. You can the point AEM to this proxy and run the proxy pointing to the real LDAP server.

Helps for debugging and in this case I added this snippet to our development servers startup script.

@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
#AEM #CQ Find and replace inside a package

This was used for converting ACL packages and then globalized. This could be useful for bulk changing a package before reinstallation.

@toodooleedoo
toodooleedoo / rsync_watch_folder.sh
Created February 2, 2015 02:00
Linux Watch a folder for changes then rsync to a server.
while inotifywait -e modify -e create -e delete /synced/; do
rsync -avz /synced/ -e ssh 192.168.1.114:/synced/
done
@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
Linux Get the then send to Android with Pushover. As a bonus raise notification level if there is rain in the forecast

Send weather to Android via Pushover findme

@toodooleedoo
toodooleedoo / user_group_report.sh
Last active December 1, 2016 15:11
#AEM #CQ #LINUX #CURL Loop through a list of user and dump there groups to a CSV file.
USER_MAP="USERNAME1 USERNAME2 USERNAME3"
for user in ${USER_MAP}; do
curl -L --silent -u admin:admin "http://<<<CUT>>>:4502/publish/bin/security/authorizables.json?limit=99&_charset_=utf-8&filter=${user}" |sed -e 's/,/\n/g;' |grep "home/groups" |sed -e 's/.*cn=//g' | sed ':a;N;$!ba;s/\n/, /g';
done
@toodooleedoo
toodooleedoo / README.md
Last active August 29, 2015 14:14
AEM/CQ: Snippet to get a user group from an LDAP server if they do not have any.

We have a script which looks up user information then redirects them to there appropriate page.

Since group syncronization is completely custom in this application we had an issue with users created before this script ran would land on an incorrect page.

By squeezing this snippet into this redirect jsp it would popupalte the msising entries.

@toodooleedoo
toodooleedoo / nbaz.sh
Last active August 29, 2015 14:14
Linux: Scrap Bank NBAZ (National Bank of Arizona) and notify via Pushover for new transactions
#!/bin/sh
#export http_proxy=192.168.1.11:8888;
#export https_proxy=192.168.1.11:8888;
USER="<<<CUT>>>"
TOK="<<<CUT>>>"
echo "Starting at `date`";
@toodooleedoo
toodooleedoo / bitcoin_rate.sh
Last active August 29, 2015 14:14
Linux: Scrap Bitcoin rate and send to mobile via 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"
#