Skip to content

Instantly share code, notes, and snippets.

View aeppert's full-sized avatar

Aaron Eppert aeppert

View GitHub Profile
#!/usr/bin/osascript
-- Author: David Koppstein
-- Version 1.0
-- A script for backing up named Calendars from iCal using the GUI interface. Currently,
-- it relies on the fact that exported calendars go to a default directory. Future versions,
-- if they ever come out, will hopefully take care of this issue. Furthermore, this program
-- also assumes that there is already a backed-up .ics file of the same name in that directory.
--
-- While the script is running, be sure not to click anything.
--
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@aeppert
aeppert / install-bro-w_pfring_and_options.sh
Created October 27, 2015 16:41 — forked from dcode/install-bro-w_pfring_and_options.sh
Install bro packages that include PF_RING and optional performance enhancements on CentOS 7
# Install epel
sudo yum -y install epel-release
# Install kernel headers for current kernel
sudo yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)
# Install ntop repos
cat << EOF | sudo tee /etc/yum.repos.d/ntop.repo
[ntop]
name=ntop packages
@aeppert
aeppert / log_lag.py
Created January 20, 2016 18:42 — forked from JustinAzoff/log_lag.py
Bro log lag
#!/usr/bin/env python
import os
import sys
import time
DEFAULT_LOG = "/bro/logs/current/conn.log"
def config():
print """
graph_category network
@aeppert
aeppert / extract_smtp_stream.bro
Created February 29, 2016 19:52 — forked from dcode/extract_smtp_stream.bro
Extracts SMTP stream going both directions using Bro. Similar to "Follow TCP Stream" in Wireshark.
event protocol_confirmation (c: connection, atype: Analyzer::Tag, aid: count)
{
if ( atype == Analyzer::ANALYZER_SMTP )
{
local both_file = generate_extraction_filename(Conn::extraction_prefix, c, "both.dat");
local both_f = open(both_file);
set_contents_file(c$id, CONTENTS_BOTH, both_f);
}
}
@aeppert
aeppert / stash_slack_integration.md
Created May 24, 2016 17:52 — forked from molaschi/stash_slack_integration.md
Integrate Stash with Slack using webhooks

This is a short article on how we integrate stash and slack in openmind

First of all i assume you have:

  • a working stash installation
  • a repository you to notify slack on pushes
  • stash user with administration priviledges
  • full access to the server (linux) where stash is installed on
  • a team configured on slack
  • slack user with administration priviledges
@aeppert
aeppert / bug_free_buddha_comment.py
Created June 20, 2016 19:24 — forked from rsvp/bug_free_buddha_comment.py
Special comment to minimize bugs in any Python or shell code -- Buddhist ASCII Art
# To minimize bugs, include this comment:
#
#
# _oo0oo_
# o8888888o
# 88" . "88
# (| -_- |)
# 0\ = /0
# ___/`---'\___
# .' \| |// '.
@aeppert
aeppert / SSHwithgit2go.go
Created September 12, 2016 04:18 — forked from zchee/SSHwithgit2go.go
Working example with SSH and libgit2/git2go
package main
import (
git "github.com/libgit2/git2go"
"log"
)
func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) {
ret, cred := git.NewCredSshKey("git", "/home/vagrant/.ssh/id_rsa.pub", "/home/vagrant/.ssh/id_rsa", "")
return git.ErrorCode(ret), &cred
@aeppert
aeppert / movefile.go
Created February 10, 2017 01:53
Golang move file using os.Rename method
package main
import (
"fmt"
"os"
)
func main() {
err := os.Rename("/dir1/file1", "/dir2/file2")