<?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>coding</title>
	<atom:link href="http://www.coding.com.br/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coding.com.br</link>
	<description>have you coded today?</description>
	<lastBuildDate>Thu, 18 Aug 2011 17:29:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>sl4a &#8211; part one</title>
		<link>http://www.coding.com.br/android/sl4a-part-one/</link>
		<comments>http://www.coding.com.br/android/sl4a-part-one/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 17:22:15 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sl4a]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1756</guid>
		<description><![CDATA[SL4A stands for Scripting Layer for Android.
One of my deceptions with Android platform was the lack of Python support. Nokia (while supporting Symbian and Maemo) had a great commitment with Python support [audio]. In fact, SL4A isn&#8217;t just Python, it&#8217;s scripting language support for Android: it means that you can use: Lua, Perl, Rhino, TCL, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;">SL4A stands for <strong>S</strong>cripting <strong>L</strong>ayer <strong>for</strong> <strong>A</strong>ndroid.</p>
<p style="text-align: justify;">One of my deceptions with Android platform was the lack of Python support. Nokia (while supporting Symbian and Maemo) had a great commitment with <a href="http://media.libsyn.com/media/awaretek/Python411_20100716_Nokia.mp3" target="_blank">Python support</a> [audio]. In fact, SL4A isn&#8217;t just Python, it&#8217;s scripting language support for Android: it means that you can use: Lua, Perl, Rhino, TCL, etc; even add your own. This is possible due it&#8217;s <a href="http://code.google.com/p/android-scripting/wiki/CodeStructure" target="_blank">design</a>:</p>
<p style="padding-left: 30px; text-align: justify;"><em>The heart of sl4a is the RPC. Each script that is started is given it&#8217;s own instance of the intepreter, a text screen (if started in foreground) and a tcp connection to an instance of the RPC. <strong>rpcHandling</strong> opens a socket, and listens for incoming requests (ie, api call). So, for example. droid.makeToast(&#8220;Hello&#8221;) is formed into a JSON packet. <strong>JsonRpcServer</strong> reads this, sees if it knows what method is being asked for, and passes it to the appropriate facade for processing. Every part of the API is managed by a facade. Each facade are compiled as seperate projects, with different platform targets [due SDK compatibility]. Then <em>JsonRpcServer runs through all the available facades, sees if they can run on the current platform, and puts them into the method list if so.</em></em></p>
<p style="text-align: justify;">Although a <em>alpha</em> quality software you can try in your device. To install SL4A go to <a href="http://code.google.com/p/android-scripting/downloads/list" target="_blank">download</a> page and get <strong>sl4a_rX.apk</strong> and <strong>PythonForAndroid_rX.apk</strong> [replace X to number  referenced by <span style="color: #008000;">Featured</span> label]. All my steps are focused on Python support but I guess that other script languages follow the same path.</p>
<p style="text-align: left;">Connect your device and install.</p>
<p style="text-align: left; padding-left: 30px;">$ <strong>adb install</strong> sl4a_rX.apk<br />
$ <strong>adb install</strong> PythonForAndroid_rX.apk</p>
<p style="text-align: left;">
<p style="text-align: center; padding-left: 30px;"><img class="aligncenter" src="http://farm7.static.flickr.com/6069/6046843648_1f51fa5daf.jpg" alt="" width="500" height="300" /></p>
<p style="text-align: justify;">Follow the steps on device you&#8217;ll need a network connection to finish the process. Open PythonForAndroid on your device and click on <em>Install</em> [this will download all necessary packages]. After you&#8217;ll see:</p>
<p style="text-align: center; padding-left: 30px;">&#8230;.<img class="aligncenter" src="http://farm7.static.flickr.com/6190/6046843686_bf633deb5d.jpg" alt="" width="500" height="300" /></p>
<div id="_mcePaste">Next let&#8217;s create a simple test to check if it&#8217;s working, open your favorite text editor and type:</div>
<div style="padding-left: 30px;"><strong>import</strong> android</div>
<div id="_mcePaste" style="padding-left: 30px;">droid = android.Android()</div>
<div id="_mcePaste" style="padding-left: 30px;">droid.makeToast(&#8220;<span style="color: #ff0000;">Hello, Android</span>&#8220;)</div>
<div style="padding-left: 30px;">print &#8220;Hello world!&#8221;</div>
<p style="text-align: left;">Save as <a href="https://raw.github.com/gist/1145715/0b110b918c334846a42226ce1c46a03a72e30f97/1st.py" target="_blank">1st.py</a> and copy to your phone:</p>
<p style="text-align: left; padding-left: 30px;">$ <strong>adb push</strong> 1st.py /sdcard/sl4a/scripts</p>
<p style="text-align: left;">Select the <em>console</em> logo do start (you can use <em>engine </em>logo too but without console output)</p>
<p style="text-align: center;"><img class="alignleft" src="http://farm7.static.flickr.com/6183/6047371528_8f156a37d8.jpg" alt="" width="300" height="500" /> <img class="alignnone" src="http://farm7.static.flickr.com/6196/6047371572_a58a31be09.jpg" alt="" width="300" height="500" /></p>
<p style="text-align: left;">Also you can choose run script from your host computer.</p>
<p style="text-align: left; padding-left: 30px;">$ adb shell am start -a com.googlecode.android_scripting.action.LAUNCH_FOREGROUND_SCRIPT -n com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher -e com.googlecode.android_scripting.extra.SCRIPT_PATH /sdcard/sl4a/scripts/1st.py</p>
<p style="text-align: left;">
<p style="text-align: left;">Now you can start write some Python code that will run on Android device. Check <a href="http://www.mithril.com.au/android/doc/" target="_blank">API reference</a> for possibilities.</p>
<h5>This was a introduction text about SL4A necessary to describe my learning process and some cool things that you can do. Wait for the next posts.</h5>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/android/sl4a-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>unifei and cacomp qr-codes</title>
		<link>http://www.coding.com.br/unifei/unifei-and-cacomp-qr-codes/</link>
		<comments>http://www.coding.com.br/unifei/unifei-and-cacomp-qr-codes/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 15:42:34 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[unifei]]></category>
		<category><![CDATA[qrcode]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1747</guid>
		<description><![CDATA[QR Codes are popular in many medias, personally I don&#8217;t know if it&#8217;s really used&#8230; But recently Hack A Day published an interesting approach on embedding logos inside this codes. Now you can put some visual &#8220;meaning&#8221; on data. Very useful to visiting cards. I decide made some, a tribute to my former university  

Download QR-Code Cacomp: [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">QR Codes are popular in many medias, personally I don&#8217;t know if it&#8217;s <a href="http://www.howpeopleuseqrcodes.com/" target="_blank">really used</a>&#8230; But recently <em>Hack A Day </em><a href="http://hackaday.com/2011/08/11/how-to-put-your-logo-in-a-qr-code/" target="_blank">published</a> an interesting approach on embedding logos inside this codes. Now you can put some visual &#8220;meaning&#8221; on data. Very useful to visiting cards. I decide made some, a tribute to my former university <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="alignnone" src="http://farm7.static.flickr.com/6185/6042013452_3013c74249_o.png" alt="" width="362" height="323" /><img class="alignnone" title="CACOMP" src="http://farm7.static.flickr.com/6139/6041492051_a164ae170b_o.png" alt="" width="362" height="323" /></p>
<p style="padding-left: 30px;">Download QR-Code Cacomp: <a href="http://farm7.static.flickr.com/6139/6041492051_8cd351dcc9_m.jpg" target="_blank">small</a>, <a href="http://farm7.static.flickr.com/6139/6041492051_a164ae170b_o.png" target="_blank">original</a><br />
Download QR-Code UNIFEI: <a href="http://farm7.static.flickr.com/6185/6042013452_ac2fab83a4_m.jpg" target="_blank">small</a>, <a href="http://farm7.static.flickr.com/6185/6042013452_3013c74249_o.png" target="_blank">original</a></p>
<p>If you want create your own, theory or other logos visit HackADay <a href="http://hackaday.com/2011/08/11/how-to-put-your-logo-in-a-qr-code/" target="_blank">link</a>.</p>
<p><a href="http://farm7.static.flickr.com/6139/6041492051_a164ae170b_o.png" target="_blank"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/unifei-and-cacomp-qr-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>avoid typos with dd wrapper</title>
		<link>http://www.coding.com.br/gnu/avoid-typos-with-dd-wrapper/</link>
		<comments>http://www.coding.com.br/gnu/avoid-typos-with-dd-wrapper/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 18:08:30 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[gnu]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1732</guid>
		<description><![CDATA[When using dd it&#8217;s very common typos that f*ck your important data. I create this 5-minutes python code do wrapper dd and make my life more safe. The usage is simple, just a config file with partition(s) you should avoid. Suppose that you have 2 disks in your computer and want avoid playing both with [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">When using <a href="http://en.wikipedia.org/wiki/Dd_%28Unix%29" target="_blank">dd</a> it&#8217;s <em>very common</em> typos that f*ck your important data. I create this 5-minutes python code do wrapper dd and make my life more safe. The usage is simple, just a config file with partition(s) you should avoid. Suppose that you have 2 disks in your computer and want avoid playing both with dd.</p>
<p style="padding-left: 30px;">$ echo /dev/sda &gt; ~/.blocklist-dd<br />
$ echo /dev/sdb &gt;&gt; ~/.blocklist-dd</p>
<p style="text-align: justify;">Then run you dd wrapper, I choose call my code &#8220;cc&#8221; (near dd in keyboard layout) and associate in $PATH environment.</p>
<p style="padding-left: 30px;">$ wget https://raw.github.com/gist/1100234/b59055e9ab1e3db8ab9d8185287852330d30e777/cc<br />
$ chmod +x cc</p>
<p style="text-align: justify;">And use &#8220;dd&#8221; normally. Bellow we have a correct example to backup MBR. Since /dev/sda is on our blacklist you need  confirm the operation.</p>
<p style="padding-left: 30px;">$ <strong>cc if=/dev/sda of=mbr.img bs=1 count=512</strong><br />
ooops, you are associating a blocked device (/dev/sda) on dd, proceed? (Y/n)<br />
Y<br />
512+0 records in<br />
512+0 records out<br />
512 bytes (512 B) copied, 0.00221805 s, 231 kB/s</p>
<p style="text-align: justify;">Sometimes adding a layer of complexity sometimes could simplify your life.</p>
<p style="text-align: justify;">Code is <a href="https://gist.github.com/1100234" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/gnu/avoid-typos-with-dd-wrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCP with paramiko</title>
		<link>http://www.coding.com.br/sysadmin/scp-with-paramiko/</link>
		<comments>http://www.coding.com.br/sysadmin/scp-with-paramiko/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 23:35:51 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1716</guid>
		<description><![CDATA[This week I needed update some files on remote hosts. rsync is the tool when you need synchronize your files with a remote directory but I tried to use a different approach: a small Python script to transfer files on the same way scp do. I used paramiko module do access different hosts and transfer [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This week I needed update some files on remote hosts. <strong>rsync</strong> is the tool when you need synchronize your files with a remote directory but I tried to use a different approach: a small Python script to transfer files on the same way scp do. I used <a href="http://www.lag.net/paramiko/" target="_blank">paramiko</a> module do access different hosts and transfer a bunch of files, based on this <a href="http://www.stillhq.com/python/paramiko/000001.html">example</a>:</p>
<p><script src="https://gist.github.com/1006704.js?file=send-scp.py"></script></p>
<p><strong>Note:</strong> I used this approach because I&#8217;m transferring few files, <a href="http://blogs.oracle.com/janp/entry/how_the_scp_protocol_works">it&#8217;s not a good idea </a>use this technique with many files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/sysadmin/scp-with-paramiko/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>android: monkeyrunner (I)</title>
		<link>http://www.coding.com.br/android/android-monkeyrunner-i/</link>
		<comments>http://www.coding.com.br/android/android-monkeyrunner-i/#comments</comments>
		<pubDate>Tue, 31 May 2011 14:18:06 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[monkey]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1704</guid>
		<description><![CDATA[There are many ways to learn, writing is one.
I&#8217;m studying Android Framework to implement automated functional and stress testing in many devices. I&#8217;ll describe my learning experience with some Android tools, starting with monkeyrunner [1] &#8211; quoting SDK documentation:
&#8220;The monkeyrunner tool provides an API for writing programs that control an Android device or emulator from [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><em>There are many ways to learn, writing is one.</em></p>
<p style="text-align: justify;">I&#8217;m studying Android Framework to implement automated functional and stress testing in many devices. I&#8217;ll describe my learning experience with some Android tools, starting with <em>monkeyrunner</em> [1] &#8211; quoting SDK documentation:</p>
<blockquote><p>&#8220;The monkeyrunner tool provides an API for writing programs that control an Android device or emulator from outside of Android code. With monkeyrunner, you can write a Python program that installs an Android application or test package, runs it, sends keystrokes to it, takes screenshots of its user interface, and stores screenshots on the workstation. The monkeyrunner tool is primarily designed to test applications and devices at the functional/framework level and for running unit test suites, but you are free to use it for other purposes.&#8221;</p></blockquote>
<p><strong>How Install?<br />
</strong></p>
<p><em>monkeyrunner</em> is available at default Android SDK.</p>
<p style="padding-left: 30px;">$ cd ~<br />
$ wget http://dl.google.com/android/android-sdk_r11-linux_x86.tgz<br />
$ tar zxvf android-sdk_r11-linux_x86.tgz<br />
$ cd android-sdk-linux_x86/tools/<br />
$ ./android</p>
<p>Go to <strong>Available packages</strong> item, select <strong>Android Repository</strong> and check <strong>Android SDK Tools, revision XX</strong></p>
<p>To give path-independent access to your user, you can edit bash config, like:</p>
<p style="padding-left: 30px;">echo &#8220;PATH=~/android-sdk-linux_x86/tools/:$PATH&#8221; &gt;&gt; ~/.bashrc<br />
echo &#8220;PATH=~/android-sdk-linux_x86/platform-tools/:$PATH&#8221; &gt;&gt; ~/.bashrc</p>
<p>Basic usage is simple, just command and script file:</p>
<pre>monkeyrunner &lt;script file&gt;</pre>
<p style="text-align: justify;">To get the idea, our first code not communicate with emulator or device yet but will list all functions from main classes. Get your favorite editor and type:</p>
<p><script src="https://gist.github.com/999191.js?file=monkeyrunner-list.py"></script></p>
<p>Run:</p>
<p style="padding-left: 30px;"><strong>monkeyrunner </strong>monkeyrunner-list.py</p>
<p style="text-align: justify;">This will output three main classes with respective functions ( <a href="http://docs.python.org/tutorial/classes.html#tut-private" target="_blank">&#8220;private&#8221;</a> methods were intentionally omitted). Behind the scene <em>monkeyrunner</em> is a shell script that starts a <em>jar</em> file that contains jython implementation.</p>
<p><strong>MonkeyRunner</strong></p>
<ul>
<li> alert</li>
<li> choice</li>
<li> help</li>
<li> input</li>
<li> sleep</li>
<li> waitForConnection</li>
</ul>
<p><strong>MonkeyDevice</strong></p>
<ul>
<li>DOWN</li>
<li> DOWN_AND_UP</li>
<li> UP</li>
<li> broadcastIntent</li>
<li> drag</li>
<li> getProperty</li>
<li> getSystemProperty</li>
<li> installPackage</li>
<li> instrument</li>
<li> press</li>
<li> reboot</li>
<li> removePackage</li>
<li> shell</li>
<li> startActivity</li>
<li> takeSnapshot</li>
<li> touch</li>
<li> type</li>
<li> wake</li>
</ul>
<p><strong>MonkeyImage</strong></p>
<ul>
<li> convertToBytes</li>
<li> getRawPixel</li>
<li> getRawPixelInt</li>
<li> getSubImage</li>
<li> sameAs</li>
<li> writeToFile</li>
</ul>
<p>Take a look on each method and image the possibilities to automate things. Stay tunned for next posts.</p>
<p>[1] <a href="http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html" target="_blank">http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/android/android-monkeyrunner-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>android: dumpsys</title>
		<link>http://www.coding.com.br/android/android-dumpsys/</link>
		<comments>http://www.coding.com.br/android/android-dumpsys/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 20:27:35 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[adb]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1688</guid>
		<description><![CDATA[Android has an interesting command called dumpsys to dump some system information. Even described on adb manual I think that some points should be reinforced. In order to get the complete status just run (will produce a large output):
adb shell dumpsys
Also you can apply filters to running services:



1	SurfaceFlinger
2	accessibility
3	account
4	activity
5	alarm
6	appwidget
7	audio
8	backup
9	battery
10	batteryinfo
11	bluetooth
12	bluetooth_a2dp
13	clipboard
14	connectivity
15	content
16	cpuinfo
17	device_policy
18	devicestoragemonitor
19	diskstats
20	dropbox
21	entropy
22	ethernet
23	hardware
24	input_method
25	iphonesubinfo
26	isms
27	keybar
28	location
29	media.audio_flinger
30	media.audio_policy
31	media.camera
32	media.player
33	meminfo
34	mount
35	netstat
36	network_management
37	notification
38	package
39	permission
40	phone
41	power
42	search
43	sensor
44	simphonebook
45	statusbar
46	telephony.registry
47	throttle
48	uimode
49	usagestats
50	vibrator
51	wallpaper
52	wifi
53	window



Some examples:
adb shell dumpsys wifi
adb shell dumpsys cpuinfo
I [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><!-- p { margin-bottom: 0.08in; }td p { margin-bottom: 0in; } -->Android has an interesting command called <em>dumpsys</em> to dump some system information. Even described on <a href="http://developer.android.com/guide/developing/tools/adb.html" target="_blank">adb manual</a> I think that some points should be reinforced. In order to get the complete status just run (will produce a large output):</p>
<h4 style="padding-left: 30px;">adb shell dumpsys</h4>
<p>Also you can apply filters to running services:</p>
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tbody>
<tr valign="TOP">
<td width="33%">1	SurfaceFlinger</p>
<p>2	accessibility</p>
<p>3	account</p>
<p>4	activity</p>
<p>5	alarm</p>
<p>6	appwidget</p>
<p>7	audio</p>
<p>8	backup</p>
<p>9	battery</p>
<p>10	batteryinfo</p>
<p>11	bluetooth</p>
<p>12	bluetooth_a2dp</p>
<p>13	clipboard</p>
<p>14	connectivity</p>
<p>15	content</p>
<p>16	<strong>cpuinfo</strong></p>
<p>17	device_policy</td>
<td width="33%">18	devicestoragemonitor</p>
<p>19	diskstats</p>
<p>20	dropbox</p>
<p>21	entropy</p>
<p>22	ethernet</p>
<p>23	hardware</p>
<p>24	input_method</p>
<p>25	iphonesubinfo</p>
<p>26	isms</p>
<p>27	keybar</p>
<p>28	location</p>
<p>29	media.audio_flinger</p>
<p>30	media.audio_policy</p>
<p>31	media.camera</p>
<p>32	media.player</p>
<p>33	meminfo</p>
<p>34	mount</p>
<p>35	netstat</td>
<td width="33%">36	network_management</p>
<p>37	notification</p>
<p>38	package</p>
<p>39	permission</p>
<p>40	phone</p>
<p>41	power</p>
<p>42	search</p>
<p>43	sensor</p>
<p>44	simphonebook</p>
<p>45	statusbar</p>
<p>46	telephony.registry</p>
<p>47	throttle</p>
<p>48	uimode</p>
<p>49	usagestats</p>
<p>50	vibrator</p>
<p>51	wallpaper</p>
<p>52	<strong>wifi</strong></p>
<p>53	window</td>
</tr>
</tbody>
</table>
<p>Some examples:</p>
<h4 style="padding-left: 30px;">adb shell dumpsys wifi</h4>
<h4 style="padding-left: 30px;">adb shell dumpsys cpuinfo</h4>
<p style="text-align: justify;">I suggest you try other items on the list above and be creative using all the power of Unix pipes. Example, to get all memory allocated by each process you can do something like:</p>
<pre style="padding-left: 30px;">adb shell dumpsys meminfo | grep "allocated:" | awk '{total = total + $5}END{print total}'</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/android/android-dumpsys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>avoid kernel messages at boottime</title>
		<link>http://www.coding.com.br/embarcado/avoid-kernel-messages-at-boottime/</link>
		<comments>http://www.coding.com.br/embarcado/avoid-kernel-messages-at-boottime/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 03:17:49 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[uboot]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1673</guid>
		<description><![CDATA[Linux embedded normally don&#8217;t behave as the same in desktop system, maybe instead login at your device you need only run a specific application &#8211; for example &#8211; by just modifying an start script. Although easily&#8230; one requisite that I faced these days was avoid boot messages from kernel, accomplished by changing kernel parameters:
setenv bootargs [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Linux embedded normally don&#8217;t behave as the same in desktop system, maybe instead <em>login</em> at your device you need only run a specific application &#8211; for example &#8211; by just modifying an start script. Although easily&#8230; one requisite that I faced these days was avoid boot messages from kernel, accomplished by changing <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/kernel-parameters.txt;h=cc85a927819070bef71e5802204b0f07cfb76973;hb=d77d9597ad8f2bd381a5168005a21e82df6f18eb" target="_blank">kernel parameters</a>:</p>
<p style="padding-left: 30px; text-align: justify;">setenv bootargs &#8216;<strong>console=<span style="color: #ff0000;">none</span> </strong>root=/dev/mmcblk0p<span style="color: #ff0000;">X</span> rootwait init=/sbin/init&#8217;</p>
<p>But this parameter broke the output of my start code (a shell script) located on /etc/rc.d/&#8230;</p>
<p style="text-align: justify;">Checking for solutions I go back to <em>getty</em> and added two parameters &#8220;<strong>-l</strong>&#8221; and &#8220;<strong>-n</strong>&#8221; to specify your program (or <em>script</em>) and prompt for <em>nologin</em>.</p>
<p>$ cat /etc/inittab</p>
<p style="padding-left: 30px;">::sysinit:/etc/rc.d/rcS<br />
::respawn:/sbin/getty -L <span style="color: #ff0000;">ttymxc0</span> 115200 vt100 <strong>-l </strong><span style="color: #ff0000;">/path/to/your/program</span><strong> -n </strong><br />
::ctrlaltdel:/sbin/reboot<br />
::shutdown:/etc/rc.d/rcS stop<br />
::restart:/sbin/init</p>
<p>Now I can see the serial output without kernel boot messages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/avoid-kernel-messages-at-boottime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BeagleBoard and Ubuntu 11.04 (beta 1) headless install</title>
		<link>http://www.coding.com.br/ubuntu/beagleboard-and-ubuntu-11-04-beta-1-headless-install/</link>
		<comments>http://www.coding.com.br/ubuntu/beagleboard-and-ubuntu-11-04-beta-1-headless-install/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 03:57:45 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[arm]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1660</guid>
		<description><![CDATA[Ubuntu OMAP team is doing a really good job by adding a headless installation of 11.04 release. I had a good impression trying on BeagleBoard (revC) and the process is straightforward (read the documentation) but I needed made a slight change at u-boot bootcmd env, so I decided share:
mmc init
mmc rescan 0
fatload mmc 0 0&#215;82000000 [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Ubuntu <a href="https://wiki.ubuntu.com/ARM/OMAP" target="_blank">OMAP</a> team is doing a really good job by adding a <em><a href="https://wiki.ubuntu.com/ARM/OMAPHeadlessInstall" target="_blank">headless installation</a></em> of 11.04 <a href="http://cdimage.ubuntu.com/ubuntu-headless/releases/11.04/beta-1/" target="_blank">release</a>. I had a good impression trying on BeagleBoard (revC) and the process is straightforward (read the documentation)<em> but</em> I needed made a slight change at u-boot <em>bootcmd</em> env, so I decided share:</p>
<p style="padding-left: 30px;">mmc init<br />
<strong>mmc rescan 0</strong><br />
fatload mmc 0 0&#215;82000000 boot.scr<br />
source 0&#215;82000000</p>
<p>After install&#8230; I put a usb/ethernet dongle and got fully supported by APT syncing from <a href="http://ports.ubuntu.com" target="_blank">ports.ubuntu.com</a> <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img class="aligncenter" title="BeagleBoard + USB/Ethernet dongle" src="http://farm5.static.flickr.com/4105/5612224154_5f56dcd14c.jpg" alt="My Beagle setup" width="500" height="375" /></p>
<p style="text-align: left;">I suggest try it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/ubuntu/beagleboard-and-ubuntu-11-04-beta-1-headless-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook &#8220;Like&#8221; button to any site</title>
		<link>http://www.coding.com.br/blog/facebook-like-button-to-any-site/</link>
		<comments>http://www.coding.com.br/blog/facebook-like-button-to-any-site/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 04:00:26 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1637</guid>
		<description><![CDATA[My dirty code to quickly add functionality of Facebook  button to websites that I visit.
javascript:void(location.href=&#8217;http://www.facebook.com/plugins/like.php?href=&#8217;+encodeURIComponent(location.href))
To use just move the link below to your bookmarks bar.
I like

I don’t know if it’s the correct way… just opted for that because I want share some content that aren’t integrated with Facebook API.
]]></description>
			<content:encoded><![CDATA[<p>My <em>dirty</em> code to quickly add functionality of Facebook <a href="http://www.coding.com.br/wp-content/uploads/2011/03/fb_like.png"><img class="alignnone size-full wp-image-1640" title="Facebook Like Button" src="http://www.coding.com.br/wp-content/uploads/2011/03/fb_like.png" alt="" width="55" height="27" /></a> button to websites that I visit.</p>
<p>javascript:void(location.href=&#8217;http://www.facebook.com/plugins/like.php?href=&#8217;+encodeURIComponent(location.href))</p>
<p style="text-align: center;">To use just <strong>move</strong> the link below to your bookmarks bar.</p>
<p style="text-align: center;"><strong><a href="javascript:void(location.href='http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(location.href))">I like</a></strong></p>
<p><center><iframe src="http://www.screenr.com/embed/sWo" width="650" height="396" frameborder="0"></iframe></center></p>
<p>I don’t know if it’s the correct way… just opted for that because I want share some content that aren’t integrated with Facebook API.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/facebook-like-button-to-any-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>re-generating ubi</title>
		<link>http://www.coding.com.br/embarcado/re-generating-ubi/</link>
		<comments>http://www.coding.com.br/embarcado/re-generating-ubi/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 18:33:07 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[ubifs]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1605</guid>
		<description><![CDATA[If you need re-generate an UBIFS and don&#8217;t know the right parameters you can inspect dmesg output to filter UBI parameters.


If you need know the steps to creante an UBI/UBIFS check the official documentation or my ubifs tag on del.icio.us.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">If you need re-generate an UBIFS and <strong>don&#8217;t know</strong> the right parameters you can inspect<em> </em><a href="http://www.linfo.org/dmesg.html" target="_blank"><em>dmesg</em></a> output to filter UBI parameters.</p>
<p style="text-align: center;"><a href="http://www.coding.com.br/wp-content/uploads/2011/01/ubi.png"><img class="aligncenter size-full wp-image-1607" title="ubi" src="http://www.coding.com.br/wp-content/uploads/2011/01/ubi.png" alt="" width="537" height="559" /></a></p>
<p style="text-align: center;">
<p style="text-align: justify;">If you need know the steps to creante an UBI/UBIFS check the <a href="http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs" target="_blank">official documentation</a> or my <a href="http://www.delicious.com/maluta/ubifs" target="_blank">ubifs tag</a> on del.icio.us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/re-generating-ubi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
