Skip to content

Instantly share code, notes, and snippets.

View heyman's full-sized avatar

Jonatan Heyman heyman

View GitHub Profile
@heyman
heyman / iptables-docker-ufw.sh
Created September 6, 2018 13:11 — forked from rubot/docker_ufw_setup.sh
easy fix for DOCKER-USER and ufw
# Solves the problem with open ports with docker and ufw
# As Docker uses the nat table, the filter table FORWARD chain is used and does not touch ufw-input chains as expected.
# Even for ufw-forward chains it would not work, as DOCKER chains are inserted in front.
# This is a simple fix that worked for me.
INTERFACE_NAME=eth0
__clear(){
sed -i '/^# dockerfix start/,/^# dockerfix end/d' $1
#!/bin/bash
touch /tmp/Recent.xyz
while true
do
echo "Checking again..."
wget -q https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/InRelease -O /tmp/InRelease.xyz
if test /tmp/InRelease.xyz -nt Recent.xyz; then
say Docker timestamp updated!
@heyman
heyman / s3botostorage.py
Created August 9, 2012 11:31 — forked from tbarbugli/s3botostorage.py
S3BotoStorage
from boto.utils import parse_ts
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage
"""
make sure you have this setting
AWS_PRELOAD_METADATA = True
and that you have python-dateutils==1.5 installed
"""
@heyman
heyman / geventmongo.py
Created November 16, 2011 09:47 — forked from gwik/geventmongo.py
PyMongo >=2.0 pool for gevent
# Copyright 2011 10gen
#
# Modified by Antonin Amand <antonin.amand@gmail.com> to work with gevent.
#
# 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
#