Episode 1x09
From Hak5
Synopsis
In this episode of Hak5 Jenn Cutter from OpenAlpha guest hosts, bringing us a PSP-Windows hack. Darren continues his quest for the ultimate vidcast-couch-potato setup with a media center remote over cell-phone. Wess puts his own spin on Dance Dance Revolution with a custom modded dance pad and Rob Fuller of mubix.com joins us to show off his USB thumbdrive toolkit. Plus an interview with the guys from Podzinger, a parody we've dubbed "the token", an intro from Sean Carruthers of Lab Rats, leet-hack interviews from Karen Johnson and Leo Laporte of TWiT shows his evil side.
VLC remote over cell phone
Requirements: VLC 0.8.x Apache 1.3.x or 2.x (or other webserver that speaks to PHP, in this example running on port 81) PHP (Tested with 5.x, should work with older versions)
Add the following files to your HTDOCS dir:
index.html
<a href="vlc.php">Start VLC</a><br /> <a href="http://YOUR IP ADDRESS OR DNS:8080/">Remote</a>
vlc.php
<?php
system("(start c:\vlc\vlc.exe h:\media --intf=http --fullscreen) >nul");
?>
vlc.php that works for jluthman --Iam8up 01:52, 9 February 2008 (EST)
<?php $cmd = '"C:\apps\VLC\vlc.exe" e:\music --intf=http --random'; exec($cmd); echo 'VLC Started<br>'; echo '<a href="/">Go Back</a>'; ?>
Open the VLC\http directory and replace index.html with this code:
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml10/DTD/xhtml10transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>VLC media player</title>
<vlc id="if" param1="url_param"/>
<meta http-equiv="refresh" content="0;URL=/" />
<vlc id="end" />
<vlc id="control" param1="stop,pause,previous,next,add,sout,play,delete,empty,seek,fullscreen,keep,volume,sort,move" />
<vlc id="set" param1="sout" param2="string" />
</head>
<body>
<form method="get" action="">
<input type="submit" name="control" value="stop" />
<input type="submit" name="control" value="pause" />
<input type="submit" name="control" value="previous" />
<input type="submit" name="control" value="next" />
<input type="submit" name="seek_value" value="-1min"/><input type="hidden" name="control" value="seek"/>
<input type="submit" name="seek_value" value="+1min"/><input type="hidden" name="control" value="seek"/>
</form><a href="/admin/?control=shutdown">X</a>
<form method="get" action="">
<table>
<vlc id="rpn" param1="0"/>
<vlc id="foreach" param1="pl" param2="playlist" />
<tr class="<vlc id="if" param1="pl.index 2 % 0 =" />ligne1<vlc id="else" />ligne2<vlc id="end" />">
<td>
<vlc id="if" param1="pl.current" />
<strong>
<vlc id="end" />
<a href="?control=play&item=<vlc id="value" param1="pl.index" />">
<vlc id="value" param1="pl.index" /> - <vlc id="value" param1="pl.uri" /><vlc id="if" param1="pl.uri value pl.name value strcmp"/> (<vlc id="value" param1="pl.name" />)<vlc id="end"/></a>
<vlc id="if" param1="pl.current" />
</strong>
<vlc id="end" />
</td>
</tr>
<vlc id="rpn" param1="1 +"/>
<vlc id="end" />
<vlc id="if" param1="0 ="/>
<tr class="ligne1">
<td>empty playlist</td>
</tr>
<vlc id="end"/>
</table>
</form>
<script language="javascript" type="text/javascript">
got_time = <vlc id="value" param1="stream_time" />;
hours = Math.floor(got_time/ 3600);
minutes = Math.floor((got_time/60) % 60);
seconds = got_time % 60;
if ( hours < 10 ) hours = "0" + hours;
if ( minutes < 10 ) minutes = "0" + minutes;
if ( seconds < 10 ) seconds = "0" + seconds;
document.getElementById('time').innerHTML = hours+":"+minutes+":"+seconds;
got_length = <vlc id="value" param1="stream_length" />;
hours = Math.floor(got_length/ 3600);
minutes = Math.floor((got_length/60) % 60);
seconds = got_length % 60;
if ( hours < 10 ) hours = "0" + hours;
if ( minutes < 10 ) minutes = "0" + minutes;
if ( seconds < 10 ) seconds = "0" + seconds;
document.getElementById('length').innerHTML = hours+":"+minutes+":"+seconds;
got_volume = <vlc id="value" param1="volume" />;
document.getElementById( 'volume').innerHTML = Math.ceil(got_volume * 100/1024) + " %";
</script>
</body>
</html>
Make the necessary changes to firewall / router configuration so that you can connect to the Apache and VLC web servers remotely. In our example Apache is running on port 81 while vlc web server runs on port 8080.


