Skip to content

Instantly share code, notes, and snippets.

@reyjrar
reyjrar / emailnotifications.pl
Last active November 19, 2015 20:25
Email notifications for privmsgs, mentions, and hilights.
#!/usr/bin/env perl
use strict;
use warnings;
use Irssi;
use Irssi::Irc;
use MIME::Lite;
use Sys::Hostname;
@reyjrar
reyjrar / del-aggregated.sql
Created May 30, 2015 12:21
Deletion with Aggregated Data
WITH dups AS(
select response_id, answer_id, section
from meta_answer
group by response_id, answer_id, section
having count(1) > 1
)
DELETE FROM meta_answer ma
WHERE EXISTS (
SELECT 1
FROM dups
#!/usr/bin/env perl
#
use strict;
use warnings;
use Benchmark qw(cmpthese timethese);
my @tests = (
q{testing 12345 some more stuff},
q{123 testing some stuff},
@reyjrar
reyjrar / mbsyncrc
Created January 12, 2015 20:51
New old mail setup
Expunge Slave
Create Both
CopyArrivalDate yes
Sync All
SyncState *
IMAPAccount company
Host imap.company.com
CertificateFile ~/Certificates/godaddy.pem
UseIMAPS yes
@reyjrar
reyjrar / git-log-code-review.log
Created April 10, 2014 20:59
Sample output of a 'git log --reverse' when using Git::Code::Review
commit 32e77a880484a60431b7e2d841549e0b6a96057f
Author: Brad Lhotsky <brad.lhotsky@booking.com>
Date: Wed Apr 2 22:11:05 2014 +0200
Initializing source repository.
---
audit_repo: /Users/blhotsky/tmp/repo
branch: master
reviewer: brad.lhotsky@booking.com
source_repo: git@github.com:reyjrar/Parse-Syslog-Line.git
@reyjrar
reyjrar / digiti-matching.pl
Created December 8, 2013 12:20
Testing variations on matching digits with Perl Regex
#!/usr/bin/env perl
#
use strict;
use warnings;
use Benchmark qw(cmpthese);
my @tests = (
q{testing 12345 some more stuff},
q{123 testing some stuff},
@reyjrar
reyjrar / adobe.txt
Last active December 29, 2015 21:59
Output from a bitsquatting whois tool I'm working on. GOOGLEUSERCONTENT.COM is rated #44 on the Alexa Top Sites
$ ./bin/bit-whois.pl adobe.com
adobe.com variation bdobe.com is taken (ns01.domaincontrol.com)
adobe.com variation aeobe.com is !! ERROR !!
No Match Domain!
adobe.com variation acobe.com is taken (ns1.s416.sureserver.com)
adobe.com variation adpbe.com is taken (ns2.hastydns.com)
adobe.com variation adnbe.com is ** AVAILABLE **
adobe.com variation adoce.com is taken (ns2.warptech.net)
adobe.com variation adoae.com is ** AVAILABLE **
adobe.com variation adobf.com is ** AVAILABLE **
@reyjrar
reyjrar / feature.xml
Created July 9, 2013 12:06
Possible enhancement to the decoders/rules
<decoder name="uptime">
<regex>load avergage: (\S+),</regex>
<order>var:load<order>
</decoder>
<rule id="100000" level="10">
<decoded_as>uptime</decoded_as>
<compare var="load" is="numeric" check="gt">2</compare>
</rule>
@reyjrar
reyjrar / crontab.xml
Created June 26, 2013 15:46
OSSEC Decoder for crontab manipulation.
<!-- Decoder to enable extracting data from the crontab command
Aug 30 17:13:02 server.example.com crontab[1347]: (root) LIST (root)
Aug 30 17:13:38 server.example.com crontab[2852]: (root) BEGIN EDIT (root)
Aug 30 17:13:41 server.example.com crontab[2852]: (root) REPLACE (root)
Aug 30 17:13:41 server.example.com crontab[2852]: (root) END EDIT (root)
Aug 30 17:14:01 server.example.com crond[1756]: (root) RELOAD (/var/spool/cron/root)
Aug 30 17:14:01 server.example.com CROND[4018]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Aug 30 17:14:06 server.example.com crontab[4030]: (root) LIST (root)
Aug 30 17:15:01 server.example.com CROND[5818]: (root) CMD (/usr/lib64/sa/sa1 1 1)
@reyjrar
reyjrar / named-axfr.xml
Created June 26, 2013 15:38
OSSEC Decoder for Named Zone Transfers
<!-- AXFR Logs
06-Mar-2013 09:16:37.228 xfer-out: client 10.1.1.5#37937: view internal: transfer of 'example.com/IN': IXFR started
06-Mar-2013 09:16:37.228 xfer-out: client 10.1.1.5#37937: view internal: transfer of 'example.com/IN': IXFR ended
06-Mar-2013 09:18:26.971 xfer-out: client 10.1.6.3#35733: view internal: transfer of 'test.example.com/IN': AXFR-style IXFR started
06-Mar-2013 09:18:26.974 xfer-out: client 10.1.6.3#35733: view internal: transfer of 'test.example.com/IN': AXFR-style IXFR ended
-->
<decoder name="bind-axfr-start">