Skip to content

Instantly share code, notes, and snippets.

View joshkoenig's full-sized avatar

Josh Koenig joshkoenig

View GitHub Profile
@joshkoenig
joshkoenig / gist:1302244
Created October 20, 2011 20:22
tomcat log
[root@josh-twobox titan]# cat /usr/share/tomcat6/logs/localhost.2011-10-20.log
Oct 20, 2011 8:12:44 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class hudson.WebAppMain
java.lang.NoClassDefFoundError: javax/jmdns/impl/tasks/state/Canceler
at javax.jmdns.impl.DNSTaskStarter$DNSTaskStarterImpl.startCanceler(DNSTaskStarter.java:227)
at javax.jmdns.impl.JmDNSImpl.startCanceler(JmDNSImpl.java:1611)
at javax.jmdns.impl.JmDNSImpl.unregisterAllServices(JmDNSImpl.java:1044)
at javax.jmdns.impl.JmDNSImpl.close(JmDNSImpl.java:1810)
at hudson.DNSMultiCast.close(DNSMultiCast.java:54)
at hudson.model.Hudson.cleanUp(Hudson.java:2440)
@joshkoenig
joshkoenig / gist:1302261
Created October 20, 2011 20:27
Catalina log
Oct 20, 2011 8:12:44 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/jenkins] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@2ce07e6b]) and a value of type [org.acegisecurity.context.SecurityContextImpl] (value [org.acegisecurity.context.SecurityContextImpl@68e1ac21: Authentication: org.acegisecurity.providers.UsernamePasswordAuthenticationToken@68e1ac21: Username: developer; Password: [PROTECTED]; Authenticated: true; Details: null; Granted Authorities: authenticated]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
@joshkoenig
joshkoenig / pantheon.settings.php
Created December 22, 2011 20:18
Snippit to parse Pantheon environment config
<?php
// Place this in settings.php if you need to load Pantheon config earlier.
// For instance, when using the domain access module.
global $is_https;
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
// Load environmental config, if present.
if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
$pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE);
foreach ($pressflow_settings as $key => $value) {
@joshkoenig
joshkoenig / strip_info.php
Created May 3, 2012 19:12
Strip drupal.org packaging data from core .info files
<?php
/**
* Quick script for stripping drupal packaging info.
*
* Run in the drupal root, or specify the root as an argument. E.g.:
*
* php strip_info.php path/to/drupal
*
*/
@joshkoenig
joshkoenig / gist:2588846
Created May 3, 2012 20:01
Instructions for testing Drupal 7.14 on Pantheon
From a working clone:
#> git pull http://git.drupal.org/project/drupal.git refs/tags/7.14
#> git push origin master
Now go run update.php in your dev environment and check everything out!
@joshkoenig
joshkoenig / gist:4121633
Created November 20, 2012 22:18
Mixpanel expressions
data = api.request(['engage'], {
'where': 'properties["$created"] > "2012-10-24T13:34:35" and properties["event_count"] > 0'
})
/**
* Implementation of hook_search().
*/
function user_search($op = 'search', $keys = NULL, $skip_access_check = FALSE) {
switch ($op) {
case 'name':
if ($skip_access_check || user_access('access user profiles')) {
return t('Users');
}
function file_create_url($path) {
<<<<<<< HEAD
// Clean up Windows paths.
$old_path = $path = str_replace('\\', '/', $path);
drupal_alter('file_url', $path);
// If any module has altered the path, then return the alteration.
if ($path != $old_path) {
return $path;
@joshkoenig
joshkoenig / gist:5913992
Created July 2, 2013 23:00
joshk_id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuDVDG43S7yt/lG+CkFA462VCAYk3/h6B01x3QMFl4OGC0zppp4MDkQ5Li3rka3qWLmDbMFJyDBvb+ST+6ncJmzqcm7sEkWFqu6iLUhzzldKasRe3QARAE4Jn0zjqBucfqG86tA0UMxvR0dYFjGBHJmdHxiNe9i3+xFF1t1nvnyMaYWblC/OllWO7tZhrVTQRonKsIcCdw0fxFVUpjAYffX8Jha6azoJt6MOWVwWQWKFqZzUH94hp2tO9VmTS5wAq8PxnTMYVQT4YC1NiTHjEnrEFDcmZCmQn/taJxLwpomtbWIme17sPryIDa0t/0DR1MKHNzZraor98eyNfCEFGfw== joshk@mithras
# Enable logging at the beginning
@include_once DRUPAL_ROOT . '/includes/database/log.inc';
Database::startLog('migratelog');
# At the end, fetch the log
$queries = Database::getLog('migratelog', 'default')