<?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>Shell Tips !</title>
	<atom:link href="http://www.shell-tips.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shell-tips.com</link>
	<description>Some useful tips about CLI tools, Shell scripts and batch files... GNU Bash, Windows XP, SQL, Help Sheets / Cheat Sheets, etc.</description>
	<lastBuildDate>Fri, 04 Dec 2009 01:58:48 +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>Flash &#8211; How to fix the &#8220;Security sandbox violation: BitmapData.draw&#8221;</title>
		<link>http://www.shell-tips.com/2009/08/30/flash-how-to-fix-the-security-sandbox-violation-bitmapdata-draw/</link>
		<comments>http://www.shell-tips.com/2009/08/30/flash-how-to-fix-the-security-sandbox-violation-bitmapdata-draw/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 01:49:39 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[BitmapData.draw]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[fms]]></category>
		<category><![CDATA[red5]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[violation]]></category>
		<category><![CDATA[wowza]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/?p=85</guid>
		<description><![CDATA[The &#8220;Security sandbox violation&#8221; message is a common problem for any Flash developer who try to do a Snapshot of an RTMP Stream. There was a couple of workaround but they stopped working since Flash Player 9.0.115 as it was considered as a possible bug. So, now how to do a proper snapshot of an [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8220;Security sandbox violation&#8221; message is a common problem for any Flash developer who try to do a Snapshot of an RTMP Stream. There was a couple of workaround but they stopped working since Flash Player 9.0.115 as it was considered as a possible bug. So, now how to do a proper snapshot of an RTMP stream ? The answer is simple but you&#8217;ll need to have the control on the streaming server, whatever it is FMS or Red5.<br />
<span id="more-85"></span><br />
Flash use a non documented part of the <a title="Real-Time Messaging Protocol (RTMP) specification" href="http://www.adobe.com/devnet/rtmp/">RTMP protocol</a>. When the client connect to an RTMP stream, the server send a packet that will indicate to the client if it can allow access to the bitmap data (pixels) or/and the raw audio data.</p>
<div id="attachment_86" class="wp-caption alignnone" style="width: 630px"><a href="http://www.shell-tips.com/wp-content/uploads/10184_screenshot+wireshark.jpg"><img class="size-full wp-image-86 " title="Wireshark - Packet capture RtmpSampleAccess" src="http://www.shell-tips.com/wp-content/uploads/10184_screenshot+wireshark.jpg" alt="Wireshark - Packet capture RtmpSampleAccess" width="620" height="390" /></a><p class="wp-caption-text">Wireshark - Packet capture RtmpSampleAccess</p></div>
<p><strong>Fix with FMS</strong></p>
<p>I think what is working here for FMS is also working for Wowza servers but I never tried. To fix your problem with Flash Media Server, you can add this two simple line of code inside the application.onConnect function :</p>
<pre class="brush:javascript">appClient.audioSampleAccess = "/";
appClient.videoSampleAccess = "/";</pre>
<p>It seem that you can also just edit your application.xml file to add the following inside the Application node :</p>
<pre class="brush:xml">&lt;AudioSampleAccess enabled=”true”&gt;/&lt;/AudioSampleAccess&gt;
&lt;VideoSampleAccess enabled=”true”&gt;/&lt;/VideoSampleAccess&gt;</pre>
<p>Beaware that using &#8220;/&#8221; will allow snapshot on all your streams, you can restrict it accordingly to your needs.</p>
<p><strong>Fix with Red5</strong></p>
<p>On last April I posted a patch to Red5 community that let you handle the problem in the same way that FMS does (Ticket <span style="text-decoration: line-through;"><a title="[Red5] Jira APPSERVER-315" href="http://jira.red5.org/browse/APPSERVER-315">#APPSERVER-315</a></span> <a title="Ticket #498 : Security sandbox violation: BitmapData.draw" href="http://www.red5.org/ticket/498" target="_self">#498</a>). So, to let your client access the stream, you will need to edit the red5-web.xml of your application :</p>
<pre class="brush:xml">&lt;bean id="rtmpSampleAccess" class="org.red5.server.stream.RtmpSampleAccess"&gt;
    &lt;property name="audioAllowed" value="true"/&gt;
    &lt;property name="videoAllowed" value="true"/&gt;
&lt;/bean&gt;</pre>
<p>All the Red5 project is designed to use beans which make this application quite flexible. So, in the same way, you can implement your own class and add every security check you want before allowing the access to your RTMP streams. All you need to do is implementing a new class with the IRtmpSampleAccess interface and create a bean using your class.</p>
<p>Even with those changes, you could still get the error message if the stream buffer is empty. So be sure to use a proper try/catch in your client application and also to listen for the &#8220;NetStatusEvent.NET_STATUS&#8221; event. You can start capturing data when the NET_STATUS event return an event.info.code as &#8220;NetStream.Buffer.Full&#8221; and stop capturing data on &#8220;NetStream.Buffer.Empty&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2009/08/30/flash-how-to-fix-the-security-sandbox-violation-bitmapdata-draw/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JETM &#8211;  The easy way to monitor your Spring Application</title>
		<link>http://www.shell-tips.com/2009/06/08/jetm-the-easy-way-to-monitor-your-spring-application/</link>
		<comments>http://www.shell-tips.com/2009/06/08/jetm-the-easy-way-to-monitor-your-spring-application/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 08:10:49 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/?p=47</guid>
		<description><![CDATA[JETM stand for Java™ Execution Time Measurement Library, it&#8217;s an useful library to monitor your java application in a smart and easy way. Here is an overview on how to use JETM with a Spring application like in Red5.
I will consider that you have a running Red5 server and you know how a Red5 application [...]]]></description>
			<content:encoded><![CDATA[<p>JETM stand for <em>Java™ Execution Time Measurement Library</em>, it&#8217;s an useful library to monitor your java application in a smart and easy way. Here is an overview on how to use <a title="JETM" href="http://jetm.void.fm">JETM</a> with a <a title="Spring" href="http://www.springsource.org">Spring</a> application like in <a title="Red5" href="http://osflash.org/red5">Red5</a>.</p>
<p><span id="more-47"></span>I will consider that you have a running Red5 server and you know how a Red5 application work. It&#8217;s quite easy to install, just have a look there if you need : <a title="Red5 Help" href="http://osflash.org/red5/help">http://osflash.org/red5/help</a></p>
<h3><span style="text-decoration: underline;"><strong>The Spring DTD based configuration</strong></span></h3>
<p>Here is the power of Spring, <a title="Aspect Oriented Programming" href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">AOP</a> and the Beans. In your Red5 installation copy the JETM jar file to the lib directory, then edit the conf/red5-common.xml as following :</p>
<pre class="brush:xml">&lt;bean id="etmMonitor"
class="etm.core.monitor.NestedMonitor"
init-method="start" destroy-method="stop"/&gt;

&lt;bean id="etmHttpConsole"
class="etm.contrib.console.HttpConsoleServer"
init-method="start" destroy-method="stop" autowire="constructor"/&gt;</pre>
<p>Those two new beans are there to instantiate the JETM monitor and activate the HTTP console, by default the JETM console listen on port 40000.</p>
<p>So, at this point if you run your red5 server you will just see two new line in your logs :</p>
<pre class="brush:text">7 juin 2009 19:48:36 etm.core.monitor.EtmMonitorSupport start
INFO: JETM 1.2.3 started.</pre>
<p>Now, we need to define which services we want to track. For example, on the oflaDemo application, we can track what&#8217;s going on  by simply adding those other beans to this config file : oflaDemo/WEB-INF/red5-web.xml</p>
<pre class="brush:xml">&lt;bean id="etmMethodCallInterceptor"
class="etm.contrib.aop.aopalliance.EtmMethodCallInterceptor"
autowire="constructor"/&gt;

&lt;bean id="etmAutoProxy"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"&gt;

&lt;property name="interceptorNames"&gt;
&lt;list&gt;
&lt;value&gt;etmMethodCallInterceptor&lt;/value&gt;
&lt;/list&gt;
&lt;/property&gt;
&lt;property name="beanNames"&gt;
&lt;value&gt;web.*&lt;/value&gt;
&lt;/property&gt;

&lt;/bean&gt;</pre>
<p>From now, we are monitoring all the web.* bean from oflaDemo, this means, if you connect to oflaDemo (http://localhost:5080/demos/ofla_demo.html), view a stream etc, then go to the console (http://localhost:40000) you will see some interesting statistics like the average time spend in your Application start method etc.</p>
<div class="wp-caption alignnone" style="width: 551px"><img class="  " title="JETM Console" src="/dl/jetm-console.jpg" alt="JETM Console - Red5 with oflaDemo" width="541" height="520" /><p class="wp-caption-text">JETM Console - Red5 with oflaDemo</p></div>
<h3><strong><span style="text-decoration: underline;">The programmatic way</span></strong></h3>
<p>If you need more detailed statistics you can implement the lib in your application. It&#8217;s what I do now as I can have better detail and select what I really want to track, also you can manage all the JETM configuration thru an xml file. To do that you just need to change your web.handler bean definition to call an init method and implement this method in your application.</p>
<p>In MyTest/WEB-INF/red5-web.xml :</p>
<pre class="brush:xml">&lt;bean id="web.handler"
class="org.example.red5.MyTestApplication"
init-method="init" singleton="true"&gt;</pre>
<p>Then implement the init method in MyTestApplication :</p>
<pre class="brush:java">private EtmMonitor profiler = EtmManager.getEtmMonitor();

public void init()
throws URISyntaxException
{
log.debug("Application initialized: {}", getClass().getName());

URL url = getClass().getClassLoader().getResource("jetm-mytest.xml");
try {
XmlEtmConfigurator.configure(new FileInputStream(url.getPath()));
if (!profiler.isStarted())
profiler.start();
} catch (FileNotFoundException fne) {
log.warn(fne.getMessage());
}
}</pre>
<p>Add the jetm-mytest.xml file in your classpath like in red5/conf or in MyTest/WEB-INF/lib. The xml file look like something like that :</p>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE jetm-config PUBLIC "-// void.fm //DTD JETM Config 1.2//EN"
"http://jetm.void.fm/dtd/jetm_config_1_2.dtd"&gt;

&lt;jetm-config timer="sun"&gt;

&lt;aggregator-chain&gt;

&lt;chain-element class="etm.core.aggregation.BufferedTimedAggregator"&gt;
&lt;!-- Set aggregation interval to 1 second --&gt;
&lt;property name="aggregationInterval"&gt;1000&lt;/property&gt;
&lt;/chain-element&gt;

&lt;chain-element class="etm.contrib.aggregation.log.CommonsLoggingAggregator"&gt;
&lt;!-- Set commons-logging log category --&gt;
&lt;property name="logName"&gt;etm-result&lt;/property&gt;
&lt;/chain-element&gt;

&lt;chain-root class="etm.core.aggregation.persistence.PersistentRootAggregator"&gt;
&lt;property name="aggregationInterval"&gt;10000&lt;/property&gt;
&lt;/chain-root&gt;

&lt;/aggregator-chain&gt;

&lt;extension&gt;
&lt;plugin class="etm.contrib.console.HttpConsoleServerPlugin"&gt;
&lt;property name="listenPort"&gt;40000&lt;/property&gt;
&lt;property name="expanded"&gt;true&lt;/property&gt;
&lt;property name="worker-size"&gt;3&lt;/property&gt;
&lt;/plugin&gt;
&lt;/extension&gt;

&lt;/jetm-config&gt;</pre>
<p>That&#8217;s it, now when you want to collect the statistic in one of your method or in a specific process you can just do something like that :</p>
<pre class="brush:java">public void MyMethod() {

EtmPoint point = profiler.createPoint(getClass().getName()+"#MyMethod");

... Your stuff ...

point.collect();

}</pre>
<p>All this is a succinct introduction, you can go further and do some amazing things. JETM is a really powerful tool to improve your application performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2009/06/08/jetm-the-easy-way-to-monitor-your-spring-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using losetup and dd to secure sensitive data (encrypted block device)</title>
		<link>http://www.shell-tips.com/2008/07/13/using-losetup-and-dd-to-secure-sensitive-data-encrypted-block-device/</link>
		<comments>http://www.shell-tips.com/2008/07/13/using-losetup-and-dd-to-secure-sensitive-data-encrypted-block-device/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 22:26:06 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[Bash - GNU Shell]]></category>
		<category><![CDATA[Case Study]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/?p=41</guid>
		<description><![CDATA[My previous post was made a long time ago, so here is a draft that I finally decide to post. Let&#8217;s see how to secure some of your data with an encrypted block device using losetup and dd.
Steps will be :

Create an image with dd
Build a new device using the image with an encrypt algorythm [...]]]></description>
			<content:encoded><![CDATA[<p>My previous post was made a long time ago, so here is a draft that I finally decide to post. Let&#8217;s see how to secure some of your data with an encrypted block device using losetup and dd.</p>
<p>Steps will be :</p>
<ol>
<li>Create an image with dd</li>
<li>Build a new device using the image with an encrypt algorythm by using losetup</li>
<li>Format the device using mkfs.ext3</li>
<li>Mount the device and start using it !</li>
</ol>
<p>Of course, when you have mounted the device, your data are readable to anyone who have access to the mounted directory.</p>
<p><span id="more-41"></span></p>
<p><strong>Create an image with dd</strong></p>
<pre class="brush:bash">root@vm-ubuntu-lamp:~# dd if=/dev/zero of=encrypted.img bs=4k count=1000 seek=4001
1000+0 records in
1000+0 records out
4096000 bytes (4,1 MB) copied, 0,10063 seconds, 40,7 MB/s
We now have a raw image file using 4MB.
<blockquote>
root@vm-ubuntu-lamp:~# ls -l encrypted.img
-rw-r--r-- 1 root root 20484096 2008-07-12 13:38 encrypted.img
root@vm-ubuntu-lamp:~# du -hs encrypted.img
4,0M    encrypted.img</blockquote>
</pre>
<p><strong>Create the encrypted device</strong></p>
<blockquote><p>root@vm-ubuntu-lamp:~# losetup -e aes /dev/loop0 encrypted.img<br />
Password:<br />
ioctl: LOOP_SET_STATUS: Invalid argument</p></blockquote>
<p>Ooops.. Something wrong. Our losetup bin isn&#8217;t patched to use AES. On ubuntu/debian based OS, it&#8217;s is to deal.</p>
<pre class="brush:bash">apt-get install loop-aes-utils
root@vm-ubuntu-lamp:~# losetup -e aes /dev/loop0 encrypted.img
Password:
ioctl: LOOP_SET_STATUS: Invalid argument, requested cipher or key length (128 bits) not supported by kernel</pre>
<p>Hmm.. Still not good, we need now to patch or change our kernel for support encryption. We have to check if the &#8220;aes&#8221; and &#8220;cryptoloop&#8221; modules are loaded, if not we will load them.</p>
<pre class="brush:bash">root@vm-ubuntu-lamp:~# lsmod | grep aes
root@vm-ubuntu-lamp:~# modprobe aes
root@vm-ubuntu-lamp:~# lsmod | grep aes
aes                    28608  0
root@vm-ubuntu-lamp:~# lsmod | grep cryptoloop
root@vm-ubuntu-lamp:~# modprobe cryptoloop
root@vm-ubuntu-lamp:~# lsmod | grep crypto
cryptoloop              4096  0
loop                   17928  1 cryptoloop</pre>
<p>If you don&#8217;t have the module with your current kernel, you will have to build it by activate the some kernel options.</p>
<pre class="brush:text">CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_AES_586=m</pre>
<p>Now we should be ok to load our encrypted image.<br />
root@vm-ubuntu-lamp:~# losetup -e aes /dev/loop0 encrypted.img<br />
Password:</p>
<p><strong>Format the device with a proper filesystem</strong></p>
<pre class="brush:bash">root@vm-ubuntu-lamp:~# mkfs.ext3 /dev/loop0
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
5016 inodes, 20004 blocks
1000 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=20709376
3 block groups
8192 blocks per group, 8192 fragments per group
1672 inodes per group
Superblock backups stored on blocks:
8193

Writing inode tables: done
Creating journal (1400 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.</pre>
<p><strong>Mount the device</strong></p>
<p>Easiest step, just have to use the mount command.</p>
<pre class="brush:bash">root@vm-ubuntu-lamp:~# mkdir /mnt/encrypted
root@vm-ubuntu-lamp:~# mount /dev/loop0 /mnt/encrypted

root@vm-ubuntu-lamp:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              7850996   1346292   6105892  19% /
varrun                   63052        40     63012   1% /var/run
varlock                  63052         0     63052   0% /var/lock
procbususb               63052        68     62984   1% /proc/bus/usb
udev                     63052        68     62984   1% /dev
devshm                   63052         0     63052   0% /dev/shm
/dev/loop0               19366      1578     16788   9% /mnt/encrypted

root@vm-ubuntu-lamp:~# df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1              8,1G   1,4G   6,3G  19% /
varrun                  65M    41k    65M   1% /var/run
varlock                 65M      0    65M   0% /var/lock
procbususb              65M    70k    65M   1% /proc/bus/usb
udev                    65M    70k    65M   1% /dev
devshm                  65M      0    65M   0% /dev/shm
/dev/loop0              20M   1,7M    18M   9% /mnt/encrypted</pre>
<p>If you want to go further on this subject : <a title="Encryption HOWTO" href="http://encryptionhowto.sourceforge.net/Encryption-HOWTO-4.html#losetup">Encryption HOWTO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2008/07/13/using-losetup-and-dd-to-secure-sensitive-data-encrypted-block-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; Impact of multiple column indexes misuse</title>
		<link>http://www.shell-tips.com/2008/02/13/mysql-impact-of-multiple-column-indexes-misuse/</link>
		<comments>http://www.shell-tips.com/2008/02/13/mysql-impact-of-multiple-column-indexes-misuse/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 11:27:44 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[Benchmarks]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2008/02/13/mysql-impact-of-multiple-column-indexes-misuse/</guid>
		<description><![CDATA[Here is a quick picture about the impact of MySQL indexes misuse. At work, our developers made a new release of their search engine using MySQL fulltext indexes, unfortunately they didn&#8217;t implement it correctly. The impact was a huge load on all our database servers. To find the trouble, I had to redirect the SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick picture about the impact of MySQL indexes misuse. At work, our developers made a new release of their search engine using <a title="MySQL Fulltext Search" href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html">MySQL fulltext indexes</a>, unfortunately they didn&#8217;t implement it correctly. The impact was a huge load on all our database servers. To find the trouble, I had to redirect the SQL search flow to a specific server and check for the slow queries then reproduce it with <a title="MySQL - Optimize query with EXPLAIN" href="http://dev.mysql.com/doc/refman/5.0/en/explain.html">EXPLAIN</a>. Don&#8217;t need a long time to find that the search query did an invalid usage of the fulltext index and the &#8220;Match / Against&#8221; syntax. In fact, the fulltext index was a multiple column fulltext index, in such case you have to specify <strong>ALL</strong> the column present in your index, else the index won&#8217;t be used by MySQL&#8230;</p>
<p align="center"><img title="MySQL - Fulltext Indexes (MATH / AGAINST)" src="/dl/match_against.png" border="0" alt="MySQL - Fulltext Indexes (MATH / AGAINST)" width="738" height="370" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2008/02/13/mysql-impact-of-multiple-column-indexes-misuse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Printing a sequence of letters or numbers</title>
		<link>http://www.shell-tips.com/2008/01/14/printing-a-sequence-of-letters-or-numbers/</link>
		<comments>http://www.shell-tips.com/2008/01/14/printing-a-sequence-of-letters-or-numbers/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 14:50:07 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[Bash - GNU Shell]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2008/01/14/printing-a-sequence-of-letter-or-number/</guid>
		<description><![CDATA[Some times, while scripting in your favorite shell (I mean Bash !! :) you need to print a sequence of letters or numbers. Don&#8217;t write it yourself ! Script it using seq or curly braces !
 Print a sequence of number
nicolas@macvin:~$ seq 1 10
1 2 3 4 5 6 7 8 9 10
nicolas@macvin:~$ seq 0 [...]]]></description>
			<content:encoded><![CDATA[<p>Some times, while scripting in your favorite shell (I mean Bash !! :) you need to print a sequence of letters or numbers. Don&#8217;t write it yourself ! Script it using <strong>seq</strong> or <strong>curly braces</strong> !</p>
<p><strong> Print a sequence of number</strong></p>
<pre class="brush:bash">nicolas@macvin:~$ seq 1 10
1 2 3 4 5 6 7 8 9 10
nicolas@macvin:~$ seq 0 2 10
0 2 4 6 8 10
nicolas@macvin:~$ echo {1..10}
1 2 3 4 5 6 7 8 9 10</pre>
<p><strong>Print a sequence of letters</strong></p>
<pre class="brush:bash">nicolas@macvin:~$ echo {a..g}
a b c d e f g</pre>
<p>Hope this will help you while doing a loop or building some hash directories :</p>
<pre class="brush:bash">nicolas@macvin:~$  mkdir -p test/{1..10}/{1..10}</pre>
<p>Enjoy !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2008/01/14/printing-a-sequence-of-letters-or-numbers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
