Skip to content

Instantly share code, notes, and snippets.

@BadgerOps
BadgerOps / screenrc-example
Created October 29, 2021 20:37
screenrc-example
#the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
postmap_relayhosts:
cmd.run:
- name: postmap /etc/postfix/relayhost_maps
- onchanges:
- file: /etc/postfix/relayhost_maps

Keybase proof

I hereby claim:

  • I am badgerops on github.
  • I am badgerops (https://keybase.io/badgerops) on keybase.
  • I have a public key ASBkrnjAhzwQ6hNWOkeNf6ygbZQbJSlfF3D2IKhneYg6Ego

To claim this, I am signing this object:

@BadgerOps
BadgerOps / gist:8b51ca5a02bba5cb06f0
Created June 23, 2014 19:28
working gelf sev to english sev logstash
input {
gelf {
strip_leading_underscore => true
remap => true
}
}
filter {
if [level] == 7 {
mutate { add_field => { "severity" => 'Debug' } }
}
@BadgerOps
BadgerOps / gist:28a56e559d7edb832a53
Created June 23, 2014 17:00
gelf log level translate
input {
gelf {
}
}
filter {
translate {
field => '%{level}'
dictionary => [ 7, 'Debug',
6, 'Info',
@BadgerOps
BadgerOps / gist:028c907a98aef8154225
Created June 19, 2014 21:13
logstash gelf level translator
filter {
translate {
dictionary => [ 7, "Debug",
6, "Info",
4, "Warn",
3, "Error",
2, "Critical" ]
field => level
}
}
@BadgerOps
BadgerOps / logstash_splitter
Created June 18, 2014 17:06
logstash splitter
input {
gelf {
'gelf stuff here'
}
}
output {
elasticsearch {
host => old_elasticsearch_cluster
index => graylog2_index
Copyright 2011 Mike Tigas. 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.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
# idiomatic_python.py
some_list = ['fee', 'phi', 'fo', 'fhum']
# do something for every item in iterable
for item in some_list:
print(item)
# need to reverse iterate?
for item in reversed(some_list):
print(item)