<?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>Le Vosgien du Net &#187; gentoo</title>
	<atom:link href="http://levosgien.net/tag/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://levosgien.net</link>
	<description>Parce que la vérité n'est pas toujours bonne à dire</description>
	<lastBuildDate>Thu, 11 Feb 2010 18:39:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Onliner Batch Rename Files with Bash</title>
		<link>http://levosgien.net/2008/12/13/onliner-batch-rename-files-with-bash/</link>
		<comments>http://levosgien.net/2008/12/13/onliner-batch-rename-files-with-bash/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 12:39:35 +0000</pubDate>
		<dc:creator>Pierre</dc:creator>
				<category><![CDATA[Geekitude]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysa]]></category>

		<guid isPermaLink="false">http://levosgien.net/?p=142</guid>
		<description><![CDATA[	Because I&#8217;m fed of searching for this kind of useful command :
$ for F in *; do E=${F:(-4)}; B=${F/$E/}; mv $F 'Wonderful.Serial.FileName.S03E'$B.'VOSTFR.HDTV.XViD.GKS'$E; done

	Explanations :
E = ${F:(-4)} extracts the file extension.
B = ${F/$E/} returns the original filename without extension.
	These two variables are then used to build the new filename  
	[EDIT]
	Another one, using sed and regular [...]]]></description>
			<content:encoded><![CDATA[	<p>Because I&#8217;m fed of searching for this kind of useful command :</p>
<code>$ for F in *; do E=${F:(-4)}; B=${F/$E/}; mv $F 'Wonderful.Serial.FileName.S03E'$B.'VOSTFR.HDTV.XViD.GKS'$E; done
</code>
	<p>Explanations :<br />
<code>E = ${F:(-4)}</code> extracts the file extension.</p>
<code>B = ${F/$E/}</code> returns the original filename without extension.
	<p>These two variables are then used to build the new filename <img src='http://levosgien.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
	<p><strong>[EDIT]</strong></p>
	<p>Another one, using sed and regular expressions :</p>
<code>$ for A in *.avi; do mv "$A" `echo $A | sed -r 's/^Name To Remove &lt;ins&gt;([0-9]&lt;/ins&gt;(-[0-9]+)?)\.avi$/\1.avi/'`; done</code>
	<p>Were we build a simple &#8220;mv&#8221; command with the original filename ($A) and a new filename by catching the output of <code>echo $A | sed</code> enclosing it with backquotes (`).</p>
	<p>sed -r allows to use extended regular expressions.</p>
	<p>s/you/me/ is the sed command to Subsitute you by me.</p>
	<p>s/^Name To Remove <ins>([0-9]</ins>(-[0-9]+)?)\.avi$/\1.avi/</p>
	<p>We match filenames like :
	<ul>
		<li>Name To Remove 123.avi (as many spaces as you want between the textual part of the name and the file number)</li>
		<li>Name To Remove 123-456.avi</li>
	</ul></p>
	<p>We catch the subexpression between parenthesis (123 or 123-456 in this poor example) and we use it to build the new filename (thanks to &#8221;\1&#8221; in the third part of the sed command.)</p>

 ]]></content:encoded>
			<wfw:commentRss>http://levosgien.net/2008/12/13/onliner-batch-rename-files-with-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo : How to unmerge all packages of a category</title>
		<link>http://levosgien.net/2008/11/14/gentoo-how-to-unmerge-all-packages-of-a-category/</link>
		<comments>http://levosgien.net/2008/11/14/gentoo-how-to-unmerge-all-packages-of-a-category/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 23:17:16 +0000</pubDate>
		<dc:creator>Pierre</dc:creator>
				<category><![CDATA[Geekitude]]></category>
		<category><![CDATA[eix]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://levosgien.net/?p=138</guid>
		<description><![CDATA[	Thanks to eix !
Note : You must be root to unmerge packages
Start by installing emerge if you don&#8217;t have it : emerge eix
Run update-eix to create or update the eix database.
Now, this&#8230; trick should work for you too  
eix --nocolor -c -I -C dev-ruby &#124; cut -d " " -f 2 &#124; grep --color=never [...]]]></description>
			<content:encoded><![CDATA[	<p>Thanks to eix !<br/><br />
Note : <em>You must be root to unmerge packages</em><br/><br />
Start by installing emerge if you don&#8217;t have it : <code>emerge eix</code><br/><br />
Run <code>update-eix</code> to create or update the eix database.<br/><br />
Now, this&#8230; trick should work for you too <img src='http://levosgien.net/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> <br/><br />
<code>eix --nocolor -c -I -C dev-ruby | cut -d " " -f 2 | grep --color=never dev-ruby | xargs emerge --unmerge</code><br/><br />
Need some explanations ?<br/><br />
<code>eix -c -I -C dev-ruby</code> extracts all installed packages from dev-ruby<br/><br />
<code>cut -d " " -f 2</code> extracts the full package name<br/><br />
<code>grep --color=never dev-ruby</code> filters the list ignoring eix overlays info and packages count (you could also use <code>eix -c -*...</code> to avoid that)<br/><br />
<code>xargs</code> takes the whole packages list and send it as a list of arguments to <code>emerge --unmerge</code> that will unmerge all listed packages in one shot !</p>

 ]]></content:encoded>
			<wfw:commentRss>http://levosgien.net/2008/11/14/gentoo-how-to-unmerge-all-packages-of-a-category/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
