<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nick ten Cate&#039;s Blog</title>
	<atom:link href="http://www.nicktencate.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nicktencate.com/blog</link>
	<description>Random things</description>
	<lastBuildDate>Tue, 31 Jan 2012 22:01:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Winamp 2.9 (2.X) and AAC+</title>
		<link>http://www.nicktencate.com/blog/2012/02/01/winamp-2-9-2-x-and-aac/</link>
		<comments>http://www.nicktencate.com/blog/2012/02/01/winamp-2-9-2-x-and-aac/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 22:01:14 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Transcoding]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=93</guid>
		<description><![CDATA[So SLAM!FM was bought by RTL, which means their internet stream now uses the RTL streaming server provided by IS.NL instead of TRUE.NL Enough ramblings. The internet stream now uses AAC+ which Winamp2.9x does not do out of the box. However! in_mp3.dll from Winamp 5.08 is compatible with Winamp 2.9x. Simply unzip and place the [...]]]></description>
			<content:encoded><![CDATA[<p>So SLAM!FM was bought by RTL, which means their internet stream now uses the RTL streaming server provided by IS.NL instead of TRUE.NL <img src='http://www.nicktencate.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Enough ramblings. The internet stream now uses AAC+ which Winamp2.9x does not do out of the box. However! in_mp3.dll from Winamp 5.08 is compatible with Winamp 2.9x. Simply unzip and place the file in C:\Program Files(x86)\Winamp\Plugins\ and yay, AAC+ support. Download here: <a href='http://www.nicktencate.com/blog/wp-content/uploads/2012/01/in_mp3.zip'>in_mp3.zip</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2012/02/01/winamp-2-9-2-x-and-aac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Math pow in Assembly</title>
		<link>http://www.nicktencate.com/blog/2011/06/10/math-pow-in-assembly/</link>
		<comments>http://www.nicktencate.com/blog/2011/06/10/math-pow-in-assembly/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 17:19:18 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[TU-Delft]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=75</guid>
		<description><![CDATA[I was programming some assembly the other day, and I noticed this specific example cannot be found anywhere! So I thought I&#8217;d post it To run&#8230; save the file as power.s, then run [bash] gcc -o power.o power.s -m32 [/bash] (-m32 only if your on a 64bit system) [bash] chmod +x power.o ./power.o [/bash] power.s [...]]]></description>
			<content:encoded><![CDATA[<p>I was programming some assembly the other day, and I noticed this specific example cannot be found anywhere! So I thought I&#8217;d post it <img src='http://www.nicktencate.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To run&#8230; save the file as power.s, then run<br />
[bash]<br />
gcc -o power.o power.s -m32<br />
[/bash]<br />
(-m32 only if your on a 64bit system)<br />
[bash]<br />
chmod +x power.o<br />
./power.o<br />
[/bash]</p>
<p>power.s<br />
[bash]<br />
# ************************************************************************<br />
# * Program name : pow                                                   *<br />
# * Description  : Assembly Power function                               *<br />
# * Author       : nicktc@gmail.com                                      *<br />
# * Date         : 2011-05-26                                            *<br />
# * License      : CC BY-NC-SA http://www.creativecommons.org            *<br />
# ************************************************************************<br />
.text</p>
<p>asknrstr:       .asciz &#8220;Please enter a natural number:&#8221;<br />
asknrstr2:      .asciz &#8220;To the power of:&#8221;<br />
printnrstr:     .asciz &#8220;%d^%d=&#8221;<br />
formatstr:      .asciz &#8220;%d&#8221; # Used in inout subroutine</p>
<p>.global main</p>
<p># ************************************************************************<br />
# * Subroutine  : main                                                   *<br />
# * Description : application entry point                                *<br />
# ************************************************************************<br />
main:   movl    %esp, %ebp      # initialize the base pointer</p>
<p>ask:<br />
        # Get number<br />
        pushl   $asknrstr       # Push ask string<br />
        call    printf          # Pop and print ask string<br />
        subl    $4,%esp         # Reserve stack space for int<br />
        leal    -4(%ebp), %eax  # Load address of stack space into %eax<br />
        pushl   %eax            # Push argument of scanf<br />
        pushl   $formatstr      # Push string<br />
        call    scanf           # Scan number</p>
<p>        pushl   $asknrstr2      # Push ask string<br />
        call    printf          # Pop and print ask string<br />
        subl    $4,%esp         # Reserve stack space for int<br />
        leal    -8(%ebp), %eax  # Load address of stack space into %eax<br />
        pushl   %eax            # Push argument of scanf<br />
        pushl   $formatstr      # Push string<br />
        call    scanf           # Scan number</p>
<p>        pushl   -8(%ebp)        # Push number<br />
        pushl   -4(%ebp)        # Push number<br />
        pushl   $printnrstr     # Push print string<br />
        call    printf          # Printf</p>
<p>        addl    $12,%esp        # Move stack pointer</p>
<p>        pushl   -8(%ebp)<br />
        pushl   -4(%ebp)<br />
        call    pow             # Call pow subroutine</p>
<p>        pushl   %eax            #<br />
        pushl   $formatstr      # Push string format<br />
        call    printf          # Print</p>
<p>end:    movl    $0,(%esp)       # push program exit code<br />
        call    exit            # exit the program</p>
<p># ************************************************************************<br />
# * Subroutine  : pow                                                    *<br />
# * Description : ask user for number and print sum                      *<br />
# ************************************************************************<br />
pow:<br />
        pushl   %ebp            # Stack base pointer<br />
        movl    %esp, %ebp      # Store stack pointer in %ebp</p>
<p>        movl    $1,%eax         # Store 1 in RESULT<br />
        movl    8(%ebp),%ebx    # Store &#8216;multiply by&#8217; in %ebx<br />
        movl    12(%ebp),%ecx   # Store COUNT in %ecx</p>
<p>pow2:<br />
        cmp     $0,%ecx<br />
        jle     pow3</p>
<p>        subl    $1,%ecx         # Substract 1 from COUNT<br />
        mul     %ebx            # Multiply %eax * %ecx (RESULT * NUMBER)</p>
<p>        cmp     $0,%ecx         # Compare COUNT to 0<br />
        jg      pow2            # COUNT > 0 = jump to pow2<br />
pow3:<br />
        movl    %ebp, %esp      # Clear local variables from stack<br />
        popl    %ebp            # Restore base pointer<br />
        ret</p>
<p>[/bash]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2011/06/10/math-pow-in-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitor Concurrent Connections from Wowza Media Server in Munin</title>
		<link>http://www.nicktencate.com/blog/2011/03/19/monitor-concurrent-connections-from-wowza-media-server-in-munin/</link>
		<comments>http://www.nicktencate.com/blog/2011/03/19/monitor-concurrent-connections-from-wowza-media-server-in-munin/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 13:04:15 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php wowza bash]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=63</guid>
		<description><![CDATA[So.. theres a professional way to do this (can be found on the Wowza Media Server forums[click]), but it requires you to bounce Wowza, which is less ideal. Heres the hack: First.. [bash] apt-get install php5-cli php5-curl [/bash] /etc/munin/wowzaget.php [php] #!/usr/bin/php getName()); $arXML['value']=trim((string)$xml); $t=array(); foreach($xml->attributes() as $name => $value) $t[$name]=trim($value); $arXML['attr']=$t; $t=array(); foreach($xml->children() as $name [...]]]></description>
			<content:encoded><![CDATA[<p>So.. theres a professional way to do this (can be found on the Wowza Media Server forums<a href="http://www.wowzamedia.com/forums/showthread.php?9822-Scripts-to-monitor-Wowza-connections-from-MRTG-and-Munin">[click]</a>), but it requires you to bounce Wowza, which is less ideal.</p>
<p>Heres the hack:</p>
<p>First..<br />
[bash]<br />
apt-get install php5-cli php5-curl<br />
[/bash]</p>
<p>/etc/munin/wowzaget.php<br />
[php]<br />
#!/usr/bin/php<br />
<?php<br />
 function xml2array($xml) {<br />
      $arXML=array();<br />
      $arXML['name']=trim($xml->getName());<br />
      $arXML['value']=trim((string)$xml);<br />
      $t=array();<br />
      foreach($xml->attributes() as $name => $value) $t[$name]=trim($value);<br />
      $arXML['attr']=$t;<br />
      $t=array();<br />
      foreach($xml->children() as $name => $xmlchild) $t[$name]=xml2array($xmlchild);<br />
      $arXML['children']=$t;<br />
      return($arXML);<br />
   }</p>
<p>function getIt($host,$user,$pass){<br />
    $ch = curl_init();<br />
    curl_setopt($ch, CURLOPT_URL, &#8220;http://&#8221;.$host.&#8221;:8086/connectioncounts&#8221;);<br />
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br />
    curl_setopt($ch, CURLOPT_USERPWD, $user.&#8221;:&#8221;.$pass);<br />
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);<br />
    $output = curl_exec($ch);<br />
    $info = curl_getinfo($ch);<br />
    curl_close($ch);</p>
<p>    $xml = simplexml_load_string ($output);<br />
    $x = xml2array($xml);<br />
    return array($x["children"]["ConnectionsTotal"]["value"],$x["children"]["ConnectionsCurrent"]["value"]);<br />
}</p>
<p>$x = getIt(&#8220;localhost&#8221;,&#8221;USERNAME&#8221;,&#8221;PASSWORD!&#8221;);</p>
<p>echo $x[0].&#8221; &#8220;.$x[1];</p>
<p>?><br />
[/php]</p>
<p>/etc/munin/plugins/munin_wowza (credit goes to <a href="http://www.wowzamedia.com/forums/member.php?7444-georgi">georgi</a><br />
[php]<br />
#!/bin/sh</p>
<p>case $1 in<br />
   config)<br />
        cat <<&#8216;EOM&#8217;<br />
graph_title Wowza connections<br />
graph_scale no<br />
graph_category wowza<br />
graph_vlabel connections<br />
total_connections.label total connections<br />
live_connections.label live connections<br />
total_connections.draw AREA<br />
live_connections.draw LINE1<br />
EOM<br />
        exit 0;;<br />
esac</p>
<p>cons=`/etc/munin/wowzaget.php`</p>
<p>tot=`echo $cons | cut -d&#8217; &#8216; -f1`<br />
live=`echo $cons | cut -d&#8217; &#8216; -f2`</p>
<p>echo -n &#8220;total_connections.value &#8221;<br />
echo $tot</p>
<p>echo -n &#8220;live_connections.value &#8221;<br />
echo $live<br />
[/php]</p>
<p>Make sure you<br />
[bash]<br />
chmod +x /etc/munin/wowzaget.php<br />
chmod +x /etc/munin/plugins/munin_wowza<br />
[/bash]</p>
<p>And replace the username/password with those found in<br />
/usr/local/WowzaMediaServer/admin.password</p>
<p>Then viola, wowza in munin.<br />
(If you look at the script, you can also use 1 server to monitor _ALL_, but you must enable your wowza control (on port 8086) to respond to external connections (which is unsafe))</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2011/03/19/monitor-concurrent-connections-from-wowza-media-server-in-munin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TI-1200 Opdracht 8</title>
		<link>http://www.nicktencate.com/blog/2010/12/03/ti-1200-opdracht-8/</link>
		<comments>http://www.nicktencate.com/blog/2010/12/03/ti-1200-opdracht-8/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 09:45:37 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[TU-Delft]]></category>
		<category><![CDATA[java TU-Delft TI1200]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=42</guid>
		<description><![CDATA[I imagine a lot of people don&#8217;t know how to do this Java exercise, so here is some code Please do NOT copy it!!! (I cannot redistribute the original assignment as this would be a breach of copyright. Please see blackboard here) Adres.java [java] // Practicum TI1200, Opdracht 8 // Auteur N.Cate, Studienummer 1342169 // [...]]]></description>
			<content:encoded><![CDATA[<p>I imagine a lot of people don&#8217;t know how to do this Java exercise, so here is some code <img src='http://www.nicktencate.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Please do NOT copy it!!!</p>
<p>(I cannot redistribute the original assignment as this would be a breach of copyright. Please see blackboard <a href="http://blackboard.tudelft.nl/webapps/portal/frameset.jsp?tab_group=courses&#038;url=/webapps/blackboard/execute/content/file%3Fcmd%3Dview%26content_id%3D_1494026_1%26course_id%3D_32256_1%26framesetWrapped%3Dtrue">here</a>)</p>
<p>Adres.java<br />
[java]<br />
//	Practicum TI1200,	Opdracht 8<br />
//	Auteur N.Cate,		Studienummer 1342169<br />
//	Datum 11-11-2010<br />
//	NetID ntencate</p>
<p>import java.util.Scanner;</p>
<p>public class Adres {</p>
<p>	//post: creert een nieuw adres, met de opgegeven waarden.</p>
<p>	private String straat;<br />
	private String huisNummer;<br />
	private String postcode;<br />
	private String plaats;</p>
<p>	/** Create a new adres<br />
	 * @param straat<br />
	 * @param huisNummer<br />
	 * @param postcode<br />
	 * @param plaats<br />
	 */<br />
	public Adres(String straat, String huisNummer, String postcode, String plaats)<br />
	{<br />
		this.straat = straat;<br />
		this.huisNummer = huisNummer;<br />
		this.postcode = postcode;<br />
		this.plaats = plaats;<br />
	}</p>
<p>	//post: retourneert een String-representatie van dit adres<br />
	public String toString()<br />
	{<br />
		return &#8220;<Adres<straat=" + this.straat + ", huisNummer=" + this.huisNummer + ", postcode=" + this.postcode + ", plaats=" + this.plaats + ">>&#8221;;<br />
	}</p>
<p>	//post: retourneert true als other hetzelfde adres is ( zelfde postcode en huisnummer) als dit.<br />
	public boolean equals(Object other)<br />
	{<br />
		if(other instanceof Adres)<br />
		{<br />
			Adres other2 = (Adres)other;</p>
<p>			if(other2.huisNummer == this.huisNummer<br />
				&#038;&#038; other2.straat == this.straat<br />
				&#038;&#038; other2.plaats == this.plaats<br />
				&#038;&#038; other2.postcode == this.postcode<br />
			)<br />
				return true;<br />
		}<br />
		return false;<br />
	}</p>
<p>	//<br />
	/** Create an address from a scanner string<br />
	 * pre: sc bevat een rij tokens die een adres voorstellen<br />
	 * post: retourneert een Adres, opgebouwd uit de waarden die sc teruggeeft<br />
	 * @param scanner text containing the address<br />
	 */<br />
	public static Adres read(Scanner scanner)<br />
	{<br />
		// scanner text ==<br />
		// Emmalaan 23<br />
		// 3051JC Rotterdam<br />
		String straat = scanner.next();<br />
		String huisNummer = scanner.next();<br />
		String postcode = scanner.next();<br />
		String plaats = scanner.next();</p>
<p>        return new Adres(straat, huisNummer, postcode, plaats);<br />
	}</p>
<p>}<br />
[/java]</p>
<p>Adres_test.java<br />
[java]<br />
//	Practicum TI1200,	Opdracht 8<br />
//	Auteur N.Cate,		Studienummer 1342169<br />
//	Datum 11-11-2010<br />
//	NetID ntencate</p>
<p>import java.io.FileNotFoundException;<br />
import java.io.FileReader;<br />
import java.util.Scanner;</p>
<p>public class Adres_test {</p>
<p>	public static void main(String [] args)<br />
	{<br />
		FileReader fileString;<br />
		Adres test;</p>
<p>		System.out.println(&#8220;test = Adres.read(sc);&#8221;);<br />
		try {<br />
			fileString = new FileReader(&#8220;src/Adres_test_text.txt&#8221;);<br />
			Scanner sc = new Scanner(fileString);</p>
<p>			 test = Adres.read(sc);</p>
<p>			System.out.println(test);<br />
		} catch (FileNotFoundException e) {<br />
			e.printStackTrace();<br />
		}</p>
<p>		System.out.println(&#8220;&#8212;&#8221;);</p>
<p>		Adres test1 = new Adres(&#8220;Lorentzplein&#8221;, &#8220;55&#8243;, &#8220;2522EE&#8221;, &#8220;Den Haag&#8221;);<br />
		Adres test2 = new Adres(&#8220;Lorentzplein&#8221;, &#8220;55&#8243;, &#8220;2522EE&#8221;, &#8220;Den Haag&#8221;);</p>
<p>		System.out.println(&#8220;test1:&#8221; + test1);<br />
		System.out.println(&#8220;test2:&#8221; + test2);<br />
		System.out.println(&#8220;test1.equals(test2):&#8221; + test1.equals(test2));</p>
<p>		System.out.println(&#8220;&#8212;&#8221;);</p>
<p>		test1 = new Adres(&#8220;Buitenhof&#8221;, &#8220;20&#8243;, &#8220;2513AG&#8221;, &#8220;Den Haag&#8221;);<br />
		System.out.println(&#8220;test1:&#8221; + test1);<br />
		System.out.println(&#8220;test2:&#8221; + test2);<br />
		System.out.println(&#8220;test1.equals(test2):&#8221; + test1.equals(test2));<br />
	}<br />
}</p>
<p>[/java]</p>
<p>Woning.java<br />
[java]<br />
//	Practicum TI1200,	Opdracht 8<br />
//	Auteur N.Cate,		Studienummer 1342169<br />
//	Datum 11-11-2010<br />
//	NetID ntencate</p>
<p>import java.util.Scanner;</p>
<p>public class Woning {<br />
	private Adres adres;<br />
	private int kamers;<br />
	private int vraagPrijs;</p>
<p>	/** Create a Woning object<br />
	 * post: creeert een Woning met de opgegeven waarden<br />
	 *<br />
	 * @param adres<br />
	 * @param kamers<br />
	 * @param vraagPrijs<br />
	 */<br />
	public Woning(Adres adres, int kamers, int vraagPrijs)<br />
	{<br />
		this.adres = adres;<br />
		this.kamers = kamers;<br />
		this.vraagPrijs = vraagPrijs;<br />
	}</p>
<p>	//post: retourneert een String-representatie van deze woning<br />
	public String toString()<br />
	{<br />
		return  &#8220;<Woning<adres=" + this.adres + ", kamers=" + this.kamers + ", vraagPrijs=" + this.vraagPrijs + ">>&#8221;;<br />
	}</p>
<p>	/** Check if the price is max<br />
	 * post: retourneert true als vraagprijs = maxprijs<br />
	 *<br />
	 * @param maxprijs<br />
	 * @return<br />
	 */<br />
	public boolean kostHooguit(int maxprijs)<br />
	{<br />
		return (this.vraagPrijs <= maxprijs);<br />
	}</p>
<p>	//post: retourneert true als other dezelfde woning is (dwz hetzelfde adres) als deze.<br />
	public boolean equals(Object other)<br />
	{<br />
		if(other instanceof Woning)<br />
		{<br />
			Woning otherWoning = (Woning) other;<br />
			if(otherWoning.kamers == this.kamers<br />
				&#038;&#038; otherWoning.vraagPrijs == this.vraagPrijs<br />
				&#038;&#038; otherWoning.adres.equals(this.adres)<br />
				)<br />
				return true;</p>
<p>		}<br />
		return false;<br />
	}</p>
<p>	/** Read Woning from file<br />
	 * pre: sc bevat een rij tokens die een woning voorstellen<br />
	 * post: retourneert een Woning, opgebouwd uit de waarden die sc teruggeeft<br />
	 *<br />
	 * @param sc Scanner text input<br />
	 * @return<br />
	 */<br />
	public static Woning read(Scanner sc)<br />
	{<br />
		/*<br />
		 * Text ==<br />
		 * Emmalaan 23<br />
		 * 3051JC Rotterdam<br />
		 * 7 kamers<br />
		 * prijs 300000<br />
		 */<br />
		Adres adres = Adres.read(sc);<br />
		int kamers = sc.nextInt();<br />
		sc.next();<br />
		sc.next();<br />
		int price = sc.nextInt();</p>
<p>		return new Woning(adres,kamers,price);<br />
	}</p>
<p>}</p>
<p>[/java]</p>
<p>Woning_test_text.txt<br />
[text]<br />
Emmalaan 23<br />
3051JC Rotterdam<br />
7 kamers<br />
prijs 300000<br />
[/text]</p>
<p>Woning_test.java<br />
[java]<br />
//	Practicum TI1200,	Opdracht 8<br />
//	Auteur N.Cate,		Studienummer 1342169<br />
//	Datum 11-11-2010<br />
//	NetID ntencate</p>
<p>import java.io.FileNotFoundException;<br />
import java.io.FileReader;<br />
import java.util.Scanner;</p>
<p>public class Woning_test {</p>
<p>	public static void main(String [] args)<br />
	{<br />
		FileReader fileString;<br />
		Woning test0;</p>
<p>		System.out.println("test0 = Woning.read(sc);");<br />
		try {<br />
			fileString = new FileReader("src/Woning_test_text.txt");<br />
			Scanner sc = new Scanner(fileString);</p>
<p>			test0 = Woning.read(sc);</p>
<p>			System.out.println("test0:" + test0);<br />
		} catch (FileNotFoundException e) {<br />
			e.printStackTrace();<br />
		}</p>
<p>		System.out.println("---");</p>
<p>		Adres adres1 = new Adres("Lorentzplein", "55", "2522EE", "Den Haag");<br />
		Adres adres2 = new Adres("Buitenhof", "20", "2513AG", "Den Haag");</p>
<p>		Woning test1 = new Woning(adres1,10,99);<br />
		Woning test2 = new Woning(adres2,10,99);</p>
<p>		System.out.println("test1:" + test1);<br />
		System.out.println("test2:" + test2);<br />
		System.out.println("test1.equals(test2):" + test1.equals(test2));</p>
<p>		System.out.println("---");</p>
<p>		Woning test3 = new Woning(adres2,11,99);<br />
		System.out.println("test3:" + test3);<br />
		System.out.println("test2:" + test2);<br />
		System.out.println("test3.equals(test2):" + test3.equals(test2));</p>
<p>		System.out.println("---");</p>
<p>		Woning test4 = new Woning(adres2,10,99);<br />
		System.out.println("test4:" + test4);<br />
		System.out.println("test2:" + test2);<br />
		System.out.println("test4.equals(test2):" + test4.equals(test2));<br />
	}<br />
}</p>
<p>[/java]</p>
<p>Portefeuille.java<br />
[java]<br />
//	Practicum TI1200,	Opdracht 8<br />
//	Auteur N.Cate,		Studienummer 1342169<br />
//	Datum 11-11-2010<br />
//	NetID ntencate</p>
<p>import java.io.FileNotFoundException;<br />
import java.io.FileReader;<br />
import java.util.ArrayList;<br />
import java.util.Iterator;<br />
import java.util.Scanner;</p>
<p>public class Portefeuille {</p>
<p>	private ArrayList<Woning> woningen;</p>
<p>	/** Initialize new Portefeuille<br />
	 *<br />
	 */<br />
	public Portefeuille()<br />
	{<br />
		this.woningen = new ArrayList<Woning>();<br />
	}</p>
<p>	/** Add a woning<br />
	 * post: voegt de woning toe &#8211; tenminste als hij er nog niet in zat<br />
	 * @param woning<br />
	 */<br />
	public void voegToe(Woning woning)<br />
	{<br />
		this.woningen.add(woning);<br />
	}</p>
<p>	/** Get a list of woning&#8217;n with a max price<br />
	 * post: retourneert een lijst met alle woningen die maxprijs of minder als vraagprijs	hebben<br />
	 * @param maxprijs<br />
	 * @return<br />
	 */<br />
	public ArrayList<Woning> woningenTot(int maxprijs)<br />
	{<br />
		Iterator<Woning> iter = this.woningen.iterator();<br />
		ArrayList<Woning> result = new ArrayList<Woning>();</p>
<p>		Woning temp;</p>
<p>		while(iter.hasNext())<br />
		{<br />
			temp = iter.next();<br />
			if(temp.kostHooguit(maxprijs))<br />
				result.add(temp);<br />
		}</p>
<p>		return result;<br />
	}</p>
<p>	/** Get a Protefeuille from file<br />
	 * pre : infile is de naam van een tekstbestand waarin op bovenbeschreven wijze een aantal woningen staan<br />
	 * post: retourneert een Portefeuille, die de woningen, gelezen uit dit tekstbestand bevat<br />
	 *<br />
	 * @param infile filename<br />
	 * @return<br />
	 */<br />
	public static Portefeuille read(String infile)<br />
	{<br />
		/*<br />
		 * SAMPLE TEXT==<br />
		 * 3<br />
		 * Emmalaan 23<br />
		 * 3051JC Rotterdam<br />
		 * 7 kamers<br />
		 * prijs 300000<br />
		 * Javastraat 88<br />
		 * 4078KB Eindhoven<br />
		 * 3 kamers<br />
		 * prijs 50000<br />
		 * Javastraat 93<br />
		 * 4078KB Eindhoven<br />
		 * 4 kamers<br />
		 * prijs 55000<br />
		 */</p>
<p>		Portefeuille result = new Portefeuille();<br />
		FileReader fileString;</p>
<p>		try {<br />
			fileString = new FileReader(infile);<br />
			Scanner sc = new Scanner(fileString);</p>
<p>			int amount = sc.nextInt();<br />
			for(int i = 0; i < amount; i++)<br />
				result.voegToe(Woning.read(sc));<br />
		} catch (FileNotFoundException e) {<br />
			e.printStackTrace();<br />
		}</p>
<p>		return result;<br />
	}</p>
<p>	public String toString()<br />
	{<br />
		String result;</p>
<p>		result = "<Portefeuille<woningen:";<br />
		Iterator<Woning> iter = this.woningen.iterator();<br />
		while(iter.hasNext())<br />
		{<br />
			result = result + iter.next() + &#8220;,&#8221;;<br />
		}<br />
		result  = result + &#8220;>>&#8221;;</p>
<p>		return result;<br />
	}<br />
}</p>
<p>[/java]</p>
<p>Portefeuille_test_text.txt<br />
[text]<br />
3<br />
Emmalaan 23<br />
3051JC Rotterdam<br />
7 kamers<br />
prijs 300000<br />
Javastraat 88<br />
4078KB Eindhoven<br />
3 kamers<br />
prijs 50000<br />
Javastraat 93<br />
4078KB Eindhoven<br />
4 kamers<br />
prijs 55000<br />
[/text]</p>
<p>WoningDriver.java<br />
[java]<br />
//	Practicum TI1200,	Opdracht 8<br />
//	Auteur N.Cate,		Studienummer 1342169<br />
//	Datum 11-11-2010<br />
//	NetID ntencate</p>
<p>import java.util.Iterator;<br />
import java.util.Scanner;</p>
<p>public class Woningdriver {</p>
<p>	public static void main(String [] args)<br />
	{<br />
		System.out.println(&#8220;Wat is de maximale prijs?&#8221;);</p>
<p>		Scanner sc = new Scanner(System.in);<br />
		int maxPrijs = sc.nextInt();</p>
<p>		Portefeuille port = Portefeuille.read(&#8220;src/Portefeuille_test_text.txt&#8221;);</p>
<p>		System.out.println(&#8220;&#8212;&#8211;&#8221;);</p>
<p>		Iterator<Woning> iter = port.woningenTot(maxPrijs).iterator();<br />
		while(iter.hasNext())<br />
			System.out.println(iter.next());<br />
	}</p>
<p>}</p>
<p>[/java]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/12/03/ti-1200-opdracht-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Lenny Rotating Screen without Drivers</title>
		<link>http://www.nicktencate.com/blog/2010/11/22/debian-lenny-rotating-screen-without-drivers/</link>
		<comments>http://www.nicktencate.com/blog/2010/11/22/debian-lenny-rotating-screen-without-drivers/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 14:40:19 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[vga]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=58</guid>
		<description><![CDATA[Had to write this down somewhere.. /boot/grub/menu.lst Kernel options [bash] video=vesa:ywrap,mtrr vga=794 fbcon=rotate:3 [/bash] VGA mode is described in http://wiki.antlinux.com/pmwiki.php?n=HowTos.VgaModes Then for Xorg server /etc/X11/xorg.conf [bash] Section &#8220;Device&#8221; Driver &#8220;fbdev&#8221; Option &#8220;Rotate&#8221; &#8220;CCW&#8221; [/bash]]]></description>
			<content:encoded><![CDATA[<p>Had to write this down somewhere..</p>
<p>/boot/grub/menu.lst<br />
Kernel options<br />
[bash]<br />
video=vesa:ywrap,mtrr vga=794 fbcon=rotate:3<br />
[/bash]<br />
VGA mode is described in</p>
<p>http://wiki.antlinux.com/pmwiki.php?n=HowTos.VgaModes</p>
<p>Then for Xorg server<br />
/etc/X11/xorg.conf<br />
[bash]<br />
Section &#8220;Device&#8221;<br />
 Driver      &#8220;fbdev&#8221;<br />
Option &#8220;Rotate&#8221; &#8220;CCW&#8221;<br />
[/bash]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/11/22/debian-lenny-rotating-screen-without-drivers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DD-WRT WPA2/Enterprise Connection Fail</title>
		<link>http://www.nicktencate.com/blog/2010/11/22/dd-wrt-wpa2enterprise-connection-fail/</link>
		<comments>http://www.nicktencate.com/blog/2010/11/22/dd-wrt-wpa2enterprise-connection-fail/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 01:52:53 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Router]]></category>
		<category><![CDATA[dd-wrt]]></category>
		<category><![CDATA[radius]]></category>
		<category><![CDATA[wpa2]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=54</guid>
		<description><![CDATA[So after installing about 15 access points in an enterprise enviroment, I discovered that the NAS (wireless driver from Broadcom) proccess included in DD-WRT v24 fails miserably at WPA2 with a radius server. Any &#8216;rejected&#8217; or &#8216;failed&#8217; or &#8216;interuppted&#8217; or &#8216;packet dropped&#8217; authentication request will stall all future authentication requests for that MAC address. To [...]]]></description>
			<content:encoded><![CDATA[<p>So after installing about 15 access points in an enterprise enviroment, I discovered that the NAS (wireless driver from Broadcom) proccess included in DD-WRT v24 fails miserably at WPA2 with a radius server. Any &#8216;rejected&#8217; or &#8216;failed&#8217; or &#8216;interuppted&#8217; or &#8216;packet dropped&#8217; authentication request will stall all future authentication requests for that MAC address.</p>
<p>To fix this very irritating problem, you can change your OS to OpenWRT (hostapd does not have this issue). However, not all devices can run OpenWRT. </p>
<p>The other work around is to restart NAS every once in a while.</p>
<p>In your startup scripts add</p>
<p>[bash]<br />
echo &#8220;#!/bin/sh \n killall -TERM nas \n nas -P /tmp/nas.wl0lan.pid -H 34954 -l br0 -i eth1 -A -m 64 -r RADIUS_KEY -s SSID_USED -w 4 -g 3600 -h RADIUS_SERVER_IP -p RADIUS_SERVER_PORT&#8221; >> /tmp/root/nasReset.sh<br />
echo &#8216; * 5 * * * root /tmp/root/nasReset.sh&#8217; >> /tmp/crontab<br />
startservice cron<br />
[/bash]</p>
<p>Adjust the cronjob (* 5 * * *) to restart it more/less often. Restarting the NAS proccess will kill all data connectivity on that SSID, but WinXP/Mac OS don&#8217;t even notice. Android devices will disconnect/reconnect. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/11/22/dd-wrt-wpa2enterprise-connection-fail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using PHP to read out a EMP800 Coin Collector</title>
		<link>http://www.nicktencate.com/blog/2010/10/13/using-php-to-read-out-a-emp800-coin-collector/</link>
		<comments>http://www.nicktencate.com/blog/2010/10/13/using-php-to-read-out-a-emp800-coin-collector/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 23:22:58 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[cc-talk]]></category>
		<category><![CDATA[coin]]></category>
		<category><![CDATA[collector]]></category>
		<category><![CDATA[emp800]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[serial]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=34</guid>
		<description><![CDATA[A friend at netcompany called me up a long time ago and said &#8220;Nick, I have this coin collector, I need to be able to read out its values in PHP!&#8221; so I naturally said &#8220;ok!&#8221; This script works on CC-Talk enabled EMP800 coin collectors. Theoretically it should work on any CC-Talk enabled coin collector, [...]]]></description>
			<content:encoded><![CDATA[<p>A friend at netcompany called me up a long time ago and said &#8220;Nick, I have this coin collector, I need to be able to read out its values in PHP!&#8221; so I naturally said &#8220;ok!&#8221; <img src='http://www.nicktencate.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This script works on CC-Talk enabled EMP800 coin collectors. Theoretically it should work on any CC-Talk enabled coin collector, but never been tested.</p>
<p>CoinCollector.php<br />
[php]<br />
<?php</p>
<p>/*********************************<br />
* EMP800 USB<br />
* Written/hacked-up by Nick ten Cate / nicktencate.com<br />
*********************************/</p>
<p>class CoinCollector<br />
{<br />
	private $_handle;						 // Open Connection<br />
	private $_device;<br />
	private $_maxCoinType = 16;  // Maximum different types of coins to accept<br />
	private $_eventCounter = 0;  // Event Counter</p>
<p>	function CoinCollector($device = "/dev/ttyUSB0", $deviceAddress = "2", $myAddress = "1")<br />
	{<br />
		$this->_device = $device;<br />
		$this->_deviceAddress = $deviceAddress;<br />
		$this->_myAddress = $myAddress;</p>
<p>		$this->setPortMode();<br />
		$this->connect();<br />
	}</p>
<p>	/********************************<br />
	| Set Port Mode Correctly<br />
	********************************/<br />
	function setPortMode()<br />
	{<br />
		exec(&#8220;chown root:root &#8220;.$this->_device);<br />
		exec(&#8220;stty -F &#8220;.$this->_device.&#8221; -brkint -icrnl -imaxbel -opost -isig -icanon -echo&#8221;);<br />
	}</p>
<p>	/********************************<br />
	| Initiate Connection<br />
	| returns true/false<br />
	********************************/<br />
	function connect()<br />
	{<br />
		if($this->_handle = fopen($this->_device,&#8221;w+&#8221;))<br />
		{<br />
			return true;<br />
		}<br />
		else<br />
		{<br />
			throw new Exception(&#8216;Could not open device&#8217;. $this->_device);<br />
		}<br />
		return false;<br />
	}</p>
<p>	/********************************<br />
	| Calculate Package CheckSum<br />
	| $commands = array of integers<br />
	********************************/<br />
	function calcCheckSum($commands)<br />
	{<br />
		return 256-(array_sum($commands)%256);<br />
	}</p>
<p>	/********************************<br />
	| Send commands to coin collector<br />
	| $commands = array of integers<br />
	| returns # of commands done<br />
	********************************/<br />
	function sendCommands($commands)<br />
	{<br />
		// Add commands to send<br />
		$c = array();<br />
		$c[] = $this->_deviceAddress;    // Target Device Address<br />
		$c[] = count($commands)-1;		   // Amount of DATA bits we are sending (excluding header bit (first one))<br />
		$c[] = $this->_myAddress;		     // My Address</p>
<p>		foreach($commands as $x)		     // Add header bit + commands<br />
		{<br />
			$c[] = $x;<br />
		}</p>
<p>		$c[] = $this->calcCheckSum($c);  // Add the checksum</p>
<p>		foreach($c as $command)			     // Send each command to device<br />
		{<br />
			if(!fputs($this->_handle,chr($command)))			// Convert to byte<br />
				throw new Exception(&#8216;Could not execute command: &#8216;. $command);<br />
		}</p>
<p>		return count($c);<br />
	}</p>
<p>	/********************************<br />
	| Return results from coin collector<br />
	| $count = amount of commands sent<br />
	| return array of integers<br />
	********************************/<br />
	function getResults($count)<br />
	{<br />
		$results = array();<br />
		$resultCounter = 1;<br />
		$command = true;<br />
		// Fetch first result<br />
		// &#038; fetch all others after it, until check sum completes.<br />
		// This should be re-written, the 2nd byte is # of data being returned.<br />
		do<br />
		{<br />
			$char = fgetc($this->_handle);	// Each Byte represents something. 1=Source, 2=Amount of Data, 3=Target, 4=Data1, 5=Data2, #=checksum</p>
<p>			if($resultCounter > $count)<br />
			{<br />
				$command = false;<br />
				$results[] = ord($char);<br />
			}</p>
<p>			$resultCounter++;<br />
		} while($command 	|| $this->calcCheckSum($results) != 256);</p>
<p>		array_pop($results);	// Remove last byte, the checksum </p>
<p>		unset($results[0]);	// Remove &#8216;source address&#8217;<br />
		unset($results[1]); // Remove &#8216;amount of data&#8217;<br />
		unset($results[2]);	// Remove &#8216;target address&#8217;<br />
		return $results;<br />
	}</p>
<p>	/********************************<br />
	| Run the commands and return the results<br />
	| Return array of results<br />
	********************************/<br />
	function execute($commands)<br />
	{<br />
		$count = $this->sendCommands($commands);<br />
		$results = $this->getResults($count);<br />
		return $results;<br />
	}</p>
<p>	/********************************<br />
	| Get array of coin types and ids<br />
	| Return array KEY=id, VALUE=coin<br />
	********************************/<br />
	function getCoinTypes()<br />
	{<br />
		$results = array();<br />
		for($x = 1; $x < $this->_maxCoinType+1; $x++)<br />
		{<br />
			$result = $this->execute(array(184,$x));<br />
			$string = &#8220;&#8221;;<br />
			foreach($result as $xx)<br />
			{<br />
				$string .= chr($xx);<br />
			}<br />
			$string = str_replace(&#8221; &#8220;,&#8221;",$string);</p>
<p>			unset($t);<br />
			$t = array();<br />
			$t["currency"] = substr($string,1,2);<br />
			$t["value"] = round(substr($string,3,3)/100,2)*1.00;<br />
			$t["denomination"] = &#8220;1&#8243;;<br />
			$t["coinId"] = $x;</p>
<p>			$results[$x] = $t;<br />
		}<br />
		return $results;<br />
	}</p>
<p>	/********************************<br />
	| Set coinIds open<br />
	| (send command + binary bytes->int for each id)<br />
	********************************/<br />
	function allowCoinEntry($array = 1)<br />
	{<br />
		$binary = array();</p>
<p>		if($array == 1)<br />
		{<br />
			$binary[] = &#8220;255&#8243;;<br />
			$binary[] = &#8220;255&#8243;;<br />
		}<br />
		else<br />
		{<br />
			// Make empty array<br />
			$settings = array();<br />
			for($x = 1; $x < $this->_maxCoinType; $x++)<br />
			{<br />
				$settings[$x] = &#8220;0&#8243;;<br />
			}<br />
			// Transform into correct array<br />
			foreach($array as $key => $x)<br />
			{<br />
				$settings[$key] = $x;<br />
			}</p>
<p>			// Create binary<br />
			$tempBinary = &#8220;&#8221;;<br />
			foreach($array as $key => $x)<br />
			{<br />
				if($key%8 == 0)<br />
				{<br />
					$binary[] = bindec($tempBinary);<br />
					$tempBinary = &#8220;&#8221;;<br />
				}</p>
<p>				if($x == 1)<br />
					$binary .= &#8220;1&#8243;;<br />
				else<br />
					$binary .= &#8220;0&#8243;;<br />
			}<br />
		}</p>
<p>		$commands = array_merge(array(&#8217;231&#8242;),$binary);</p>
<p>		$this->execute($commands);<br />
	}</p>
<p>	/********************************<br />
	| Poll for coins<br />
	| Return array KEY=coinId VALUE=# of coins<br />
	********************************/<br />
	function poll()<br />
	{<br />
		$results = $this->execute(array(229));<br />
		//Results Array Definitions<br />
		// 4  = event counter<br />
		// 5  = Event A Key ==> 0 (ERROR) || 1 &#8211; $_maxCoinType (COIN ID)<br />
		// 6  = Event A Value ==> Error Id  || 0<br />
		// 7  = Event B Key<br />
		// 8  = Event B Value<br />
		// 9  = Event C Key<br />
		// 10  = Event C Value<br />
		// 11  = Event D Key<br />
		// 12  = Event D Value<br />
		// 13  = Event E Key<br />
		// 14  = Event E Value<br />
		if($this->_eventCounter > 0)<br />
			$diff = $results[4] &#8211; $this->_eventCounter;<br />
		else<br />
			$diff = 0;</p>
<p>		$coins = array();<br />
		for($x = 1; $x < $this->_maxCoinType; $x++)<br />
		{<br />
			$coins[$x] = 0;<br />
		}</p>
<p>		for($x = 0; $x < $diff; $x++)<br />
		{<br />
			$coinId = $results[(5+(2*$x))];</p>
<p>			// Add to coin amount<br />
			$coins[$coinId] = $cois[$coinId] + 1;<br />
		}</p>
<p>		// Set Event Counter<br />
		$this->_eventCounter = $results[4];<br />
		return $coins;<br />
	}</p>
<p>	function debug($text)<br />
	{<br />
		echo &#8220;DEBUG:: $text \r\n&#8221;;<br />
	}</p>
<p>	/********************************<br />
	| Called when coin is put<br />
	| $coins = array of key=coinId, value=# of coins<br />
	********************************/<br />
	function onCoinEvent($coins)<br />
	{<br />
		// Do something<br />
		echo &#8220;Got Coin(s)! &#8220;;<br />
		foreach($coins as $k => $v)<br />
		{<br />
			if($v > 0)<br />
			{<br />
				echo $v.&#8221;x&#8221;.$k.&#8221;-&#8221;;<br />
			}<br />
		}<br />
		echo &#8220;\r\n&#8221;;<br />
	}</p>
<p>	/********************************<br />
	| Calculate Total Value<br />
	| Return total value<br />
	********************************/<br />
	function calculateValue($coins, $coinTypes = false)<br />
	{<br />
		if($coinTypes == false)<br />
		{<br />
			$coinTypes = $this->getCoinTypes();<br />
		}</p>
<p>		$total = 0;</p>
<p>		foreach($coins as $coinId => $amount)<br />
		{<br />
			$total += $coinTypes[$coinId]["value"] * $amount;<br />
		}<br />
		return $total;<br />
	}</p>
<p>	/********************************<br />
	| Poll for coins<br />
	| Return array of coins<br />
	********************************/<br />
	function pollTimeOut($time = 5)<br />
	{<br />
		$originalTime = $time;<br />
		$totalCoins = array();</p>
<p>		for($x = 1; $x < $this->_maxCoinType; $x++)<br />
		{<br />
			$totalCoins[$x] = 0;<br />
		}</p>
<p>		while($time > 0)<br />
		{<br />
			$runAmount = 3;<br />
			for($x = 0; $x < $runAmount; $x++)<br />
			{<br />
				$coins = $this->poll();		// Poll for coins<br />
				if(array_sum($coins) > 0)	// Accepted Coin<br />
				{<br />
					$this->onCoinEvent($coins);</p>
<p>					$time = $originalTime;	// Reset Timeout<br />
					foreach($coins as $k => $v)	// Add-up coins<br />
					{<br />
						$totalCoins[$k] += $coins[$k];<br />
					}<br />
				}</p>
<p>				usleep((1000000/$runAmount)); // Wait for 500ms<br />
			}</p>
<p>			$this->debug(&#8220;Time is: $time&#8221;);<br />
			$time&#8211;;<br />
		}<br />
		return $totalCoins;</p>
<p>	}</p>
<p>}</p>
<p>?><br />
[/php]</p>
<p>Heres a quick implementation<br />
[php]<br />
<?php</p>
<p>include("CoinCollector.php");</p>
<p>$collector = new CoinCollector();</p>
<p>$a = $collector->getCoinTypes();</p>
<p>print_r($a);</p>
<p>$coins = $collector->pollTimeOut(10);</p>
<p>print_r($coins);</p>
<p>echo &#8220;Total Value \r\n&#8221;;<br />
echo $collector->calculateValue($coins);<br />
echo &#8221; EURO&#8221;;</p>
<p>?><br />
[/php]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/10/13/using-php-to-read-out-a-emp800-coin-collector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>librtmp + ffmpeg + vlc 1.1.4.1 on Debian Lenny 64-bit</title>
		<link>http://www.nicktencate.com/blog/2010/10/13/librtmp-ffmpeg-vlc-1-1-4-1-on-debian-lenny-64-bit/</link>
		<comments>http://www.nicktencate.com/blog/2010/10/13/librtmp-ffmpeg-vlc-1-1-4-1-on-debian-lenny-64-bit/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 23:02:35 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Transcoding]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[vlc]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=20</guid>
		<description><![CDATA[This is a pain to get working, at least if you want to use the newer versions of everything. However, it does work! Below is what I pieced together. To install either copy paste all the commands, or put them into a bash file. (vim go.sh, copy paste, ./go.sh) Note: this by far does not [...]]]></description>
			<content:encoded><![CDATA[<p>This is a pain to get working, at least if you want to use the newer versions of everything. However, it does work! Below is what I pieced together. To install either copy paste all the commands, or put them into a bash file. (vim go.sh, copy paste, ./go.sh)</p>
<p>Note: this by far does not cover all the items you can include in vlc. it just includes the ones I needed.<br />
Note2: none of this is recommended. using the repo is much better (but outdated..)</p>
<p>[bash]<br />
#################################################<br />
# Get Apt Sorted<br />
echo &#8220;deb http://mirrors.nl.kernel.org/debian/ lenny main contrib non-free&#8221; >> /etc/apt/sources.list<br />
echo &#8220;deb http://www.debian-multimedia.org lenny main non-free&#8221; >> /etc/apt/sources.list<br />
wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb<br />
dpkg -i debian-multimedia-keyring_2008.10.16_all.deb<br />
apt-get update</p>
<p>###################################################<br />
# FFMPEG INSTALL</p>
<p>apt-get install zlib1g-dev libssl-dev pkg-config &#8211;yes &#8211;force-yes<br />
wget &#8220;http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz&#8221;<br />
tar -xvvf rtmpdump-2.3.tgz<br />
cd rtmpdump-2.3<br />
make<br />
make install</p>
<p>cd ..</p>
<p>wget -O faac-1.28.tar.gz &#8220;http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz?r=http%3A%2F%2Fwww.audiocoding.com%2Fdownloads.html&#038;ts=1286909210&#038;use_mirror=kent&#8221;<br />
tar -xvvf faac-1.28.tar.gz<br />
cd faac-1.28<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>wget &#8220;http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz&#8221;<br />
tar -xvvf yasm-1.1.0.tar.gz<br />
cd yasm-1.1.0<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>apt-get install git-core &#8211;yes &#8211;force-yes<br />
git clone git://git.videolan.org/x264.git<br />
cd x264<br />
CFLAGS=&#8221;-m64 -mtune=athlon64 -pipe -fPIC&#8221; ./configure &#8211;enable-pic &#8211;enable-shared<br />
make<br />
make install</p>
<p>cd ..</p>
<p>apt-get install subversion &#8211;yes &#8211;force-yes<br />
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg<br />
cd ffmpeg<br />
CFLAGS=&#8221;-m64 -mtune=athlon64 -pipe -fPIC&#8221; ./configure &#8211;cc=&#8221;gcc -m64 -mtune=athlon64 -pipe&#8221; &#8211;enable-version3 &#8211;enable-libfaac &#8211;enable-libx264 &#8211;enable-pthreads &#8211;enable-gpl &#8211;enable-nonfree &#8211;enable-librtmp &#8211;enable-shared &#8211;enable-postproc<br />
make<br />
make install</p>
<p>cd ..</p>
<p>###################################################<br />
# VLC INSTALL</p>
<p># Some packages that are usefull<br />
apt-get install libtool autoconf libdbus-1-dev liblua5.1-0-dev libxcb-shm0-dev libqt4-dev libgcrypt-dev &#8211;yes &#8211;force-yes</p>
<p>#libmad<br />
wget &#8220;ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz&#8221;<br />
tar -xvf libmad-0.15.1b.tar.gz<br />
cd libmad-0.15.1b<br />
cp configure configure_backup<br />
sed &#8216;s/optimize=&#8221;$optimize -fforce-mem&#8221;/#optimize=&#8221;$optimize -fforce-mem&#8221;/g&#8217; configure_backup > configure<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#liblame<br />
wget -O lame-3.98.4.tar.gz &#8220;http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flame%2Ffiles%2Flame%2F&#038;ts=1286919122&#038;use_mirror=kent&#8221;<br />
tar -xvf lame-3.98.4.tar.gz<br />
cd lame-3.98.4<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libogg<br />
wget &#8220;http://downloads.xiph.org/releases/ogg/libogg-1.2.0.tar.gz&#8221;<br />
tar -xvf libogg-1.2.0.tar.gz<br />
cd libogg-1.2.0<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libvorbis<br />
wget &#8220;http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.1.tar.gz&#8221;<br />
tar -xvf libvorbis-1.3.1.tar.gz<br />
cd libvorbis-1.3.1<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libtheora<br />
wget &#8220;http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2&#8243;<br />
tar -xvf libtheora-1.1.1.tar.bz2<br />
cd libtheora-1.1.1<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libxv<br />
apt-get install libxv-dev &#8211;yes &#8211;force-yes<br />
wget -O libdv-1.0.0.tar.gz &#8220;http://downloads.sourceforge.net/project/libdv/libdv/1.0.0/libdv-1.0.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flibdv%2F&#038;ts=1286919451&#038;use_mirror=kent&#8221;<br />
tar -xvf libdv-1.0.0.tar.gz<br />
cd libdv-1.0.0<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p># liba52<br />
wget &#8220;http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz&#8221;<br />
tar -xvf a52dec-0.7.4.tar.gz<br />
cd a52dec-0.7.4<br />
CFLAGS=&#8221;-m64 -mtune=athlon64 -pipe -fPIC&#8221; ./configure &#8211;enable-shared &#8211;disable-static<br />
make<br />
make install</p>
<p>cd ..</p>
<p># mpeg2 libraries<br />
wget &#8220;http://libmpeg2.sourceforge.net/files/libmpeg2-0.5.1.tar.gz&#8221;<br />
tar -xvf libmpeg2-0.5.1.tar.gz<br />
cd libmpeg2-0.5.1<br />
./configure<br />
make<br />
make install</p>
<p>cd ..	</p>
<p>#libdvbpsi<br />
wget &#8220;http://download.videolan.org/pub/libdvbpsi/0.1.7/libdvbpsi-0.1.7.tar.bz2&#8243;<br />
tar -xvf libdvbpsi-0.1.7.tar.bz2<br />
cd libdvbpsi-0.1.7<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#live555<br />
wget &#8220;http://www.live555.com/liveMedia/public/live555-latest.tar.gz&#8221;<br />
tar -xvf live555-latest.tar.gz<br />
cd live<br />
./genMakefiles linux-64bit<br />
make</p>
<p>cd ..</p>
<p>#libfaad<br />
wget &#8220;http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz&#8221;<br />
tar -xvf faad2-2.7.tar.gz<br />
cd faad2-2.7<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#twolame<br />
wget &#8220;http://downloads.sourceforge.net/twolame/twolame-0.3.12.tar.gz&#8221;<br />
tar -xvf twolame-0.3.12.tar.gz<br />
cd twolame-0.3.12<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libraw1394<br />
wget -O libraw1394-2.0.5.tar.gz &#8220;http://sourceforge.net/projects/libraw1394/files/libraw1394/libraw1394-2.0.5.tar.gz/download&#8221;<br />
tar -xvf libraw1394-2.0.5.tar.gz<br />
cd libraw1394-2.0.5<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libdc1394<br />
wget -O libdc1394-2.1.2.tar.gz &#8220;http://sourceforge.net/projects/libdc1394/files/libdc1394-2/2.1.2/libdc1394-2.1.2.tar.gz/download&#8221;;<br />
tar -xvf libdc1394-2.1.2.tar.gz<br />
cd libdc1394-2.1.2<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libavc1394<br />
wget -O libavc1394-0.5.4.tar.gz &#8220;http://sourceforge.net/projects/libavc1394/files/libavc1394/libavc1394-0.5.4.tar.gz/download&#8221;;<br />
tar -xvf libavc1394-0.5.4.tar.gz<br />
cd libavc1394-0.5.4<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#v4l<br />
wget -O v4l.tar.bz2 &#8220;http://freshmeat.net/urls/5ecd7149a259c2cb1cc8b84ae8d3efe1&#8243;<br />
tar -xvf v4l.tar.bz2<br />
cd v4l-utils-0.8.1<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#libdca<br />
wget &#8220;http://download.videolan.org/pub/videolan/libdca/0.0.5/libdca-0.0.5.tar.bz2&#8243;<br />
tar -xvf libdca-0.0.5.tar.bz2<br />
cd libdca-0.0.5<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#flac<br />
wget -O flac-1.2.1.tar.gz &#8220;http://sourceforge.net/projects/flac/files/flac-src/flac-1.2.1-src/flac-1.2.1.tar.gz/download&#8221;<br />
tar -xvf flac-1.2.1.tar.gz<br />
cd flac-1.2.1<br />
sed -i  &#8217;1i #include <cstring>&#8216; examples/cpp/encode/file/main.cpp<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#speex<br />
wget &#8220;http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz&#8221;<br />
tar -xvf speex-1.2rc1.tar.gz<br />
cd speex-1.2rc1<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#alsa<br />
wget &#8220;ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.9rc4.tar.bz2&#8243;<br />
tar -xvf alsa-lib-1.0.9rc4.tar.bz2<br />
cd alsa-lib-1.0.9rc4<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#freetype<br />
wget -O freetype-2.4.3.tar.gz &#8220;http://sourceforge.net/projects/freetype/files/freetype2/2.4.3/freetype-2.4.3.tar.gz/download&#8221;<br />
tar -xvf freetype-2.4.3.tar.gz<br />
cd freetype-2.4.3<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p>#fribidi<br />
wget &#8220;http://fribidi.org/download/fribidi-0.10.9.tar.gz&#8221;<br />
tar -xvf fribidi-0.10.9.tar.gz<br />
cd fribidi-0.10.9<br />
./configure<br />
make<br />
make install</p>
<p>cd ..</p>
<p># VLC finally..<br />
apt-get install lua5.1 libxcb-shm0-dev libxcb-xv0-dev libxcb-keysyms1-dev libxcb-randr0-dev libx11-xcb-dev &#8211;yes &#8211;force-yes<br />
wget &#8220;http://download.videolan.org/pub/vlc/1.1.4.1/vlc-1.1.4.1.tar.bz2&#8243;<br />
tar -xvvf vlc-1.1.4.1.tar.bz2<br />
cd vlc-1.1.4.1<br />
./configure &#8211;disable-nls &#8211;disable-mozilla &#8211;disable-xcb &#8211;enable-live555 &#8211;with-live555-tree=&#8221;../live/&#8221;<br />
./configure &#8211;enable-xvideo &#8211;disable-nls &#8211;disable-mozilla &#8211;enable-sdl &#8211;enable-avcodec &#8211;enable-avformat &#8211;enable-swscale &#8211;enable-mad &#8211;enable-a52 &#8211;enable-libmpeg2 &#8211;enable-dvdnav &#8211;enable-faad &#8211;enable-vorbis &#8211;enable-ogg &#8211;enable-theora &#8211;enable-mkv &#8211;enable-speex &#8211;enable-live555 &#8211;with-live555-tree=&#8221;../live/&#8221; &#8211;enable-skins2 &#8211;enable-alsa &#8211;enable-qt4 &#8211;enable-ncurses &#8211;enable-realrtsp &#8211;enable-twolame &#8211;enable-real &#8211;enable-x264<br />
make<br />
make install</p>
<p># Fix vlc links<br />
ln -s /usr/local/lib/libvlc* /usr/lib/<br />
ln -s /usr/local/lib/libx264.a /usr/lib/<br />
ln -s /usr/local/lib/vlc /usr/lib/vlc<br />
[/bash]</p>
<p>After this.. you can run vlc!<br />
[bash]<br />
nick@debian:/home/nick/vlc-1.1.4.1$ ./vlc<br />
VLC media player 1.1.4.1 The Luggage (revision exported)<br />
[/bash]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/10/13/librtmp-ffmpeg-vlc-1-1-4-1-on-debian-lenny-64-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DD-WRT v24 pre-SP2 SNMP Clients on eth1(wl0) and wl0.1</title>
		<link>http://www.nicktencate.com/blog/2010/10/13/dd-wrt-v24-pre-sp2-snmp-clients-on-eth1wl0-and-wl0-1/</link>
		<comments>http://www.nicktencate.com/blog/2010/10/13/dd-wrt-v24-pre-sp2-snmp-clients-on-eth1wl0-and-wl0-1/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 23:01:52 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Router]]></category>
		<category><![CDATA[dd-wrt]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=25</guid>
		<description><![CDATA[So for a pet project I recently had to record and graph how many clients were on any SSID at one time, accross all 30+ dd-wrt enabled routers. It seems the built in SNMP client does not have this capability So naturally, I had to figure out my own. Here&#8217;s how I did it. First, [...]]]></description>
			<content:encoded><![CDATA[<p>So for a pet project I recently had to record and graph how many clients were on any SSID at one time, accross all 30+ dd-wrt enabled routers. It seems the built in SNMP client does not have this capability <img src='http://www.nicktencate.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  So naturally, I had to figure out my own. Here&#8217;s how I did it.</p>
<p>First, host this script on a webserver that can be reached by all intended routers. For this guide, it will be placed at http://192.168.1.2/ddwrtSnmpScript.txt<br />
[bash]<br />
#!/bin/sh</p>
<p>place=&#8221;.1.3.6.1.4.1.2021.254&#8243;</p>
<p>refresh() {</p>
<p>  # Calc total clients Eth1<br />
  wlId=&#8221;eth1&#8243;<br />
  totalClientsEth1=0<br />
  for mac in $(wl -i $wlId assoclist | cut -d&#8221; &#8221; -f2)<br />
  do<br />
   let totalClientsEth1=$totalClientsEth1+1<br />
  done</p>
<p>  # Calc total clients Wl0.1<br />
  wlId=&#8221;wl0.1&#8243;<br />
  totalClientsWl01=0</p>
<p>  for mac in $(wl -i $wlId assoclist | cut -d&#8221; &#8221; -f2)<br />
  do<br />
   let totalClientsWl01=$totalClientsWl01+1<br />
  done</p>
<p>  let totalClients=$totalClientsWl01+$totalClientsEth1</p>
<p>  eval getnext_1361412021254=&#8221;$place.3.54.1.3.32.1.27.1&#8243;</p>
<p>  # DESCRIPTIONS<br />
  # Total Clients<br />
  eval value_136141202125435413321271=&#8221;Total_Clients_on_AP&#8221;<br />
  eval type_136141202125435413321271=&#8221;string&#8221;</p>
<p>  # Total Clients eth1<br />
  eval getnext_136141202125435413321271=&#8221;$place.3.54.1.3.32.1.27.2&#8243;<br />
  eval value_136141202125435413321272=&#8221;Total_Clients_using_eth1_on_AP&#8221;<br />
  eval type_136141202125435413321272=&#8221;string&#8221;</p>
<p>  # Total Clients wl0.1<br />
  eval getnext_136141202125435413321272=&#8221;$place.3.54.1.3.32.1.27.3&#8243;<br />
  eval value_136141202125435413321273=&#8221;Total_Clients_using_wl0.1_on_AP&#8221;<br />
  eval type_136141202125435413321273=&#8221;string&#8221;</p>
<p>  eval getnext_136141202125435413321273=&#8221;$place.3.54.1.3.32.1.28.1&#8243;</p>
<p>  # VALUES</p>
<p>  # Total Clients<br />
  eval value_136141202125435413321281=$totalClients<br />
  eval type_136141202125435413321281=&#8221;integer&#8221;</p>
<p>  # Total Clients eth1<br />
  eval getnext_136141202125435413321281=&#8221;$place.3.54.1.3.32.1.28.2&#8243;<br />
  eval value_136141202125435413321282=$totalClientsEth1<br />
  eval type_136141202125435413321282=&#8221;integer&#8221;</p>
<p>  # Total Clients wl0.1<br />
  eval getnext_136141202125435413321282=&#8221;$place.3.54.1.3.32.1.28.3&#8243;<br />
  eval value_136141202125435413321283=$totalClientsWl01<br />
  eval type_136141202125435413321283=&#8221;integer&#8221;</p>
<p>  eval getnext_13614120212543541332128${lastid}=&#8221;NONE&#8221;<br />
}</p>
<p>LASTREFRESH=0</p>
<p>while read CMD<br />
do<br />
  case &#8220;$CMD&#8221; in<br />
    PING)<br />
      echo PONG<br />
      continue<br />
      ;;<br />
    getnext)<br />
      read REQ<br />
      let REFRESH=$(date +%s)-$LASTREFRESH<br />
      if test $REFRESH -gt 30<br />
      then<br />
        LASTREFRESH=$(date +%s)<br />
        refresh<br />
      fi</p>
<p>      oid=$(echo $REQ | tr -d .)<br />
      eval ret=\$getnext_${oid}<br />
      if test &#8220;x$ret&#8221; = &#8220;xNONE&#8221;<br />
      then<br />
        echo NONE<br />
        continue<br />
      fi<br />
      ;;<br />
    *)<br />
      read REQ<br />
      if test &#8220;x$REQ&#8221; = &#8220;x$place&#8221;<br />
      then<br />
        echo NONE<br />
        continue<br />
      else<br />
        ret=$REQ<br />
      fi<br />
      ;;<br />
  esac</p>
<p>  oid=$(echo $ret | tr -d .)<br />
  if eval test &#8220;x\$type_${oid}&#8221; != &#8220;x&#8221;<br />
  then<br />
    echo $ret<br />
    eval echo &#8220;\$type_${oid}&#8221;<br />
    eval echo &#8220;\$value_${oid}&#8221;<br />
  else<br />
    echo NONE<br />
  fi</p>
<p>done<br />
[/bash]</p>
<p>Next, go to your DD-WRT &#8220;Services&#8221; -> &#8220;Services&#8221; and enable SNMP (http://192.168.1.1/Services.asp).</p>
<p>Then go to your DD-WRT &#8220;Administration&#8221; -> &#8220;Commands&#8221; (http://192.168.1.1/Diagnostics.asp) and enter the following into your startup script.<br />
[bash]<br />
wget http://192.168.1.2/ddwrtSnmpScript.txt -O /tmp/root/snmp.sh<br />
chmod +x /tmp/root/snmp.sh<br />
echo &#8220;pass_persist .1.3.6.1.4.1.2021.254 /tmp/root/snmp.sh&#8221; >> /var/snmp/snmpd.conf<br />
killall -TERM snmpd<br />
snmpd -c /var/snmp/snmpd.conf<br />
[/bash]</p>
<p>Restart your router&#8230;</p>
<p>Then viola!<br />
[bash]<br />
root@MONITOR-1:~# snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.4.1.2021.254<br />
UCD-SNMP-MIB::ucdavis.254.3.54.1.3.32.1.27.1 = STRING: &#8220;Total_Clients_on_AP&#8221;<br />
UCD-SNMP-MIB::ucdavis.254.3.54.1.3.32.1.27.2 = STRING: &#8220;Total_Clients_using_eth1_on_AP&#8221;<br />
UCD-SNMP-MIB::ucdavis.254.3.54.1.3.32.1.27.3 = STRING: &#8220;Total_Clients_using_wl0.1_on_AP&#8221;<br />
UCD-SNMP-MIB::ucdavis.254.3.54.1.3.32.1.28.1 = INTEGER: 73<br />
UCD-SNMP-MIB::ucdavis.254.3.54.1.3.32.1.28.2 = INTEGER: 64<br />
UCD-SNMP-MIB::ucdavis.254.3.54.1.3.32.1.28.3 = INTEGER: 9<br />
[/bash]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/10/13/dd-wrt-v24-pre-sp2-snmp-clients-on-eth1wl0-and-wl0-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ffmpeg + x264 + rtmp on Debian Lenny 64-bit</title>
		<link>http://www.nicktencate.com/blog/2010/10/12/ffmpeg-x264-rtmp-on-debian-lenny/</link>
		<comments>http://www.nicktencate.com/blog/2010/10/12/ffmpeg-x264-rtmp-on-debian-lenny/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 21:17:17 +0000</pubDate>
		<dc:creator>nicktc</dc:creator>
				<category><![CDATA[Transcoding]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[x264]]></category>

		<guid isPermaLink="false">http://www.nicktencate.com/blog/?p=16</guid>
		<description><![CDATA[Getting ffmpeg to work with x264 support on Debian Lenny (2.6.26-2-amd64) can prove to be a challenge. Here is what works &#8216;right now&#8217;. I&#8217;ve used non-dep sources, since the dep sources are all very outdated. Take caution when upgrading your system after installing these. Prep your sources. [bash] echo &#8220;deb http://mirrors.nl.kernel.org/debian/ lenny main contrib non-free&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Getting ffmpeg to work with x264 support on Debian Lenny (2.6.26-2-amd64) can prove to be a challenge. Here is what works &#8216;right now&#8217;. </p>
<p>I&#8217;ve used non-dep sources, since the dep sources are all very outdated. Take caution when upgrading your system after installing these.</p>
<p>Prep your sources.<br />
[bash]<br />
echo &#8220;deb http://mirrors.nl.kernel.org/debian/ lenny main contrib non-free&#8221; >> /etc/apt/sources.list<br />
echo &#8220;deb http://www.debian-multimedia.org lenny main non-free&#8221; >> /etc/apt/sources.list<br />
wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb<br />
dpkg -i debian-multimedia-keyring_2008.10.16_all.deb<br />
apt-get update<br />
[/bash]</p>
<p>Install librtmp (included in rtmpdump)<br />
[bash]<br />
apt-get install zlib1g-dev libssl-dev pkg-config<br />
wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz<br />
tar -xvvf rtmpdump-2.3.tgz<br />
cd rtmpdump-2.3<br />
make<br />
make install<br />
cd ..<br />
[/bash]</p>
<p>Get libfaac<br />
[bash]<br />
wget -O faac-1.28.tar.gz http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz?r=http%3A%2F%2Fwww.audiocoding.com%2Fdownloads.html&#038;ts=1286909210&#038;use_mirror=kent<br />
tar -xvvf faac-1.28.tar.gz<br />
cd faac-1.28<br />
./configure<br />
make<br />
make install<br />
cd ..<br />
[/bash]</p>
<p>Get YASM<br />
[bash]<br />
wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz<br />
tar -xvvf yasm-1.1.0.tar.gz<br />
cd yasm-1.1.0<br />
./configure<br />
make<br />
make install<br />
cd ..<br />
[/bash]</p>
<p>Get x264 (git, so latest version! Probably not desired for a production use system)<br />
[bash]<br />
apt-get install git-core<br />
git clone git://git.videolan.org/x264.git<br />
cd x264<br />
CFLAGS=&#8221;-m64 -mtune=athlon64 -pipe -fPIC&#8221; ./configure &#8211;enable-pic &#8211;enable-shared<br />
make<br />
make install<br />
cd ..<br />
[/bash]</p>
<p>Get ffmpeg (svn, so latest version! Probably not desired for a production use system)<br />
[bash]<br />
apt-get install subversion<br />
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg<br />
cd ffmpeg<br />
CFLAGS=&#8221;-m64 -mtune=athlon64 -pipe -fPIC&#8221; ./configure &#8211;cc=&#8221;gcc -m64 -mtune=athlon64 -pipe&#8221; &#8211;enable-version3 &#8211;enable-libfaac &#8211;enable-libx264 &#8211;enable-pthreads &#8211;enable-gpl &#8211;enable-nonfree &#8211;enable-librtmp &#8211;enable-shared<br />
make<br />
make install<br />
cd ..<br />
[/bash]</p>
<p>All done <img src='http://www.nicktencate.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicktencate.com/blog/2010/10/12/ffmpeg-x264-rtmp-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

