Skip to content

Instantly share code, notes, and snippets.

View stevehenderson's full-sized avatar

Steve Henderson stevehenderson

View GitHub Profile
@stonith
stonith / logstash.conf
Created July 24, 2012 23:32
logstash config to accept iis/wineventlogs and send to elasticsearch
input {
tcp {
type => "iis"
port => 5141
format => json
#Disable timeouts as logstash may drop events when timing out
data_timeout => -1
}
tcp {
@stevehenderson
stevehenderson / gist:5606632
Last active December 17, 2015 11:59
Search Gist
http://www.gistboxapp.com/
@stevehenderson
stevehenderson / gist:5606650
Created May 19, 2013 04:12
Search your gists
user:stevehenderson
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement
import urllib2
from bs4 import BeautifulSoup
import urlparse
import shutil
import re, os
base_url = "http://10.5.5.9:8080/videos/DCIM/XXXGOPRO/" #Where XXX, change it by the directory you want (for instance 100GOPRO)
content = urllib2.urlopen(base_url).read()
@aodin
aodin / gist:9493190
Last active March 23, 2024 20:24
Parsing JSON in a request body with Go
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
)
type Message struct {
@mjul
mjul / form_to_opencv.py
Created July 2, 2014 19:27
Decode Python (Flask or Werkzeug) photo file uploaded via HTTP POST request in-memory to an OpenCV matrix.
#
# Example from code built on the Flask web framework (and Werkzeug)
# Accepts uploading a photo file in the 'photo' form member, then
# copies it into a memory byte array and converts it to a numpy array
# which in turn can be decoded by OpenCV.
#
# Beware that this increases the memory pressure and you should
# configure a max request size before doing so.
#
# It saves a round-trip to a temporary file, though.
# Bro-IDS Logstash parser
# Parts of this taken from http://www.appliednsm.com/wp-content/uploads/logstash-SObro22-parse.conf_.txt
#Logs being parsed:
#app_stats.log
#conn.log
#dns.log
#dpd.log
#files.log
#http.log
@tanuka72
tanuka72 / Host_Django_on_AWS
Last active February 18, 2023 20:02
Hosting a Django application on AWS EC2 (running AMI Linux) - steps involved
As a newbie, I recently went through the process of migrating my Django application that was developed and tested on a Windows environment onto AWS (AMI Linux) to host it using Apache and mod_wsgi. The source code for the application was on GitHub.
My sincere thanks to the people who have contributed the References that I've listed in my notes below. They were immensely helpful for me to get through this process.
I'm posting my notes compiling all the steps involved, in case it helps others.
This is NOT production level hosting.
I Creating AWS account and instances
=====================================
Reference : http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/web-app-hosting-intro.html
@dcode
dcode / stenographer.service
Last active June 30, 2023 03:00
This is a hack that I put together to pull PCAP from multiple instances of stenographer, each with a different configuration file. It adds `mergecap` as a dependency, which is used to produce the final PCAP, which is then filtered through `tcpdump` as before.
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active June 25, 2024 04:08
Partition, format, and mount a drive on Ubuntu