Skip to content

Instantly share code, notes, and snippets.

View ninetwentyfour's full-sized avatar

Travis Berry ninetwentyfour

View GitHub Profile
@ninetwentyfour
ninetwentyfour / example1.php
Last active June 5, 2022 08:40
Use PHP To Zip Folders For Download - blogpost
<?php
// WARNING
// This code should NOT be used as is. It is vulnerable to path traversal. https://www.owasp.org/index.php/Path_Traversal
// You should sanitize $_GET['directtozip']
// For tips to get started see http://stackoverflow.com/questions/4205141/preventing-directory-traversal-in-php-but-allowing-paths
//Get the directory to zip
$filename_no_ext= $_GET['directtozip'];
// we deliver a zip file
@ninetwentyfour
ninetwentyfour / example1.php
Created August 28, 2011 19:02
Upload Videos To MediaSilo With PHP/FTP - blogpost
<?php
//MediaSilo Information
$server = "upload.mediasilo.com";
$ftp_user_name = "YOUR MEDIASILO LOGIN NAME AND HOSTNAME(e.g NAMEHOSTNAME";
$ftp_user_pass = "YOUR MEDIASILO LOGIN PASSWORD";
$dest = "THE WORKSPACE YOU WANT TO UPLOAD TO";
//Video Folder Information
$source_folder = "FULL PATH TO FOLDER. NO TRAILING SLASH (e.g. /var/www/videofolder)";
//Grabs everything in the source folder. You may want to set a file type like, ($source_folder."/*.flv")
@ninetwentyfour
ninetwentyfour / example1.php
Created August 28, 2011 18:59
Upload A Video To Ooyala With PHP - blogpost
<?php
/**
*Publish video to ooyala
*/
function publish(){// this kicks off the massive publish functions
$labels = $_POST['label'];
$file = $_POST['video_file'];
$dir = $file;
$name = explode("/", $dir );
$name = array_reverse($name );//this get just the name of the file and not
@ninetwentyfour
ninetwentyfour / example1.xml
Created August 28, 2011 18:47
Reasons And Tips For Automated Motion Workflow - blogpost
<styleRun style="10178" offset="0" length="1"/>
<text>Website</text>
@ninetwentyfour
ninetwentyfour / example1.php
Created August 28, 2011 18:39
Create A Ghetto, But Functional, Search Function For CakePHP - blogpost
<div id="search">
<form id="orderform" action="<?php echo $html->url('/users/search'); ?>" method="post" enctype="multipart/form-data">
<label for="searchuser">Search Users:</label><input type="text" name="searchuser" />
Search By:
<input type="radio" name="searchtype" value="User.id" checked> User ID
<input type="radio" name="searchtype" value="User.email" checked> User Email
<input type="radio" name="searchtype" value="Entity.name"> Entity Name
<?php
echo $form->end('Search');
?>
@ninetwentyfour
ninetwentyfour / example20.txt
Created August 28, 2011 18:12
How To Setup A LAMP Virtual Machine 3 - blogpost
gksudo gedit hosts
@ninetwentyfour
ninetwentyfour / example11.txt
Created August 28, 2011 18:10
How To Setup A LAMP Virtual Machine 2 - blogpost
gksudo gedit /etc/php5/apache2/php.ini
@ninetwentyfour
ninetwentyfour / example1.txt
Created August 28, 2011 18:06
How To Setup A LAMP Virtual Machine 1 - blogpost
sudo apt-get install apache2
@ninetwentyfour
ninetwentyfour / example1.txt
Created August 28, 2011 17:45
Best Ogg Theora Video Compressor - blogpost
ffmpeg -i Elephants_Dream.mov -vcodec libtheora -b 700k -s 512x288 -acodec libvorbis -ab 96k -threads 6 test.ogg
@ninetwentyfour
ninetwentyfour / example1.txt
Created August 28, 2011 17:21
Video Compression Show Down
ffmpeg -i sourcemovie.mov -vcodec libx264 -vpre hq -b 400k -g 250 -keyint_min 24 -bf 16 -coder 1 -refs 6 -flags +loop -deblockalpha -6 -deblockbeta -6 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -flags2 +dct8x8+mixed_refs+wpred+bpyramid -me_method umh -subq 8 -s 640x360 -acodec libfaac -ar 44100 -ab 96k -threads 6 -f mp4 outputmovie.mp4