Skip to content

Instantly share code, notes, and snippets.

View raytiley's full-sized avatar

Ray Tiley raytiley

View GitHub Profile
@raytiley
raytiley / RDAProxy.js
Created April 20, 2012 20:05
A simple Carousel RDA Proxy that can turn tags on and off
var http = require('http');
var net = require('net');
var url = require('url');
//Config Settings
var HOST = 'demo.trms.com';
var PORT = 56906;
var USERNAME = 'Admin';
var PASSWORD = 'demotrms';
@raytiley
raytiley / gist:2037893
Created March 14, 2012 17:02
Hashing first 100MB of a file
//Grab a SHA1 of the first 100MB file
LogToolbox.TraceMessage(string.Format("{0}: Generating SHA1: {1}", m_Parent.CMName, file.Key));
using (HashAlgorithm sha = new SHA1CryptoServiceProvider())
{
FileStream fs = null;
try
{
int bytesToSHA = 1024 * 1024 * 100; //100MB
byte[] first100MB = new byte[bytesToSHA];
fs = new FileStream(file.Key, FileMode.Open, FileAccess.Read);
@raytiley
raytiley / vod-table.php
Created January 11, 2012 21:20
A simple php script for printing a html table of links to On Demand Programming from Cablecast Servers
<?php
/*
This script prints an html table of all shows that are availalbe for VOD on the server
The shows must have valid event dates that are in the past
*/
//SETUP
date_default_timezone_set('America/New_York'); //Probably doesn't really matter. A few hours shouldn't make a difference
$serverAddress = "http://pittsfieldtv.dyndns.org/"; //This will be where you can publically log onto front door. Rembember to leave off trailing slash
$channelID = 1; //One will work for most stations unless you've deleted channels in the past
//END SETUP
@raytiley
raytiley / transcodeMP4.php
Created February 11, 2011 16:38
Transcodes files in a directory to mp4 using handbrakeCLI.
<?php
//Setup Content drives and Destination path
$contentPaths = array("/Volumes/VS400/", "/Volumes/SXServer/", "/Volumes/SXSafe/");
$destinationPath = "/Volumes/VODContent/mp4/";
$transcodeCommand = "HandBrakeCLI --preset \"iPhone & iPod Touch\" --width 320 --vb 500 --two-pass --turbo --optimize ";
//pid class used to determine if script is already running.
class pid {
@raytiley
raytiley / upnext.php
Created November 12, 2010 02:58
Upnext revamped
<?php
//Configure Script
$displayUpcomingNum = 4; // Changes number of upcoming shows to display
$server = "http://frontdoor.ctn5.org/"; //include trailing backslash
$channelID = 1; //Cablecast Channel ID
date_default_timezone_set("America/New_York");
//End Configure
$server = $server."CablecastWS/CablecastWS.asmx?WSDL"; //Generates Link to WSDL file.
@raytiley
raytiley / nowplaying.php
Created November 12, 2010 02:11
nowPlaying.php Revambed
<?php
//Configure Script
$server = "http://frontdoor.ctn5.org/"; //include trailing backslash
$channelID = 1; //Cablecast Channel ID
$defualtSource = "Community Bulletin Board";
date_default_timezone_set("America/New_York");
//End Configure
$view = new view;
$view->name = 'Schedule';
$view->description = 'Schedule';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
<?php
//Setup Content drives and Destination path
$contentPaths = array("/Volumes/VS400/", "/Volumes/SXServer/", "/Volumes/SXSafe/");
$destinationPath = "/Volumes/VODContent/mp4/";
$transcodeCommand = "HandBrakeCLI --preset \"iPhone & iPod Touch\" --width 320 --vb 500 --two-pass --turbo --optimize ";
//Define some functions to do various tasks
function dirList ($directory)
<?php
$cablecast_client = new SoapClient("http://demo.trms.com/CablecastWS/CablecastWS.asmx?WSDL");
$showInfo = $cablecast_client->GetShowInformation(array("ShowID" => 21978));
$showInfo = $showInfo->GetShowInformationResult;
$params = array("ShowID" => $showInfo->ShowID,
"LocalID" => $showInfo->LocalID,
"Title" => $showInfo->InternalTitle,
"CGTitle" => $showInfo->Title,
"ProjectID" => 18,
<?php
function updateProjectIDforShow($show_id, $project_id) {
if($cablecast_client = $this->get_cablecast_client()) {
$showInfo = $cablecast_client->GetShowInformation($show_id);
$showInfo = $showInfo->GetShowInformationResult;
$params = array("ShowID" => $showInfo->ShowID,
"LocalID" => $showInfo->LocalID,
"Title" => $showInfo->InternalTitle,
"CGTitle" => $showInfo->Title,