Skip to content

Instantly share code, notes, and snippets.

# Where to chdir at start.
CELERYBEAT_CHDIR="$CELERYD_CHDIR"
CELERYBEAT="$ENV_PYTHON $CELERYD_CHDIR/manage.py celerybeat"
#
# # Extra arguments to celerybeat
CELERYBEAT_OPTS="--schedule=/home/www/.virtualenvs/insight_env/core/run/celerybeat-schedule"
#
CELERYBEAT_LOG_FILE="/mnt/log/celery/celerybeat.log"
CELERYBEAT_PID_FILE="/var/run/celery/celerybeat.pid"
# Start w?? first (general workers) and b?? (beat workers) last
# CELERYD_NODES="w01 w02 w03 w04 w05 w06 w07 w08 w09 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 w31 w31 w32 w33 w34 w35 w36 w37 w39 w40 w41 w42 w43 w44 w45 w46 w47 w48 w49 w50 b01 b02 b03 b04 b05 b06 b07 b08 b09 b10 b11 b12 b13 b14 b15 b16 b17 b18 b19 b20"
CELERYD_NODES="w01 w02 b01 b02 b03 b04 b05 b06 b07 b08 b09 b10 b11 b12 b13 b14 b15 b16"
# Where to chdir at start. (CATMAID Django project dir.)
CELERYD_CHDIR="/home/www/.virtualenvs/insight_env/core"
# Python interpreter from environment. (in CATMAID Django dir)
ENV_PYTHON="/home/www/.virtualenvs/insight_env/bin/python"
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@daleobrien
daleobrien / gist:e20162cd70ec79e1b400
Created November 20, 2015 01:09
Simple way to see if a number is an int
if isinstance(o, decimal.Decimal):
if o % 1 > 0:
return float(o)
else:
return int(o)
@daleobrien
daleobrien / ga_yearweek_to_date.py
Last active August 12, 2016 20:00
Convert Google Analytic ga:yearweek to a date using python.
def ga_yearWeek_to_date(yearweek):
'''
Convert from Google Analytic ga:yearweek to a date at the start of
the time period.
e.g.:
>> ga_yearWeek_to_date('201353')
>> 2013-12-29
'''
year, week = int(yearweek[:4]), int(yearweek[4:])
config:
FunctionName: lambda-python
Handler: index.handler
Runtime: nodejs
Description: Python hello world from Lambda
install: make

Keybase proof

I hereby claim:

  • I am daleobrien on github.
  • I am whale (https://keybase.io/whale) on keybase.
  • I have a public key whose fingerprint is D2D8 D041 9FDF 08D3 5E6B F27A 776C 8A43 BA91 ACBB

To claim this, I am signing this object:

@daleobrien
daleobrien / s3put
Last active August 29, 2015 14:05 — forked from rubiojr/s3put
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import boto
import config
import gevent
import gevent.pool
import os
@daleobrien
daleobrien / rabbitmq-server
Last active August 29, 2015 14:04 — forked from krmcbride/rabbitmq-server
rabbitmq-server init.d start script.
#!/bin/sh
#
# rabbitmq-server RabbitMQ broker
#
# chkconfig: - 80 05
# description: Enable AMQP service provided by RabbitMQ
#
### BEGIN INIT INFO
# Provides: rabbitmq-server
@daleobrien
daleobrien / gist:893ab19136eb54d87e61
Created July 24, 2014 00:06
Install for fail2ban
sudo yum -y install fail2ban
sudo chkconfig --add fail2ban
sudo service fail2ban start