Get the JAR files from github
wget https://github.com/downloads/dtolabs/rundeck/rundeck-launcher-1.1.0.jar --no-check-certificate
Install Java
sudo apt-get install openjdk-6-jre
module AfterCommit | |
def self.included(base) | |
base.class_eval do | |
[:save, :save!].each do |method| | |
alias_method_chain method, :after_commit | |
end | |
end | |
base.define_callbacks :after_commit, :after_commit_on_create | |
end | |
################################## | |
# MIT LICENSE | |
# Copyright (C) 2012 Luke Bayes | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
# Allows Tasks that have no servers to be skipped instead of raising a NoMatchingServersError | |
module Capistrano | |
class Configuration | |
module Connections | |
def execute_on_servers(options={}) | |
raise ArgumentError, "expected a block" unless block_given? | |
if task = current_task | |
servers = find_servers_for_task(task, options) |
# Author:: Adam Jacob <adam@opscode.com> | |
# Author:: Joshua Timberman <joshua@opscode.com> | |
# | |
# Copyright 2009-2010, Opscode, Inc | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
# ACK: | |
# modified from | |
# http://gist.github.com/264496 by github.com/eric | |
# http://gist.github.com/465293 by github.com/alexyoung | |
# USAGE: | |
# 1) > ruby -rrequire_tracking -e "require 'active_support'" | |
# 2) put in config/preinitializer.rb | |
# WHAT: Provides a simple overview of memory allocation occuring |
# This allows you to represents a JavaScript function with a proc. When converted to JSON, it will | |
# automatically wrap the method body with "function(){" and "}" and list as many arguments as you | |
# had listed in your proc, automatically giving them the names a, b, c, etc. | |
# | |
# This is convenient when you want to create a Ruby hash representating options to be passed to | |
# a JavaScript method, which you plan to call to_json on when you actually output the method call | |
# to the web page. If you tried to represent your JavaScript function with a string value in the | |
# hash, then when you called to_json on the hash, it would in turn call String#to_json, which | |
# returns an escaped copy of the string surrounded by quotes. | |
# |
class SampleJob | |
def perform | |
begin | |
# do all your work in the begin block. | |
puts "hello world" | |
rescue Exception => e | |
# rescue any errors so that you know something went wrong. Email yourself the error if you need. | |
error_msg = "#{Time.now} ERROR (SampleJob#perform): #{e.message} - (#{e.class})\n#{(e.backtrace or []).join("\n")}" | |
puts error_msg | |
ensure |
<div id="user_nav"> | |
<% if user_signed_in? %> | |
<img src="<%= user_avatar %>" id="main_avatar"> Signed in as <%= current_user.email %>.<br /> | |
Not you? | |
<% if session[:fb_token].nil? %> | |
<%= link_to "Sign out", destroy_user_session_path %> | |
<% else %> | |
<%= link_to "Sign out", facebook_logout_path %> | |
<% end %> |
class Admin::DelayedJobsController < AdminController | |
# GET /admin/delayed_jobs | |
def index | |
@delayed_jobs = Delayed::Backend::Mongoid::Job.desc(:created_at) | |
.paginate :page => params[:page], :per_page => 20 | |
end | |
end |