running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
# Utility for https://talysto.com/tech/groovestack applications | |
# Will export your current DB to a single JSON file that can be consumed directly | |
# by React-admin Fakerest adapter | |
# lib/tasks/db_export.rake | |
namespace :db do | |
desc 'Export all tables to a single JSON file, database-agnostic' | |
task export: :environment do | |
require 'json' | |
# Define an array of tables to exclude |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 |
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
// Bufferered channel. Remove the 50 to see how an unbuffered channel behaves differently |
require 'mechanize' | |
a = Mechanize.new | |
body = a.post('http://localhost:9200/sbir_dom/Firm/_search?search_type=scan&scroll=1m', { | |
"query": { | |
"query_string": { "query": "name:z*" } | |
}, | |
"_source": false, "fields": ["_id"], "size": 10 | |
}.to_json).body |
# Only run in server process, not console or rake tasks | |
if !Rails.const_defined?('Console') && !($0 =~ /rake$/) && !Rails.env.test? | |
Rails.application.config.after_initialize do | |
(1..2).each do |thread_id| | |
Thread.new { | |
Thread.current[:thread_name] = "DJ Web Worker Thread #{thread_id}" | |
ActiveRecord::Base.connection_pool.with_connection do |conn| | |
dj = Delayed::Worker.new | |
Rails.logger.warn "Starting #{Thread.current[:thread_name]}" |
apps = `heroku apps`.split("\n\n")[0].lines[1..-1].collect{|l| l.strip } | |
printf("%-20s %4s %4s\n", 'APP', 'WEB', 'BG') | |
apps.each{|a| | |
astats = `heroku ps -a #{a}` | |
info = `heroku apps:info -a #{a}` | |
access = `heroku access -a #{a}` | |
stack = info.scan(/Stack:\s+(.*)/).first.last rescue 'NA' | |
web, workers = (astats.match(/web\.\d/).size rescue 0), (astats.match(/worker\.\d/).size rescue 0) | |
printf("%-20s %4s %4s %20s\t#{access}\n", a, web, workers, stack) | |
} |
cd ~ | |
sudo yum update | |
sudo yum install java-1.7.0-openjdk.i686 unzip wget -y | |
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.zip -O elasticsearch.zip | |
export ES_HOME=/opt/elasticsearch | |
sudo unzip elasticsearch.zip -d $ES_HOME | |
rm elasticsearch.zip |
# Crosstab module for ruby. This class allows you to iterate through an | |
# array of models (rows) and refactor the data to a crosstab format. | |
# This takes one of the columns and makes it your row-key, another column | |
# and makes it column-keys, then sums all cell values where these two | |
# keys interesect. | |
# | |
# Currently only a single column can be used for row-keys and column-keys | |
# but this may be expanded in the future with the addition of 'row grouping' | |