<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Masumi Mutsuda</title>
	
	<link>http://mutsuda.com</link>
	<description>Passionate geek voice actor</description>
	<lastBuildDate>Sun, 12 May 2013 17:56:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Nigeka" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="nigeka" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Raspberry Pi for Secret Agents</title>
		<link>http://mutsuda.com/2013/05/12/raspberry-pi-for-secret-agents/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=raspberry-pi-for-secret-agents</link>
		<comments>http://mutsuda.com/2013/05/12/raspberry-pi-for-secret-agents/#comments</comments>
		<pubDate>Sun, 12 May 2013 17:55:33 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Ciència]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2449</guid>
		<description><![CDATA[I recently had the honor to participate in the technical reviewing of a cool book about Raspberry Pi and fun applications for the famous mini computer. It shows you how to do many cool things like video/audio spying, GPS tracking, &#8230; <a href="http://mutsuda.com/2013/05/12/raspberry-pi-for-secret-agents/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://www.packtpub.com/raspberry-pi-for-secret-agents/book"><img class="alignright size-full wp-image-2454" style="border: 0px;" alt="Raspberry Pi for Secret Agents" src="http://mutsuda.com/wp-content/uploads/2013/05/5787OT.png" width="175" height="213" /></a>I recently had the honor to participate in the technical reviewing of a cool book about <strong>Raspberry Pi</strong> and fun applications for the famous mini computer. It shows you how to do many cool things like video/audio spying, GPS tracking, &#8220;network security analysis&#8221;&#8230;<br />
If you liked my posts about the Raspberry Pi you will definitely love book, so I encourage you to <a title="Raspberry Pi for Secret Agents" href="http://www.packtpub.com/raspberry-pi-for-secret-agents/book">grab a copy of the eBook or the printed book</a>, because you will learn a lot, and it won&#8217;t let you down!</p>
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2013/05/12/raspberry-pi-for-secret-agents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partitura Polseres Vermelles per a piano</title>
		<link>http://mutsuda.com/2013/04/07/partitura-polseres-vermelles-per-a-piano/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=partitura-polseres-vermelles-per-a-piano</link>
		<comments>http://mutsuda.com/2013/04/07/partitura-polseres-vermelles-per-a-piano/#comments</comments>
		<pubDate>Sat, 06 Apr 2013 23:21:45 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Música]]></category>
		<category><![CDATA[partitura]]></category>
		<category><![CDATA[piano]]></category>
		<category><![CDATA[polseres]]></category>
		<category><![CDATA[polseres vermelles]]></category>
		<category><![CDATA[pulseras]]></category>
		<category><![CDATA[pulseras rojas]]></category>
		<category><![CDATA[rojas]]></category>
		<category><![CDATA[solo]]></category>
		<category><![CDATA[vermelles]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2430</guid>
		<description><![CDATA[Polseres Vermelles (Pulseras Rojas, The Red Band Society) s&#8217;ha convertit en la sèrie del moment no només a Catalunya, també arreu del món. La banda sonora està composta en la major part per temes de grups catalans, però també hi &#8230; <a href="http://mutsuda.com/2013/04/07/partitura-polseres-vermelles-per-a-piano/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Polseres Vermelles (Pulseras Rojas, The Red Band Society) s&#8217;ha convertit en la sèrie del moment no només a Catalunya, també arreu del món. La banda sonora està composta en la major part per temes de grups catalans, però també hi ha algunes peces d&#8217;orquestra per Arnau Batallé. Per petició popular he fet la partitura d&#8217;una peça que en algunes ocasions sona amb piano sol, en d&#8217;altres acompanyat dels violins, però que per si sola ja té bastant de cos.</p>
<p style="text-align: justify;"><a href="http://bit.ly/17jxFIz">Descarrega la partitura de Polseres Vermelles</a> (comenteu si us agrada <img src='http://mutsuda.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )</p>
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F86659656"></iframe>
<p><iframe src="http://www.youtube.com/embed/1rKqi7iOveM" height="360" width="640" allowfullscreen="" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2013/04/07/partitura-polseres-vermelles-per-a-piano/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>For how long does “X” play Minecraft a day?</title>
		<link>http://mutsuda.com/2013/04/02/for-how-long-does-x-play-minecraft-a-day/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=for-how-long-does-x-play-minecraft-a-day</link>
		<comments>http://mutsuda.com/2013/04/02/for-how-long-does-x-play-minecraft-a-day/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 20:04:16 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Paranoies]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[playtime]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[ticks]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[track]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2388</guid>
		<description><![CDATA[If you are a parent, a brother, a boyfriend or a girlfriend of someone who plays Minecraft you must have asked yourself this question: How many f**** hours does my son, girlfriend, boyfriend, father or mother play Minecraft a day? &#8230; <a href="http://mutsuda.com/2013/04/02/for-how-long-does-x-play-minecraft-a-day/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">If you are a parent, a brother, a boyfriend or a girlfriend of someone who plays Minecraft you must have asked yourself this question: How many f**** hours does my son, girlfriend, boyfriend, father or mother play Minecraft a day? They are literally stuck to their computers day and night and you come to wonder if they actually do anything else.</p>
<p style="text-align: justify;">The thing is you can&#8217;t control them, because you are not always there to check if they are playing or not, and they can lie you about how long they have been playing. In most cases they don&#8217;t even know the number.</p>
<div id="attachment_2389" class="wp-caption aligncenter" style="width: 810px"><a href="http://mutsuda.com/wp-content/uploads/2013/04/Untitled-2.jpg"><img class="size-full wp-image-2389" alt="Average Minecraft Player" src="http://mutsuda.com/wp-content/uploads/2013/04/Untitled-2.jpg" width="800" height="800" /></a><p class="wp-caption-text">Average Minecraft Player</p></div>
<p style="text-align: justify;"><span id="more-2388"></span></p>
<p style="text-align: justify;">Fortunately Minecraft provides a <a href="http://www.minecraftwiki.net/wiki/Statistics">set of statistic data</a> that can be really useful to get an idea of how addicted someone is to the game. One of the most interesting pieces of data is the <strong>Minutes Played </strong>statistic, which is the actual time that the player has been playing  (pause time or menu navigating time does not count). But this data is absolute, and will always show the total amount of minutes played, which can be really difficult to read or to compare to the day before&#8217;s data.</p>
<p style="text-align: justify;">It would be really useful to have some sort of tracking device that could give us the total amount of minutes or hours played every day.</p>
<p style="text-align: justify;">I came up with a really simple but effective solution, using python and crontab that helped me track my brother&#8217;s Minecraft playing behaviour.</p>
<div id="attachment_2421" class="wp-caption aligncenter" style="width: 778px"><a href="http://mutsuda.com/wp-content/uploads/2013/04/image.jpg"><img class="size-full wp-image-2421" alt="Simple schema" src="http://mutsuda.com/wp-content/uploads/2013/04/image.jpg" width="768" height="704" /></a><p class="wp-caption-text">Simple schema</p></div>
<p style="text-align: justify;">Minecraft stores time data in ticks, every tick is equivalent to 0,052 seconds, so I&#8217;m going to talk about ticks rather than time. The architecture is pretty straightforward, the script will parse the latest ticks obtained in the last execution (step 1), and will compare it to the Minecraft statistics file to get the difference (step 2). If no one played, the difference should be 0 ticks, but if someone did, the difference will be positive. Once we get the value, we store it again in the log file (step 3).</p>
<p style="text-align: justify;"><script src="https://gist.github.com/5282837.js"></script><noscript><pre><code class="language-python python">import re
import os.path
import datetime
import os
import time


# Path to the minecraft statistics file
mine_path = &quot;FULL_PATH_TO_/stats_user_unsent.dat&quot;

# Path to the own log
log_path = &quot;/Users/mutsuda/Code/log_stats.html&quot;

# One Minecraft tick is equivalent to 0.052 seconds
eq = 0.052

# The regular expression that will match the gameplay Ticks
ticks_regex = re.compile('{&quot;1100&quot;:.*}');

# Return the current number of ticks in a Minecraf stats file
def get_ticks(f):
	for line in f:
		time = ticks_regex.findall(line)
		if time:
			return time[0].split(':')[1].replace(&quot;}&quot;,&quot;&quot;)

# Gets the latest data from the log file
def get_latest_ticks(f):
	last = os.popen(&quot;tail -n 1 %s&quot; % log_path).read()
	return last.split('|')[1]

# Operates the current ticks with the old ones
def get_result(aT,lT):
	delta_ticks = int(aT) - int(lT)
	delta_time = datetime.timedelta(seconds=delta_ticks*eq)
	return (&quot;[&quot; + str(datetime.datetime.now())+ &quot;]&quot; +  
		&quot;|&quot; + str(aT)+ &quot;|&quot; + str(delta_time))

# Writes the resulting line back to the log file
def write_result(f,result):
	f.write(result+&quot;\n&quot;)

def main():
	latest_ticks = 0

	# Read latest ticks
	if os.path.exists(log_path):

		# If the file already exists, we obtain the latest ticks
		latest_ticks = get_latest_ticks(open(log_path,'r'))
	
	# We get the ticks we have now in the minecraft stats file
	actual_ticks = get_ticks(open(mine_path, 'r'))

	# We obtain the line we the delta in ticks and time
	result = get_result(actual_ticks,latest_ticks);

	# We now write the result into our statistics file
	write_result(open(log_path,&quot;a&quot;),result)


if __name__ == &quot;__main__&quot;:
    main()</code></pre></noscript></p>
<p style="text-align: justify;">Finally, what we want to do is to automatically run the script once a day, so we just have to configure crontab to do it for us.</p>
<p style="text-align: justify;">We can easily edit crontab with the &#8220;crontab -e&#8221; command. We will add the line:</p>
<pre style="text-align: justify;">0 1 * * * python /PATH_TO_YOUR_SCRIPT/mine_time.py</pre>
<p style="text-align: justify;">This will set crontab to run your script every one in the morning.</p>
<p style="text-align: justify;">As you can see it&#8217;s pretty simple to set up. In this case the script is supposed to read a local file, but you could easily use <strong>scp </strong>to do all this tracking remotely, for example in a hidden raspberry pi (why the hell would you like to hide it? well it&#8217;s just cooler). The script is just ment to check one user, but if you have more than one son you might want to replicate the code for each son, or rewrite it in to make it more generic.</p>
<p style="text-align: justify;">The result:</p>
<p style="text-align: justify;"><a href="http://mutsuda.com/wp-content/uploads/2013/04/Captura-de-pantalla-2013-04-02-a-las-21.28.04.png"><img class="aligncenter size-full wp-image-2426" alt="Command line" src="http://mutsuda.com/wp-content/uploads/2013/04/Captura-de-pantalla-2013-04-02-a-las-21.28.04.png" width="380" height="48" /></a>So on April 2nd he played 6 hours and 44 minutes, and he said he thought he had been playing for 1 hour and 20 minutes!</p>
<p style="text-align: justify;">#LOL</p>
<p style="text-align: justify;">
<link href="https://gist.github.com/assets/embed-0af287a4b5c981db301049e56f06e5d3.css" rel="stylesheet" media="screen" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2013/04/02/for-how-long-does-x-play-minecraft-a-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pianoforte 2010 – Jake Shimabukuro</title>
		<link>http://mutsuda.com/2013/03/31/pianoforte-2010-jake-shimabukuro/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pianoforte-2010-jake-shimabukuro</link>
		<comments>http://mutsuda.com/2013/03/31/pianoforte-2010-jake-shimabukuro/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 02:10:51 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Música]]></category>
		<category><![CDATA[Flute]]></category>
		<category><![CDATA[jake]]></category>
		<category><![CDATA[piano]]></category>
		<category><![CDATA[pianoforte]]></category>
		<category><![CDATA[pianoforte2010]]></category>
		<category><![CDATA[shimabukuro]]></category>
		<category><![CDATA[ukelele]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2377</guid>
		<description><![CDATA[Aquest cap de setmana he tingut temps per gravar una cançó que porto uns dies intentant amb ukelele però que encara no he aconseguit dominar. Davant la frustració he decidit interpretar-la fent una versió per a piano i dues flautes &#8230; <a href="http://mutsuda.com/2013/03/31/pianoforte-2010-jake-shimabukuro/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Aquest cap de setmana he tingut temps per gravar una cançó que porto uns dies intentant amb ukelele però que encara no he aconseguit dominar. Davant la frustració he decidit interpretar-la fent una versió per a piano i dues flautes travesseres, i ho he gravat amb video per poder-ho penjar a Youtube.</p>
<p><iframe src="http://www.youtube.com/embed/luOw_IzxS-8?rel=0" height="360" width="640" allowfullscreen="" frameborder="0"></iframe></p>
<p style="text-align: justify;">La cançó és una obra de Jake Shimabukuro, un músic Hawaià i virtuós de l&#8217;ukelele de qui em vaig comprar un llibre de partitures recentment. El meu objectiu final és poder-la tocar tal i com la va concebre, per a 3 ukeleles, però em queda un llarg camí a recórrer abans no hi arribi!</p>
<p style="text-align: justify;">Fins la propera!</p>
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2013/03/31/pianoforte-2010-jake-shimabukuro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minecraft server recipies</title>
		<link>http://mutsuda.com/2013/01/16/minecraft-server-recipies/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=minecraft-server-recipies</link>
		<comments>http://mutsuda.com/2013/01/16/minecraft-server-recipies/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 20:41:51 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2321</guid>
		<description><![CDATA[These are some pieces of code I use to make my life easier when managing the Minecraft server I run. The first of them is updating the server, because as everyone knows, every now and then the server needs to &#8230; <a href="http://mutsuda.com/2013/01/16/minecraft-server-recipies/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">These are some pieces of code I use to make my life easier when managing the Minecraft server I run.</p>
<p><img class="size-full wp-image-2323" title="Untitled-2" src="http://mutsuda.com/wp-content/uploads/2013/01/Untitled-2.jpg" alt="" width="642" height="377" /></p>
<p style="text-align: justify;">The first of them is updating the server, because as everyone knows, every now and then the server needs to be updated in order to accept players with updated versions of their clients.</p>
<pre>wget -O $HOME/server/minecraft_server.jar https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar</pre>
<p style="text-align: justify;">This line simply downloads the file from the Minecraft webpage server to the directory I have mine, overwriting it.</p>
<p style="text-align: justify;">My server is open to almost everyone, and sometimes there is people that destroy things I build, maybe even without willing. For that purpose I have a mini script I run every now and then (although it could be added to a cron job for it to be executed periodically) that simply backups the current world status to a backup directory I called &#8220;world_backups&#8221;.</p>
<p style="text-align: justify;">World backup mini script:</p>
<pre>!/bin/sh
d=$(date +%Y%m%d%H%M%S)
mkdir $HOME/sever/world_backups/"world_at_"$d
cp -r $HOME/server/world/* $HOME/server/world_backups/"world_at_"$d
echo "Done!"</pre>
<p style="text-align: justify;">It uses the current date as an ID to differentiate one world from the other. It might take a while, but once it&#8217;s done, you will get prompted.</p>
<p style="text-align: justify;">And finally one of the most useful scripts, the one that starts the server. It checks if it is already running, and if it is not, it starts it using the &#8220;screen&#8221; command.</p>
<p style="text-align: justify;">Server start mini script:</p>
<pre>#!/bin/sh
running=$(netstat -tulnap | grep 25565)
if [ -z "$running" ]
then
 echo "Minecraft server not running, starting it..."
 cd $HOME/server
 screen java -Xmx512M -Xincgc -jar minecraft_server.jar
 fi
else
 echo "Minecraft server already running!"
 screen -x
fi</pre>
<p style="text-align: justify;">I use the &#8220;screen&#8221; command because the server does not have a display so I access it through an SSH console. You don&#8217;t want your server to shut down whenever you close your connection to the server&#8230; If the server is already running, the command &#8220;screen -x&#8221; is executed so you get access to the Minecraft console again.</p>
<p style="text-align: justify;">And this is everything for now!</p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2013/01/16/minecraft-server-recipies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux Minecraft Server 101</title>
		<link>http://mutsuda.com/2013/01/14/linux-minecraft-server-101/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=linux-minecraft-server-101</link>
		<comments>http://mutsuda.com/2013/01/14/linux-minecraft-server-101/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 00:09:41 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2292</guid>
		<description><![CDATA[This post will guide you through the process of setting up a server as your Minecraft playground and opening it to the world to join and play. Setting up a Linux Minecraft server for anyone to play in it is &#8230; <a href="http://mutsuda.com/2013/01/14/linux-minecraft-server-101/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">This post will guide you through the process of setting up a server as your Minecraft playground and opening it to the world to join and play.</p>
<p style="text-align: justify;">Setting up a Linux Minecraft server for anyone to play in it is not difficult, but involves 3 steps.</p>
<ol style="text-align: justify;">
<li>Make your network reachable from anywhere</li>
<li>Make your router point your server machine</li>
<li>Install the Minecraft server</li>
</ol>
<div style="text-align: justify;">Ironically, the third point is the easiest, so I&#8217;m going to try to make everything clear.</div>
<p>&nbsp;</p>
<div style="text-align: justify;"><a href="http://mutsuda.com/wp-content/uploads/2013/01/2013-01-14_00.48.52_Snapseed.jpg"><img class="aligncenter size-full wp-image-2311" title="Minecraft shot" src="http://mutsuda.com/wp-content/uploads/2013/01/2013-01-14_00.48.52_Snapseed.jpg" alt="" width="672" height="480" /></a></div>
<p style="text-align: justify;"><span id="more-2292"></span></p>
<p>&nbsp;</p>
<h1 style="text-align: justify;"><span style="color: #000000; font-weight: bold;">Make your network reachable from anywhere at anytime</span></h1>
<p style="text-align: justify;">In order to make you network reachable from anywhere you will either need to have a static IP address, or to use a service like <a href="http://www.no-ip.com/">no-ip</a> to create an alias for your public IP that keeps updating it whenever it changes.</p>
<p style="text-align: justify;">Go to this URL in your browser to discover your own public IP address:</p>
<pre><a href="http://www.whatismyip.com">http://www.whatismyip.com/</a></pre>
<p style="text-align: justify;">If you are lucky enough to have a static IP address, your are done with step 1. Let&#8217;s assume that you DON&#8217;T have a static IP address, as most of you won&#8217;t.</p>
<p style="text-align: justify;">Go to <a href="http://www.no-ip.com/">no-ip</a> and register as a new user choosing your domain name of choice.</p>
<p style="text-align: justify;"><a href="http://mutsuda.com/wp-content/uploads/2013/01/noip.jpg"><img class="aligncenter size-full wp-image-2297" title="Registering to no-ip" src="http://mutsuda.com/wp-content/uploads/2013/01/noip.jpg" alt="Registering to no-ip" width="423" height="316" /></a></p>
<p style="text-align: justify;">The next step is downloading the DNS update client, which will keep your public IP up to date. Here is a <a title="Install no-ip dns update" href="http://support.no-ip.com/customer/portal/articles/363247-installing-the-linux-dynamic-update-client-on-ubuntu">detailed explanation</a> (and video) on how to do it in Ubuntu Linux.</p>
<p style="text-align: justify;">Congratulations! Now your network is accessible from everywhere at:</p>
<pre>whatyouchose.no-ip.org</pre>
<p>&nbsp;</p>
<h1 style="text-align: justify;"><span style="color: #000000; font-weight: bold;">Make your router point your server machine</span></h1>
<p style="text-align: justify;">Once you&#8217;ve set up the address that will be able to access your router from the outside, you will have to change your router configuration in order to point it to the machine that is running the Minecraft server.</p>
<p style="text-align: justify;">Enter your router configuration by going to this address in your browser:</p>
<pre>http://192.168.1.1</pre>
<p style="text-align: justify;">You will likely be asked for a user and password. If nobody changed it, it could be something like &#8220;admin&#8221; &#8220;admin&#8221; or &#8220;admin&#8221; &#8220;1234&#8243;. Keep trying, ask someone who knows, or check the bottom of your router, because it might be written there.</p>
<p style="text-align: justify;">Once you are inside, you have to search for the &#8220;Port Forwarding&#8221; menu. It&#8217;s sometimes under &#8220;Application and Gaming&#8221; but it&#8217;s slightly different in every router, so you might want to check for further instructions <a href="http://portforward.com/english/applications/port_forwarding/Minecraft_Server/">here</a>.</p>
<p style="text-align: justify;">Once you find that menu, add a line to make the router point your server whenever it gets a request from a Minecraft client. Minecraft server runs by default in the port 25565.</p>
<p style="text-align: justify;"><a href="http://mutsuda.com/wp-content/uploads/2013/01/Captura-de-pantalla-2013-01-13-a-las-22.51.24.png"><img class="aligncenter size-full wp-image-2293" title="Port Forwarding for Minecraft" src="http://mutsuda.com/wp-content/uploads/2013/01/Captura-de-pantalla-2013-01-13-a-las-22.51.24.png" alt="Port Forwarding for Minecraft" width="439" height="39" /></a></p>
<p style="text-align: justify;">In my case, the server&#8217;s IP is 192.168.1.41 but you might want to check yours by running the following command in your server&#8217;s terminal:</p>
<pre>ifconfig</pre>
<p style="text-align: justify;">You will find your server&#8217;s IP address in the output</p>
<pre>eth1 Link encap:Ethernet HWaddr 00:c0:26:a0:53:bd
 inet addr:<strong>192.168.1.41</strong> Bcast:192.168.1.255 Mask:255.255.255.0
 inet6 addr: fe80::2c0:26ff:fea0:53bd/64 Scope:Link
 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
 RX packets:10297691 errors:0 dropped:0 overruns:0 frame:0
 TX packets:5870460 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:1029027266 (1.0 GB) TX bytes:2505625407 (2.5 GB)
 Interrupt:22 Base address:0xdd00</pre>
<p>&nbsp;</p>
<h1>Install the Minecraft Server</h1>
<p>As I said before, installing the server is the easiest part. You may want to create a directory named &#8220;Minecraft&#8221; where we will put the server.</p>
<pre>cd $HOME
mkdir Minecraft</pre>
<p>Then, you want to download the server to that directory.</p>
<pre>wget -O $HOME/Minecraft/minecraft_server.jar https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar</pre>
<p>And finally you will want to run it!</p>
<pre>cd $HOME/Minecraft
java -Xmx512M -Xincgc -jar minecraft_server.jar</pre>
<p>This will generate all the files a server needs to start, and will enable other users to join it as you might be used to.</p>
<p><a href="http://mutsuda.com/wp-content/uploads/2013/01/Captura-de-pantalla-2013-01-14-a-las-00.44.13.png"><img class="aligncenter size-full wp-image-2310" title="Minecraft Multiplayer Screen" src="http://mutsuda.com/wp-content/uploads/2013/01/Captura-de-pantalla-2013-01-14-a-las-00.44.13.png" alt="" width="664" height="465" /></a></p>
<p>Happy crafting! ^^</p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2013/01/14/linux-minecraft-server-101/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi into an audio spying device</title>
		<link>http://mutsuda.com/2012/09/07/raspberry-pi-into-an-audio-spying-device/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=raspberry-pi-into-an-audio-spying-device</link>
		<comments>http://mutsuda.com/2012/09/07/raspberry-pi-into-an-audio-spying-device/#comments</comments>
		<pubDate>Fri, 07 Sep 2012 10:54:11 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Ciència]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[alsamixer]]></category>
		<category><![CDATA[mic]]></category>
		<category><![CDATA[microphone]]></category>
		<category><![CDATA[pi]]></category>
		<category><![CDATA[raspberry]]></category>
		<category><![CDATA[raspberry pi]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2279</guid>
		<description><![CDATA[If you are a spy or work for the CIA or the FBI, this will come in handy in your knowledge. Given the size and price of the Raspberry Pi, it occurred to me that using it as a spying &#8230; <a href="http://mutsuda.com/2012/09/07/raspberry-pi-into-an-audio-spying-device/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">If you are a spy or work for the CIA or the FBI, this will come in handy in your knowledge. Given the size and price of the Raspberry Pi, it occurred to me that using it as a spying device (which are actually really expensive) would be really appropriate.</p>
<p style="text-align: justify;">In this case, I&#8217;ll explain how to convert your Raspberry Pi into an audio streaming device, or audio spying device, however suits best to you. Use it under your own responsibility.</p>
<h2 style="text-align: justify;">Plugging the microphone and loading the module</h2>
<p style="text-align: justify;">The Raspberry Pi has an audio output jack, but unfortunately there is no input port. We will then need a USB microphone. If you have one, keep reading, if not, go buy one <img src='http://mutsuda.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (or plug a webcam with microphone).</p>
<p style="text-align: justify;">Once the microphone is plugged in, you might have to load the audio module by typing the following command if it isn&#8217;t.</p>
<pre style="text-align: justify;">sudo modprobe snd_bcm2835</pre>
<h2 style="text-align: justify;">Recording and playing a test file</h2>
<p style="text-align: justify;">Now we can try to record some audio into a file by running:</p>
<pre>arecord -D plughw:1,0 test.wav</pre>
<p style="text-align: justify;">Just press CTRL+C once you think you&#8217;ve got enough recording. Now let&#8217;s play it to see if it works! But first, plug your earphones to the audio output of your Raspberry Pi!</p>
<pre>aplay test.wav</pre>
<p style="text-align: justify;">Did you hear anything? Great! Your Raspberry is ready to &#8220;rock&#8221;ord some audio!</p>
<p style="text-align: justify;">If you want to record louder or adjust some parameter, you can use the alsamixer tool to play with the input/output levels of your microphone.</p>
<pre>alsamixer</pre>
<div class="mceTemp mceIEcenter" style="text-align: justify;">
<dl id="" class="wp-caption aligncenter" style="width: 555px;">
<dt class="wp-caption-dt"><img class="  " title="Alsamixer" src="https://dl.dropbox.com/u/226227/blogcontent/alsamixer.png" alt="Alsamixer" width="545" height="545" /></dt>
<dd class="wp-caption-dd">Alsamixer</dd>
</dl>
</div>
<p style="text-align: justify;">Once you have set your settings, remember to store your changes:</p>
<pre>sudo alsactl store</pre>
<h2 style="text-align: justify;">Streaming the audio to another PC</h2>
<p style="text-align: justify;">What we want to do next, is to give the Pi the capability to send this audio through the network, maybe to a server we have somewhere. In order to tho that, we will pipe the audio from the microphone into an ssh communication to the destination computer. As simple as:</p>
<pre>arecord -D plughw:1,0 -f dat | ssh -C user@remoteip aplay -f dat</pre>
<p style="text-align: justify;">Now you have everything set! Switch on your speakers in the destination PC, and hear what the Raspberry Pi is spying from hundreds of miles!</p>
<div class="mceTemp" style="text-align: justify;">
<dl id="" class="wp-caption alignnone" style="width: 606px;">
<dt class="wp-caption-dt"><img class="     " title="Raspberry under the bed" src="https://dl.dropbox.com/u/226227/blogcontent/bed_Snapseed.jpg" alt="Raspberry under the bed" width="596" height="448" /></dt>
<dd class="wp-caption-dd">Raspberry under the bed</dd>
</dl>
</div>
<p style="text-align: justify;">In this (two overlapped and faded) pictures you can see my Raspberry Pi set under a bed, using a Wifi dongle, set to work as a baby-cry transmitter.</p>
<p style="text-align: justify;">This might be useful in some situations ^^</p>
<p style="text-align: justify;">See you!</p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2012/09/07/raspberry-pi-into-an-audio-spying-device/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi + Webcam + Python + BASH + Dropbox = geek</title>
		<link>http://mutsuda.com/2012/09/03/raspberry-pi-photo-automatio/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=raspberry-pi-photo-automatio</link>
		<comments>http://mutsuda.com/2012/09/03/raspberry-pi-photo-automatio/#comments</comments>
		<pubDate>Sun, 02 Sep 2012 22:20:33 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Camera]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[logitech]]></category>
		<category><![CDATA[pi]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[raspberry]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2269</guid>
		<description><![CDATA[I recently acquired a Raspberry Pi and have been playing with it for some time. It amazes me how powerful can something so small and cheap be. We could say that the Raspberry Pi is just a really small computer without &#8230; <a href="http://mutsuda.com/2012/09/03/raspberry-pi-photo-automatio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">I recently acquired a <a title="Raspberry Pi" href="http://www.raspberrypi.org/">Raspberry Pi</a> and have been playing with it for some time. It amazes me how powerful can something so small and cheap be. We could say that the Raspberry Pi is just a really small computer without case (or fans).</p>
<p style="text-align: justify;">There are countless projects counting on the power, price and size of the Raspberry Pi, but I wanted to implement an easy one just to see what kind of things could be done.</p>
<blockquote>
<p style="text-align: justify;">My goal was to set the Raspberry Pi with a Logitech Quickcam Express camera plugged in, to upload a picture to my Dropbox folder, whenever anyone in the world visited a website hosted in the same Raspberry Pi.</p>
</blockquote>
<p style="text-align: justify;">Yes, I know, it&#8217;s useless, but let me enjoy, ok? <img src='http://mutsuda.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="mceTemp" style="text-align: justify;">
<dl id="" class="wp-caption alignnone" style="width: 531px;">
<dt class="wp-caption-dt"><img class="   " title="General architecture" src="https://dl.dropbox.com/u/226227/blogcontent/raspberry.png" alt="General architecture" width="521" height="368" /></dt>
<dd class="wp-caption-dd">General architecture</dd>
</dl>
</div>
<p style="text-align: justify;"><span id="more-2269"></span></p>
<p style="text-align: justify;">You&#8217;ll just need your Raspberry Pi, a computer with Dropbox where you can SSH, and a webcam. In the explanation of this process I&#8217;ll assume that you have the latest Raspbian &#8220;Wheezy&#8221; installed. If not, download it and install it from <a href="http://www.raspberrypi.org/downloads">here</a>.</p>
<h2 style="text-align: justify;">1. Getting a picture from the camera</h2>
<p style="text-align: justify;">In my case I&#8217;m using a Logitech Quickcam Express (yes, a Dinacam) and it just worked without having to install anything. Just connect your webcam and check if /dev/video0 appears. If it does, open a terminal in your Raspberry Pi (or SSH to it) and type:</p>
<pre style="text-align: justify;">fswebcam -r 356x292 -d /dev/video0 test.jpg</pre>
<p style="text-align: justify;">This should output something like :</p>
<pre>--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to 'test.jpg'.</pre>
<p style="text-align: justify;">Now you took your first picture!</p>
<h2 style="text-align: justify;">2. Sending the picture to a remote machine with Dropbox installed</h2>
<p style="text-align: justify;">Ok, one of our goals is to get the pictures to Dropbox somehow. Unfortunately, installing Dropbox in your Pi is not an option. What we can do is to send those pictures to a computer in the network that has Dropbox installed. I&#8217;ll asssume 192.168.1.5 is the IP address of that computer and that it has SSH and SCP. Try this command:</p>
<pre style="text-align: justify;">scp test.jpg username@192.168.1.5:Dropbox/your_folder</pre>
<p style="text-align: justify;">It will ask your password and then it will put the image right where you need it. But we need to automate this process so we have to avoid having to enter the password. Next step!</p>
<h2 style="text-align: justify;">3. Adding the Raspberry Pi to the SSH authorized_keys in the remote machine</h2>
<p style="text-align: justify;">We don&#8217;t want the remote machine to ask for the password each time we want to send a file. We then need to generate a key in the Pi and add it to the remote machine&#8217;s authorized keys. Running the following command in your Pi will generate the keys:</p>
<pre>ssh-keygen -t rsa</pre>
<p style="text-align: justify;">The following step is to copy the public key to the remote machine :</p>
<pre> scp .ssh/id_rsa.pub user@192.168.1.5:</pre>
<p style="text-align: justify;">Then SSH into the remote machine and add the recently generated key into the authorized_keys file (last time your password will  be asked!).</p>
<pre>cat id_rsa.pub &gt;&gt; .ssh/authorized_keys</pre>
<h2 style="text-align: justify;">4. Automating the process of taking a picture and sending it to the remote machine</h2>
<p style="text-align: justify;">Ok, now we know how to take a picture, and we know how to move it to a remote machine for Dropbox to automatically upload it to its servers, but wouldn&#8217;t it be nice to wrap everything in a single script? Let&#8217;s do it.</p>
<pre>#!/bin/sh
filename=$(date +"%m-%d-%y|||%H%M%S")
fswebcam -r 356x292 -d /dev/video0 $filename.jpg
scp $filename.jpg user@192.168.1.5:Dropbox/yourfolder</pre>
<p style="text-align: justify;">Create a file called &#8220;smile.sh&#8221; and put those lines inside. It generates the filename using the current date in order to avoid collisions. Give the script permissions to run.</p>
<pre style="text-align: justify;">chmod +x smile.sh</pre>
<p style="text-align: justify;">Try running ./smile.sh and see what happens. No surprises, it takes a picture, names it with the current date and sends it to a remote computer that finally uploads it to Dropbox.</p>
<h2 style="text-align: justify;">5. Activate the script via web!</h2>
<p style="text-align: justify;">Wow, this is the last step! Wouldn&#8217;t it be great to be able to take the picture by just visiting a URL?</p>
<p style="text-align: justify;">For that to happen we need the Raspberry to be a server, and we also need to code one little CGI. Create a directory wherever you will run your server in.</p>
<pre>mkdir cgi-bin</pre>
<p style="text-align: justify;">And put a file called <strong>photo_cgi.py</strong> inside</p>
<pre>#!/usr/bin/env python
import subprocess
print "Content-type: text/html"
print "&lt;title&gt;Picture taking CGI&lt;/title&gt;"
print "&lt;p&gt;I'm going to upload the picture!&lt;/p&gt;"
subprocess.call(['/path/to/your/smile.sh'])</pre>
<p style="text-align: justify;">Finally, start your server by running:</p>
<pre>python -m CGIHTTPServer</pre>
<p style="text-align: justify;">Now, assuming your Pi IP is 192.168.1.6, open a browser anywhere in your network and type:</p>
<pre>http://192.168.1.6:8000/cgi-bin/photo_cgi.py</pre>
<p style="text-align: justify;">Open your Dropbox folder and voilà!</p>
<div class="mceTemp" style="text-align: justify;">
<dl id="" class="wp-caption alignnone" style="width: 366px;">
<dt class="wp-caption-dt"><img title="Dômo-kun and Yoshi" src="https://dl.dropbox.com/u/226227/blogcontent/09-02-12%7C%7C%7C215628.jpg" alt="Dômo-kun and Yoshi" width="356" height="292" /></dt>
<dd class="wp-caption-dd">Dômo-kun and Yoshi</dd>
</dl>
</div>
<p style="text-align: justify;">Of course now you can change your router&#8217;s configuration to redirect all 8000 petitions to your Raspberry Pi, allowing everyone in the world to upload pictures of YOU to YOUR Dropbox!</p>
<p style="text-align: justify;">Useful right?</p>
<p style="text-align: justify;">Wait until you see my next project!</p>
<p style="text-align: justify;">See you!</p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2012/09/03/raspberry-pi-photo-automatio/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>The Dark Knight Rises piano score</title>
		<link>http://mutsuda.com/2012/07/17/the-dark-knight-rises-piano-score/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-dark-knight-rises-piano-score</link>
		<comments>http://mutsuda.com/2012/07/17/the-dark-knight-rises-piano-score/#comments</comments>
		<pubDate>Tue, 17 Jul 2012 21:26:48 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[Música]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2259</guid>
		<description><![CDATA[Divendres que ve s&#8217;estrena la nova pel·lícula de Batman, però la banda sonora ja està disponible a internet. Una de les peces té un passatge bastant sinistre en piano que he volgut passar a partitura per si algú té curiositat &#8230; <a href="http://mutsuda.com/2012/07/17/the-dark-knight-rises-piano-score/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Divendres que ve s&#8217;estrena la nova pel·lícula de Batman, però la banda sonora ja està disponible a internet. Una de les peces té un passatge bastant sinistre en piano que he volgut passar a partitura per si algú té curiositat de tocar-ho.</p>
<p style="text-align: justify;"><a href="http://bit.ly/NHuSfc">Download &#8220;The Dark Knight Rises &#8211; Mind if I cut in&#8221; piano score</a></p>
<p style="text-align: justify;">La peça es diu &#8220;Mind if I cut in&#8221;</p>
<p style="text-align: justify;">Fins aviat!</p>
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2012/07/17/the-dark-knight-rises-piano-score/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bach Sonata in G minor BWV1020</title>
		<link>http://mutsuda.com/2012/07/01/bach-sonata-in-g-minor-bwv1020/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=bach-sonata-in-g-minor-bwv1020</link>
		<comments>http://mutsuda.com/2012/07/01/bach-sonata-in-g-minor-bwv1020/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 21:44:19 +0000</pubDate>
		<dc:creator>Mutsuda</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Música]]></category>

		<guid isPermaLink="false">http://mutsuda.com/?p=2248</guid>
		<description><![CDATA[Una de les meves peces preferides per a flauta travessera és la Sonata en Sol menor de Bach. Avui he tingut una estona per enregistrar-ne la part de clave per poder-la assajar amb acompanyament. D&#8217;aquí la podeu descarregar.]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;">Una de les meves peces preferides per a flauta travessera és la Sonata en Sol menor de Bach. Avui he tingut una estona per enregistrar-ne la part de clave per poder-la assajar amb acompanyament.</p>
<p style="text-align: justify;"><iframe width="100%" height="166" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F51464875&auto_play=false&show_artwork=false&color=000000"></iframe></p>
<p style="text-align: justify;"><iframe width="640" height="385" src="http://www.youtube.com/embed/jquTd56taSQ" frameborder="0" type="text/html"></iframe><div style="text-align:right;"><a style="color:#aaa;font-size:9px" href="http://www.clickonf5.org/" title="IFRAME Embed for Youtube Free WordPress Plugin" target="_blank">IFRAME Embed for Youtube</a></div></p>
<p style="text-align: justify;">
<p style="text-align: justify;"><a href="https://dl.dropbox.com/u/226227/BlogContent/Bach%20Sonata.m4a">D&#8217;aquí la podeu descarregar.</a></p>
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://mutsuda.com/2012/07/01/bach-sonata-in-g-minor-bwv1020/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss><!-- W3 Total Cache: Minify debug info:
Engine:             disk: basic
Theme:              c28f0
Template:           index
--><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Database Caching using disk: basic
Object Caching 1046/1071 objects using disk: basic

 Served from: mutsuda.llima.net @ 2013-05-22 09:01:39 by W3 Total Cache --><!-- W3 Total Cache: Page cache debug info:
Engine:             disk: enhanced
Cache key:          mutsuda.llima.net/feed/_index.html
Caching:            disabled
Reject reason:      Page is feed
Creation Time:      0.673s
Header info:
X-Pingback:          http://mutsuda.com/xmlrpc.php
Last-Modified:       Sun, 12 May 2013 17:56:07 GMT
X-W3TC-Minify:       On
Content-Type:        text/xml; charset=UTF-8
-->
