Skip to content

Instantly share code, notes, and snippets.

View ideaoforder's full-sized avatar

Mark Dickson ideaoforder

  • Sitesteaders Developement
View GitHub Profile
def YOUR VIDEO MODEL
STUFF
def zencode!
# only zencode if it's not waiting to be uploaded
if self.video.queued_for_write.empty?
result = YOUR ZENCODER JOB
if result['errors']
self.zencoder_status = "Error: #{result['errors']}"
ffmpeg -i fifty-fifty_short.mp4 -b 5000k -acodec wmav2 -vcodec wmv2 -ar 44100 -ab 56000 -ac 2 -y fifty-fifty_short.wmv
// When animation starts
ExternalInterface.call('js_get_flash_val', [animationName], 'start');
// When animation finishes
ExternalInterface.call('js_get_flash_val', [animationName], 'finish');
// NOTE: We have to replace the 'releases/xxxx' folder with 'current'
define('FCPATH', preg_replace('/releases\/\d*\//', 'current/', __FILE__));
namespace :deploy do
task :start do
restart_monit
sudo "monit -g #{application} start all"
START WEB SERVER (mongrels, thins, litespeed, whatever)
end
task :stop do
restart_monit
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.
#!/bin/sh -e
# workling This init.d script is used to start workling.
# It basically just calls workling.
. /lib/lsb/init-functions
ROOT="YOUR_WEB_APP"
PID=$ROOT"log/workling$2.pid"
WORKLING=$ROOT"script/workling_client"
START_COMMAND=$WORKLING" start"
#!/bin/sh -e
# starling This init.d script is used to start starling.
# It basically just calls starling.
ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
set -e
if [ -x /usr/bin/starling ] ; then
HAVE_STARLING=1
else
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: workling
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop worklings
### END INIT INFO
#
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: starling
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop starling server
### END INIT INFO
#