Skip to content

Instantly share code, notes, and snippets.

View cculb's full-sized avatar

Chris Culbreth cculb

  • Time Warner Cable
  • Denver, CO
View GitHub Profile
@ItGumby
ItGumby / SimpleSoap.groovy
Created October 24, 2014 02:33
Simple SOAP Example (without JAXB) using groovy and Spring WebServices. Based on http://spring.io/guides/gs/consuming-web-service/, but as a single-file script
@Grab('org.springframework.ws:spring-ws-core:2.2.0.RELEASE')
@Grab('org.springframework.ws:spring-xml:2.2.0.RELEASE')
import org.springframework.ws.client.core.WebServiceTemplate
import org.springframework.ws.soap.client.core.SoapActionCallback
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory
import org.springframework.xml.transform.StringSource
import groovy.util.slurpersupport.GPathResult
import groovy.util.XmlSlurper
@auniverseaway
auniverseaway / aem-compact-script.sh
Last active November 26, 2018 09:47
AEM Compaction Script
#!/bin/bash
now="$(date +'%d-%m-%Y')"
logfile="compact-$now.log"
installfolder="/data/aem"
aemfolder="$installfolder/crx-quickstart"
oakrun="$installfolder/help/oak-run-1.0.18.jar"
## Shutdown AEM
printf "Shutting down AEM.\n"
$aemfolder/bin/stop
@r2k0
r2k0 / Think_FIB_Plot_1
Last active December 8, 2019 23:41
Automatic Opening Range and Fibonacci Levels This Thinkscript is designed to plot the OR high, low, 50% fib retrace, and fib extensions for the current day. This will only work correctly on time-based charts, where the OR time frame is divisible by the bar period e.g. 30 minute OR, 10 min bars. An extra fib extension may be used if desired to cr…
#
def na=double.nan;
#
# Define time that OR begins (in hhmm format,
# 0930 is the default):
#
input ORBegin = 0930;
#
# Define time that OR is finished (in hhmm format,
# 10:00 is the default):
@soe
soe / livechat.html
Created January 30, 2013 00:32
sample page on how to include Salesforce Live Agent button code and deployment code
<html>
<body>
<!-- live chat button -->
<a id="liveagent_button_online_573i00000004DD7" href="javascript://Chat" style="display: none;" onclick="liveagent.startChat('573i00000004DD7')">
Online Chat
</a>
<div id="liveagent_button_offline_573i00000004DD7" style="display: none;">
Offline Chat
</div>
@cowboy
cowboy / finder-open-iterm-here.scpt
Created April 6, 2011 12:10
Finder Open iTerm Here: Drop a folder on this script (or just run it) to open a new iTerm window there. If the selected item isn't a folder, it will open the item's parent folder. Great when bound to a hotkey in FastScripts or added to the Finder Sidebar
(*
* Finder Open iTerm Here - v1.0.2 - 4/14/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*)
tell application "Finder"
Standard:
-Xmx -- Increase heap size to 50% total machine ram, or 24gb -- whichever is smaller
-XX:+UseG1GC -- More efficient server GC in Java 8
-XX:+UseAES -XX:+UseAESIntrinsics -- Use Hardware crypto features for AES if available
-XX:+AggressiveOpts -- Experimental faster JVM tunings
-Djava.awt.headless=true -- Required for headless unix boxes for Java2D support to work properly
-Djava.io.tmpdir=/tmp -- Recommended to set somewhere with fast i/o
Debugging:
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -- Used for triaging heap full errors
@snowkidind
snowkidind / README.md
Last active November 11, 2021 16:53
TDAmeritrade API Notes for Node.js

Access to Ameritrade API

notes that may be helpful for node.js devs

What I've gathered is authorization tokens must be earned first. Authorization tokens are good for three months, once you are setup, you will get two tokens which come as long strings, An access_token and a refresh_token. Access tokens are only valid for 30 minutes so you will need to code to refresh the session using the refresh token frequently. When you refresh, you are given a new access token and that is what you use to "login" or pull from the api for the next period. But in order to get the tokens, you will be required to go through some processes to get a valid token that applies to your app. The following text kind of steers you in that direction...

Making an app

On the api site you will need to make an app, where you pick some random name by using some random numbers. It should be automatically generated but it isnt. For this field item, I simply went to https://www.uuidgenerator.net/ and just grabbed the firs

@bols-blue
bols-blue / jenkins-slave
Created November 23, 2011 09:45
jenkisn daemon sclipt./etc/init.d/jenkins-slave and /etc/default/jenkins-slave
# defaults for jenkins continuous integration server
JENKINS_ARGS="-jnlpUrl http://test.lnc.jp:8080/computer/wock/slave-agent.jnlp"
# jenkins home location
JENKINS_HOME=/opt/jenkins-slave
# location of the jenkins war file
JENKINS_WAR=$JENKINS_HOME/slave.jar
# pulled in from the init script; makes things easier.
NAME=jenkins
@xiongchiamiov
xiongchiamiov / why.sh
Last active March 14, 2023 04:19
Use this when Amazon gives you an "Encoded authorization failure message" and you need to turn it into something readable. If you only get a request id... you're out of luck.
function decode-authorization-failure-message {
if [ $# -ne 1 ] || [ "$1" = -h ] || [ "$1" = --help ]; then
cat <<'EOT'
Usage: decode-authorization-failure-message <message>
Use this when Amazon gives you an "Encoded authorization failure message" and
you need to turn it into something readable.
EOT
return 1
fi

AEM6.x Migration

  • How to Rebuild a Pre-Existing AEM+Mongo Cluster
  • or migrate from Tar to MongoDB or MongoDB to Tar"
  • or migrate from 5.6.1 or 6.x to 6.x via data migration instead of jar upgrade
  1. (Mongo to Mongo only) Remove one replica from the replica set and delete/recreate the db
    1. Remove the replica node from the set: http://docs.mongodb.org/master/tutorial/remove-replica-set-member/
    2. Validate that no other nodes in the set consider that node to be part of the set anymore. Log into each node in the cluster via mongo shell and run rs.status() to validate that the node that was taken out is not in the cluster any longer.
    3. Drop the aem database on that node http://docs.mongodb.org/manual/reference/command/dropDatabase/
  2. Re-add the database with the correct user permissions (do not add the mongo instance back to the replica set)