Skip to content

Instantly share code, notes, and snippets.

Avatar

Phil Dinh phuongdh

View GitHub Profile
View gist:4273769
A = [ ...
100 4.92630004882812500E-002/190 4.96048927307128906E-002
200 0.49138092994689941/327 0.49293804168701172
300 1.7685108184814453/498 1.7717289924621582
400 4.4745218753814697/685 4.4804339408874512
500 8.7446169853210449/836 8.7561042308807373
600 16.105212211608887/997 16.120862007141113
700 28.720081806182861/1101 28.742238998413086
800 50.931740999221802/1586 50.967889070510864
900 61.240034818649292/1524 61.279205322265625
View Mathlab
A = [ ...
100 190
200 327
300 498
400 685
500 836
600 997
700 1101
800 1586
900 1524
View gist:4274107
A = [ ...
100^2 100*3.19766998291015625E-002/4.96048927307128906E-002
200^2 100*0.33522772789001465/0.49293804168701172
300^2 100*1.1971025466918945/1.7717289924621582
400^2 100*2.9364573955535889/4.4804339408874512
500^2 100*5.6204292774200439/8.7561042308807373
600^2 100*10.630518913269043/16.120862007141113
700^2 100*19.235197305679321/28.742238998413086
800^2 100*32.594357967376709/50.967889070510864
900^2 100*39.031611204147339/61.279205322265625
View gist:4723794
Listening for transport dt_socket at address: 8000
10:47:13 INFO (RestPublisher:231) - Registered REST endpoint at /org
10:47:13 INFO (RestPublisher:231) - Registered REST endpoint at /capture-admin
10:47:13 INFO (RestPublisher:231) - Registered REST endpoint at /mediapackage
10:47:13 INFO (OrganizationDatabaseImpl:64) - Activating persistence manager for kernel
10:47:15 INFO (OrganizationDirectoryServiceImpl:230) - Updating organization 'mh_default_org'
10:47:15 WARN (OrganizationFilter:107) - No organization is mapped to handle http://localhost:8080/login.html
10:47:15 INFO (SmtpService:124) - Mail transport protocol is 'smtp'
10:47:15 INFO (SmtpService:195) - Mail service configured with localhost
10:47:15 INFO (SmtpService:199) - mail.smtp.port: 25
@phuongdh
phuongdh / console.rb
Last active Dec 14, 2015
Screwy SimpleDatastream
View console.rb
[56] pry(main)> mo = MediaObject.find("hydrant:175")
=> #<MediaObject:3344532618636883548 @pid="hydrant:175" >
[57] pry(main)> mo.section_pid
=> ["hydrant:176"]
[58] pry(main)> mo.section_pid = []
=> []
[59] pry(main)> mo.section_pid
=> ["hydrant:176"]
[60] pry(main)> mo.section_pid = []
=> []
View Gemfile.lock
GIT
remote: git://github.com/variations-on-video/avalon-engage.git
revision: e4d9250a043fdf3a72e9a8649bd8a7829976a7e0
specs:
avalon-engage (0.0.1)
less-rails (~> 2.2.3)
View gist:5135771
<job xmlns="http://job.opencastproject.org" version="4" status="FINISHED" type="org.opencastproject.distribution.streaming" id="1014" dispatchable="true">
<args>
<arg>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><mediapackage start="2013-03-11T14:58:00Z" id="8a16fa55-d80c-4346-9fd8-4e113241bad7" duration="6314" xmlns="http://mediapackage.opencastproject.org"><title>avalon:131</title><media><track type="presenter/source" id="453bab78-58b3-42fb-bf25-9ffb3bfb34b4"><mimetype>video/mp4</mimetype><tags><tag>archive</tag></tags><url>http://localhost:8080/episode/archive/mediapackage/8a16fa55-d80c-4346-9fd8-4e113241bad7/453bab78-58b3-42fb-bf25-9ffb3bfb34b4/0/track.mp4</url><checksum type="md5">7ae24368ccb7a6c6422a14ff73f33c9a</checksum><duration>6314</duration><audio id="audio-1"><device/><encoder type="AAC"/><channels>2</channels><bitrate>171030.0</bitrate></audio><video id="video-1"><device/><encoder type="AVC"/><bitrate>74477.0</bitrate><framerate>23.719</framerate><resolution>200x110</resolution><scant
@phuongdh
phuongdh / gist:5293100
Created Apr 2, 2013
Encoding profiles 04/02/2013
View gist:5293100
profile.mp4-low.http.name = low quality video
profile.mp4-low.http.input = visual
profile.mp4-low.http.output = visual
profile.mp4-low.http.suffix = -low.mp4
profile.mp4-low.http.mimetype = video/mp4
profile.mp4-low.http.ffmpeg.command = -i #{in.video.path} -vf yadif=0:-1:1,scale=trunc(oh*a/2)*2:360 -vcodec libx264 -preset fast -b 1M -maxrate 1M -bufsize 2M -refs 5 -me_method umh -bf 0 -subq 8 -threads 0 -r 30 -force_key_frames expr:gte(t,n_forced/2) -pix_fmt yuv420p -acodec libfaac -ab 96k -ar 32000 #{out.dir}/#{out.name}#{out.suffix}
profile.mp4-medium.http.name = Medium Quality Video
profile.mp4-medium.http.input = visual
profile.mp4-medium.http.output = visual
View cap log
triggering load callbacks
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
* executing "ls -x /var/www/avalon/releases"
servers: ["lancelot.dlib.indiana.edu"]
View deploy.rb
task :update_code do
run "cd #{current_release}; #{sudo :as => 'avalon'} git checkout Gemfile.lock; #{sudo :as => 'avalon'} git checkout config/role_map_development.yml; #{sudo :as => 'avalon'} git pull origin #{branch}"
end
task :migrate do
run "cd #{current_release}; #{sudo :as => 'avalon'} -i bundle exec rake RAILS_ENV=development db:migrate"
end