Skip to content

Instantly share code, notes, and snippets.

@tsykoduk
tsykoduk / gist:a8430235b6ccde7a1b805ca61c836487
Created September 9, 2019 21:57 — forked from beanieboi/gist:ad526faf063181f336a2
Codeship Nginx Config for Heroku
daemon off;
# Heroku dynos have at least 4 cores.
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>;
events {
use epoll;
accept_mutex on;
worker_connections 1024;
}
@tsykoduk
tsykoduk / Play_job.md
Created April 18, 2012 19:15 — forked from lstoll/Play_job.md
Scheudling jobs on heroku with the play framework.

Jobs with the Play! Framework and Heroku

First thing, create a job that runs your task. Don't set a timer or anything on it, we will trigger it manually.

You will need to add two things to your app. First is an endpoint that uses authorization (for your security) to trigger the job in the background. Something like this will do it:

public class JobEndpoint extends Controller{ 
    public static void runTheJob(){ 
        if( "jobuser".equals(request.username) && "jobpass".equals(request.password) ){ 

new WhateverYourJobClassIs().now();

#!/usr/bin/env bash
## Bash Script to setup a number of boxen
## Pass this script a series of machine names, and watch it go to work
## Email is who gets the report, access_type is the command used to access the remote boxes - usally ssh.
# if you are using telnet, you are doing it wrong
#Lovingly stolen from @tsykoduk, and then hacked to crap
Let's make a list of Sinatra-based apps!
Apps:
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com"
- http://github.com/rtomayko/wink "minimalist blogging engine"
- http://github.com/foca/integrity "The easy and fun Continuous Integration server"
- http://github.com/sr/git-wiki "git-powered wiki"
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits."
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>."
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!"
# If cached file exists, serve it and stop processing
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [L]
# other redirection (imgs, js, css, ...)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.*/mephisto/.*
RewriteCond %{REQUEST_URI} !.*html
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1 -f