Skip to content

Instantly share code, notes, and snippets.

View cleesmith's full-sized avatar

Christopher cleesmith

View GitHub Profile
@cleesmith
cleesmith / send_logs_to_ekanite.rb
Created October 18, 2015 15:30
send test syslogs to ekanite
#!/usr/bin/env ruby
require 'socket'
require 'timeout'
# see: https://github.com/ekanite/ekanite
if ARGV.empty?
do_it = 1
else
do_it = ARGV[0].to_i
@cleesmith
cleesmith / waitgroup.go
Created July 30, 2015 08:47
GoLang concurrency
package main
import (
"fmt"
"net/http"
"sync"
"time"
)
func main() {
@cleesmith
cleesmith / gist:817541904bfaf25d4270
Last active April 2, 2021 07:31
remastering Tiny Core using VirtualBox
TinyCore
Apr 13, 2015:
remastering tiny core using virtualbox:
1. create a new virtualbox vm and add TinyCore-current.iso to the Storage setting
2. start the new vm
3. in a terminal window do: tce-load -wi ezremaster
4. perform all of these tce-load's: ... but do NOT configure anything, nor add pip (as it won't persist)
1. tce-load -wi libxslt.tcz ... lxml dependency
2. tce-load -wi libxml2-dev.tcz ... lxml dependency
3. tc-install.tcz ... so users of this remaster can install it if they want to, instead of only using the .iso
@cleesmith
cleesmith / suricata2install
Last active September 23, 2018 21:31
install/test Suricata on a virtualbox with Ubuntu 14.04 installed
Suricata
Nov 2, 2014:
... don't waste time installing it on osx :(
instead, try it on ubuntu 14.04 using virtualbox, much better, and more like a real server:
sudo apt-get install build-essential automake libtool bison subversion pkg-config
sudo apt-get install libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev libpcre3 libpcre3-dev
sudo apt-get install openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3
sudo apt-get install libnet1 libnet1-dev
sudo apt-get install libpcap-dev libpcap0.8 libpcap0.8-dev
sudo apt-get install libcap-ng-dev
@cleesmith
cleesmith / file_sf.geojson
Created September 16, 2014 17:02
cls test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cleesmith
cleesmith / server.py
Created September 15, 2014 09:55
Server to receive the streamed image sent from detect_motion_socket_send.py client on RPi
import socket
import datetime
HOST = '192.168.0.2'
PORT = 9876
ADDR = (HOST,PORT)
BUFSIZE = 4096
serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serv.bind(ADDR)
serv.listen(5)
@cleesmith
cleesmith / detect_motion_socket_send.py
Created September 15, 2014 09:53
Client to run on RPi and send motion detected jpg images to server.py
#!/usr/bin/python
import signal
import io
import socket
import numpy as np
import picamera
import picamera.array
import datetime
import logging
@cleesmith
cleesmith / detect_motion.py
Created September 15, 2014 06:46
simple motion detection using picamera
#!/usr/bin/python
import signal
import numpy as np
import picamera
import picamera.array
import datetime
import logging
logging.basicConfig(level=logging.INFO, format="%(message)s")
LOG = logging.getLogger("capture_motion")
@cleesmith
cleesmith / Security Onion installation
Last active September 16, 2021 04:47
Security Onion installation in a virtualbox
Security Onion
Aug 2014:
... my purpose for installing this was to:
- learn more about security stuff
- steal the packet captures (pcap) provided so I can replay them using tcpreplay for snort testing,
as it's not so sexy to just test using ICMP ping data or local rules that match anything
see:
http://blog.securityonion.net/
@cleesmith
cleesmith / snort_barnyard2
Last active April 6, 2019 22:47
Install Snort and Barnyard2
Install Snort and Barnyard2 virtualbox ubuntu 12.04 and 14.04
Aug 2014:
Snort:
... in virtualbox set Network + Advanced 'Promiscuous Mode' to 'Allow All'
sudo apt-get install snort
ps aux | grep -i snort
sudo service snort stop
sudo nano /etc/snort/snort.conf