Skip to content

Instantly share code, notes, and snippets.

View jeffery9's full-sized avatar

Jeffery CHEN Fan jeffery9

View GitHub Profile
@jeffery9
jeffery9 / redis_session_store.py
Created May 15, 2016 12:19 — forked from carlopires/redis_session_store.py
Werkzeug Redis Session Store
# -*- coding: utf-8 -*-
"""
Created on 09/11/2011
@author: Carlo Pires <[email protected]>
"""
import tnetstring
from werkzeug.contrib.sessions import SessionStore
SESSION_TIMEOUT = 60*60*24*7 # 7 weeks in seconds
#!/bin/bash
##############################################################################
#
# Copyright (c) 2004-2009 TINY SPRL. (http://tiny.be)
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
@jeffery9
jeffery9 / gist:47b27afd35f32554934f
Last active August 29, 2015 14:20
pypi mirror
$ cat .pip/pip.conf
[global]
use-mirror=true
mirrors=http://mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple
@jeffery9
jeffery9 / gist:e59fe7bd7f76bfc0f39a
Created February 14, 2015 11:02
odoo inital database script
c:\python27\python openerp-server -c oe.conf -i sales_team,sale_stock,sale_service,sale_order_dates,sale_mrp,sale_margin,sale_layout,sale_journal,sale_crm,sale_analytic_plans,purchase_analytic_plans,product_extended,product_visible_discount,product_margin,product_expiry,product_email_template,website_sale,website_sale_delivery,website_sale_options,website_quote,account_asset,hr_payroll_account,im_livechat,mrp_operations,payment_transfer,project_timesheet,delivery,crm_partner_assign,fleet,purchase_requisition --stop-after-init -d %1
@jeffery9
jeffery9 / default.vcl.pl
Created August 29, 2012 02:13 — forked from bmarini/default.vcl.pl
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)