Skip to content

Instantly share code, notes, and snippets.

View cfalzone's full-sized avatar

Christopher Falzone cfalzone

  • Aquent
  • Erie County, PA
View GitHub Profile
@cfalzone
cfalzone / GPlusAuthRedirect.java
Created July 22, 2014 18:23
Google Plus Redirect for DotCMS
package com.aquent.auth;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@cfalzone
cfalzone / AgentToolServlet.java
Created July 22, 2014 14:32
Saving Content and Pushing to an environment in dotCMS
/**
* @author cfalzone
*
* This class handles the forms for the agent tool
*/
package com.aquent.agenttool;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
// Rewrite Rule for Cross Domain Web Fonts
// This allows web fonts to be shared across hosts, primarily a cross-site security restriction in Firefox.
NormalRule rule = new NormalRule();
rule.setName("CrossDomainWebFontsHeader");
rule.setFrom("\\.(eot|ttf|otf|woff)");
SetAttribute set = new SetAttribute();
set.setType("response-header");
set.setName("Access-Control-Allow-Origin");
set.setValue("*");
rule.addSetAttribute(set);
==> tomcat/logs/dotcms-velocity.log <==
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: #--------------------------------------------------------------------------------------
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: #
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: # Velocity Error
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: # on url : aquent.com/agents/agents_detailed.htm
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: # on req : /go/shallalalalal
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: # with macro : #dotParse
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: # on template : /assets/6/7/67138454-4439-47ef-84f4-e5f16e7b3a94/fileAsset/page.agent-detail.vtl
[15/07/14 14:02:56:782 EDT] ERROR velocity.VelocityServlet: # stack:
[15/07/14 14:02:56:783 EDT] ERROR velocity.VelocityServlet: # -- /live/c8490437-41ca-48c9-b9f6-8c4184772584.dotpage
dotcms=# SELECT bl.pid AS blocked_pid,
dotcms-# a.usename AS blocked_user,
dotcms-# ka.query AS blocking_statement,
dotcms-# now() - ka.query_start AS blocking_duration,
dotcms-# kl.pid AS blocking_pid,
dotcms-# ka.usename AS blocking_user,
dotcms-# a.query AS blocked_statement,
dotcms-# now() - a.query_start AS blocked_duration
dotcms-# FROM pg_catalog.pg_locks bl
dotcms-# JOIN pg_catalog.pg_stat_activity a ON a.pid = bl.pid
dotcms=# select pid,waiting,state,now() - query_start, query from pg_stat_activity;
pid | waiting | state | ?column? |
query
@cfalzone
cfalzone / update.sql
Created July 7, 2014 18:23
Updating a user role to match in all environments
select * from users_cms_roles where user_id = 'dotcms.org.2838';
-- note the id and change the id in the example on line 10
delete from users_cms_roles where user_id = 'dotcms.org.2838';
update cms_role set db_fqn = '9ac1ff78-71a9-4485-a541-9d1418b17aa4 --> 8f0c52ca-6215-4fd4-a62d-992998cdab51' where role_key = 'dotcms.org.2838';
update cms_role set id='8f0c52ca-6215-4fd4-a62d-992998cc12f2' where role_key = 'dotcms.org.2838';
-- Make sure to note the id from line 1 and change it to the correct id instead of ed155bc3-beb6-4ebe-81bc-9d077dfd8320
insert into users_cms_roles values ('ed155bc3-beb6-4ebe-81bc-9d077dfd8320','dotcms.org.2838','8f0c52ca-6215-4fd4-a62d-992998cc12f2');
==> tomcat/logs/dotcms-velocity.log <==
[30/06/14 11:24:09:141 EDT] ERROR velocity.VelocityServlet: #--------------------------------------------------------------------------------------
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: #
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # Velocity Error
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # on url : aquent.com/find-work/index.htm
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # on req : /find-work/
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # with macro : #dotParse
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # on template : /assets/2/d/2d0b6e49-31fc-4c3b-be1a-9990aec61196/fileAsset/page.find-work-landing.vtl
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # stack:
[30/06/14 11:24:09:142 EDT] ERROR velocity.VelocityServlet: # -- /live/55ab0ca4-7b74-4cfe-832e-d2a8ec6965a0.dotpage
@cfalzone
cfalzone / catalina.out
Created June 30, 2014 14:32
DotCMS Staging Lock up after push
2014-06-30 10:10:42,420 INFO com.dotcms.rest.PublishThread - : [BundleID: e47decb8-cd38-4e2e-9f6d-1b7ee05a2b91.tar.gz] Started bundle publish process
2014-06-30 10:16:07
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.0-b56 mixed mode):
"elasticsearch[dotCMS_1][search][T#1292]" daemon prio=10 tid=0x00007f12dce11000 nid=0x7d71 waiting on condition [0x00007f12d05a9000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c55c0058> (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)
"Log4J Active Asynchronous Appender" daemon prio=10 tid=0x00007f132475b000 nid=0x64ab in Object.wait() [0x00007f12f9f45000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:503)
at edu.emory.mathcs.backport.java.util.concurrent.locks.CondVar.await(CondVar.java:72)
- locked <0x00000006c06a5610> (a edu.emory.mathcs.backport.java.util.concurrent.locks.CondVar)
at edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingDeque.takeLast(LinkedBlockingDeque.java:401)
at org.apache.log4j.appender.LoggingEventBlockingDeque.takeLast(LoggingEventBlockingDeque.java:80)
at org.apache.log4j.appender.LoggingEventDispatcher.dispatchAndWait(LoggingEventDispatcher.java:242)
at org.apache.log4j.appender.LoggingEventDispatcher.run(LoggingEventDispatcher.java:91)