Skip to content

Instantly share code, notes, and snippets.

View jarvys's full-sized avatar

Jarvis Young jarvys

View GitHub Profile
@jarvys
jarvys / run-multiple-redis-instances.md
Last active September 27, 2022 13:02
run multiple redis instances on the same server for centos
  • create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
  • edit /etc/redis-xxx.conf, illustrated as below
...
@jarvys
jarvys / loggers.py
Last active March 8, 2016 09:55
logging configuration for django
import os
LOGS_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'logs')
LOGGING = {
'version': 1,
'dusable_existing_loggers': True,
'formatters': {
'normal': {
'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
@jarvys
jarvys / list-all-crontab.sh
Created September 23, 2015 02:45
list all crontabs
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@jarvys
jarvys / Makefile
Last active September 21, 2015 09:08
my makefile for django project
host:=0.0.0.0
port:=8000
activate_venv=source venv/bin/activate
debug:
./manage.py runserver $(host):$(port)
start-uwsgi:
$(activate_venv) \
&& uwsgi --socket 127.0.0.1:$(port) \
/**
* Base constructor for all React elements. This is only used to make this
* work with a dynamic instanceof check. Nothing should live on this prototype.
*
* @param {*} type
* @param {string|object} ref
* @param {*} key
* @param {*} props
* @internal
*/
@jarvys
jarvys / server-checklist.md
Created June 26, 2015 06:25
服务器搭建 checklist
  • 安装sysstat(sar)
@jarvys
jarvys / wiki.md
Created June 10, 2015 12:00
厘米脚印开发wiki
  • test
    • test1
  • test2
@jarvys
jarvys / get_connections.sh
Created December 11, 2014 09:56
get tcp connections
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@jarvys
jarvys / nginx.conf
Created December 7, 2014 00:47
template nginx config file for node web app
server {
listen 80;
server_name smile.limijiaoyin.com;
access_log /var/log/nginx/smile.access.log;
error_log /var/log/nginx/smile.error.log;
client_max_body_size 200m;
keepalive_timeout 9000;
gzip on;