Skip to content

Instantly share code, notes, and snippets.

View pdxjohnny's full-sized avatar
🐢
Rolling Alice...

John Andersen pdxjohnny

🐢
Rolling Alice...
View GitHub Profile
@pdxjohnny
pdxjohnny / docker-compose.yml
Created May 29, 2015 06:32
Docker mysql scripts
mysql:
image: mysql:latest
ports:
- "13306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
volumes:
- /srv/docker/mysql:/var/lib/mysql
@pdxjohnny
pdxjohnny / docker-cassandra
Created May 29, 2015 20:32
Docker cassandra scripts
#! /bin/sh
# /etc/init.d/docker-cassandra
#
case "$1" in
start)
echo "Starting docker cassandra..."
docker start cassandra_cassandra_1
;;
stop)
@pdxjohnny
pdxjohnny / Dockerfile
Created May 29, 2015 21:58
Dockerfile for apache-php setup
FROM ubuntu:latest
MAINTAINER John Andersen <johnandersenpdx@gmail.com>
RUN apt-get update
RUN apt-get -y upgrade
# Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container.
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php5 php5-mysql php5-gd php-pear php-apc php5-curl curl lynx-cur
@pdxjohnny
pdxjohnny / get_shellcode.py
Last active August 29, 2015 14:22
Generate and run shellcode
import os
import sys
import random
import string
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def objdump(file_name, function="main"):
tmp = id_generator()
@pdxjohnny
pdxjohnny / jquery_addons.js
Last active August 29, 2015 14:22
Handy jquery addtions
// Creates an object from a form
$.fn.toObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
@pdxjohnny
pdxjohnny / ssh.py
Last active August 16, 2016 11:54
Paramiko ssh connector
import sys
import threading
import paramiko
__connections__ = {}
__hosts__ = {}
EXAMPLE_HOSTS = [
{
@pdxjohnny
pdxjohnny / fanlogger.c
Created July 2, 2015 17:58
Liunx log filesystem changes
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/fanotify.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
@pdxjohnny
pdxjohnny / sanitize.py
Last active August 29, 2015 14:24
PyFileSystem save to tmp file before remote write
"""
sanitize is a colletion of database functions to
abtract file storage and other actions
"""
import sys
import uuid
from fs.opener import fsopendir
# Custom modules
import extra.config as config
@pdxjohnny
pdxjohnny / docker_listen_lan.py
Last active August 29, 2015 14:24
Make docker listen on lan
"""
Makes docker listen on lan
tcp://192.168.1.32:2375
http://192.168.1.32:2375
"""
import json
import copy
import fcntl
import socket
import string
@pdxjohnny
pdxjohnny / Dockerfile
Last active August 29, 2015 14:25
X11 and Openssh server in a container
# VERSION: 0.1
# DESCRIPTION: X11 and Openssh server in a container
# AUTHOR: John Andersen <johnandersenpdx@gmail.com>
# COMMENTS:
# This file builds a container which can be accessed via ssh
# with username=user password=user. Usefull as a base image
# for a conatiner which whishes to install gui software
# USAGE:
# # Download x11 Dockerfile
# wget https://gist.githubusercontent.com/pdxjohnny/0ae3d5b2eba388829c03/raw/b12c5e5e89ad80400f73c38ce464a672378572d0/Dockerfile