Skip to content

Instantly share code, notes, and snippets.

@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();

@tsykoduk
tsykoduk / wp-config-snippet.php
Created April 9, 2012 23:00
Portion of a wp-config.php for heroku
<?php
...
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', $_ENV["XEROUND_DATABASE_NAME"]);
/** MySQL database username */
define('DB_USER', $_ENV["XEROUND_DATABASE_USERNAME"]);
/** MySQL database password */
@tsykoduk
tsykoduk / apache_log_url_getter.sh
Created December 13, 2011 22:08
pull GET urls out of an apache log file
#!/usr/bin/env bash
# Use this script to pull just the POST URLs out of an apache log file
# Useful to replay traffic against test servers
cat $1 | tr -d - | cut -d\" -f2 | sed 's/GET //' | sed 's/ HTTP\/1.1//' | grep -v "POST" | grep -v '^$' >list.txt
#!/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
[app;tomcats]
update no
contacts no
tomcat_jvm.update no
tomcat_jvm.graph_category Tomcat
tomcat_jvm.graph_title Tomcat JVM
tomcat_jvm.stack \
app;server0:tomcat_jvm.tomcat_jvm \
app;server1:tomcat_jvm.tomcat_jvm \
app;server2:tomcat_jvm.tomcat_jvm \
@tsykoduk
tsykoduk / gist:897781
Created April 1, 2011 05:17
Growl mail replacement
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
set maxlen to 200
set the notificationList to {"new Mail"}
tell application "GrowlHelperApp"
register as application ¬
"myGrowlMail" all notifications notificationList ¬
default notifications notificationList ¬
icon of application "Mail"
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# Modified slightly by Greg AT Nokes DOT Name
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]
<?xml version="1.0" standalone='no'?>
<!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
#!/usr/bin/env bash
#
# Supported Operating Systems:
#
# - Arch Linux
# - RedHat Based (CentOS, ...)
# - Debian Based (Ubuntu, ...)
#
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!"