<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>fucking the white bunny rabbit &#187; know-how</title>
	<atom:link href="http://blog.foppiano.org/category/know-how/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.foppiano.org</link>
	<description>this blog is a feature</description>
	<lastBuildDate>Mon, 08 Mar 2010 12:50:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.foppiano.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7bcf0d2e608c356c4bcbcf938beeed05?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>fucking the white bunny rabbit &#187; know-how</title>
		<link>http://blog.foppiano.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.foppiano.org/osd.xml" title="fucking the white bunny rabbit" />
	<atom:link rel='hub' href='http://blog.foppiano.org/?pushpress=hub'/>
		<item>
		<title>copying, zipping selecting files with Groovy</title>
		<link>http://blog.foppiano.org/2009/12/21/copying-zipping-selecting-files-con-groovy/</link>
		<comments>http://blog.foppiano.org/2009/12/21/copying-zipping-selecting-files-con-groovy/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 10:41:15 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://blog.foppiano.org/?p=890</guid>
		<description><![CDATA[Today I had to select some files from different directories copy in another. Despite it seemed a simple task, it wasn&#8217;t. The files were a lot, so I had to pack it.
Basically the structure of the directories was something like:

/A/US/file1
/A/US/file2
/A/US/file3
/A/UK/file1
/A/UK/file2
/A/UK/file3
...
/B/US/file1
/B/US/file2
/B/US/file3
/B/UK/file1
/B/UK/file2
/B/UK/file3
and I had to select the N% of the files from each of the second level [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=890&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Today I had to select some files from different directories copy in another. Despite it seemed a simple task, it wasn&#8217;t. The files were a lot, so I had to pack it.</p>
<p>Basically the structure of the directories was something like:</p>
<blockquote><p><code><br />
/A/US/file1<br />
/A/</code><code>US</code><code>/file2<br />
/A/</code><code>US</code><code>/file3<br />
/A/UK/file1<br />
/A/UK/file2<br />
/A/UK/file3<br />
...<br />
/B/US/file1<br />
/B/US/file2<br />
/B/US/file3<br />
/B/UK/file1<br />
/B/UK/file2<br />
/B/UK/file3</code></p></blockquote>
<p>and I had to select the N% of the files from each of the second level directories (AA,AB, AC&#8230;and so on).</p>
<p>I wrote this short script that select only N% (parameter inside the script) of the files from the directory, pack it (without any structure information), and copy on the destination directory:</p>
<pre class="brush: groovy;">
import java.util.zip.*

def createZip(destination, fileList) {
    try{
        byte[] buffer = new byte[1024];

        ZipOutputStream out = new ZipOutputStream(new
            FileOutputStream(destination));
        out.setLevel(Deflater.DEFAULT_COMPRESSION);
        fileList.each { selected -&amp;gt;
            FileInputStream in_ = new FileInputStream(selected);
            //the new File(selected).getName() return just the name of the file,
            //in order to remove the directory structure inside.
            out.putNextEntry(new ZipEntry(new File(selected).getName()));

            int len;
            while ((len = in_.read(buffer)) &amp;gt; 0) {
                out.write(buffer, 0, len);
            }
            out.closeEntry();
            in_.close();
        }
        out.close();
    }
    catch (IllegalArgumentException iae)
    {
        iae.printStackTrace();
    }
    catch (FileNotFoundException fnfe)
    {
        fnfe.printStackTrace();
    }
    catch (IOException ioe)
    {
        ioe.printStackTrace();
    }

    null
}

/**
  * Script
 **/
def rootDirectory = /C:\inputDirectory/
def outputDirectory = /C:\outputDirectory/

if ((!new File(rootDirectory).list()) || (! new File(outputDirectory).list())){
    println &quot;Error. Input or Output directory are not valid.&quot;
    throw new RuntimeException() //TODO: understand how to exit without raising an exception
}

def directories = ['A', 'B', 'C', 'D']
def percentageRules = 5    //5 = 5% of the rules for each country

directories.each{ subDirectory -&amp;gt;
    println &quot;listing ${rootDirectory}\\${subDirectory}&quot;
    def directoryList = new File(&quot;${rootDirectory}\\${subDirectory}&quot;).list()
    if( directoryList ){
        directoryList.each{ elem -&amp;gt;
            def fileList = new File(&quot;${rootDirectory}\\${subDirectory}\\${elem}&quot;).list().grep{ !it.contains('out') }
            def numberFiles = (fileList.size() * 5 / 100) as Integer
            if ((numberFiles == 0) &amp;amp;&amp;amp; (fileList.size() &amp;gt; 0)) {
                numberFiles = fileList.size()
            }
            println &quot;Zipping ${numberFiles} (${percentageRules}%) of files from ${rootDirectory}\\${subDirectory}\\${elem} into ${outputDirectory}\\${subDirectory}-${elem}.zip&quot;

            if(numberFiles){
                fileList = fileList.collect{ e -&amp;gt;
                    &quot;${rootDirectory}\\${subDirectory}\\${elem}\\${e}&quot;
                }
                createZip(&quot;${outputDirectory}\\${subDirectory}-${elem}.zip&quot;, fileList[0..&amp;lt;numberFiles])

                /* The old version copied the files instead of zipping it, using AntBuilder,
                   you can use it if you don't need to zip the files. */
                /*
                fileList[0..&amp;lt;numberFiles].each{
                    ( new AntBuilder ( ) ).copy ( file : &quot;${rootDirectory}\\${subDirectory}\\${elem}\\${inputF}&quot; , tofile : &quot;${outputDirectory}\\${inputF}&quot; )
                }
                */
            }
        }
    }
}
</pre>
<p>I wrote it rushing, and I copied somewhere the first method (which was java), so might be errors or better ways. Anyway any suggestion are welcome.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/890/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/890/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/890/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=890&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2009/12/21/copying-zipping-selecting-files-con-groovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>How to OpenVPN over Proxy</title>
		<link>http://blog.foppiano.org/2008/07/24/how-to-openvpn-over-proxy/</link>
		<comments>http://blog.foppiano.org/2008/07/24/how-to-openvpn-over-proxy/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 15:41:26 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[static]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/?p=519</guid>
		<description><![CDATA[Sometimes there are places where is impossible to reach to internet without pass through a proxy. Using proxy is problematic because usually is impossible to read mail or use chat, irc and any application which work on a port different from 80 or 443.
This how to should work on most of the cases, unless the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=519&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes there are places where is impossible to reach to internet without pass through a proxy. Using proxy is problematic because usually is impossible to read mail or use chat, irc and any application which work on a port different from 80 or 443.</p>
<p>This how to should work on most of the cases, unless the proxy policy is too <span style="cursor:pointer;"><span class="sg"><span class="se1"><span class="trn">restrictive.</span></span></span></span></p>
<p>Basically, the idea is to use the main connections to all the application which support proxy and are simple to configure and a customized route only for services that can&#8217;t pass thought a proxy.</p>
<p><strong>Server</strong></p>
<p>Openvpn uses default port 1194 (TCP or UDP), to pass over a proxy you must use the 443 port. I suggest to leave default openvpn port and apply a prerouting rule on iptables which map the 443 port on 1194:</p>
<blockquote><p><code>iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport <span style="text-decoration:line-through;">80</span> 443 -j DNAT --to-destination 192.168.10.127:1194</code></p></blockquote>
<p>Let&#8217;s start to configure openvpn service.</p>
<p>First of all you must read <a href="http://openvpn.net/index.php/documentation/howto.html#pki">this official howto section</a> to understand how to generate certificate (there are a lot of scripts and sample configuratino files shipped with openvpn package); you can also modify and use my configuration file.<br />
Here my server configuration file:</p>
<blockquote><p><code>mode server<br />
local 192.168.10.127<br />
;port 443<br />
proto tcp<br />
dev tun<br />
ca keys/ca.crt<br />
cert keys/server.crt<br />
key keys/server.key  # This file should be kept secret<br />
dh keys/dh2048.pem<br />
server 10.8.0.0 255.255.255.0<br />
push "route 192.168.10.0 255.255.255.0"<br />
keepalive 10 120<br />
tls-auth keys/ta.key 0 # This file is secret<br />
cipher AES-128-CBC   # AES<br />
comp-lzo<br />
user nobody<br />
group nobody<br />
persist-key<br />
persist-tun<br />
verb 5<br />
mute 20</code></p></blockquote>
<p>I stored my certificates into <code>/etc/openvpn/keys</code> and my openvpn configuration file into <code>/etc/openvpn</code>.<br />
I want to spend just few words about network configuration:</p>
<ul>
<li>192.168.10.0/24 is my home network (192.168.10.127 is my server network address)</li>
<li>192.168.x.x/x is network I&#8217;m connected with client</li>
<li>10.8.0.0/24 is the tunnel network</li>
</ul>
<p><strong>Client</strong></p>
<p>Here a basic configuration (you can find a well explained file into sample configuration openvpn files):</p>
<blockquote><p><code>client<br />
dev tun<br />
proto tcp-client<br />
remote public_ip_address 443 #Public ip address of your home network<br />
resolv-retry infinite<br />
nobind<br />
persist-key<br />
persist-tun<br />
cipher AES-128-CBC<br />
ca "/etc/openvpn/keys/home/ca.crt"<br />
cert "/etc/openvpn/keys/home/client1.crt"<br />
key "/etc/openvpn/keys/home/client1.key"<br />
tls-auth "/etc/openvpn/keys/home/ta.key" 1<br />
comp-lzo<br />
verb 5<br />
http-proxy proxy.ras 80 passwd_file basic<br />
#http-proxy-retry<br />
http-proxy-option AGENT Mozilla/5.0+(Windows;+U;+Windows+NT+5.0;+en-GB;+rv:1.7.6)+Gecko/20050226+Firefox/1.0.1<br />
</code></p></blockquote>
<p>I will not explain about keys and certificates here because openvpn how to give you a good explanation about it.<br />
If your proxy need authentication, you must put proxy username and proxy password into your passwd_file, respectly on first and second line.</p>
<p>Now, you can start openvpn on server (<code>service start openvpn</code>).<br />
Then you have to start openvpn on client. If you pass through a proxy, services can return you a FAILED, in this case, you should check <code>/var/log/messages</code> to get information about it.</p>
<p>If you got something like:</p>
<blockquote><p><code>Initialization Sequence Completed</code></p></blockquote>
<p>the tunnel is started. To verify that it work, just try to ping other tunnel part.</p>
<p><strong>Natting and fowarding</strong><br />
Now is necessary to enable NAT and forward on your openvpn server, to allow certain flows, forwarded througt your vpn can reach internet by passing on your home router.</p>
<p>Just apply this few rules:</p>
<blockquote><p><code>/bin/echo "1" &gt; /proc/sys/net/ipv4/ip_forward<br />
iptables -A FORWARD -i tun0 -j ACCEPT<br />
iptables -t nat  -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE</code></p></blockquote>
<p>now the server configuration is done.</p>
<p>Now we have to create static routes:</p>
<blockquote><p><code>route add -host ip_you_want_to_staticize gw your_vpn_tunnel_address</code></p></blockquote>
<p>for example: jabber, you have to retrieve your jabber server ip address, and insert into route command.as &#8220;ip_you_want_to_staticize&#8221;.</p>
<p>If you don&#8217;t have a dns into your subnet, to maintain transparency in applications, is better to use /etc/hosts to map every ip address to his name.</p>
<p>I&#8217;m using vpn only for jabber and email, I want to use also mugshot but it doesn&#8217;t work&#8230;dunno why.</p>
<p>Thanks to <a href="http://blog.kiwized.net/">Kiwi</a> to help me.</p>
<p>This post is under construction&#8230;so If you have suggestion or any issue to propose me, don&#8217;t hesitate to tell me.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/519/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/519/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/519/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=519&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2008/07/24/how-to-openvpn-over-proxy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing source package with YUM</title>
		<link>http://blog.foppiano.org/2007/12/11/installing-source-package-with-yum/</link>
		<comments>http://blog.foppiano.org/2007/12/11/installing-source-package-with-yum/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 08:50:50 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[yum]]></category>
		<category><![CDATA[yumdownloader]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/12/11/installing-source-package-with-yum/</guid>
		<description><![CDATA[To install source package with YUM you have to install yum-utils
yum install yum-utils
then, just use yumdownloader:
yumdownloader --source packagename
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=406&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>To install source package with YUM you have to install yum-utils</p>
<blockquote><p><code>yum install yum-utils</code></p></blockquote>
<p>then, just use yumdownloader:</p>
<blockquote><p><code>yumdownloader --source packagename</code></p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/406/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/406/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=406&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/12/11/installing-source-package-with-yum/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>ICH5 module fixing</title>
		<link>http://blog.foppiano.org/2007/11/07/ich5-module-fixing/</link>
		<comments>http://blog.foppiano.org/2007/11/07/ich5-module-fixing/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 20:34:53 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[snd_8x0]]></category>
		<category><![CDATA[soundcard]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/11/07/ich5-module-fixing/</guid>
		<description><![CDATA[Yesterday, I resolved a problem of a soundcard with Linux. That PC had a Realtek Integrated soundcard (ICH5) and the rear output didn&#8217;t work, to listen audio, it was possible only using headphone in the front microphone.
Here there is the model, using lspci:
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC&#8217;97 Audio Controller (rev 02)
The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=382&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I resolved a problem of a soundcard with Linux. That PC had a Realtek Integrated soundcard (ICH5) and the rear output didn&#8217;t work, to listen audio, it was possible only using headphone in the front microphone.</p>
<p>Here there is the model, using lspci:</p>
<blockquote><p>00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC&#8217;97 Audio Controller (rev 02)</p></blockquote>
<p>The solution is quite easy. Time ago I wrote a similar document about my soundcard. The problem is the hardware implementation of soundcard is based only on a driver (that you can install only with windows) and in Linux no information are provided to use correct soundcard&#8217;s settings.<br />
So, as I wrote, is necessary to give when module (in this case snd_8&#215;0) is probed, a options. To see which options, you should install source code or documentation of kernel and you find in Documentation/sound/alsa/ALSA-Documentation.txt file.</p>
<p>After found the correct module, you should edit /etc/modprobe.conf as follow:</p>
<blockquote><p>options snd-intel8&#215;0 ac97_clock=0 ac97_quirk=inv_eapd</p></blockquote>
<p>The more important option, in this case, is ac97_quirk, and for my soundcard is set to &#8220;inv_eapd&#8221;, there are many other options, and, if you are not sure, is better to try all. You can find in the &#8220;ac97_quirk&#8221; section in ALSA-Documentation.txt file.</p>
<p>After this, (this is a particular settings of my soundcard) I choose 4 channels and shared computation (instead indipendent) and it work with rear output.</p>
<p>I&#8217;m sorry if this article is not explain so good. I know but I wrote fast. If you find mistakes, tell me by comments.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/382/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/382/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/382/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=382&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/11/07/ich5-module-fixing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>sed regexp tips #1</title>
		<link>http://blog.foppiano.org/2007/10/30/sed-regexp-tips-1/</link>
		<comments>http://blog.foppiano.org/2007/10/30/sed-regexp-tips-1/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 18:07:11 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/10/30/sed-regexp-tips-1/</guid>
		<description><![CDATA[Thanks to Jigen, this is another method to add and remove semicolon with sed. The result is the same as here.
To add semicolon:
sed -e &#8217;s/[01]/&#38;;/g&#8217; foo
To remove semicolon:
sed -e &#8217;s/\([01]\);/\1/g&#8217; foo
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=380&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://caste.netsons.org">Jigen,</a> this is another method to add and remove semicolon with sed. The result is the same as <a href="http://bayzone.wordpress.com/2007/10/30/perl-regexp-tips-1/">here</a>.</p>
<p>To add semicolon:</p>
<blockquote><p><font face="courier">sed -e &#8217;s/[01]/&amp;;/g&#8217; foo</font></p></blockquote>
<p>To remove semicolon:</p>
<blockquote><p><font face="courier">sed -e &#8217;s/\([01]\);/\1/g&#8217; foo</font></p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/380/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/380/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/380/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=380&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/10/30/sed-regexp-tips-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>perl regexp tips #1</title>
		<link>http://blog.foppiano.org/2007/10/30/perl-regexp-tips-1/</link>
		<comments>http://blog.foppiano.org/2007/10/30/perl-regexp-tips-1/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 08:56:22 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[know-how]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/10/30/perl-regexp-tips-1/</guid>
		<description><![CDATA[I didn&#8217;t know how to set the title of this post, so I choose a generic and useless title  
I have a text file with 81 characters (one and zero) per rows. I want to add a semicolon (&#8220;;&#8221;) between every character.
Eg. if the line is:
 010101101010
and I want to became:
0;1;0;1;0;1;1;0;1;0;
This is the solution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=379&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t know how to set the title of this post, so I choose a generic and useless title <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>I have a text file with 81 characters (one and zero) per rows. I want to add a semicolon (&#8220;;&#8221;) between every character.</p>
<p>Eg. if the line is:</p>
<blockquote><p><font face="courier"> 010101101010</font></p></blockquote>
<p>and I want to became:</p>
<blockquote><p><font face="courier">0;1;0;1;0;1;1;0;1;0;</font></p></blockquote>
<p>This is the solution script (thanks <a href="http://dfa.slackware.it">dfa</a>)</p>
<blockquote><p><font face="courier">perl -ne &#8217;s/([01])/\1;/g; print&#8217; file_input  &gt; file_output</font></p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/379/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/379/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=379&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/10/30/perl-regexp-tips-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>a script to clone a directory but with empty files :P</title>
		<link>http://blog.foppiano.org/2007/10/12/a-script-to-clone-a-directory-but-with-empty-files-p/</link>
		<comments>http://blog.foppiano.org/2007/10/12/a-script-to-clone-a-directory-but-with-empty-files-p/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 19:39:49 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[know-how]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/10/12/a-script-to-clone-a-directory-but-with-empty-files-p/</guid>
		<description><![CDATA[  This is my first seriuous bash script. Thanks in advance to people from #bash and #sed, thanks to Jigen, Dani and Arbiter.
I have a directory with some file inside. I want to create another directory with the same file (with same name) but empty (created with touch).
My code take two parameters:
 copianomi.sh -i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=364&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>  This is my first seriuous bash script. Thanks in advance to people from #bash and #sed, thanks to Jigen, <a href="http://natonelbronx.wordpress.com">Dani</a> and <a href="http://blog.arbiterlab.net/posts">Arbiter</a>.</p>
<p>I have a directory with some file inside. I want to create another directory with the same file (with same name) but empty (created with touch).</p>
<p>My code take two parameters:</p>
<blockquote><p> <code>copianomi.sh -i input_dir -o output_dir</code></p></blockquote>
<p>Here my code:</p>
<blockquote>
<pre>
#!/bin/bash
# ./copianomi.sh -i dirInput -o dirOutput

NO_ARGS=0
if [ $# -eq "$NO_ARGS" ]  # Script invoked with no command-line args?
then
   echo "Usage: $0 dirInput dirOutput"
exit        # Exit and explain usage, if no argument(s) given.
fi

#
# check parameters
#
while getopts ":o:i:" Option
do
   case $Option in
      i 	) INPUT=$OPTARG;;
      o	) OUTPUT=$OPTARG;;
   esac
done

#
# Copy names
#
for NAME in "$INPUT"/*; do
   touch "$OUTPUT/${NAME##*/}"
done</pre>
</blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/364/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/364/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=364&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/10/12/a-script-to-clone-a-directory-but-with-empty-files-p/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>nota personale</title>
		<link>http://blog.foppiano.org/2007/10/05/nota-personale/</link>
		<comments>http://blog.foppiano.org/2007/10/05/nota-personale/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 11:33:21 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[opensource & freesoftware]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/10/05/nota-personale/</guid>
		<description><![CDATA[Per fare in modo che il boot vada a buon fine, l&#8217;unicale uniche partizionei che non puòpossono stare &#8220;lontanae&#8221; dalla root &#8220;/&#8221;, (cioè in una partizione diversa) èsono &#8220;/bin&#8221;, &#8220;/lib&#8221;, &#8220;/etc&#8221;, &#8220;/sbin&#8221;.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=356&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><em>Per fare in modo che il boot vada a buon fine, <strike>l&#8217;unica</strike>le uniche partizion<strike>e</strike>i che non <strike>può</strike>possono stare &#8220;lontan<strike>a</strike>e&#8221; dalla root &#8220;/&#8221;</em><em>, (cioè in una partizione diversa) <strike>è</strike>sono &#8220;/bin&#8221;, &#8220;/lib&#8221;, &#8220;/etc&#8221;, &#8220;/sbin&#8221;.</em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/356/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/356/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=356&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/10/05/nota-personale/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>GmailFS installing and configuration (Fedora 7)</title>
		<link>http://blog.foppiano.org/2007/09/28/gmailfs-installing-and-configuration-fedora-7/</link>
		<comments>http://blog.foppiano.org/2007/09/28/gmailfs-installing-and-configuration-fedora-7/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 23:38:53 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[fedora]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/09/28/gmailfs-installing-and-configuration-fedora-7/</guid>
		<description><![CDATA[Disclaimer: Don&#8217;t trust gmail storage disk. Is possibile to lose all store data or get your account blocked (if you copy too much data, eg 100mb). Use it only to have fun or testing. If you wanna do backup, don&#8217;t store sensible data (is Google..remember) or be sure to have another backup.
GmailFS is a virtual [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=297&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer:</strong> Don&#8217;t trust gmail storage disk. Is possibile to lose all store data or get your account blocked (if you copy too much data, eg 100mb). Use it only to have fun or testing. If you wanna do backup, don&#8217;t store sensible data (is Google..remember) or be sure to have another backup.</p>
<p>GmailFS is a virtual filesystem (developed by <a href="http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html">Richard Jones</a>) that permit you to mount your gmail box as an external hard drive. Is usefull for small backups similar to NFS.<br />
Let&#8217;s start to install and configure GmailFS. I suppose here that you have a gmail address (if not, go <a href="http://gmail.google.com">here</a>).</p>
<p>Packages need to be installed:<br />
- python 2.3<br />
- fuse<br />
- libgmail (you can found <a href="http://rpm.pbone.net/index.php3/stat/4/idpl/5035782/com/python-libgmail-0.1.6.2-0.1.cmn7.noarch.rpm.html">here</a> packaged by <a href="http://rpm.pbone.net/index.php3/stat/15/pakman/2888/com/Ville%20Skytt%C3%A4%20%3Cville_skytta%20at%20iki_fi%3E.html">Ville SkyttĂ</a>)<br />
- fuse python bind  (watch my (temporary) <a href="http://whitenoise.netsons.org/wiki/doku.php?id=projects:repository">repository</a>)<br />
- gmailfs  (watch my (temporary) <a href="http://whitenoise.netsons.org/wiki/doku.php?id=projects:repository">repository</a>)</p>
<p>After downloaded and installed all my packets, if your pc don&#8217;t crash, we can go ahead and configure gmailfs.</p>
<p>Add a line about gmailfs to your <code>/etc/fstab</code> as explain in the <a href="http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem-using.html">official project site</a>: <code> usr/local/bin/gmailfs.py   /path/of/mount/point       gmailfs   noauto,user 0 0</code></p>
<p>If you want to access to your storage gmail disk with root user, you have to modify the configuration file <code>/etc/gmailfs.conf </code>adding username, password and disk name (disk name <strong>must</strong> be something difficult to guess to avoid someone can mess up your email).</p>
<p>To mount, simply use (as root):<br />
<code>mount /mnt/path/of/mount/point </code></p>
<p>If something go wrong, you can find log files in <code>~/gmailfs.log</code>. Remember also if you need to use proxy configuration, you need appropriate ssl packages (eg. pythong-openssl) to use it.</p>
<p>To mount partition as normal user, you need to create a file similar to <code>/etc/gmailfs.conf</code> in your home and call it <code>.gmailf</code> (<code>~/.gmailfs</code>).<br />
After that, you have to modify permission of mount point:<br />
<code>chown root:fuse /mnt/path/of/mount/point</code><br />
<code>chmod 775 /mnt/path/of/mount/point</code></p>
<p>Now you need to add your user to <code>fuse</code> group (I used administrator panel of GNOME). After that exit and log-in again, you should be able to mount fuse partition, using:</p>
<p><code>mount /mnt/path/of/mount/point</code></p>
<p>For information, correction, error and so on&#8230;.use comments <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<p><strong>Update 01/10/2007@00:29  </strong>I have problems to unmount device from normal users. I get this error &#8220;unmount: /mnt/backup mount disagrees with the fstab&#8221;.</p>
<p>This, because when mtab is written, is different from fstab. I try to modify manually mtab but mtab change when a new partition is added, so is better to use root to unmount.</p>
<p><strong><br />
</strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/297/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/297/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/297/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=297&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/09/28/gmailfs-installing-and-configuration-fedora-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple &amp; Easy NAT between wifi and eth</title>
		<link>http://blog.foppiano.org/2007/09/27/bash-scripting-simple-easy-nat-between-wifi-and-eth/</link>
		<comments>http://blog.foppiano.org/2007/09/27/bash-scripting-simple-easy-nat-between-wifi-and-eth/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 22:37:40 +0000</pubDate>
		<dc:creator>whitenoise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nat]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://bayzone.wordpress.com/2007/09/27/bash-scripting-simple-easy-nat-between-wifi-and-eth/</guid>
		<description><![CDATA[Sometimes happen the same situation: one ethernet port, one ethernet cable, no hub/switch and many PCs with wireless.
A good solution is to connect a pc with ethernet and create a WLAN (ad hoc or infrastructure) to connect other PCs to internet.
Too many time I had this problem and the solution is always the same or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=349&subd=bayzone&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes happen the same situation: one ethernet port, one ethernet cable, no hub/switch and many PCs with wireless.<br />
A good solution is to connect a pc with ethernet and create a WLAN (ad hoc or infrastructure) to connect other PCs to internet.<br />
Too many time I had this problem and the solution is always the same or similar, so I wrote this useful and reusable bash script to configure wifi card (chipset Atheros with madwifi driver) and create a NAT to connect AdHoc WLAN.</p>
<p><code><br />
#!/bin/bash<br />
</code><code># inizializing ethernet (I suppose outer network have address 193.205.22.12)<br />
# I suggest to disable NetworkManager and kill dhclient<br />
ifconfig eth0 193.205.22.12<br />
</code><code></code></p>
<p><code># Now I need to unload and reload module with option "autocreate=adhoc". This<br />
# simplify the creation of virttual interfaces athX (See how madwifi work for more informations)<br />
/sbin/rmmod ath_pci<br />
modprobe ath_pci autocreate=adhoc</code><br />
<code><br />
# Configuring essid (In this case I use essid "spongepowa"<br />
iwconfig ath0 essid spongepowa<br />
# Configuring WLAN address (I suppose my network is 192.168.1.0/24)<br />
ifconfig ath0 192.168.1.1<br />
</code></p>
<p><code># Enabling forwarding<br />
/bin/echo "1" &gt; /proc/sys/net/ipv4/ip_forward<br />
</code></p>
<p><code># Inizializing iptables<br />
iptables --flush<br />
iptables -t nat -P POSTROUTING ACCEPT<br />
iptables -t nat -P PREROUTING ACCEPT</code></p>
<p><code># Making rules:<br />
# - 192.168.1.0/24 is local WLAN addresses<br />
# - eth0 is the output interface (ethernet interface), ath0 is the input interface (wifi interface)<br />
iptables -A FORWARD -s 192.168.1.0/24 -d 0/0 -j ACCEPT<br />
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -d 192.168.1.0/24 -j ACCEPT<br />
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j MASQUERADE</code></p>
<p>I hope this is correct. If you have any question ask me by comment.</p>
<p>If my english is full of mistakes, tell me (AYBABTU is not allowed without motivation :þ)&#8230;with my mistakes, of course.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bayzone.wordpress.com/349/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bayzone.wordpress.com/349/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayzone.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bayzone.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bayzone.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bayzone.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bayzone.wordpress.com/349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&blog=63216&post=349&subd=bayzone&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.foppiano.org/2007/09/27/bash-scripting-simple-easy-nat-between-wifi-and-eth/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5d7dfa79907f7bf28fb2f6680c94e0f6?s=96&#38;d=wavatar" medium="image">
			<media:title type="html">bayzone</media:title>
		</media:content>
	</item>
	</channel>
</rss>