Skip to content

Instantly share code, notes, and snippets.

View dkerwin's full-sized avatar
🇺🇦

Daniel Kerwin dkerwin

🇺🇦
View GitHub Profile
@dkerwin
dkerwin / delete_job_snip.go
Last active August 9, 2018 20:15
Delete job via api client
for _, job := range jobs {
// get uid and created jobs
uid := job.GetObjectMeta().GetUID()
// Delete job first. See https://github.com/kubernetes/kubernetes/issues/43168
err := clientset.BatchV1().Jobs(job.GetNamespace()).Delete(job.GetName(), &metav1.DeleteOptions{})
if err != nil {
return i, fmt.Errorf("failed to delete job %s/%s: %s", job.GetNamespace(), job.GetName(), err)
} else {
@dkerwin
dkerwin / gist:5e0a550c12a780d9b45a
Created June 5, 2015 09:10
Graylog2 Web Exception
[error] play - Cannot invoke the action, eventually got an error: java.lang.NullPointerException
[error] application -
! @6mcag17e7 - Internal server error, for (GET) [/search?rangetype=relative&fields=message%2Csource&width=1436&relative=86400&q=Exception] ->
play.api.Application$$anon$1: Execution exception[[NullPointerException: null]]
at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.10-2.3.9.jar:2.3.9]
at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.10-2.3.9.jar:2.3.9]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.9.jar:2.3.9]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.9.jar:2.3.9]
[error] play - Cannot invoke the action, eventually got an error: javax.ws.rs.core.UriBuilderException: java.net.URISyntaxException: Illegal character in query at index 370: http://459c1723-bfac-4427-9c90-c47c9b235ddb:session@127.0.0.1:12900/tools/grok_tester?pattern=%25%7BHAPROXYHTTPLOG%7D&string=%3C134%3E1+2015-03-31T15:05:00.857831%2B00:00+mt02+haproxy%5B4006%5D:+-+haproxy:++185.22.222.155:62219+%5B31/Mar/2015:15:05:00.116%5D+fe-api.gini.net~+api/10.1.8.3:49188_mt03.prod.gini.net+43/0/0/698/741+201+503+-+-+----+0/0/0/0/0+0/0+%7B3309481|Zend_Http_Client%7D+%22POST+/documents?filename%3D1508477_print+HTTP/1.1%22
[error] application -
! @6lk0dkce9 - Internal server error, for (GET) [/a/tools/grok_test?string=%3C134%3E1+2015-03-31T15%3A05%3A00.857831%2B00%3A00+mt02+haproxy%5B4006%5D%3A+-+haproxy%3A++185.22.222.155%3A62219+%5B31%2FMar%2F2015%3A15%3A05%3A00.116%5D+fe-api.gini.net~+api%2F10.1.8.3%3A49188_mt03.prod.gini.net+43%2F0%2F0%2F698%2F741+201+503+-+-+----+0%2F0%2F0%2F0%2F0+0%2F0+%7B3309481%7CZend_Http_Cli

Keybase proof

I hereby claim:

  • I am dkerwin on github.
  • I am dkerwin (https://keybase.io/dkerwin) on keybase.
  • I have a public key whose fingerprint is EBD4 EB16 AC68 41AF 2BB4 5D60 C1C2 C5CB CDFC 30A5

To claim this, I am signing this object:

Exception in thread "restapi-execution-handler-5"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "restapi-execution-handler-5"
@dkerwin
dkerwin / gist:537db0820d85d662af7a
Created February 23, 2015 13:15
graylog issues
[error] o.g.r.m.UserService - Unauthorized to load user admin
org.graylog2.restclient.lib.APIException: API call failed GET http://@127.0.0.1:12900/users/admin
at org.graylog2.restclient.lib.ApiClientImpl$ApiRequestBuilder.execute(ApiClientImpl.java:498) ~[org.graylog2.graylog2-rest-client-1.0.0.jar:na]
at org.graylog2.restclient.models.UserService.retrieveUserWithSessionId(UserService.java:160) ~[org.graylog2.graylog2-rest-client-1.0.0.jar:na]
at lib.security.RedirectAuthenticator.authenticateSessionUser(RedirectAuthenticator.java:122) [graylog-web-interface.graylog-web-interface-1.0.0.jar:1.0.0]
at lib.security.RedirectAuthenticator.getUsername(RedirectAuthenticator.java:54) [graylog-web-interface.graylog-web-interface-1.0.0.jar:1.0.0]
at play.mvc.Security$AuthenticatedAction.call(Security.java:37) [com.typesafe.play.play_2.10-2.3.6.jar:2.3.6]
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.TimeoutException: No response received after 5000
at com.ning.http.client.providers.net
@dkerwin
dkerwin / gist:3840746
Created October 5, 2012 16:07
crx array post
code, body = cq_call(:post, "/etc/map/http",
{:params => { ':name' => @resource[:name],
':operation' => 'import',
':contentType' => 'json',
':content' => { 'jcr:primaryType' => 'sling:Mapping',
'sling:internalRedirect' => [ @resource[:target], '/' ],
}.to_json
}
}
)
/** $Id: Exp $
*
* Copyright (c) 1997-2005 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
@dkerwin
dkerwin / gist:3047135
Created July 4, 2012 12:41
Example fact
if File.exist?("/etc/facts.txt")
File.readlines("/etc/facts.txt").each do |line|
if line =~ /^(.+)=(.+)$/
var = $1; val = $2
Facter.add(var) do
setcode { val }
end
end
end