<?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>Nepherte (dot) be &#187; tutorial</title>
	<atom:link href="http://www.nepherte.be/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nepherte.be</link>
	<description>About Nepherte, Mosiah and the person behind</description>
	<lastBuildDate>Mon, 30 Aug 2010 18:45:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Howto: Enable DVD menus in MPlayer</title>
		<link>http://www.nepherte.be/howto-enable-dvd-menus-in-mplayer/</link>
		<comments>http://www.nepherte.be/howto-enable-dvd-menus-in-mplayer/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:47:50 +0000</pubDate>
		<dc:creator>Nepherte</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[dvd menu]]></category>
		<category><![CDATA[MPlayer]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.nepherte.be/?p=198</guid>
		<description><![CDATA[A lot of distributions ship a binary of mplayer that is one, old, and two, doesn&#8217;t have the capability to see the menu of a dvd. The reason they ship an old binary of mplayer is because the developpers of mplayer don&#8217;t believe in releases. The &#8220;latest&#8221; release dates of October 2007. Yup that&#8217;s more [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of distributions ship a binary of mplayer that is one, old, and two, doesn&#8217;t have the capability to see the menu of a dvd. The reason they ship an old binary of mplayer is because the developpers of mplayer don&#8217;t believe in releases. The &#8220;latest&#8221; release dates of October 2007. Yup that&#8217;s more than a year ago. What the developpers do believe in, is svn. Every change they make is just put in svn and that&#8217;s where you&#8217;ll get a recent version of mplayer.</p>
<p>First we need a recent version of dvdread and dvdnav, two libraries that allow us to view and navigate through dvd menus. We start with dvdread. Again, you will probably have a very old version of dvdread, so we get a recent version. Dvdread depends on libdvdcss so make sure you have it. You will also need the tools to compile from source of course.</p>
<p>1. Get the source:<br />
<code>wget http://www7.mplayerhq.hu/MPlayer/releases/dvdnav/libdvdread-4.1.3.tar.bz2</code><br />
2. Unpack it and navigate to the directory:<br />
<code>tar xvfj libdvdread-4.1.3.tar.bz2<br />
cd libdvdread-4.1.3</code><br />
3. Compile, build and install:<br />
<code>./autogen.sh --prefix=/usr<br />
make<br />
sudo make install</code></p>
<p>Now we do the same for dvdnav:</p>
<p>1. Get the source:<br />
<code>wget http://www8.mplayerhq.hu/MPlayer/releases/dvdnav/libdvdnav-4.1.3.tar.bz2</code><br />
2. Unpack it and navigate to the directory:<br />
<code>tar xvfj libdvdnav-4.1.3.tar.bz2<br />
cd libdvdnav-4.1.3.tar.bz2</code><br />
3. Compile, build and install:<br />
<code>./autogen.sh --prefix=/usr<br />
make<br />
sudo make install</code></p>
<p>Now that we have everything to read a dvd and its dvd menu, it&#8217;s time to install mplayer with this functionality.</p>
<p>1. Get the source:<br />
<code>svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer</code><br />
2. Navigate to the directory:<br />
<code>cd mplayer</code><br />
3. Compile, build and install. There are a lot of configuration options available for mplayer, but I will only mention the ones you need to enable dvd menus.</p>
<p><code>./configure --disable-dvdread-internal --enable-dvdnav<br />
make<br />
sudo make install</code></p>
<p>Now hurry up and try out some fancy dvd menu with mplayer. Here are a few of The Terminal:<a href="http://www.nepherte.be/wp-content/uploads/2008/12/dvdmenu.png"><br />
</a></p>
<p><a href="http://www.nepherte.be/wp-content/uploads/2008/12/languagemenu.png"><img class="size-medium wp-image-211 alignleft" title="The Terminal Language Menu" src="http://www.nepherte.be/wp-content/uploads/2008/12/languagemenu-300x187.png" alt="The Terminal Language Menu" width="300" height="187" /></a></p>
<p><a href="http://www.nepherte.be/wp-content/uploads/2008/12/dvdmenu.png"><img class="alignnone size-medium wp-image-210" title="The Terminal DVD Menu" src="http://www.nepherte.be/wp-content/uploads/2008/12/dvdmenu-300x187.png" alt="The Terminal DVD Menu" width="300" height="187" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nepherte.be/howto-enable-dvd-menus-in-mplayer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: Send Mail Over SMTPS In Java</title>
		<link>http://www.nepherte.be/send-mail-over-smtps-in-java/</link>
		<comments>http://www.nepherte.be/send-mail-over-smtps-in-java/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 16:00:28 +0000</pubDate>
		<dc:creator>Nepherte</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[smtps]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.nepherte.be/?p=72</guid>
		<description><![CDATA[Introduction This tutorial will show you how to send mail in Java over SMTPS. SMTP, or Simple Mail Transfer Protocol, is the de facto standard for email transmissions across the internet. The SSL protocol, or Secure Socket Layer, provides an encrypted, secure connection. Many providers try to use this secure version of smtp and I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
This tutorial will show you how to send mail in Java over SMTPS. SMTP, or Simple Mail Transfer Protocol, is the de facto standard for email transmissions across the internet. The SSL protocol, or Secure Socket Layer, provides an encrypted, secure connection. Many providers try to use this secure version of smtp and I encourage everyone to make use of it. </p>
<p><strong>Example code</strong><br />
In the example given, we will use the smtps server of Google. To use this server, you will need a Gmail account. The example makes use of the fictive email account &#8216;mail@gmail.com&#8217; with &#8216;password&#8217; and the <a href="http://java.sun.com/products/javamail/">JavaMail</a> library.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Properties</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.Message</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.Multipart</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.Session</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.internet.InternetAddress</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.internet.MimeBodyPart</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.internet.MimeMessage</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.mail.internet.MimeMultipart</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.mail.smtp.SMTPSSLTransport</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> sendMail<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> to, <span style="color: #003399;">String</span> from, <span style="color: #003399;">String</span> subject, Multipart content<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// create properties</span>
<span style="color: #003399;">Properties</span> props <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">getProperties</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// &lt; -- authorization, i.e. account &amp;amp; password is required --&gt;</span>
props.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mail.smtps.auth&quot;</span>, <span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// &lt; -- it is important you use the correct port. smtp uses 25, smtps 465 --&gt;</span>
props.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mail.smtps.port&quot;</span>, <span style="color: #0000ff;">&quot;465&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// &lt; -- put the smtps server host address here --&gt;</span>
props.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mail.smtps.host&quot;</span>, <span style="color: #0000ff;">&quot;smtp.gmail.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// create session</span>
Session session <span style="color: #339933;">=</span> Session.<span style="color: #006633;">getDefaultInstance</span><span style="color: #009900;">&#40;</span>props<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
session.<span style="color: #006633;">setDebug</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// create content</span>
MimeMultipart msgContent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MimeMultipart<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;alternative&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Text Mail</span>
MimeBodyPart html <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MimeBodyPart<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// &lt; -- we will send plain text, &quot;text/html&quot; is possible as well --&gt;</span>
html.<span style="color: #006633;">setContent</span><span style="color: #009900;">&#40;</span>content, <span style="color: #0000ff;">&quot;text/plain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
html.<span style="color: #006633;">setHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MIME-Version&quot;</span>, <span style="color: #0000ff;">&quot;1.0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
html.<span style="color: #006633;">setHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span>, <span style="color: #0000ff;">&quot;text/plain; charset=iso-8859-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
msgContent.<span style="color: #006633;">addBodyPart</span><span style="color: #009900;">&#40;</span>html<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
MimeMessage msg <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MimeMessage<span style="color: #009900;">&#40;</span>session<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
msg.<span style="color: #006633;">setContent</span><span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// set sender and recipient</span>
msg.<span style="color: #006633;">setFrom</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> InternetAddress<span style="color: #009900;">&#40;</span>from<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
msg.<span style="color: #006633;">addRecipient</span><span style="color: #009900;">&#40;</span>Message.<span style="color: #006633;">RecipientType</span>.<span style="color: #006633;">TO</span>, <span style="color: #000000; font-weight: bold;">new</span> InternetAddress<span style="color: #009900;">&#40;</span>to<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
msg.<span style="color: #006633;">setSubject</span><span style="color: #009900;">&#40;</span>subject<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// transport the message</span>
<span style="color: #666666; font-style: italic;">// &lt; -- we will send the message over smtps --&gt;</span>
SMTPSSLTransport transport <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>SMTPSSLTransport<span style="color: #009900;">&#41;</span>session.<span style="color: #006633;">getTransport</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;smtps&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// connect to server</span>
<span style="color: #666666; font-style: italic;">// &lt; -- fill in gmail email address and password --&gt;</span>
transport.<span style="color: #006633;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;smtp.gmail.com&quot;</span>, <span style="color: #0000ff;">&quot;mail@gmail.com&quot;</span>, <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// send the message</span>
transport.<span style="color: #006633;">sendMessage</span><span style="color: #009900;">&#40;</span>msg, msg.<span style="color: #006633;">getAllRecipients</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// close the connection</span>
transport.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> catch<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
e.<span style="color: #006633;">getStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nepherte.be/send-mail-over-smtps-in-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
