Skip to content

Instantly share code, notes, and snippets.

Evgeny Zislis kesor

Block or report user

Report or block kesor

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
View refrigerator.pp
ensure => running,
kesor / Vagrantfile
Last active Aug 29, 2015
docker workshop
View Vagrantfile
Vagrant.configure("2") do |v| = "yungsang/boot2docker"
v.vm.box_version = ">= 1.3.7"
v.vm.box_check_update = false :forwarded_port, guest: 5000, host: 60050 :forwarded_port, guest: 8500, host: 60085 :forwarded_port, guest: 8080, host: 60080
View gist:11682
# Cleanup World of Warcraft AddOns folder from embedded libraries,
# only if those are installed individually or as part of a library pack (eg. Ace3)
# Usual dir on a Mac OS X is at :
# ~/Applications/World of Warcraft/Interface/AddOns
# Useful shell alias
kesor / rails_vendor_gems_ng.rb
Created Dec 29, 2008
handle vendor/gems in rails 2.2 as a dir for gems, not foreign alien shit that it is today
View rails_vendor_gems_ng.rb
# see mail reply in
# with explanation about how/why this works better than rails 2.2
module Rails
class VendorGemSourceIndex
def gemspec_filename(d)
kesor /
Last active Sep 9, 2015
Uploading ssl to AWS
decrypted_rsa_key=$(mktemp `dirname $0`/${cert_name}-com-server-key-UNENCRYPTED.pem.XXXXXXX)
trap "rm -rf $decrypted_rsa_key" EXIT
openssl rsa -in ${cert_name}-com-server-key.pem -out $decrypted_rsa_key
# The certificate chain must start with the immediate signing certificate,
kesor / gist:1029749
Created Jun 16, 2011
RSyslog <-> ElasticSearch LogStash events
We couldn’t find that file to show.
kesor /
Created Sep 20, 2011
Django SQL dump middleware
from django.conf import settings
from django.db import connection
class SqldumpMiddleware(object):
def process_response(self, request, response):
if settings.DEBUG and 'sqldump' in request.GET:
response.content = str(connection.queries)
response['Content-Type'] = 'text/plain'
return response
import jinja2
from django.template.loader import BaseLoader
from django.template.loaders.app_directories import app_template_dirs
from django.template import TemplateDoesNotExist, Origin
from django.core import urlresolvers
from django.conf import settings
import datetime
import urllib
from django.utils.timesince import timesince, timeuntil
kesor /
Created Oct 3, 2011
Caching for GenericRelation models in Django
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.core.cache import cache
from django.dispatch import receiver
class LabelsManager(models.Manager):
""" The manager for Label/s, as well as superclass of the RelatedManager/s of Label/s """
def all(self):
kesor /
Created Apr 15, 2012
Django X-Host-Name + X-Host-IP +X-Host-MacAddress middleware
class HostnameMiddleware(object):
"""Middleware that adds a header X-Hostname to erroneous pages."""
def process_response(self, request, response):
if response.status_code != 200:
import socket
hostname = socket.gethostname()
addresses = ",".join( socket.gethostbyname_ex(hostname)[2] )
response['X-Host-Name'] = hostname
response['X-Host-IP'] = addresses
You can’t perform that action at this time.