This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $(/usr/bin/xinput | /bin/grep K750) ]] ; then | |
/usr/bin/setxkbmap -option apple:badmap,lv3:rwin_switch,altwin:swap_alt_win | |
else | |
/usr/bin/setxkbmap -option | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$NS = <<SCRIPT | |
sudo cat <<REPO >> /etc/apt/sources.list | |
deb http://http.us.debian.org/debian/ testing non-free contrib main | |
REPO | |
sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Val: record { | |
sha256_hash: string; | |
document_name: string; | |
}; | |
global blacklist_hash_database = "/var/db/blacklist"; | |
event document_exfil(description: Input::EventDescription, tpe: Input::Event, r: Val) | |
{ | |
print fmt("Data exfiltration detected with hash %s, document %s", r$sha256_hash, r$document_name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
sub populateArrayFromFile { | |
my ($filename) = @_; | |
open FILE, $filename || die "Cannot open file ".$filename." for read"; | |
@lines=<FILE>; | |
close FILE; | |
return @lines; | |
} | |
sub ip6AppendZeroes { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
sub populateArrayFromFile { | |
my ($filename) = @_; | |
open FILE, $filename || die "Cannot open file ".$filename." for read"; | |
@lines=<FILE>; | |
close FILE; | |
return @lines; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RETAINDAYS=7 | |
HOST="localhost" | |
PORT=9200 | |
INDICES=`curl -ss -XGET $HOST:$PORT/_cat/indices?v | awk -F " " '{print $3}' | grep sessions | sort -n` | |
TODAY=`date +"%y%m%d"` | |
for index in $INDICES; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for index in `curl -ss -XGET localhost:9200/_cat/indices?v | grep red | perl -ne 'if (m/.+(sessions-\d+\w\d+).+/){print "$1\n"}'` | |
do curl -XDELETE localhost:9200/$index | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERIAL=`sudo hdparm -I /dev/sda | grep 'Serial Number:' | perl -ne 'if(m/:\s*(\S+)/){print "$1\n"}' | tr -cd 0-9` | |
UNIQUE_FILE='/tmp/uniq.txt' | |
grep $SERIAL $UNIQUE_FILE > /dev/null 2>&1 || echo $SERIAL > $UNIQUE_FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var warn_threshold = 30 | |
var crit_threshold = 10 | |
var data = stream | |
.from().measurement('cpu') | |
.where(lambda: "cpu" == 'cpu-total') | |
.groupBy('host') | |
// Do normal alerting | |
data.alert() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./configure \ | |
--prefix=/opt/rsyslog8 \ | |
--enable-extended-tests=yes \ | |
--enable-imptcp \ | |
--enable-imttcp \ | |
--enable-impstats \ | |
--enable-omstdout \ | |
--enable-imfile \ |
OlderNewer