Skip to content

Instantly share code, notes, and snippets.

View genomics-geek's full-sized avatar

Michael Gonzalez genomics-geek

View GitHub Profile
@genomics-geek
genomics-geek / README.md
Created April 15, 2017 02:46 — forked from bruth/README.md
Django command that gives a set of subcommands a namespace. For example, a command named after an app can be defined with a set of subcommands, e.g. `python manage.py command subcommand`.

Subcommander

Managment commands are assumed to be unique across all apps in a Django project. This can lead to long or obscure command names in attempt to namespace those commands.

Subcommander acts as a proxy command giving the real commands a namespace. The subcommander module can be named after the app name or some derivation. The structure looks as follows:

myapp/
    management/
        commands/
; Configuration for Airflow webserver and scheduler in Supervisor
[program:airflow]
command=/bin/airflow webserver
stopsignal=QUIT
stopasgroup=true
user=airflow
stdout_logfile=/var/log/airflow/airflow-stdout.log
stderr_logfile=/var/log/airflow/airflow-stderr.log
environment=HOME="/home/airflow",AIRFLOW_HOME="/etc/airflow",TMPDIR="/storage/airflow_tmp"
@genomics-geek
genomics-geek / cors-nginx.conf
Created February 26, 2017 23:58 — forked from alexjs/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
from django import forms
from django.contrib.auth.models import User
class UserProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ['first_name', 'last_name', 'email']
@genomics-geek
genomics-geek / jenikns_ci_on_osx.md
Created January 18, 2017 15:11 — forked from ostinelli/jenkins_ci_on_osx.md
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@genomics-geek
genomics-geek / README.md
Created February 13, 2017 02:47
Setting up a pypi package

Setting up a python package

This will include:

  1. Travis CI integration
  2. Codecov integration
  3. run tests using pytest and tox

Step 1. Cookiecutter

@genomics-geek
genomics-geek / README.md
Created January 28, 2017 18:44
SMTP with Mailgun
smtp_host = smtp.mailgun.org
smtp_starttls = False
smtp_ssl = True
smtp_user = USERNAME
smtp_port = 465
smtp_password = PASSWORD
smtp_mail_from = EMAIL
@genomics-geek
genomics-geek / gist:5c58461a4bfdb95b54d1db47e3a1f573
Created January 16, 2017 22:30 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

******************************************************************** Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor********************************************************************

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
def set_up_dag_run(context, dag_run_obj):
dag_run_obj.payload = {"config": context["config"]}
dag_run_obj.run_id = str(uuid4())
print context
return dag_run_obj
def launch_workflow_command(args):
config_location = args.config_location
analysis_id = args.analysis_id