Skip to content

Instantly share code, notes, and snippets.

@feylya
feylya / TL-1043ND Wireless
Created June 17, 2012 19:16
TL-1043ND Wireless Conf
config 'wifi-device' 'radio0'
option 'type' 'mac80211'
option 'macaddr' 'f8:d1:11:24:97:14'
list 'ht_capab' 'HT40-'
list 'ht_capab' 'SHORT-GI-40'
list 'ht_capab' 'DSSS_CCK-40'
option 'country' 'IE'
option 'channel' '9'
option 'hwmode' '11ng'
option 'htmode' 'HT40-'
@feylya
feylya / osx.sh
Created October 11, 2012 10:35
OS X Defaults
#!/bin/bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@feylya
feylya / grok.rb
Created October 26, 2012 13:21
Run grok regex against log line
#!/usr/bin/env ruby
require 'rubygems'
require 'grok-pure'
grok = Grok.new
Dir["/vol/logstash/patterns/patterns"].each { |p| grok.add_patterns_from_file(p) }
text = 'Oct 26 06:49:36 logstash puppet-agent[4443]: Finished catalog run in 7.02 seconds'
@feylya
feylya / security-group-cleanup.py
Last active December 10, 2015 21:58 — forked from miketheman/security-group-cleanup.py
Checks all security groups used by all instances in an AWS account and compares them to the list of all security groups, deleting the unused ones.
#!/usr/bin/env python
import sys
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]
@feylya
feylya / gist:4529717
Created January 14, 2013 12:25
Foreman 500 error
Started POST "/hosts/compute_resource_selected" for 193.120.41.142 at Mon Jan 14 12:24:00 +0000 2013
Processing by HostsController#compute_resource_selected as
Parameters: {"compute_resource_id"=>"3", "operatingsystem_id"=>"", "architecture_id"=>""}
Rendered compute_resources_vms/form/_ec2.html.erb (5570.8ms)
Rendered hosts/_compute.html.erb (5574.2ms)
Operation FAILED: undefined method `<=>' for nil:NilClass
Rendered common/500.rhtml (3.2ms)
Completed 500 Internal Server Error in 5587ms (Views: 3.9ms | ActiveRecord: 0.4ms)
@feylya
feylya / gist:4532036
Created January 14, 2013 18:13
Replace empty variable in Logstash
grep {
match => [ "some_variable", ".*" ]
drop => false
negate => true
add_field => [ "some_variable", "0" ]
}
@feylya
feylya / gist:4585567
Created January 21, 2013 11:57
Graylog exception
2013-01-21 11:51:27,021 ERROR: org.graylog2.buffers.processors.ProcessBufferProcessor - Could not apply filter [CounterUpdater] on message <6fb66b47-a43d-443b-a7c4-48e749aaeda7>:
java.lang.NullPointerException
at org.graylog2.MessageCounterImpl.countUpStream(MessageCounterImpl.java:141)
at org.graylog2.MessageCounterImpl.incrementStream(MessageCounterImpl.java:129)
at org.graylog2.filters.CounterUpdateFilter.filter(CounterUpdateFilter.java:56)
at org.graylog2.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:82)
at org.graylog2.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:41)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:113)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)