<?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; scripting</title>
	<atom:link href="http://blog.foppiano.org/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.foppiano.org</link>
	<description>this blog is a feature</description>
	<lastBuildDate>Sat, 04 Feb 2012 08:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.foppiano.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>fucking the white bunny rabbit &#187; scripting</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>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[knowledge]]></category>
		<category><![CDATA[Linux]]></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 &#8216;s/[01]/&#38;;/g&#8217; foo To remove semicolon: sed -e &#8216;s/\([01]\);/\1/g&#8217; foo<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&amp;blog=63216&amp;post=380&amp;subd=bayzone&amp;ref=&amp;feed=1" width="1" height="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 &#8216;s/[01]/&amp;;/g&#8217; foo</font></p></blockquote>
<p>To remove semicolon:</p>
<blockquote><p><font face="courier">sed -e &#8216;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/gofacebook/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bayzone.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bayzone.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=63216&amp;post=380&amp;subd=bayzone&amp;ref=&amp;feed=1" width="1" height="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>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[knowledge]]></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&amp;blog=63216&amp;post=364&amp;subd=bayzone&amp;ref=&amp;feed=1" width="1" height="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/gofacebook/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bayzone.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bayzone.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=63216&amp;post=364&amp;subd=bayzone&amp;ref=&amp;feed=1" width="1" height="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>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[computer]]></category>
		<category><![CDATA[knowledge]]></category>
		<category><![CDATA[Linux]]></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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.foppiano.org&amp;blog=63216&amp;post=349&amp;subd=bayzone&amp;ref=&amp;feed=1" width="1" height="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/gofacebook/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bayzone.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bayzone.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=63216&amp;post=349&amp;subd=bayzone&amp;ref=&amp;feed=1" width="1" height="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>
