<?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>www.elsotanillo.net de Juan Sierra Pons</title>
	<atom:link href="http://www.elsotanillo.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elsotanillo.net</link>
	<description>Linux, Open Source, Bash, Virtualization, Blog, Travels, etc.</description>
	<lastBuildDate>Mon, 27 Aug 2012 08:15:47 +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>
		<item>
		<title>How to configure the Comtrend&#8217;s HG532c ADSL router ARP table for (WOL) Wake On Lan from internet using expect</title>
		<link>http://www.elsotanillo.net/2012/05/how-to-configure-the-comtrends-hg532c-adsl-router-arp-table-for-wol-wake-on-lan-from-internet-using-expect/</link>
		<comments>http://www.elsotanillo.net/2012/05/how-to-configure-the-comtrends-hg532c-adsl-router-arp-table-for-wol-wake-on-lan-from-internet-using-expect/#comments</comments>
		<pubDate>Fri, 25 May 2012 07:47:11 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Comtrend HG532c WOL]]></category>
		<category><![CDATA[expect]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wake on lan]]></category>
		<category><![CDATA[WOL]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=935</guid>
		<description><![CDATA[Several months ago I finally got the (WOL) Wake On Lan feature of my RTL8111/8168B NIC card working. The problem was that a new driver (other than the provided by Debian) and a special PCI configuration was needed. The other &#8230; <a href="http://www.elsotanillo.net/2012/05/how-to-configure-the-comtrends-hg532c-adsl-router-arp-table-for-wol-wake-on-lan-from-internet-using-expect/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Several months ago I finally got the (WOL) Wake On Lan feature of my RTL8111/8168B NIC card working. The problem was that a new driver (other than the provided by Debian) and a <a title="[SOLVED] RTL8111/8168B wake on lan (WOL) working randomly" href="http://lists.debian.org/debian-user/2012/01/msg00241.html" target="_blank">special PCI configuration was needed.</a></p>
<p>The other problem I had to deal with was the ADSL Router (Comtrend HG532c, The one provided by the <a title="Jazztel" href="http://www.jazztel.com" target="_blank">Spanish ISP Jazztel</a>) configuration:</p>
<ul>
<li>Open the required port: This was an easy one just opening the 7 a 9 port and forwarding them to the server we want to WOL from the internet</li>
<li>Make the router remember the server&#8217;s tuple MAC/IP address. That was easy too, but some manual work was needed as when router is restarted the ARP table is flushed.  <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
</ul>
<p>In my current job I had to change recently some configuration and restart more than 600 IP phones. To perform such titanic task I created a quick and dirty script using <a title="http://en.wikipedia.org/wiki/Expect " href="http://en.wikipedia.org/wiki/Expect " target="_blank">expect</a>. It worked like a charm and made me think about automatize the way I set the ARP table in my Comtrend HG532c ADSL router.</p>
<p><span id="more-935"></span></p>
<p>The scripts is very easy to understand. It just simulates a Telnet session with your router:</p>
<ol>
<li>Login and password</li>
<li>Set the required MAC/IP tuple</li>
<li>Displays the ARP table</li>
</ol>
<p>Here you are:</p>
<pre escaped="true" lang="expect" line="1">#!/usr/bin/expect -f
set timeout 10
set env(TERM)

set router "router"  #your router's dns name or IP
set login "admin"    #your router's login. admin is the default
set password "admin" #your router's password. admin is the default
set ip "192.168.1.2" #your server's IP address (not the dns name)
set mac "2f:1e:8a:84:2a:f9" #your server's MAC 

spawn telnet $router
expect "Login: "
send -- "$login\r"
expect "Password: "
send -- "$password\r"
expect "ATP&gt;"
send "sh\r"
expect "# "
send "arp -s $ip $mac\r"
expect "# "
## check that all is right
send "arp -a\r"
expect "# "</pre>
<p>The output must be similar to:</p>
<pre escaped="true" lang="">juan@mediacenter:~/bin$ ./ActualizarTablaArpRouterADSL.sh
spawn telnet router
Trying 192.168.1.1...
Connected to router.
Escape character is '^]'.
-------------------------------
-----Welcome to ATP Cli------
-------------------------------

Login: admin
Password:
ATP&gt;sh

BusyBox vv1.9.1 (2011-05-25 16:23:47 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

# arp -s 192.168.1.2 00:1e:8c:84:2a:f9
# arp -a
? (192.168.1.2) at 2F:1E:8A:84:2A:F9 [ether] PERM on br0</pre>
<p>As can be seen in the last line the router have set the ARP entry as permanent&#8230;. permanent till router next restart. <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  But at least every time this script is run the ARP is set automagically <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The next thing to do is to put this script in a crontab job, /etc/rc.local, etc of one of your servers. This way every time it runs you will be sure that you can restart your server from the internet.</p>
<p>My decision was add a line in my server&#8217;s /etc/rc.local file like this:</p>
<pre escaped="true" lang="bash" line="1">#### Sets the MAC/IP tuple in ADSL router for WOL from internet
/path/to/ActualizarTablaArpRouterADSL.sh |mail -s "`hostname` MAC para el WOL" email@domain.tld</pre>
<p>This has 2 added benefits:</p>
<ol>
<li>I will know when my server is started</li>
<li>I will know that my router configuration is ready for wake on lan</li>
</ol>
<p>The last step is have at least to ways to start your computer from the internet. Mine are:</p>
<ol>
<li><a title="Online Wake-On-LAN" href="http://www.wakeonlan.me/" target="_blank"><span id="h3">Online Wake-On-LAN</span></a> web page.</li>
<li><a title="Wol Wake on Lan Wan for Android" href="    https://play.google.com/store/apps/details?id=com.benfinnigan.wol&amp;hl=es" target="_blank">Wol Wake on Lan Wan</a> for my Android phone.</li>
</ol>
<p>I have created a github project: <a title="expect-update-arp-table-ADSL-router-for-wol" href="https://github.com/juasiepo/expect-update-arp-table-ADSL-router-for-wol" target="_blank">expect-update-arp-table-ADSL-router-for-wol</a> (just in case other features can be added later) where you can download also the source code.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2012/05/how-to-configure-the-comtrends-hg532c-adsl-router-arp-table-for-wol-wake-on-lan-from-internet-using-expect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install the Citrix Client in Linux. (Debian way and .tgz all linux flavors way)</title>
		<link>http://www.elsotanillo.net/2012/03/how-to-install-the-citrix-client-in-linux-debian-way-and-tgz-all-linux-flavors-way/</link>
		<comments>http://www.elsotanillo.net/2012/03/how-to-install-the-citrix-client-in-linux-debian-way-and-tgz-all-linux-flavors-way/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 18:12:28 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[Citrix client for Linux]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=912</guid>
		<description><![CDATA[1 year  ago I couldn&#8217;t get connected to my office&#8217;s network using my VPN client. The reason was that my p12 certificate was expired. AFAIK IPsec cannot renew certificates automatically as windows VPN client does. To make it work I &#8230; <a href="http://www.elsotanillo.net/2012/03/how-to-install-the-citrix-client-in-linux-debian-way-and-tgz-all-linux-flavors-way/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>1 year  ago I couldn&#8217;t get connected to my office&#8217;s network using my VPN client. The reason was that my p12 certificate was expired. AFAIK IPsec cannot renew certificates automatically as windows VPN client does. To make it work I needed to renew it using the windows client and then <a href="http://www.elsotanillo.net/?p=842">migrate a p12  certificate to a Linux/IPsec friendly format</a>. As I was in a little hurry I tried installing the Linux Citrix client</p>
<p><span id="more-912"></span></p>
<p>When it happened there wasn&#8217;t any .deb package so I had to install it manually from a <strong>.tgz</strong> file. I have checked the <a href="http://www.citrix.com/English/ss/downloads/details.asp?downloadId=2316611&amp;productId=1689163#top" target="_blank">Citrix Client download page</a> today and there is a .deb package so I will continue using it:</p>
<ol>
<li>Go to <a href="http://www.citrix.com/English/ss/downloads/details.asp?downloadId=2316611&amp;productId=1689163#top" target="_blank">Citrix Client download page.</a> and download the .deb (debian/ubuntu friendly) client depending your architecture 32 bits or 64. There is also a ARM version for smartphones but it is out of the scope of this tutorial. Pay attention to a small advice in the webpage <strong>x86 client &#8211; requires OpenMotif v.2.3.1</strong>. That&#8217;s an easy one <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  :
<pre escaped="true" lang="bash">sudo wajig install libmotif4 motif-clients</pre>
</li>
<li>Install the client manually using <strong>dpkg</strong>. Go to the directory where you downloaded the client and install it:</li>
</ol>
<pre escaped="true" lang="bash">juan@virtualito:~/Descargas$ sudo dpkg -i icaclient_12.0.0_i386.deb
Selecting previously unselected package icaclient.
(Leyendo la base de datos ... 262342 ficheros o directorios instalados actualmente.)
Desempaquetando icaclient (de icaclient_12.0.0_i386.deb) ...
Configurando icaclient (12.0.0) ...
No target eula.txt found under . for es_ES.UTF-8
Trying English...
No target Npica.ad found under . for es_ES.UTF-8
Trying English...
No target module.ini found under .. for es_ES.UTF-8
Trying English...
No target wfclient.ini found under .. for es_ES.UTF-8
Trying English...
No target appsrv.ini found under .. for es_ES.UTF-8
Trying English...

No target index.htm found under .. for es_ES.UTF-8
Trying English...
Procesando disparadores para menu ...</pre>
<p>As you can see it is really easy and a 2 steps (5 minutes) consuming task. Things are getting easier for .deb packages users. <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Anyway if you want to try the .tgz way. Here you are:</p>
<ol>
<li>Go to <a href="http://www.citrix.com/English/ss/downloads/details.asp?downloadId=2316611&amp;productId=1689163#top" target="_blank">Citrix Client download page.</a> and download the .tgz (all linux flavor friendly) client depending your architecture 32 bits or 64.</li>
<li>Install the <strong>OpenMotif v.2.3.1</strong>. Just in case: 
<pre escaped="true" lang="bash">sudo wajig install libmotif4 motif-clients</pre>
</li>
<li>untar, unzip the downloaded <strong>.tgz</strong> package and run the <strong>./setupwfc</strong> script:</li>
</ol>
<pre escaped="true" lang="text">juan@virtualito:~/Desktop$ ./setupwfc                                                                

No target setupwfc.msg found under /home/juan/Desktop/. for es_ES@euro                               

Trying English...                                                                                     

No target hinst.msg found under /home/juan/Desktop for es_ES@euro                                    

Trying English...                                                                                     

Citrix Receiver for Linux 11.0 setup.                                                                

Copyright 1996-2009 Citrix Systems, Inc. All rights reserved.

Citrix, Independent Computing Architecture (ICA), Program Neighborhood,

MetaFrame, and MetaFrame XP are registered trademarks and Citrix Receiver,

Citrix XenApp, XenDesktop, Citrix Presentation Server, Citrix Access Suite,

and SpeedScreen are trademarks of Citrix Systems, Inc. in the United States

and other countries.                                                       

Microsoft, MS, MS-DOS, Outlook, Windows, Windows NT, and BackOffice are

either registered trademarks or trademarks of Microsoft Corporation in

the United States and other countries.                                 

All other Trade Names referred to are the Servicemark, Trademark,

or Registered Trademark of the respective manufacturers.        

User install mode.

Select a setup option:

 1. Install Citrix Receiver for Linux 11.0

 2. Remove Citrix Receiver for Linux 11.0

 3. Quit Citrix Receiver for Linux 11.0 setup

Enter option number 1-3 [1]: 1

Please enter the directory in which Citrix Receiver for Linux is to be installed.

[default /home/juan/ICAClient/linuxx86]                                         

or type "quit" to abandon the installation:                                     

The parent directory /home/juan/ICAClient does not exist.

Do you want to create it? [default y]: y                

You have chosen to install Citrix Receiver for Linux 11.0 in /home/juan/ICAClient/linuxx86.

Proceed with installation? [default n]: y

No target eula.txt found under /home/juan/Desktop for es_ES@euro

Trying English...                                              

CITRIX(R) LICENSE AGREEMENT                                     

Use of this component is subject to the Citrix license covering the

Citrix product(s) with which you will be using this component. This

component is only licensed for use with such Citrix product(s).    

CTX_code EP_T_A34320

Select an option:

 1. I accept

 2. I do not accept

Enter option number 1-2 [2]: 1

Installation proceeding...   

Checking available disk space ...

        Disk space available 5882688 K

        Disk space required 6267 K    

Continuing ...

Creating directory /home/juan/ICAClient/linuxx86

Core package...                                

Setting file permissions...                    

No target eula.txt found under . for es_ES@euro

Trying English...                              

No target install.txt found under . for es_ES@euro

Trying English...                                

No target readme.txt found under . for es_ES@euro

Trying English...                                

No target Npica.ad found under . for es_ES@euro  

Trying English...                                 

No target module.ini found under .. for es_ES@euro

Trying English...                                

No target wfclient.ini found under .. for es_ES@euro

Trying English...                                  

No target appsrv.ini found under .. for es_ES@euro

Trying English...                                  

No target index.htm found under .. for es_ES@euro

Trying English...                               

Integrating with browsers...                    

Integration complete.

Do you want to integrate Citrix Receiver with KDE and GNOME? [default y]: y

Do you want GStreamer to use the plugin from this client? [default y]: y  

Select a setup option:

 1. Install Citrix Receiver for Linux 11.0

 2. Remove Citrix Receiver for Linux 11.0

 3. Quit Citrix Receiver for Linux 11.0 setup

Enter option number 1-3 [2]: 3

Quitting Citrix Receiver for Linux 11.0 setup.</pre>
<p>Now you can connect to your Citrix servers from Linux using Firefox or Iceweasel as the Citrix client is fully integrated with both.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2012/03/how-to-install-the-citrix-client-in-linux-debian-way-and-tgz-all-linux-flavors-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Cloud Webcast and service orchestration</title>
		<link>http://www.elsotanillo.net/2011/11/ubuntu-cloud-webcast-and-service-orchestration/</link>
		<comments>http://www.elsotanillo.net/2011/11/ubuntu-cloud-webcast-and-service-orchestration/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 18:13:49 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[service orchestration]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Webminar]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=885</guid>
		<description><![CDATA[Today I have assisted to the Ubuntu Cloud Webcast, Presented by: Mark Shuttleworth (Canonical Founder) and Stephen O&#8217;Grady from Redmonk. Enjoy! I have assisted to several others Ubuntu webminars: What&#8217;s new in Landscape 1.5: Link to the webinar Link to &#8230; <a href="http://www.elsotanillo.net/2011/11/ubuntu-cloud-webcast-and-service-orchestration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Today I have assisted to the Ubuntu Cloud Webcast, Presented by: <a title="http://en.wikipedia.org/wiki/Mark_Shuttleworth" href="http://en.wikipedia.org/wiki/Mark_Shuttleworth" target="_blank">Mark Shuttleworth</a> (Canonical Founder) and Stephen O&#8217;Grady from Redmonk.</p>
<p>Enjoy!<br />
<span id="more-885"></span><br />
<script type="text/javascript" src="http://www.brighttalk.com/clients/js/embed/embed.js"></script> <object class="BrightTALKEmbed" width="705" height="660"><param name="player" value="channel_player"/><param name="domain" value="http://www.brighttalk.com"/><param name="channelid" value="6793"/><param name="communicationid" value="35441"/><param name="autoStart" value="false"/><param name="theme" value=""/></object></p>
<p>I have assisted to several others Ubuntu webminars:</p>
<ul>
<li>What&#8217;s new in Landscape 1.5:</li>
</ul>
<blockquote>
<ol>
<li><a title="What's new in Landscape 1.5 webminar" href="https://us88.spreed.com/c/711148157/spreed/131/recorder?recording=1" target="_blank">Link to the webinar</a></li>
<li><a title="Landscape 1.5 Webinar.pdf" href="https://us88-rr.spreed.net/rrr/repo/1545371/application/pdf/001/Landscape%201.5%20Webinar.pdf?m=s&amp;u=https%3A%2F%2Fus88.spreed.com%2Fvalidate_ticket&amp;ticket=LWludGVybmFsOmRlNTIyNTg5LTdiY2QtNDk2Mi1hMzk0LTkxMzlhNzA1N2ZjMQcxNTQ1MzcxACRmYWMzOTVlZS0wOTY2LTQ3NmEtYjEyZS0yNjA3ODNmNTNhZWIXeJC6hoVAoDdfApO6SJEV&amp;download=1" target="_blank">Link to the documents</a></li>
</ol>
</blockquote>
<ul>
<li>Ubuntu Enterprsie Cloud in your Business:</li>
</ul>
<blockquote>
<ol>
<li><a title="Ubuntu Enterprsie Cloud in your Business webminar" href="https://us88.spreed.com/c/956818927/recording_gui?recording=1" target="_blank">Link to the webinar</a></li>
<li><a title="20100604UECWebinarpdf4.pdf" href="https://us88-rr.spreed.net/rrr/repo/1577275/application/pdf/002/20100604UECWebinarpdf4.pdf?m=s&amp;u=https%3A%2F%2Fus88.spreed.com%2Fvalidate_ticket&amp;ticket=LWludGVybmFsOmExM2M1ZjFlLThhYjUtNDg2MC1iYmMyLTM3MjY5MGJjYzZjNgcxNTc3Mjc1ACQxNjNlNmYxZC03ZmRjLTQ5NTAtYThlZS04M2M5Yjc1YjNiYTBthS4jSD6ywk6YjZDbmZc1&amp;download=1" target="_blank">Link to the documents</a></li>
</ol>
</blockquote>
<ul>
<li>Successful desktop migrations:</li>
</ul>
<blockquote>
<ol>
<li><a title="Successful Desktop Migration webminar" href="https://us88.spreed.com/c/907238117/recording_gui?recording=1" target="_blank">Link to the webinar</a></li>
<li><a title="UbuntuDesktopMigration.pdf" href="https://us88-rr.spreed.net/rrr/repo/1854441/application/pdf/000/UbuntuDesktopMigration.pdf?m=s&amp;u=https%3A%2F%2Fus88.spreed.com%2Fvalidate_ticket&amp;ticket=LWludGVybmFsOmQ0NDMxODZmLTBjZGMtNDMzOS1iN2ZlLTk4OTVkOTkyZTgxNwcxODU0NDQxACRjZDZjNTdkOS1lYzYwLTRlZDgtYmMxMC00NWZhMzkzN2RkZTS57Q9t0BCQaHDdxDAQYq+L&amp;download=1" target="_blank">Link to the documents</a></li>
</ol>
</blockquote>
<ul>
<li>Managing UEC with Landscape:</li>
</ul>
<blockquote>
<ol>
<li><a title="Managing UEC with Landscape webminar" href="https://us88.spreed.com/c/836231777/recording_gui?recording=1" target="_blank">Link to the webinar</a></li>
<li><a title="Landscape_Cloud_webinar.pdf" href="https://us88-rr.spreed.net/rrr/repo/1873384/application/pdf/002/Landscape_Cloud_webinar.pdf?m=s&amp;u=https%3A%2F%2Fus88.spreed.com%2Fvalidate_ticket&amp;ticket=LWludGVybmFsOmIxOTQ2ZDc0LTNhNjYtNDIyZi04OGYzLTdjYzFiYjk4ZjAwMwcxODczMzg0ACRhZGNjYjNkMC1jZTJhLTQ4NmMtYWU0OC0xOTAxM2RjNDk5YTHfrhCYSBJcnxPpDePQLgAB&amp;download=1" target="_blank">Link to the documents</a></li>
</ol>
</blockquote>
<ul>
<li>Top 10 Server questions answered</li>
</ul>
<blockquote>
<ol>
<li><a title="Your top 10 Ubuntu Server questions answered  webminar" href="https://eu42.spreed.com/c/322771773" target="_blank">Link to the webinar</a> This one I couldn&#8217;t assist  <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  but anyway the webinar is public <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ol>
</blockquote>
<p>Here you are the <a title="List with all Canonical webminars" href="http://www.canonical.com/about-canonical/resources/webinars" target="_blank">list with all Canonical webminars</a>.</p>
<p>More or less I already knew all the concepts speakers talked about: Landscape, cloud, computing, monitoring, provisioning etc. But in this one I first hear about something called <a title="A Formal Introduction to The Ubuntu Orchestra Project" href="http://blog.dustinkirkland.com/2011/08/formal-introduction-to-ubuntu-orchestra.html" target="_blank">Service orchestration.</a></p>
<p>I have previous experience with (as they call in the webinar): <strong>Machine-centric configuration</strong> management systems as <a title="http://www.puppetlabs.com" href="http://www.puppetlabs.com">puppet</a> and more or less with Landscape but In the webinar they talk about <strong>Service-centric</strong> management.</p>
<p>Interesting concept: managing services not machines.</p>
<p>I have learned something new so I can go to sleep now. &#8211; Spanish saying</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/11/ubuntu-cloud-webcast-and-service-orchestration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to connect a road warrior VPN linux client to a Check Point Firewall-1</title>
		<link>http://www.elsotanillo.net/2011/09/how-to-connect-a-road-warrior-vpn-linux-client-to-a-check-point-firewall-1/</link>
		<comments>http://www.elsotanillo.net/2011/09/how-to-connect-a-road-warrior-vpn-linux-client-to-a-check-point-firewall-1/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 14:54:58 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[OpenSwan]]></category>
		<category><![CDATA[roadwarriors VPNs in linux]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=842</guid>
		<description><![CDATA[Yesterday I received a message in the debian-user-spanish mailing list with subject: Conectarse por VPN a un Firewall-1 In that email the user was referring to very useful tutorial: Check Point Firewall-1 NG(X). I remembered that link as I used &#8230; <a href="http://www.elsotanillo.net/2011/09/how-to-connect-a-road-warrior-vpn-linux-client-to-a-check-point-firewall-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Yesterday I received a message in the <a title="http://lists.debian.org/debian-user-spanish" href="http://lists.debian.org/debian-user-spanish" target="_blank">debian-user-spanish</a> mailing list with subject: <a title="Conectarse por VPN a un Firewall-1" href="http://lists.debian.org/debian-user-spanish/2011/09/msg01496.html" target="_blank">Conectarse por VPN a un Firewall-1</a></p>
<p>In that email the user was referring to very useful tutorial: <a title="Check Point Firewall-1 NG(X)" href="http://www.fw-1.de/aerasec/ng/vpn-freeswan/CP-FW1-NG+Linux-FreeSWAN-RoadWarrior.html" target="_blank">Check Point Firewall-1 NG(X). </a>I remembered that link as I used it to configure my first road warrior VPN client. But this document is outdated as the procedure to obtain the private key is not valid anymore. There is a new procedure that I documented in my personal wiki. In this post I am gonna copy &amp; paste the right procedure from it.</p>
<p><span id="more-842"></span></p>
<p>This is a almost copy and paste procedure post. I am not going to explain all the &#8220;History/Theory&#8221; as it has been already well documented in the <a title="Check Point Firewall-1 NG(X)" href="http://www.fw-1.de/aerasec/ng/vpn-freeswan/CP-FW1-NG+Linux-FreeSWAN-RoadWarrior.html" target="_blank">Check Point Firewall-1 NG(X)</a> tutorial.</p>
<h1>Get the needed files from the .pk12 certificate and put them in the right directories:</h1>
<p>Retrieving DER-encoded CRL from CheckPoint</p>
<pre escaped="true" lang="bash">wget http://firewall-1:18264/ICA_CRL1.crl</pre>
<p>Converting DER-encoded CRL to PEM-encoded and store it in related directory</p>
<pre escaped="true" lang="bash">openssl crl -in ICA_CRL1.crl -inform DER -outform PEM -out /etc/ipsec.d/crls/checkpoint.crl</pre>
<p>Convert user certificate generated by Check Point Management from PKCS#12 to X.509</p>
<p>Extract private key of user PKCS#12, you have to specify first the import password (remember: given in GUI) and an export password</p>
<pre escaped="true" lang="bash">openssl pkcs12 -in vpnjuan.p12 -nocerts -out tempkey.pem</pre>
<p>Convert private key of user to RSA:</p>
<pre escaped="true" lang="bash">openssl rsa -in tempkey.pem -des3 -out /etc/ipsec.d/private/vpnjuan-key.pem</pre>
<p>Copy <strong>firewall-1-cert.pem</strong> (provided by your network admin) in /etc/ipsec.d/certs/<strong>firewall-1-cert.pem</strong></p>
<p>Extract certificates of user from PKCS#12 to X.509 (results in a file containing the CA and the user certificate)</p>
<pre escaped="true" lang="bash">openssl pkcs12 -in vpnjuan.p12 -nokeys -out temp2.pem</pre>
<p>Split singe file into different ones, results in e.g. firewall-1-internal-ca.pem (CA certificate is first one in file) and vpnjuan-cert.pem (user certificate is normally the second one in file) The header part of the CA certificate is like:</p>
<p>subject=/O=checkpoint.intranet.example.com..p9bkhs</p>
<p>issuer= /O=checkpoint.intranet.example.com..p9bkhs</p>
<p>The header of the user certificate is like:</p>
<p>subject=/O=checkpoint.intranet.example.com..p9bkhs/OU=users/CN=freeswan</p>
<p>issuer=/O=checkpoint.intranet.example.com..p9bkhs</p>
<p>Copy user X.509 certificate to related Openswan directory</p>
<pre escaped="true" lang="bash">cp vpnjuan-cert.pem /etc/ipsec.d/certs</pre>
<p>Copy firewall-1 CA certificate to related Openswan directory</p>
<pre escaped="true" lang="bash">cp firewall-1-internal-ca.pem /etc/ipsec.d/cacerts</pre>
<h1>Modifying the .conf files:</h1>
<p>Add the following line to /etc/ipsec.secrets</p>
<pre escaped="true" lang="bash">: RSA /etc/ipsec.d/private/vpnjuan-key.pem %prompt</pre>
<p>Modify the /etc/ipsec.conf depending your own configuration:</p>
<pre escaped="true" lang="bash"># /etc/ipsec/ipsec.conf - Openswan IPsec configuration file
# RCSID $Id: ipsec.conf.in,v 1.15.2.6 2006/10/19 03:49:46 paul Exp $

# This file:  /usr/share/doc/openswan-2.4.15-r2/ipsec.conf-sample
#
# Manual:     ipsec.conf.5

version 2.0     # conforms to second version of ipsec.conf specification

# basic configuration
config setup
        # plutodebug / klipsdebug = "all", "none" or a combation from below:
        # "raw crypt parsing emitting control klips pfkey natt x509 private"
        # eg: plutodebug="control parsing"
        #
        # ONLY enable plutodebug=all or klipsdebug=all if you are a developer !!
        #
        # NAT-TRAVERSAL support, see README.NAT-Traversal
        nat_traversal=yes
        # virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12
        #
        # enable this if you see "failed to find any available worker"
        nhelpers=0
#       plutodebug=all
        protostack=netkey
# Add connections here
# sample VPN connections, see /etc/ipsec.d/examples/

## RoadWarrior to Net behind Gateway: FreeS/WAN X.509 &lt;-&gt; Check Point - Net
conn MYCOMPANYCONNECTION
    # Right side is FreeS/WAN RoadWarrior
    right=%defaultroute
    rightrsasigkey=%cert
    rightcert=vpnjuan-cert.pem
    # Left side is Check Point
    left=X.X.X.X          ### put here your firewall's IP address
    leftsubnet=10.0.0.0/8 ### put here your company's network range
    leftcert=firewall-1-cert.pem
    leftid=X.X.X.X        ### put here your firewall's IP address
    # config
    type=tunnel
    keyingtries=3
    disablearrivalcheck=no
    authby=rsasig
    auth=esp
    keyexchange=ike
    auto=route</pre>
<h1>Procedure to connect:</h1>
<p>Restart ipsec daemon to reread configuration:</p>
<pre escaped="true" lang="bash">mediacenter:/etc/ipsec.d/certs# service ipsec restart
ipsec_setup: Stopping Openswan IPsec...
ipsec_setup: stop ordered, but IPsec appears to be already stopped!
ipsec_setup: doing cleanup anyway...
ipsec_setup: Starting Openswan IPsec U2.6.28/K2.6.38-2-amd64...</pre>
<p>Insert the passphrase of yout private key:</p>
<pre escaped="true" lang="bash">mediacenter:/etc/ipsec.d/certs# ipsec auto --rereadsecrets
040 need passphrase for '/etc/ipsec.d/private/vpnjuan-key.pem'
Enter passphrase:</pre>
<h1>Start the VPN:</h1>
<p>mediacenter:/etc/ipsec.d/certs# ipsec auto &#8211;up MYCOMPANYCONNECTION</p>
<pre escaped="true" lang="bash">104 "MYCOMPANYCONNECTION" #1: STATE_MAIN_I1: initiate
003 "MYCOMPANYCONNECTION" #1: received Vendor ID payload [draft-ietf-ipsec-nat-t-ike-02_n] method set to=106
106 "MYCOMPANYCONNECTION" #1: STATE_MAIN_I2: sent MI2, expecting MR2
003 "MYCOMPANYCONNECTION" #1: NAT-Traversal: Result using draft-ietf-ipsec-nat-t-ike-02/03: i am NATed
108 "MYCOMPANYCONNECTION" #1: STATE_MAIN_I3: sent MI3, expecting MR3
004 "MYCOMPANYCONNECTION" #1: STATE_MAIN_I4: ISAKMP SA established {auth=OAKLEY_RSA_SIG cipher=oakley_3des_cbc_192 prf=oakley_sha group=modp1024}
117 "MYCOMPANYCONNECTION" #2: STATE_QUICK_I1: initiate
003 "MYCOMPANYCONNECTION" #2: ignoring informational payload, type IPSEC_RESPONDER_LIFETIME msgid=1a0f153c
004 "MYCOMPANYCONNECTION" #2: STATE_QUICK_I2: sent QI2, IPsec SA established tunnel mode {ESP=&gt;0x6ae22f40 &lt;0x4bca9ef5 xfrm=3DES_0-HMAC_SHA1 NATOA=none NATD=none DPD=none}</pre>
<p>Launch the rdesktop (terminal server client for linux) against your Pc&#8217;s IP address and have fun!</p>
<pre escaped="true" lang="bash">mediacenter:/etc/ipsec.d/certs# rdesktop X.X.X.X</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/09/how-to-connect-a-road-warrior-vpn-linux-client-to-a-check-point-firewall-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Backing up a cpanel hosting account</title>
		<link>http://www.elsotanillo.net/2011/09/backing-up-a-cpanel-hosting-account/</link>
		<comments>http://www.elsotanillo.net/2011/09/backing-up-a-cpanel-hosting-account/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 17:59:32 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Bluehost]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Spideroak]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=797</guid>
		<description><![CDATA[Since 2005 I have hosted this web page in the Cpanel based Bluehost company. First with Joomla and recently migrated to WordPress. Bluehost allows to download a daily, weekly and monthly backup from your Cpanel control panel, but manual intervention &#8230; <a href="http://www.elsotanillo.net/2011/09/backing-up-a-cpanel-hosting-account/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Since 2005 I have hosted this web page in the <a title="http://www.cpanel.net" href="http://www.cpanel.net" target="_blank">Cpanel</a> based <a title="www.bluehost.com" href="http://www.bluehost.com/track/elsotani" target="_blank">Bluehost </a>company. First with <a title="www.joomla.org" href="http://www.joomla.org" target="_blank">Joomla</a> and recently migrated to <a title="www.wordpress.org" href="http://www.wordpress.org" target="_blank">WordPress</a>.</p>
<p><a title="www.bluehost.com" href="http://www.bluehost.com/track/elsotani" target="_blank">Bluehost </a>allows to download a daily, weekly and monthly backup from your <a title="http://www.cpanel.net" href="http://www.cpanel.net" target="_blank">Cpanel </a>control panel, but manual intervention is needed:</p>
<ol>
<li>Logon in the control panel</li>
<li>Navigate to the backup page</li>
<li>Perform the backup</li>
<li>Download it to your local computer.</li>
</ol>
<p>This is a manually/time consuming task and of course <strong>you should not forget it!!</strong></p>
<p>In this post I gonna show my automatic method to backup files and databases using:</p>
<ol>
<li>Crontab for automatic backups.</li>
<li>Public/private keys for passwordless ssh connections.</li>
<li>Rsync command for synchronizing directories between remote and local servers. This way bandwidth is reduced as if a file has already been copied to the local server no data transfer is needed.</li>
<li>Mysqldump for dumping the MySQL databases to a local file.</li>
<li><a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> for data <a title="http://en.wikipedia.org/wiki/Data_deduplication" href="http://en.wikipedia.org/wiki/Data_deduplication" target="_blank">deduplication</a> and remote backup.</li>
</ol>
<p>Some previous knowledge is needed to understand how it works, anyway there are some useful links to understand it. <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-797"></span></p>
<p>Let&#8217;s have a look to the script:</p>
<pre escaped="true" lang="bash">#!/bin/bash

# BackupCpanel.sh  Author:juan@elsotanillo.net
# http://www.elsotanillo.net/2011/09/backing-up-a-cpanel-hosting-account/
# Disclaimer: It works OK for my configuration. Please check carefully before using it in production environments

#uncomment for debug
set -x

# Defining some variables
MAILTO="email@domain.tld"
USERDB="YourUserDB"
PASSDB="YourDBPassword"
SSHUSER="YourSSHUser"
DOMAIN="domain.tld" # This is your main domain
REMOTE_PATH_BACKUP="/homeX/XXXXXXX"
LOCAL_PATH_BACKUP="$HOME/$DOMAIN"
LOCAL_MYSQL_PATH_BACKUP="$LOCAL_PATH_BACKUP/BackupDDBB/" # before using it as a DB backup folder it must be created
DB_NAME_BACKUP="BackupDDBB_`date +%Y-%m-%d`.sql"

## Checking ssh-agent is running and have valid identities already loaded
ssh-add -l
if [ $? = 1 ]
        then echo "Please add private key identities to the authentication agent and run it again"|mail -s "error in backup script" $MAILTO
        exit 1
fi ## no identities were loaded, so the script finished here as private/public ssh-keys are needed to remote logon

# Loading ssh-agent variables for private/public passwordless logon
/usr/bin/keychain
source  $HOME/.keychain/${HOSTNAME}-sh

### Remote msyqldump to a local file
ssh $SSHUSER@$DOMAIN "mysqldump -u$USERDB -p$PASSDB --all-databases" &gt; $LOCAL_MYSQL_PATH_BACKUP$DB_NAME_BACKUP 

### Rsync between remote and local server
### We don't want to backup cache, session, mail and others directories,  so I "--exclude" them from the rsync command
###

rsync -avr --exclude 'mail/' \
           --exclude '.cpanel' \
           --exclude 'tmp' \
           --exclude 'BackupDDBB/' \
$SSHUSER@$DOMAIN:$REMOTE_PATH_BACKUP $LOCAL_PATH_BACKUP

# Run SpiderOak for deduplication and folder synchronization
SpiderOak --batchmode</pre>
<p>And now let&#8217;s explain how it works:</p>
<ol>
<li>Some variables must to be defined depending your own configuration. MAILTO, USERDB, etc. These depends on your login name, ssh user, etc</li>
<li>The script checks if the ssh-agent have valid identities already loaded. If not an email is send to MAILTO informing about the error and the script returns a 1 as a returning code.</li>
<li>Runs the <a title="http://www.gentoo.org/proj/en/keychain/index.xml" href="http://www.gentoo.org/proj/en/keychain/index.xml" target="_blank">keychain</a> and read some variables from <em>$HOME/.keychain/${HOSTNAME}-sh</em> file. Please read the <a title="http://oceanpark.com/notes/howto_ssh_keychain_public_key_authentication_forwarding.html" href="http://oceanpark.com/notes/howto_ssh_keychain_public_key_authentication_forwarding.html" target="_blank"><span style="font-family: CG Times;">Passwordless connections via OpenSSH using public key authentication, keychain and AgentForward.</span></a><span style="font-family: CG Times;"> web page for more information.</span></li>
<li title="How do I get the best backup deduplication from compressed files?">Backup using msyqldump is made in the LOCL_MYSQL_PATH_BACKUP local folder with all your mysql databases. The database dump file is not gziped as this makes the deduplication process useless<span id="question">. (<a title="How do I get the best backup deduplication from compressed files?" href="https://spideroak.com/faq/questions/30/how_do_i_get_the_best_backup_deduplication_from_compressed_files/">How do I get the best backup deduplication from compressed files</a></span><a title="How do I get the best backup deduplication from compressed files?" href="https://spideroak.com/faq/questions/30/how_do_i_get_the_best_backup_deduplication_from_compressed_files/">?</a>).  <strong>Note: I don&#8217;t have any postgresql database. If you have any you will have to deal with it by yourself. But the same procedure can be applied with some modifications.</strong></li>
<li><span style="font-family: CG Times;">At this moment passwordless ssh connections can be made between your computer and the remote server so we can proceed with the raw data in your remote /home/login directory. The rsync command is launched excluding some directories which contains no interesting data to be copied. When rsync finished all the files are copied to our local computer</span></li>
<li><span>Now is turnto run the <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> command (<a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> needs to be previously installed and configured). This will copy (using data <a title="http://en.wikipedia.org/wiki/Data_deduplication" href="http://en.wikipedia.org/wiki/Data_deduplication" target="_blank">deduplication</a>) your pre-defined directories to the <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> cloud. <strong>This way you will have at least 2 remote copies:</strong> your local PC and the <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> cloud.<br />
</span></li>
</ol>
<h1> Installing SpiderOak in your computer (the debian way)</h1>
<ol>
<li>Create your <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak </a>account. They provide a 2 GBlifetime free account.</li>
<li>install the client depending your O.S (They have clients for many O.S. windows,linux, MAC OS). For Debian add the following to your <strong>sources.list</strong>:        deb http://apt.spideroak.com/debian/ stable non-free</li>
<li>apt-get update &amp;&amp; apt-get install SpiderOak</li>
<li>Run <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> from a console to start the configuration GUI and customize it to adjust your needs: defining the directories you want to backup, you want to share, you want to sync with others computers, etc.</li>
</ol>
<h1>FAQs:</h1>
<h2>I don&#8217;t see any deduplication benefits here <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_evil.gif' alt=':evil:' class='wp-smiley' />   Can you put an example?</h2>
<p>Imagine you have 3 Joomla, 4 Mediawiki and 6 WordPress installations in your <a title="www.bluehost.com" href="http://www.bluehost.com/track/elsotani" target="_blank">Bluehost </a>account.</p>
<p>The benefits can be seen when the <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> software copies the data between your server and its cloud network as all the installation files must be the same (if your are using same versions) and even if they are different versions as they must look similar. Data is transfered onces for same files and partially for similar files. This saves you a lot of bandwidth and space on your <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak</a> account.</p>
<p><a title="SpiderOak uses de-duplication in a very advantageous way as it relates to your SpiderOak account" href="https://spideroak.com/blog/20090112220000-what-does-i_-mn--v_r-__--_-_-_c_">&#8220;<em>SpiderOak uses de-duplication in a very advantageous way as it relates to your SpiderOak account</em>&#8220;</a></p>
<p>Today my SpiderOak account has <strong>21.515 GB</strong></p>
<p>Size of all stored files (without compression or deduplication): <strong>107.638 GB</strong></p>
<p>Also SpiderOak keep multiple versions of files:</p>
<p><a title="If a file is ever damaged or deleted or accidentally overwritten, you will always have the option of downloading an earlier undamaged version." href="https://spideroak.com/faq/questions/6/does_spideroak_keep_multiple_versions_of_files/"><em>&#8220;If a file is ever damaged or deleted or accidentally overwritten, you will always have the option of downloading an earlier undamaged version.&#8221;</em></a></p>
<h2>I am a little bit concerned/paranoid with my backups. How can I have more security in my backups?</h2>
<p>If for more security you understand more copies of your data in distant places&#8230;. you can use the <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak&#8217;s</a> SYNC feature.</p>
<p>In a standard configuration you can have several directories synchronized in severals server across multiple location using the standard <a title="www.spideroak.com" href="https://spideroak.com/download/referral/a219fa1e410c25e80883cbfbd01d3769" target="_blank">SpiderOak&#8217;s</a> client. <a title="In a standard configuration you can have several directories synchronized in severals server across multiple location using the standard SpiderOak's client" href="https://spideroak.com/fiveservicesinone#sync">Learn howto</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/09/backing-up-a-cpanel-hosting-account/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debian Templates Disk Images Qemu/KVM for libvirt</title>
		<link>http://www.elsotanillo.net/2011/08/debian-templates-disk-images-qemukvm-for-libvirt/</link>
		<comments>http://www.elsotanillo.net/2011/08/debian-templates-disk-images-qemukvm-for-libvirt/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 19:44:27 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Qemu / KVM]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[debian virtual templates]]></category>
		<category><![CDATA[kvm debian templates]]></category>
		<category><![CDATA[qemu debian templates]]></category>
		<category><![CDATA[virtualbox debian templates]]></category>
		<category><![CDATA[vmware debian templates]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=768</guid>
		<description><![CDATA[A long time ago, in a galaxy far far away when I started with openvz I followed this tutorial for Debian template creation. Now I am adapting it (using my own experience and this template-squeeze tutorial too) to Qemu/KVM disk &#8230; <a href="http://www.elsotanillo.net/2011/08/debian-templates-disk-images-qemukvm-for-libvirt/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A long time ago, in a galaxy far far away when I started with openvz I followed this tutorial for <a href="http://wiki.openvz.org/Debian_template_creation#Squeeze_.28current_Debian_stable.29" rel="nofollow">Debian template creation</a>. Now I am adapting it (using my own experience and this <a href="http://wiki.sugarlabs.org/go/Machine/template-squeeze" rel="nofollow">template-squeeze tutorial </a>too) to Qemu/KVM disk images than later can be used directly or via libvirt.</p>
<p>This procedure tries to generalize the template. While working with disk cloned images many elements need to be &#8220;generalized&#8221; before capturing and deploying a disk image to multiple computers. Some of these elements include:</p>
<ol>
<li>ssh keys</li>
<li>/etc/apt/sources.list</li>
</ol>
<p>The more &#8220;generalized&#8221; is a template, the less manual work is needed after deploying it.</p>
<p>This method must work in others virtualization systems: vmware, virtualbox, etc. As it is &#8220;virtualizator/hypervisor/emulator independent&#8221; as it is focused only in the disk image.</p>
<p><span id="more-768"></span></p>
<ul>
<li>Install the Debian image using you usual procedure, LVM, packages, virtio, etc.</li>
</ul>
<ul>
<li>Set Debian repositories</li>
</ul>
<pre escaped="true" lang="bash">cat &lt;&lt;EOF &gt; /etc/apt/sources.list
deb http://ftp.rediris.es/debian/ squeeze main
deb-src http://ftp.rediris.es/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

# squeeze-updates, previously known as 'volatile'
deb http://ftp.rediris.es/debian/ squeeze-updates main
deb-src http://ftp.rediris.es/debian/ squeeze-updates main
EOF</pre>
<ul>
<li>Install some more packages</li>
</ul>
<pre escaped="true" lang="bash">apt-get install ssh quota less acpid bash-completion sudo vim facter</pre>
<ul>
<li>Remove some unneeded packages</li>
</ul>
<pre escaped="true" lang="bash">dpkg --purge ppp pppoeconf pppoe pppconfig</pre>
<ul>
<li>Upgrade system</li>
</ul>
<pre escaped="true" lang="bash">apt-get upgrade</pre>
<ul>
<li>Clean packages</li>
</ul>
<p>After installing packages, you&#8217;ll have some junk packages laying around in your cache. Since you don&#8217;t want your template to have those, this command will wipe them out.</p>
<pre escaped="true" lang="bash">apt-get --purge clean</pre>
<ul>
<li>Reconfigure your desired locales</li>
</ul>
<pre escaped="true" lang="bash">dpkg-reconfigure locales</pre>
<ul>
<li>Change timezone</li>
</ul>
<p>dpkg-reconfigure tzdata</p>
<ul>
<li>Disable all but one tty in <strong>/etc/inittab</strong> as in a VM you don&#8217;t usually need 6 tty working, even in real servers&#8230; <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </li>
</ul>
<pre escaped="true" lang="bash"># Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6</pre>
<ul>
<li>Disable sync() for syslog</li>
</ul>
<p>Turn off doing sync() on every write for syslog&#8217;s log files, to improve I/O performance:</p>
<pre escaped="true">sed -i -e 's@\([[:space:]]\)\(/var/log/\)@\1-\2@' /etc/*syslog.conf</pre>
<ul>
<li>Copy your public key to the template (for passwordless ssh logins)</li>
</ul>
<pre escaped="true" lang="bash">ssh-copy-id root@IPADDRESS</pre>
<ul>
<li>Delete the udev rule related to your NIC</li>
</ul>
<p>This is important or when you clone your first VM you will see that it doesn&#8217;t have any NIC&#8230; This is caused by the rule /etc/udev/rules.d/70-persistent-net.rules as it has your current MAC configured on it. Cloned VM will have different MAC so this rule will fail and VM will not have any eth0 configured.</p>
<pre escaped="true" lang="bash"># This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x1af4:0x1000 (virtio_net)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<strong>52:54:00:18:d9:5f</strong>", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERN
EL=="eth*", NAME="eth0"</pre>
<p>It&#8217;s safe to delete it as a new file will be generated on boot time</p>
<pre escaped="true" lang="bash">rm /etc/udev/rules.d/70-persistent-net.rules</pre>
<ul>
<li>Fix SSH host keys.</li>
</ul>
<pre escaped="true" lang="bash">rm -f /etc/ssh/ssh_host_*</pre>
<p>This is only useful if you installed SSH. Each individual VM should have its own pair of SSH host keys. The code below will wipe out the existing SSH keys and instruct the newly-created VE to create new SSH keys on first boot.</p>
<pre escaped="true" lang="bash">cat &lt;&lt; EOF &gt; /etc/init.d/ssh_gen_host_keys
#!/bin/sh
### BEGIN INIT INFO
# Provides:          Generates new ssh host keys on first boot
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Generates new ssh host keys on first boot
# Description:       Generates new ssh host keys on first boot
### END INIT INFO
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ""
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ""
insserv -r /etc/init.d/ssh_gen_host_keys
rm -f \$0
EOF</pre>
<pre escaped="true" lang="bash">chmod a+x /etc/init.d/ssh_gen_host_keys
insserv /etc/init.d/ssh_gen_host_keys</pre>
<p>Finally stop the VM make a backup and label it as a Template.</p>
<p>In next posts I am gonna configure all the cloned servers &#8220;automagically&#8221; using puppet.</p>
<p>Have a look to the <a title="Installing Puppet master and client in the same host. The Debian way" href="http://www.elsotanillo.net/2011/08/installing-puppet-master-and-client-in-the-same-host-the-debian-way/" target="_blank">Installing Puppet master and client in the same host. The Debian way</a> previous post for more info.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/08/debian-templates-disk-images-qemukvm-for-libvirt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Puppet master and client in the same host. The Debian way</title>
		<link>http://www.elsotanillo.net/2011/08/installing-puppet-master-and-client-in-the-same-host-the-debian-way/</link>
		<comments>http://www.elsotanillo.net/2011/08/installing-puppet-master-and-client-in-the-same-host-the-debian-way/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 15:48:36 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[installing puppet the debian way]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[puppet client]]></category>
		<category><![CDATA[puppet debian]]></category>
		<category><![CDATA[puppet master]]></category>
		<category><![CDATA[puppet master client in the same host]]></category>
		<category><![CDATA[puppet master client in the same server]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=739</guid>
		<description><![CDATA[Since I started learning puppet several weeks ago I wanted to install the client and the server in the same host but using several aliases for the same machine. But there are several funny error related to puppet master and &#8230; <a href="http://www.elsotanillo.net/2011/08/installing-puppet-master-and-client-in-the-same-host-the-debian-way/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Since I started learning <a href="http://www.puppetlabs.com/" target="_blank">puppet</a> several weeks ago I wanted to install the client and the server in the same host but using several aliases for the same machine. But there are several funny error related to puppet master and client sharing the same ssl directory: <a href="http://bugs.debian.org/514550">SSL certificate confusion</a>, <a href="http://bugs.debian.org/573416">obscure errors</a>, and <a href="http://reductivelabs.com/redmine/issues/show/1525">SSL revocation horrors</a>.</p>
<p>I took the main ideas from <a href="http://madduck.net/blog/2010.03.11:splitting-puppetd-from-puppetmaster/" target="_blank">Splitting puppetd from puppetmaster</a> from <a href="http://madduck.net" target="_blank">madduck</a>&#8216;s blog. But using this method you don&#8217;t have to create 2 differents <strong>ssl</strong> directories. Both installations (client and server) will share the same directory. I think it&#8217;s easier to implement and maintain.</p>
<p>The golden rule is to create all the SSL stuff (CA, keys, certificates,etc) in the right moment. And you may ask&#8230; When is the right moment? After the file <strong>/etc/puppet/puppet.conf</strong> is created with the <strong>certname</strong> directive properly updated. As by default puppet create all the SSL stuff using the hostname instead of the alias you want.</p>
<p>This tutorial assume you are using Debian (but should work on its derivatives: Ubuntu, Mint, etc) and have one server with two aliases replying to the same host (via /etc/hosts or DNS) In my case: puppet (server) and mediacenter (client).</p>
<h1><span id="more-739"></span>Let&#8217;s have fun:</h1>
<ul>
<li>Install puppetmaster:</li>
</ul>
<pre escaped="true" lang="bash">apt-get install puppetmaster</pre>
<ul>
<li>Stop puppetmaster:</li>
</ul>
<pre escaped="true" lang="bash">/etc/init.d/puppetmaster stop</pre>
<ul>
<li>kill <strong>puppet master</strong> processes</li>
</ul>
<pre escaped="true" lang="bash">root@mediacenter:/etc/puppet# ps -ef|grep puppet
puppet    3610     1  0 08:09 ?        00:00:01 /usr/bin/ruby1.8 /usr/bin/puppet master --masterport=8140
root      4053  3035  0 08:28 pts/0    00:00:00 grep puppet
kill 3610</pre>
<ul>
<li>Remove ssl directory: (as it has the ssl data related to the hostname instead of the alias you want)</li>
</ul>
<pre escaped="true" lang="bash">rm -rf /etc/puppet/ssl/</pre>
<ul>
<li>create /etc/puppet/puppet.conf</li>
</ul>
<pre escaped="true" lang="bash">[main]

[master]
certname=puppet.vnet

[agent]
server=puppet.vnet</pre>
<ul>
<li>Start puppetmaster:</li>
</ul>
<pre escaped="true" lang="bash">/etc/init.d/puppetmaster start</pre>
<ul>
<li>Check ssl logs on /var/log/daemon.log (ans check ssl directory and certificates have been created using puppet as server name)</li>
</ul>
<pre escaped="true" lang="bash">mediacenter puppet-master[3758]: Signed certificate request for ca
mediacenter puppet-master[3758]: Rebuilding inventory file
mediacenter puppet-master[3758]: puppet.vnet has a waiting certificate request
mediacenter puppet-master[3758]: Signed certificate request for puppet.vnet
mediacenter puppet-master[3758]: Removing file Puppet::SSL::CertificateRequest puppet.vnet at '/etc/puppet/ssl/ca/requests/puppetmaster.vnet.pem'
mediacenter puppet-master[3758]: Removing file Puppet::SSL::CertificateRequest puppet.vnet at '/etc/puppet/ssl/certificate_requests/puppetmaster.vnet.pem'
mediacenter puppet-master[3815]: Reopening log files
mediacenter puppet-master[3815]: Starting Puppet master version 2.7.1</pre>
<ul>
<li>Check ssl directory has been re-created on /etc/puppet:</li>
</ul>
<pre escaped="true" lang="bash">ls /etc/puppet/ssl</pre>
<ul>
<li>Install puppet client:</li>
</ul>
<pre escaped="true" lang="bash">apt-get install puppet</pre>
<ul>
<li>Create a SSL certificate for <strong>mediacenter.vnet</strong>. In order for the two systems to communicate securely we need to create signed SSL certificates.</li>
</ul>
<pre escaped="true" lang="bash">root@mediacenter:/etc/puppet# puppetd --no-daemonize --onetime --verbose --waitforcert 30
warning: peer certificate won't be verified in this SSL session
info: Creating a new SSL certificate request for mediacenter.vnet
info: Certificate Request fingerprint (md5): 93:7C:65:BD:77:39:2C:90:F3:15:99:D1:46:18:F1:40
warning: peer certificate won't be verified in this SSL session</pre>
<ul>
<li>Check all certificates:</li>
</ul>
<pre escaped="true" lang="bash">root@mediacenter:/etc/puppet# puppetca --list --all
mediacenter.vnet (93:7C:65:BD:77:39:2C:90:F3:15:99:D1:46:18:F1:40)
+ puppet.vnet (7A:5B:E1:42:00:B3:C9:EE:38:10:47:9E:D2:ED:C2:8C)</pre>
<ul>
<li>Check pending certificates (to be signed by the server)</li>
</ul>
<pre escaped="true" lang="bash">root@mediacenter:/etc/puppet# puppetca --list
mediacenter.vnet</pre>
<ul>
<li>Sign mediacenter.vnet certificate</li>
</ul>
<pre escaped="true" lang="bash">root@mediacenter:/etc/puppet# puppetca --sign mediacenter.vnet
notice: Signed certificate request for mediacenter.vnet</pre>
<ul>
<li>Now all certificates are signed. <strong>Pay attention to the plus (+) symbol</strong></li>
</ul>
<pre escaped="true" lang="bash">root@mediacenter:/etc/puppet# puppetca --list --all
+ mediacenter.vnet (B3:87:0C:F5:05:00:29:76:07:B5:1C:D1:2B:DA:20:12)
+ puppet.vnet (7A:5B:E1:42:00:B3:C9:EE:38:10:47:9E:D2:ED:C2:8C)</pre>
<ul>
<li>At this moment some test can be performed. from: <a href="http://www.howtoforge.com/installing_puppet_on_ubuntu" rel="nofollow">Installing Puppet On Ubuntu</a>.</li>
</ul>
<ul>
<li>Create the file /etc/puppet/manifests/site.pp</li>
</ul>
<ol>
<li>Create &#8220;/tmp/testfile&#8221; if it doesn&#8217;t exist.</li>
</ol>
<pre escaped="true" lang="bash">class test_class {
   file { "/tmp/testfile":
      ensure =&gt; present,
      mode   =&gt; 644,
      owner  =&gt; root,
      group  =&gt; root
    }
}

# tell puppet on which client to run the class
node mediacenter {
    include test_class
}</pre>
<ul>
<li>On the client run puppetd in verbose mode (-v) and only once (-o).</li>
</ul>
<pre escaped="true" lang="bash">puppetd -v -o</pre>
<ul>
<li>Then you will see in the logs the following:</li>
</ul>
<pre escaped="true" lang="bash">mediacenter puppet-master[4620]: Compiled catalog for mediacenter.vnet in environment production in 0.02 seconds
mediacenter puppet-agent[5271]: Caching catalog for mediacenter.vnet
mediacenter puppet-agent[5271]: Applying configuration version '1313132026'
mediacenter puppet-agent[5271]: (/Stage[main]/Test_class/File[/tmp/testfile]/ensure) created
mediacenter puppet-agent[5271]: Finished catalog run in 0.06 seconds</pre>
<ul>
<li>Check is the file has been created:</li>
</ul>
<pre escaped="true" lang="bash">ls -l /tmp/testfile
-rw-r--r-- 1 root root 0 ago 13 18:53 /tmp/testfile</pre>
<ul>
<li>Now that all is running OK, configure the puppet agent to start on boot by modifying /etc/default/puppet</li>
</ul>
<pre escaped="true" lang="bash"># Defaults for puppet - sourced by /etc/init.d/puppet

# Start puppet on boot?
START=yes

# Startup options
DAEMON_OPTS=""</pre>
<ul>
<li>Start puppet client</li>
</ul>
<pre escaped="true" lang="bash">/etc/init.d/puppet start</pre>
<p>Now, you can start playing with puppet master and client in the same host. <strong>Have fun!</strong></p>
<p>Special thanks to <a href="http://madduck.net" target="_blank">madduck</a> for sharing his time and knowledge!.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/08/installing-puppet-master-and-client-in-the-same-host-the-debian-way/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Migration from Joomla to WordPress succesfully done!</title>
		<link>http://www.elsotanillo.net/2011/08/migration-from-joomla-to-wordpress-succesfully-done/</link>
		<comments>http://www.elsotanillo.net/2011/08/migration-from-joomla-to-wordpress-succesfully-done/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 14:32:48 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[joomla2wordpress]]></category>
		<category><![CDATA[Mambo importer]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=722</guid>
		<description><![CDATA[Last week I finally finished the migration from my old 1.0.15 Joomla installation to the new shiny 3.2.1 WordPress. I had in mind to migrate to the new 1.5.X Joomla series but there was not an easy one-click upgrade tool as &#8230; <a href="http://www.elsotanillo.net/2011/08/migration-from-joomla-to-wordpress-succesfully-done/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Last week I finally finished the migration from my old 1.0.15 Joomla installation to the new shiny 3.2.1 WordPress. I had in mind to migrate to the new 1.5.X Joomla series but there was not an easy one-click upgrade tool as there was so many core differences between version and some manual work had to be done. That was the reason to study other options.</p>
<p>Finally I decided to move on with WordPress and with the help of <a title="Misterpah" href="http://misterpah.com/" rel="home">Misterpah</a>&#8216;s <a title="Mambo Importer" href="http://misterpah.com/scripts/import-mambo-into-wordpress/" target="_blank"><strong>Mambo Importer</strong></a> plug-in at least half of the work was already done. <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Although some manual work has to be done (recreating path&#8217;s, images, etc) <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Special thanks to <a title="Misterpah" href="http://misterpah.com/" rel="home">Misterpah</a> for sharing his knowledge and time!</p>
<p>P.S.: Starting from today all (or at least almost) news posts/pages will be written in English.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/08/migration-from-joomla-to-wordpress-succesfully-done/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thai Yoga Massage advanced course</title>
		<link>http://www.elsotanillo.net/2011/07/thai-yoga-massage-advanced-course/</link>
		<comments>http://www.elsotanillo.net/2011/07/thai-yoga-massage-advanced-course/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 20:09:46 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Thai Yoga Massage]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/?p=779</guid>
		<description><![CDATA[Finally after one cancellation I assisted to the Thai Yoga Massage advanced course (Energetic Lines) in Murcia. One week doing Yoga, meditation,enjoying Jose&#8217;s vegetarian food, learning and practicing. And a very important thing: One week without computers. And&#8230; of course &#8230; <a href="http://www.elsotanillo.net/2011/07/thai-yoga-massage-advanced-course/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Finally after one cancellation I assisted to the <a title="Thai Yoga Massage advanced course (Energetic Lines) in Murcia" href="http://www.emchi.net/site/sun136761/hau521923244.asp?osLang=2" target="_blank">Thai Yoga Massage advanced course (Energetic Lines) in Murcia.</a></p>
<p><span id="more-779"></span></p>
<p>One week doing Yoga, meditation,enjoying Jose&#8217;s vegetarian food, learning and practicing. And a very important thing: One week without computers.</p>
<p>And&#8230; of course I got my diploma <img src='http://www.elsotanillo.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="mceTemp" style="text-align: center;">
<dl id="attachment_781" class="wp-caption alignnone" style="width: 2058px;">
<dt class="wp-caption-dt"><a href="http://www.elsotanillo.net/wp-content/uploads/CIMG1106.jpg"><img class="size-full wp-image-781" title="Foto con el titulo del Curso avanzado de masaje Thailandés (Lineas energeticas) con Choenzom" src="http://www.elsotanillo.net/wp-content/uploads/CIMG1106.jpg" alt="Foto con el titulo del Curso avanzado de masaje Thailandés (Lineas energeticas) con Choenzom" width="2048" height="1536" /></a>Picture with Choenzom (my teacher)</dt>
</dl>
</div>
<p>&nbsp;</p>
<div class="mceTemp" style="text-align: center;">
<dl id="attachment_780" class="wp-caption alignnone" style="width: 1546px;">
<dt class="wp-caption-dt"><a href="http://www.elsotanillo.net/wp-content/uploads/CIMG1107.jpg"><img class="size-full wp-image-780" title="Foto con el titulo del Curso avanzado de masaje Thailandés (Lineas energeticas) con Jose" src="http://www.elsotanillo.net/wp-content/uploads/CIMG1107.jpg" alt="Foto con el titulo del Curso avanzado de masaje Thailandés (Lineas energeticas) con Jose" width="1536" height="2048" /></a>Picture with Jose (the cook)</dt>
</dl>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2011/07/thai-yoga-massage-advanced-course/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo Convertir archivos audio a mp3</title>
		<link>http://www.elsotanillo.net/2009/02/howto-convertir-archivos-audio-a-mp3-2/</link>
		<comments>http://www.elsotanillo.net/2009/02/howto-convertir-archivos-audio-a-mp3-2/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 03:46:58 +0000</pubDate>
		<dc:creator>Juan Sierra Pons</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[HowTo Convertir archivos audio a mp3]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[m4a2mp3]]></category>
		<category><![CDATA[m4atomp3]]></category>
		<category><![CDATA[ogg2mp3]]></category>
		<category><![CDATA[oggtomp3]]></category>

		<guid isPermaLink="false">http://www.elsotanillo.net/wp/?p=515</guid>
		<description><![CDATA[Algunas veces tienes que pasar música a tu mp3 portátil y esa música esta en formato ogg, m4a, etc. Pásala a mp3 sin ningún esfuerzo. El comando a usar es el ffmpeg y según los parámetros lo podremos usar para &#8230; <a href="http://www.elsotanillo.net/2009/02/howto-convertir-archivos-audio-a-mp3-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Algunas veces tienes que pasar música a tu mp3 portátil y esa música esta en formato ogg, m4a, etc. Pásala a mp3 sin ningún esfuerzo.<br />
<span id="more-515"></span></p>
<p>El comando a usar es el ffmpeg y según los parámetros lo podremos usar para convertir de unos ficheros a otros:</p>
<ul>
<li>Convertir ogg a mp3 (<strong>ogg2mp3/oggtomp3</strong>)</li>
</ul>
<pre escaped="true" lang="bash">ffmpeg -i nombre.ogg nombre.mp3</pre>
<ul>
<li>Convertir m4a a mp3 (<strong>m4a2mp3/m4atomp3</strong>)</li>
</ul>
<p><strong>ffmpeg -i nombre.m4a nombre.mp3</strong></p>
<p>Si queremos convertir todos los ficheros que hay en un directorio podremos usar el siguiente script:</p>
<pre escaped="true" lang="bash">for i in * ; do ffmpeg -i $i $i.mp3 ; done</pre>
<p>Luego para normalizar el nombre usaremos el comando rename:</p>
<pre escaped="true" lang="bash">rename 's/.m4a//' *.m4a.mp3</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.elsotanillo.net/2009/02/howto-convertir-archivos-audio-a-mp3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
