Skip to content

Instantly share code, notes, and snippets.

View deoren's full-sized avatar
💭
I may be slow to respond.

Deoren Moor deoren

💭
I may be slow to respond.
View GitHub Profile
@deoren
deoren / chef_scratch_notes.md
Last active March 21, 2018 22:30
Chef scratch notes

Chef scratch notes

Applying recipes locally

sudo chef-client --local-mode /path/to/recipe/file.rb

Resources

chef_elements_of_resources

@deoren
deoren / rsyslogque.md
Created March 9, 2018 04:31 — forked from esfand/rsyslogque.md
Rsyslog queues

Main Queue

This object is available since 7.5.3. It permits to specify parameters for the main message queue. Note that only queue-parameters are permitted for this config object. This permits to set the same options like in ruleset and action queues. A special statement is needed for the main queue, because it is a different object and cannot be configured via any other object.

Note that when the main_queue() object is configured, the legacy $MainMsgQ... statements are ignored.

A Simple Example

main_queue(    
    queue.size="100000"      # how many messages (messages, not bytes!) to hold in memory

queue.type="LinkedList" # allocate memory dynamically for the queue. Better for handling spikes

@deoren
deoren / 02-prosody.conf
Created March 2, 2018 04:06
Rsyslog - Prosody conf fragment
# Catch log messages generated by the Prosody daemon
if $programname == 'prosody' then {
# Skip logging of SASL AUTH log entries (base64 encoded username/passwords)
# Note: recent updates to the mod_auth_dovecot module likely make
# this unnecessary, but I left it in to protect against regressions
if $msg contains ":auth_dovecot: sending" then {
stop
}
@deoren
deoren / golang_scratch_notes.md
Last active February 27, 2018 19:48
Go scratch notes

Golang Scratch Notes

Assignment + Declaration vs assignment

:=

TODO: Confirm this statement

Using this operator results in a declaration (automatically I believe) and initial assignment. You can't go back later and use the operator again to assign a different value to the variable.

@deoren
deoren / redact.py
Created February 26, 2018 14:33 — forked from alq666/redact.py
Redact certain patterns in rsyslog
#!/usr/bin/env python
"""A message modification plugin to remove credentials
Copyright (C) 2014 by Adiscon GmbH and Peter Slavov
Copyright (C) 2016 by Datadog
This file is part of rsyslog.
Licensed under the Apache License, Version 2.0 (the "License");
@deoren
deoren / enable_winrm_service.ps1
Created February 26, 2018 05:55
Enable WinRM Service
#------------------------------------------------------------------------------------
#\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/\|-|-|/
#/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\/|-|-|\
#------------------------------------------------------------------------------------
#|\--
#|-\-Author: Chris Rakowitz
#|--\Purpose: Allows for Enabling and Disabling of the Windows Remote Managment
#|--/ Service.
#|-/-Date: October 10, 2015
#|/--Updated: June 21, 2016 (1.01)
@deoren
deoren / rsyslog_docs_docker_image_testing.md
Last active February 26, 2018 05:50
rsyslog-doc Docker image testing

These commands were run inside a VM, while the regular tweaking/editing was done in an editor outside of the VM.

ubuntu@ubuntu-devbox:/tmp/rsyslog-doc$

  1. git reset HEAD --hard
  2. git checkout update-release-script-to-use-docker-image
  3. git pull --ff-only
  4. cd tools/buildenv/
  5. sudo docker build -t deoren/rsyslog_doc_gen:i536 $PWD/
  6. sudo docker push deoren/rsyslog_doc_gen:i536
@deoren
deoren / docker_prep_ubuntu_16.04_container.md
Created February 24, 2018 06:23
Docker - Prep Ubuntu 16.04 container for testing

Docker: Ubuntu 16.04 container for testing

These notes are mainly for prepping a container for rsyslog testing, but generic enough to use as a basic Ubuntu 16.04 base

  1. sudo docker pull ubuntu:16.04
  2. sudo docker run -ti -p 2222:22 ubuntu:16.04
  3. apt-get update
  4. apt-get install software-properties-common
  5. apt-add-repository ppa:adiscon/v8-stable
  6. apt-get update
@deoren
deoren / notepadpp_regexes.md
Last active February 26, 2018 05:51
Notepad++ Regexes