Skip to content

Instantly share code, notes, and snippets.

View awheeler's full-sized avatar

Alex Wheeler awheeler

View GitHub Profile
@awheeler
awheeler / gist:dc0f8bd15c1a5e223887
Created June 26, 2015 18:32
consul-alerts panic
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4b4f8e]
goroutine 16 [running]:
github.com/AcalephStorage/consul-alerts/consul.(*ConsulAlertClient).updateHealthCheck(0xc2080cce00, 0xc2083b46c0, 0x5a, 0xc20810cd80)
/gopath/src/github.com/AcalephStorage/consul-alerts/consul/client.go:336 +0x126e
github.com/AcalephStorage/consul-alerts/consul.(*ConsulAlertClient).UpdateCheckData(0xc2080cce00)
/gopath/src/github.com/AcalephStorage/consul-alerts/consul/client.go:245 +0x6e2
main.processChecks()
/gopath/src/consul-alerts/check-handler.go:66 +0x342
@awheeler
awheeler / user_info.yml
Last active August 29, 2015 14:05
Flexible user management in Ansible
---
users:
user1:
name: user1
group_match:
users: devdomain.net$
wheel: proddomain.com$
user2:
name: user2
group_match:
@awheeler
awheeler / gist:6188570
Created August 8, 2013 20:48
elasticsearch 0.90.3 failing with plugin elasticsearch-cloud-aws
{0.90.3}: Initialization Failed ...
1) IllegalStateException[This is a proxy used to support circular references involving constructors. The object we're proxying is not constructed yet. Please wait until after injection has completed to use this object.]2) NoSuchMethodError[org.elasticsearch.discovery.zen.ZenDiscovery.<init>(Lorg/elasticsearch/common/settings/Settings;Lorg/elasticsearch/cluster/ClusterName;Lorg/elasticsearch/threadpool/ThreadPool;Lorg/elasticsearch/transport/TransportService;Lorg/elasticsearch/cluster/ClusterService;Lorg/elasticsearch/node/settings/NodeSettingsService;Lorg/elasticsearch/cluster/node/DiscoveryNodeService;Lorg/elasticsearch/discovery/zen/ping/ZenPingService;)V]
@awheeler
awheeler / gist:6185752
Created August 8, 2013 15:43
Sample elasticsearch post
curl -XPOST 'http://localhost:9200/logstash-2013.08.08/eric/3' -d '{
"@tags": [ "alex", "foobar"],
"__level": "4",
"__ip": "192.168.100.105",
"__id": "3e09d652-e7d4-4195-9722-8316b0d62841",
"__dt": "2012-06-26T15:58:20.135353Z",
"__comp": "testComp",
"linenumber": "100",
"classname": "some.java.class.ClassName",
"stuff": { "field1":"bar", "Field2":"bam" },
@awheeler
awheeler / gist:5420109
Created April 19, 2013 12:47
GlusterFS 3.4 Alpha 3.02 UFO Unit tests
# ./unittests.sh
Unable to read test config /etc/swift/test.conf - file not found
.................F................F.E...................................................................
======================================================================
ERROR: test_unlinkold_is_dir_failure (test.unit.common.test_diskfile.TestDiskFile)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/rpmbuild/BUILD/glusterfs-3.4.0alpha3/ufo/test/unit/common/test_diskfile.py", line 708, in test_unlinkold_is_dir_failure
assert os.path.isdir(gdf.data_file)
File "/usr/lib64/python2.6/genericpath.py", line 41, in isdir
@awheeler
awheeler / GlusterFS Keystone Quickstart
Last active December 15, 2015 10:58
GlusterFS Swift with Openstack Keystone
This document has moved to a permanent home:
http://www.gluster.org/community/documentation/index.php/GlusterFS_Keystone_Quickstart
@awheeler
awheeler / gist:5153921
Last active December 14, 2015 21:49
Add '.' support for glusterfs volume names, and provide additional error notification.
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index c09aa62..7e55757 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -211,7 +211,9 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **options
goto out;
for (i = 0; i < strlen (volname); i++)
- if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-'))
+ if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-') && (volname[i] != '.')) {
@awheeler
awheeler / test.rb
Created October 29, 2012 15:28
Elasticsearch Regex Extraction
{
"facets": {
"terms": {
"terms": {
"script": "import java.util.regex.Matcher;import java.util.regex.Pattern;Pattern pin=Pattern.compile('.*[?&]pin=([^?&]+).*');Matcher m=pin.matcher(doc['@fields.params'].value);if(m.matches()){field=m.group(1);}",
"size": 25
}
}
},
"query": {
@awheeler
awheeler / logstash-simple-1.conf
Created October 23, 2012 20:45
Logstash Config And Dump
input { stdin { type => "stdin-type"}}
output {
stdout { debug => true debug_format => "json"}
elasticsearch_http {
# cluster => "elasticsearch"
host => "192.168.67.136"
port => 9200
}
}