Skip to content

Instantly share code, notes, and snippets.

FROM python:3.8.12
WORKDIR /usr/src/app
# set noninteractive
ENV TZ=Asia/Shanghai \
DEBIAN_FRONTEND=noninteractive
# set Asia/Shanghai timezone
RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
[program:tomcat6]
command=/opt/tomcat6-instance/bin/supervisor-wrapper.sh
@foxracle
foxracle / latency.txt
Created November 14, 2013 05:48 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@foxracle
foxracle / out_mongo_timezone.rb
Created August 14, 2013 11:20
use local time instead of UTC format when insert into mongoDB
require 'fluent/plugin/out_mongo'
module Fluent
class MongoTimezoneOutput < MongoOutput
Plugin.register_output('mongo_timezone', self)
# offset to UTC (in hour)
config_param :utcoffset, :integer, :default => 0
def collect_records(chunk)
"""
Copyright (c) 2009, Sean Creeley
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,