Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
#
# Copyright (c) 2014 Nicolas Blais
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@coolacid
coolacid / gist:0056bf9ffad1e4e2b636
Created November 6, 2014 17:22
Pull all Logstash-Plugins
#!/usr/bin/env python
from pygithub3 import Github
from subprocess import call
import os
gh = Github()
#es = gh.orgs.get('elasticsearch')
repos = gh.repos.list_by_org('logstash-plugins')
input {
generator {
message => "9.8.7.6 5.4.3.2"
count => 1
}
}
filter {
grok {
match => [ "message", "%{IPORHOST:src} %{IPORHOST:dst}" ]
@coolacid
coolacid / gist:025e0bd1370d5489d9e4
Created January 24, 2015 01:18
Set description of a USB sound card
This expects that you might have multiple USB sound cards that are the same type like I have.
Start out by finding the ATTRS{devpath} value:
udevadm info --attribute-walk /dev/snd/by-id/[DEVICE] | grep devpath | grep ATTRS | head -1
Create a udev rules file in /etc/udev/rules.d (such as 98-audiocards.rules) and add a line matching the devpath from above:
SUBSYSTEMS=="usb", ATTRS{devpath}=="2.1.1", ENV{SOUND_DESCRIPTION}="Mixer"
@coolacid
coolacid / 1.Readme
Last active August 29, 2015 14:14
Logstash Augmentation Outputs
This is just a collection of different outputs from Event Augmentation Filters.
TLD - Breaks apart TLD data and reports information based on that
OUI - Takes a MAC address and reports the manufacturer details based on OUI lookup
GeoIP - Find the Geo Information from an IP address
@coolacid
coolacid / gist:835fc66ff6b5784d6aae
Last active August 29, 2015 14:15
Yellorium Mystcraft World
Original Thread: http://forum.feed-the-beast.com/threads/creating-an-endless-lava-ocean-on-mystcraft.15421/
Ocean Biome
Single Biome Distribution
Stone Block
Fluid Yellorium Block
Standard World
Normal Moon
Dark Stars
Dark Sun
@coolacid
coolacid / gist:158eee28112cfad787c1
Created April 20, 2015 04:59
Logstash, DNS, GeoIP and CIFv2 Augments.
NOTE:: The IPs were taken from the CIF DB for testing. Not actual events.
Logstash startup completed
{
"message" => "2015-04-19 05:46:59,798 fail2ban.actions: WARNING [asterisk-iptables] Ban 141.101.113.108",
"@version" => "1",
"@timestamp" => "2015-04-19T09:46:59.798Z",
"type" => "fail2ban",
"host" => "homer",
"path" => "/srv/Logs/f2b/fail2ban",
{
"_shard": 0,
"_node": "fan7MZSvSUS6LS3XcwQFfA",
"_index": "cif.observables-2015.04.20",
"_type": "observables",
"_id": "bafb0b47000be58fb6c4f08f29af81704531965b0bd907e57c7f99c69ae194b8",
"_score": 1,
"fields": {
"tags": [
"suspicious"
@coolacid
coolacid / Hash
Created April 22, 2015 15:19
Example Results from logstash-filter-virustotal
Logstash startup completed
{
"message" => "99017f6eebbac24f351415dd410d522d",
"@version" => "1",
"@timestamp" => "2015-04-22T15:03:59.534Z",
"type" => "generated",
"host" => "homer",
"sequence" => 0,
"virustotal" => {
"scans" => {
@coolacid
coolacid / 1st run of example
Created April 22, 2015 19:01
Example output from logstash-filter-cache-memcached
Logstash startup completed
{
"message" => "Something to cache",
"@version" => "1",
"@timestamp" => "2015-04-22T18:54:20.008Z",
"type" => "generated",
"host" => "homer",
"sequence" => 0,
"message1" => nil,
"tags" => []