Skip to content

Instantly share code, notes, and snippets.

Noah Kantrowitz coderanger

Block or report user

Report or block coderanger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@coderanger
coderanger / admin.py
Created Aug 31, 2010
Pagination for admin inlines
View admin.py
class MyInline(admin.TabularInline):
model = MyModel
extra = 0
template = 'admin/edit_inline/list.html'
def get_formset(self, request, obj=None, **kwargs):
FormSet = super(ActivationKeyInline, self).get_formset(request, obj, **kwargs)
class NewFormSet(FormSet):
def _construct_forms(self, *args, **kwargs):
qs = self.get_queryset()
View preseed.cfg
# This is the entire preseed config file used on an example Lucid system. See the preseed
# documentation for more information on the options here. This will use US English by default.
#
# https://help.ubuntu.com/10.04/installation-guide/amd64/preseed-contents.html
#
# This preseed will automatically install Ubuntu 10.04 with default options. Understand what
# it is doing before you use it.
#
# Boot Options line:
#
@coderanger
coderanger / traefik.yaml
Created Nov 6, 2018
Traefik quick start
View traefik.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: traefik
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik
@coderanger
coderanger / Dockerfile
Last active Aug 17, 2018
Dockerfile snippet for Caddy build
View Dockerfile
###################
# Caddy build image
FROM abiosoft/caddy:builder
ARG caddy_version="0.11.0"
ARG caddy_plugins="cors,realip,expires,proxyprotocol,prometheus"
ENV ENABLE_TELEMETRY="false"
# Disable a bunch of standard plugins we don't need.
RUN sed -i "/# build/a sed -Ei '/caddyhttp.(basicauth|browse|fastcgi|markdown|templates|websocket)/d' /go/src/github.com/mholt/caddy/caddyhttp/caddyhttp.go" /usr/bin/builder.sh
View email.md

From: 7N5C 7n5corp@gmail.com

Subject: Converstion with you

Noah,

My name is Stella Hughes and I would like to have a conversation with you about a project I have been trying to develop for the past several years.

@coderanger
coderanger / README.md
Last active Mar 8, 2018
How to patch Ubuntu for Heartbleed
View README.md

How to patch Ubuntu for Heartbleed

  1. sudo apt-get update
  2. sudo apt-get install -y libssl1.0.0 openssl
  3. openssl version -a and confirm the "built on" date is >= 2014-04-07
  4. sudo lsof -n | grep ssl | grep DEL and restart all listed services.

Repeat #4 until no results are returned.

@coderanger
coderanger / pitch.md
Last active Jan 6, 2018
Old clan warfare idea I found
View pitch.md

Clan Warfare Revamp Make-A-KoL

Elevator Pitch

Make clan war be a turned-based tower defense minigame. Towers and tower upgrades have an escalating cost so larger clans don't have an advantage. Each player gets one clan attack a day if they are participating and can attack either a random clan for material rewards or a specific clan for bragging rights points (similar to PvP).

@coderanger
coderanger / chef-server.rb
Created Apr 4, 2017
ssd's config example for Chef Server external stuffs
View chef-server.rb
fqdn "FQDN"
postgresql['external'] = true
postgresql['vip'] = 'EXTERNAL_PG_IP'
postgresql['db_superuser'] = 'DB_SUPERUSER'
postgresql['db_superuser_password'] = 'DB_SUPERUSER_PASSWORD'
opscode_solr4['external'] = true
opscode_solr4['external_url'] = 'http://EXTERNAL_ES_IP:9200'
opscode_erchef['search_provider'] = 'elasticsearch'
opscode_erchef['search_queue_mode'] = 'batch'
bookshelf['storage_type'] = :sql
@coderanger
coderanger / example.rb
Created Jun 15, 2016
Example of subclassing the Unicorn resource
View example.rb
module MyUnicorn
# Subclass the resource.
class Resource < PoiseApplicationRuby::Resources::Unicorn::Resource
# Give it a new name so we can find it.
provides(:my_unicorn)
# Add a new property. Could do more here.
property(:listen)
end
# Subclass the provider.
@coderanger
coderanger / make_diecut.py
Created Sep 6, 2016
Automatically extract diecut paths for an image.
View make_diecut.py
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import re
import sys
import attr
import cv2
import numpy
You can’t perform that action at this time.