Skip to content

Instantly share code, notes, and snippets.

View cfalzone's full-sized avatar

Christopher Falzone cfalzone

  • Xometry
  • Erie County, PA
View GitHub Profile
@cfalzone
cfalzone / monit.conf
Created March 25, 2014 21:02
dotcms monit scripts
check process dotcms with pidfile /tmp/current.pid
alert eiswebdev@aquent.com
start program = "/bin/bash -c 'source /etc/profile.d/ant.sh && source /etc/profile.d/java.sh && cd /data/wwwroot/dotcms/current && bin/startup.sh'"
as uid dotcms and gid dotcms
stop program = "/bin/bash -c 'source /etc/profile.d/ant.sh && source /etc/profile.d/java.sh && cd /data/wwwroot/dotcms/current && bin/shutdown.sh'"
as uid dotcms and gid dotcms
if failed host localhost port 8080 proto http with timeout 10 seconds for 3 cycles
then exec "/bin/bash -c 'source /etc/profile.d/ant.sh && source /etc/profile.d/java.sh && /data/wwwroot/dotcms/scripts/site_restart.sh'"
as uid dotcms and gid dotcms
if failed host localhost port 8080 protocol http then alert
@cfalzone
cfalzone / Hook.java
Created March 5, 2014 15:20
Contentlet Pre Hook
private Contentlet addurlTitle(Contentlet con) {
if(!UtilMethods.isSet(con.getStringProperty("urlTitle"))) {
String urlTitle = con.getStringProperty("firstName")+con.getStringProperty("lastName");
urlTitle = urlTitle.replaceAll("[^A-Za-z]", "");
synchronized(TalentCalendarHook.class) {
urlTitle = urlTitle + (new Date().getTime());
}
Logger.debug(this, "Making Art Entry "+con.getIdentifier()+" - urlTitle = "+urlTitle);
@cfalzone
cfalzone / catalina.out
Created March 3, 2014 21:10
Deadlock thread dump from dotCMS startup with a job in it.
2014-03-03 15:50:15
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode):
"Timer-1" daemon prio=5 tid=7fda8af9d000 nid=0x116fea000 waiting for monitor entry [116fe9000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.quartz.utils.UpdateChecker.buildUpdateCheckUrl(UpdateChecker.java:114)
at org.quartz.utils.UpdateChecker.doCheck(UpdateChecker.java:55)
at org.quartz.utils.UpdateChecker.checkForUpdate(UpdateChecker.java:47)
at org.quartz.utils.UpdateChecker.run(UpdateChecker.java:39)
at java.util.TimerThread.mainLoop(Timer.java:512)
package com.aquent.jobs;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.dotmarketing.util.Logger;
ERROR: Bundle com.aquent [13] Error starting/stopping bundle. (org.osgi.framework.BundleException: Activator start error in bundle com.aquent [13].)
java.lang.RuntimeException: Failed to schedule jobs
at com.aquent.osgi.AquentActivator.scheduleJobs(AquentActivator.java:110)
at com.aquent.osgi.AquentActivator.start(AquentActivator.java:53)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1483)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:334)
at java.lang.Thread.run(Thread.java:695)
@cfalzone
cfalzone / Console.log
Created February 10, 2014 15:32
Minecraft Error Logs
[10:24:59] [INFO] in Launcher JGoogleAnalyticsTracker$2.run:483: AnalyticsBackgroundThread started [10:24:59] [INFO] in Launcher LaunchFrame.main:191: FTBLaunch starting up (version 1.3.4) [10:24:59] [INFO] in Launcher LaunchFrame.main:192: Java version: 1.6.0_45 [10:24:59] [INFO] in Launcher LaunchFrame.main:193: Java vendor: Sun Microsystems Inc. [10:24:59] [INFO] in Launcher LaunchFrame.main:194: Java home: C:\Program Files\Java\jre6 [10:24:59] [INFO] in Launcher LaunchFrame.main:195: Java specification: Java Virtual Machine Specification version: 1.0 by Sun Microsystems Inc. [10:24:59] [INFO] in Launcher LaunchFrame.main:197: Java vm: Java HotSpot(TM) 64-Bit Server VM version: 20.45-b01 by Sun Microsystems Inc. [10:24:59] [INFO] in Launcher LaunchFrame.main:198: OS: amd64 Windows 7 6.1 [10:24:59] [INFO] in Launcher LaunchFrame.main:199: Launcher Install Dir: C:\Users\Falzone\Desktop\FTB [10:24:59] [INFO] in Launcher LaunchFrame.main:200: System memory: 5888M free, 8169M total [10:24:59] [INFO] in Launche
@cfalzone
cfalzone / importer.java
Created February 6, 2014 19:02
Code to import from feed with multiple languages [not working]
boolean hasEN; // Set by feed
boolean hasFR; // Set by feed
boolean hasJP; // Set by Feed
String stInode; // Getting earlier in code
Host stHost; // Getting earlier in code
Contentlet contentlet=new Contentlet();
contentlet.setStructureInode(stInode);
contentlet.setHost(stHost.getIdentifier());
@cfalzone
cfalzone / example.vtl
Created February 3, 2014 21:53
Using the aquent geolocation tool in dotCMS to compute the nearest office location
## GET THE LOCATION DATA MAP FOR THIS IP
#set($userLocationMap = $geoip.getLocationMap($ip))
## GET THE LOCATION DATA OBJECT FOR THIS IP
#set($userLocationObj = $geoip.getLocation($ip))
## TRY TO GET THE CLOSEST MARKET
#set($marketDistance = 100000)
#set($nearestMarket = 0)
#foreach($office in $dotcontent.pull("+structureName:aquentOffices +categories:${userCountry.toLowerCase()}* +languageId:1",0,''))
#set($officeDistance = $geoip.distance($userLocationObj, $text.getFloat($office.lat), $text.getFloat($office.long)))
@cfalzone
cfalzone / ThreadDump.log
Created January 28, 2014 15:00
Thread Dump
2014-01-28 09:41:25
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.0-b56 mixed mode):
"elasticsearch[dotCMS_1][search][T#160]" daemon prio=10 tid=0x00007f411429a000 nid=0xf00 waiting on condition [0x00007f40e85ed000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c1bc1910> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
@cfalzone
cfalzone / running_queries.sql
Created January 28, 2014 14:54
Running queries on stag - 1/28/2014
-[ RECORD 1 ]----+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------