Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@dairoot
dairoot / decorator.py
Last active December 22, 2023 03:46
分布式函数锁
import json
from redis import Redis
redis = Redis()
def setnx_lock(cache_time):
# 分布式锁 (原理 利用 setnx)
@snower
snower / logging_file_lock_handler.py
Created May 31, 2023 01:27
logging_file_lock_handler
# -*- coding: utf-8 -*-
# 14-8-20
# create by: snower
import os
import time
import struct
import fcntl
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler