Skip to content

Instantly share code, notes, and snippets.

Phil Dinh phuongdh

Block or report user

Report or block phuongdh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4047f61b765e57908a62e814490fc27e
- Generate hyrax app: rails _5.1.6_ new vc19 -m https://raw.githubusercontent.com/samvera/hyrax/v2.5.0/template.rb
- Generate admin set: rake hyrax:default_admin_set:create hyrax:workflow:load
- Generate Work type: rails generate hyrax:work Video
- Add gems:
printf "\ngem 'hyrax-active_encode'" >> Gemfile
printf "\ngem 'aws-sdk'" >> Gemfile
- bundle install
- Run hyrax-active_encode generator: rails g hyrax:active_encode:install
View cv.yaml
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
@phuongdh
phuongdh / gist:6640407
Created Sep 20, 2013
Pawpaw upgrade script
View gist:6640407
cap deploy matterhorn HOSTS=pawpaw.dlib.indiana.edu production SCM_BRANCH=release/2.0.0
View gist:5912148
[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"]
View gist:5861294
mo = MediaObject.new
co = Collection.new
mo.collection = co
View gist:5853112
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
View avalon_pilot_auth
#!/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}`
@phuongdh
phuongdh / gist:5592515
Created May 16, 2013
MediaElement evaluation
View gist:5592515
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 / gist:5496958
Created May 1, 2013
avalon-engage modifieds
View gist:5496958
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
View gist:5482389
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'
You can’t perform that action at this time.