Skip to content

Instantly share code, notes, and snippets.

View aeppert's full-sized avatar

Aaron Eppert aeppert

View GitHub Profile
@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")
@aeppert
aeppert / README.md
Created February 10, 2017 15:55 — forked from grigorescu/README.md
breakpoint_to_pcap

breakpoint_to_pcap

Overview

Given an input PCAP and a location in a Bro script, this script will filter the PCAP into a new file, which contains only the connections that visited that script location. This script can help filter a large PCAP to narrow down problematic connections, such as protocol violations, weirds, etc.

Example

@aeppert
aeppert / pcap_count_packets.go
Created February 10, 2017 22:24
Count Packets in a PCAP
package main
import (
"flag"
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
"log"
)
@aeppert
aeppert / hl7sniff.rb
Created February 16, 2017 15:22 — forked from sween/hl7sniff.rb
# Ron Sweeney
# Dev Arboretum
# Original Post: http://www.clubpacswestmi.net/articles/2007/4/1/a-ruby-hl7-sniffer
require 'pcap'
require 'Ethernet'
require 'rubygems'
require 'ruby-hl7'
@aeppert
aeppert / dockertags.sh
Created May 22, 2017 14:11
List docker tags
#!/bin/bash
#
# Original: https://stackoverflow.com/questions/28320134/how-to-list-all-tags-for-a-docker-image-on-a-remote-registry
#
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
@aeppert
aeppert / poll_load_average.go
Last active July 5, 2017 17:22
Periodic polling of load average and check for an increase
package main
import (
"fmt"
"time"
"github.com/shirou/gopsutil/load"
)
var currentLoad *load.AvgStat
@aeppert
aeppert / pcap_stats.sh
Created August 3, 2017 20:47
Generate PCAP protocol statistics
#!/bin/bash
for i in `find . -type f -name "$1"`
do
mv $i $i.pcap
tshark -r $i.pcap -q -z io,phs > $i-summary.txt
done
@aeppert
aeppert / resize_chrome_720.applescript
Created August 7, 2017 13:20
Resize Chrome to 720p
set theApp to "Chrome"
set appHeight to 720
set appWidth to 1280
tell application "Finder"
set screenResolution to bounds of window of desktop
end tell
set screenWidth to item 3 of screenResolution
set screenHeight to item 4 of screenResolution
@aeppert
aeppert / sym_test.cc
Created August 8, 2017 18:31
Enumerate and demangle symbols within an executable's own symbol table.
#include <stdio.h>
#include <stdlib.h>
#include <cxxabi.h>
#include <link.h>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
@aeppert
aeppert / vin_check.cc
Last active August 18, 2017 19:17
Verify VIN
#include <vector>
#include <iostream>
#include <map>
#include <functional>
#include <numeric>
using namespace std;
#define VIN_LEN 17
#define VIN_CHECKDIGIT_POS 8