Skip to content

Instantly share code, notes, and snippets.

View jeffery9's full-sized avatar

Jeffery CHEN Fan jeffery9

View GitHub Profile
@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, ...)
@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 <carlopires@gmail.com>
"""
import tnetstring
from werkzeug.contrib.sessions import SessionStore
SESSION_TIMEOUT = 60*60*24*7 # 7 weeks in seconds
@jeffery9
jeffery9 / RedisPythonPubSub1.py
Created April 8, 2017 09:59 — forked from jobliz/RedisPythonPubSub1.py
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@jeffery9
jeffery9 / README-Template.md
Created December 2, 2018 02:32 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jeffery9
jeffery9 / Activate Office 2019 for macOS VoL.md
Created July 30, 2019 07:34 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@jeffery9
jeffery9 / hack.sh
Created August 8, 2019 01:29 — forked from mbinna/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2357277/hack.sh | sh
#
@jeffery9
jeffery9 / git-sync-all-branches.sh
Last active October 12, 2020 00:31 — forked from piaoger/git-sync-all-branches.sh
git-sync-all-branches
# fetch all branches
# From: http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
git fetch --all
@jeffery9
jeffery9 / install_posbox_in_pc.sh
Created December 12, 2022 03:14 — forked from bitodoo/install_posbox_in_pc.sh
Install Odoo posbox in pc
#!/bin/bash
# Run not as root
# ./install_posbox_in_pc.sh
# No LSB modules are available.
# Distributor ID: Ubuntu
# Description: Ubuntu 18.04.3 LTS
# Release: 18.04
# Codename: bionic