Skip to content

Instantly share code, notes, and snippets.

View jnovack's full-sized avatar
😠
Changing tabs to spaces...

Justin J. Novack jnovack

😠
Changing tabs to spaces...
View GitHub Profile
@jnovack
jnovack / asavpn.sec
Created October 26, 2011 14:50
SEC (Simple Event Correlator) Ruleset showcasing hashes and variables instead of multiple defined rules which are similar
#############
# asavpn.sec
# - Designed by jnovack@gmail.com (with the help of the simple-evcorr-users@lists.sourceforge.net)
#
# Design considations:
# - The friendlynames.txt purpose is to generate the alerts with a user-supplied name. In the example, 12.34.56.78 is more easily remembered as "Remote Site 1". The alerts contain the friendly name.
# - The file friendlynames.txt contains 1 entry per line in the form of "12.34.56.78=REMOTE SITE 1"
# - I make heavy use of the SYSLOG levels in my emails so I can properly gauge my teams expected response time.
# - The use of context= =($variable{"$1"}) ensure sec will only process the event if the hash entry exists. This is limited to your population of the friendlynames file. Easily ignore other IPs by not including them in friendlynames.txt
#
@jnovack
jnovack / pushover.pl
Last active March 28, 2018 19:08
pushover.pl - Sends irssi notifications to Pushover
use strict;
use warnings;
# {{{ DOCUMENTATION
#####
# A lot of code borrowed from the prowlnotify.pl script at
# http://www.denis.lemire.name/2009/07/07/prowl-irssi-hack/
# and pushovernotify.pl (Daniel Johansson <donnex@donnex.net>)
# and http://www.geekfarm.org/wu/muse/scripts/growl-notify.txt
#
@jnovack
jnovack / gist:3737872
Created September 17, 2012 15:02
Cards Against Humanity - Custom Cards
Black Cards
-----------
* Given the choice between _____ and _____, I will always choose the latter.
* What I wouldn’t give for ten minutes alone with _____.
* It was more uncomfortable than a _____ at a _____ convention.
* When I think about _____ I touch myself. (must sing)
* My parents were shocked to learn that I like _____.
* It wasn’t until they pulled out _____ that it got really embarrassing.
White Cards
@jnovack
jnovack / README.md
Last active April 3, 2024 03:24
Opening up mosh in firewalld using firewall-cmd

Mosh (mobile shell) is a gift from the Gods(tm). Anyone with spotty internet or wireless connection has suffered the pain of a lost SSH session. Sure, one can fire up screen (or tmux as the kids are using these days), but that's an extra step and you are still using the SSH protocol.

I'm not here to tout the benefits of Mosh, you came here to open it up in your firewall.

  1. Create the following file as /etc/firewalld/services/mosh.xml
  2. firewall-cmd --add-service=mosh --permanent
  3. firewall-cmd --reload

If you tend to have a lot of sessions (not recommended), you can increase the ports, but the default should be fine for most applications.

@jnovack
jnovack / rsyslog.conf
Created December 12, 2015 17:55
rsyslog v8.14.0-6 configs
[root@elasticsearch ~]# cat /etc/rsyslog.conf
# rsyslog configuration file
# note that most of this config file uses old-style format,
# because it is well-known AND quite suitable for simple cases
# like we have with the default config. For more advanced
# things, RainerScript configuration is suggested.
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
@jnovack
jnovack / elasticsearch.conf
Created December 13, 2015 20:58
rsyslog-doc#191
module(load="omelasticsearch") # Elasticsearch output module
# this is for index names to be like: logstash-YYYY.MM.DD
template(name="logstash-index"
type="list") {
constant(value="logstash-")
property(name="timereported" dateFormat="rfc3339" position.from="1" position.to="4")
constant(value=".")
property(name="timereported" dateFormat="rfc3339" position.from="6" position.to="7")
constant(value=".")
@jnovack
jnovack / led.js
Created December 20, 2015 16:04
Old LED functions
function flash() {
var num = Math.floor(Math.random()*25);
if (num === 1) {
driver.setRGB('#FFFFFF', 0, 1, 2);
} else {
driver.setRGB('#000000', 0, 1, 2);
}
driver.send();
setTimeout(function() { flash() }, 10);
};
@jnovack
jnovack / README.md
Last active June 26, 2020 18:00
Using Linux Display on OSX in docker
@jnovack
jnovack / nginx.conf
Created July 25, 2016 16:02
nginx Reverse SSL Proxy
# /etc/nginx/nginx.conf
# ...
http {
# ...
include /etc/nginx/sites-enabled/*.conf
}
@jnovack
jnovack / bluetooth.sh
Created January 18, 2017 15:38
Control Bluetooth Daemon through Command Line OSX
#read the current pref, returns '0' for off and '1' for on.
defaults read /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState
#set bluetooth pref to off
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0
#set bluetooth pref to on
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1
#kill the bluetooth server process