Skip to content

Instantly share code, notes, and snippets.

@phuongdh
phuongdh / avalon.rb
Created April 18, 2013 14:50
Run whenever after bundle install
require 'whenever/capistrano/recipes'
after 'bundle:install', 'whenever:update_crontab'
after 'deploy:rollback', 'whenever:update_crontab'
cap --dry-run HOSTS=pawpaw.dlib.indiana.edu matterhorn deploy
triggering load callbacks
* executing `avalon'
* executing `matterhorn'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
@phuongdh
phuongdh / gist:5496958
Created May 1, 2013 17:58
avalon-engage modifieds
public/video_player.htm
public/engage/Videodisplay.swf
public/engage/ui/js/player/init-watch.js
public/engage/ui/js/player/player-multi-hybrid-flash.js
public/engage/ui/js/player/player-multi-hybrid-initialize.js
public/engage/ui/js/player/player-multi-hybrid-scubber.js
public/engage/ui/js/player/player-multi-hybrid.js
public/engage/ui/js/player/watch.js
public/engage/ui/js/bridge/Videodisplay.js
public/engage/ui/js/engage_plugins/segments.js
@phuongdh
phuongdh / gist:5592515
Created May 16, 2013 15:21
MediaElement evaluation
Pros:
+ Good JS code seperation of concerns
+ Clean plugin architecture
+ Good interface / CSS theming
+ Larger & active community
+ ~10 pull requests being merged per month
Cons:
- Naive Flash code
- Fullscreen Flash player's controls don't work well: slider not working, volume not adjustable (only on/off)
@phuongdh
phuongdh / avalon_pilot_auth
Created June 4, 2013 21:10
avalon_pilot.conf
#!/bin/bash
while read uri; do
saveIFS=$IFS
IFS='=&'
parm=($uri)
IFS=$saveIFS
raw=`curl -s "http://palm.dlib.indiana.edu/authorize.txt?token=${parm[1]}"`
resp="${raw//[[:space:]]/}"
valid=`echo ${parm[1]} | grep ^${resp}`
Hi,
Michael Klein will probably give you a more throughout answer when he gets back from vacation. But you can read up on this page: https://wiki.dlib.indiana.edu/pages/viewpage.action?pageId=513774863
Token is generated here: https://github.com/avalonmediasystem/avalon/blob/master/app/models/stream_token.rb
Basically the streaming server's app grabs the token from the streaming URL and asks Avalon's StreamAuth if this token is valid.
-Phuong
mo = MediaObject.new
co = Collection.new
mo.collection = co
[8] pry(main)> mo = MediaObject.new
=> #<MediaObject pid:"", avalon_uploader:nil, avalon_publisher:nil, title:nil, alternative_title:[], translated_title:[], uniform_title:[], statement_of_responsibility:nil, creator:[], date_created:nil, date_issued:nil, copyright_date:nil, abstract:nil, note:[], format:nil, contributor:[], publisher:[], genre:[], subject:[], related_item:[], geographic_subject:[], temporal_subject:[], topical_subject:[], duration:nil, section_pid:[]>
[9] pry(main)> mo.DC.creator = "Adam"
=> "Adam"
[10] pry(main)> mo.DC.creator
=> ["Adam"]
@phuongdh
phuongdh / gist:6640407
Created September 20, 2013 16:46
Pawpaw upgrade script
cap deploy matterhorn HOSTS=pawpaw.dlib.indiana.edu production SCM_BRANCH=release/2.0.0
@phuongdh
phuongdh / cv.yaml
Created September 6, 2018 03:38
Conda for CV
name: base
channels:
- conda-forge
- defaults
dependencies:
- backports=1.0=py_2
- backports.functools_lru_cache=1.5=py_1
- backports_abc=0.5=py_1
- blas=1.1=openblas
- bzip2=1.0.6=h470a237_2