<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-3992037435056807380</atom:id><lastBuildDate>Sun, 31 Aug 2025 06:38:03 +0000</lastBuildDate><category>linux</category><category>kernel</category><category>ubuntu</category><category>vim</category><category>debug</category><category>gdb</category><category>ipv6</category><category>kde</category><category>scripts</category><category>sed</category><category>.ics file</category><category>/proc</category><category>Linux Fun</category><category>PREEMPT_RT</category><category>bluetooth</category><category>build kernel</category><category>coding-style</category><category>community</category><category>compaq</category><category>configure kernel</category><category>custom search</category><category>debugfs</category><category>dentry</category><category>drop cache</category><category>emulation</category><category>errors</category><category>fake numa</category><category>fedora</category><category>firefox</category><category>fonts</category><category>gcc</category><category>git</category><category>gnuplot</category><category>hardy</category><category>ibm</category><category>info proc</category><category>instrumentation</category><category>klog</category><category>kmail</category><category>kopete</category><category>large pages</category><category>lenovo</category><category>lkml</category><category>lotus notes</category><category>memory</category><category>module</category><category>mp3</category><category>multi-core</category><category>network attacks</category><category>numa</category><category>numa_maps</category><category>page cache</category><category>page tables</category><category>per-cpu variables</category><category>png</category><category>presario</category><category>realtime</category><category>reiserfs</category><category>rt-mutex</category><category>sametime</category><category>sound problems on hardy</category><category>splitter</category><category>streamline_config</category><category>systemtap</category><category>task migration</category><category>thinkpads</category><category>thread state</category><category>topology</category><category>trace</category><category>tunneling</category><category>udev</category><category>udpflood</category><category>unix</category><category>vbrfix</category><category>vcd to avi</category><category>vsftpd</category><category>whitespaces</category><title>Linux Hacks</title><description>Linux is the fast growing state-of-the-art OS. This blog will focus on new kernel features, Review of the best opensource software and news. HOWTO&#39;s will also be added from time to time based on interest.</description><link>http://linux-hacks.blogspot.com/</link><managingEditor>noreply@blogger.com (Anki)</managingEditor><generator>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-6318373020060518867</guid><pubDate>Sun, 30 Jan 2011 12:47:00 +0000</pubDate><atom:updated>2011-01-30T04:47:57.821-08:00</atom:updated><title>Working with Big Patchsets</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;In the past, whenever there was a need for me to test or review huge patchsets, I&#39;d generate individual patches by saving the mails containing them. This can get cumbersome, especially if the patchset is huge and if you have to try out multiple versions of the patches. There is however an alternative available. It is to obtain the mbox file pertaining to the entire patchset. The mbox file for kernel patches can be obtained from &lt;a href=&#39;https://patchwork.kernel.org/&#39; target=&#39;_blank&#39;&gt;patchworks&lt;/a&gt;. The home page displays a list of projects that are hosted. Below are a few steps to get started - &lt;br/&gt;&lt;ol&gt;&lt;li&gt;Create a login on  &lt;a href=&#39;https://patchwork.kernel.org/&#39; target=&#39;_blank&#39;&gt;patchworks&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Once in your account, select the project of interest from the home page&lt;/li&gt;&lt;li&gt;Using the filters, search for the particular patchset&lt;/li&gt;&lt;li&gt;Select the individual mails of the patchset and create a new &#39;bundle&#39; from the interface at the bottom of the page. &#39;bundles&#39; are a group of related &lt;br/&gt;patches. Name the bundle appropriately&lt;br/&gt;&lt;/li&gt;&lt;li&gt;You can go to all your bundles by clicking on the &#39;bundles&#39; link at the top right corner of any page&lt;/li&gt;&lt;li&gt;The bundles interface allows you to manage your bundles, with support to download it. Bundles are nothing but all the mails in a mbox format&lt;/li&gt;&lt;li&gt;You can then open the mbox with either your mail client or apply it directly to your tree with patch management tools that allow importing mbox files. I use &lt;a href=&#39;http://www.mutt.org/&#39; target=&#39;_blank&#39;&gt;mutt&lt;/a&gt; to read the mbox file and &lt;a href=&#39;http://www.procode.org/stgit/&#39; target=&#39;_blank&#39;&gt;stgit &lt;/a&gt;to import the patches&lt;/li&gt;&lt;/ol&gt;&lt;br/&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2011/01/working-with-big-patchsets.html</link><author>noreply@blogger.com (Anki)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-5818531546316299633</guid><pubDate>Wed, 26 May 2010 11:03:00 +0000</pubDate><atom:updated>2010-05-26T04:13:43.903-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">kmail</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">vim</category><title>Avoid Kmail Editor And Use Vim Editor Instead</title><description>Kmail has bad editor when it comes to sending patches inlined. More often the message gets mangled (word wrapped). To overcome this problem Kmail allows the use of external editor.&lt;br /&gt;&lt;br /&gt;1. Settings-&gt;Configure Mail and Click on Composer&lt;br /&gt;2. Click on &quot;Use External Editor&quot; and specify the editor as &quot;xterm -e vim -f %f&quot;&lt;br /&gt;3. Click Apply.&lt;br /&gt;&lt;br /&gt;Open the composer and type in mail id and subject and click on the body. When you start typing a new editor window opens up which is vim. Type in your message and type &quot;:wq&quot;. Thats it.&lt;br /&gt;&lt;br /&gt;For people intending to send patches, use :vsplit &lt;path&gt; and use visual method to highlight and &#39;y&#39; to yank the highlighted message. Close the vsplit and type &quot;p&quot; to paste it.&lt;/path&gt;</description><link>http://linux-hacks.blogspot.com/2010/05/avoid-kmail-vim-editor.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-4065675307391534226</guid><pubDate>Thu, 22 Apr 2010 05:18:00 +0000</pubDate><atom:updated>2010-04-21T22:27:55.153-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">vcd to avi</category><title>Convert VCD T0 AVI (Xvid)</title><description>A simple way to convert old vcds to avi(xvid) and not lose too much video quality is by using the tool mencoder.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Download and Install mencoder:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#sudo apt-get install mencoder&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Start Conversion:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#mencoder vcd://2 -o movie.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Where vcd://2 points to the title you wish to decode. Most vcds have 2 to 3 titles and the biggest one being the movie. Choose the biggest title of vcd for the decode. If you are unsure what to choose, i suggest trial and error starting from 1 to any number till mencoder throws out error of not finding the title.&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-hacks.blogspot.com/2010/04/convert-vcd-t0-avi-xvid.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-7585690639699720128</guid><pubDate>Fri, 18 Dec 2009 09:08:00 +0000</pubDate><atom:updated>2010-04-20T06:13:36.954-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mp3</category><category domain="http://www.blogger.com/atom/ns#">splitter</category><category domain="http://www.blogger.com/atom/ns#">vbrfix</category><title>Rip mp3 from cue/flac!</title><description>Here is a simple way to rip mp3 from flac files.  There are few softwares that need to be installed for to work.&lt;br /&gt;&lt;br /&gt;Download and Install Sound Converter For Linux. It can be downloaded from &lt;a href=&quot;http://soundconverter.berlios.de/&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once Installed you can start up the application from the multimedia panel in the start menu.&lt;br /&gt;&lt;br /&gt;Install additional packages&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#sudo apt-get install flac mp3splt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Step 1:&lt;/span&gt; Convert the flac file to mp3 using Sound Converter. This process is quite simple. Start the sound converter and specify the flac file you wish to convert and press &quot;Convert&quot;. This converts the flac file to one single mp3 file. But we are aware of multiple songs in that mp3 file.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Step 2:&lt;/span&gt; Split the single mp3 files into multiple mp3 tracks. This can be done using the mp3splt utility we just installed.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#mp3splt -f -c Album.cue Album.mp3&lt;/span&gt;&lt;br /&gt;Assuming that Album.mp3 is the file produced by the Sound Converter. &quot;cue&quot; files are generally provided with flac files for this very purpose. If you do not have the cue file, you have to use some mp3 splitter to achieve the same.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Step 3:&lt;/span&gt; The new mp3 files might have issues with reading mp3 duration of these files. If that happens then a simple tool called vbrfix will fix the problem.&lt;br /&gt;Install vbrfix&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#sudo apt-get install vbrfix&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To fix a mp3 file using vbrfix&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;#vbrfix myfile.mp3 myfile_fix.mp3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The myfile_fix.mp3 would have the duration problem fixed.</description><link>http://linux-hacks.blogspot.com/2009/12/rip-mp3-from-cueflac.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-4246976622359966907</guid><pubDate>Fri, 18 Sep 2009 05:38:00 +0000</pubDate><atom:updated>2009-09-17T22:38:11.797-07:00</atom:updated><title>Real-Time Linux Kernel Scheduler</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;My article explaining the Real-Time Linux kernel scheduler is finally available for general reading on the Linux Journal site. You can read it &lt;a href=&#39;http://www.linuxjournal.com/article/10165&#39;&gt;here&lt;/a&gt;. Any feedback on the article are most welcome !&lt;br/&gt;&lt;br/&gt;&lt;div class=&#39;zemanta-pixie&#39;&gt;&lt;img src=&#39;http://img.zemanta.com/pixy.gif?x-id=7156fd82-5484-8734-bee7-be386936c20b&#39; alt=&#39;&#39; class=&#39;zemanta-pixie-img&#39;/&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/09/real-time-linux-kernel-scheduler.html</link><author>noreply@blogger.com (Anki)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-2702492344581569231</guid><pubDate>Mon, 03 Aug 2009 17:30:00 +0000</pubDate><atom:updated>2009-08-03T10:32:34.124-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">debugfs</category><category domain="http://www.blogger.com/atom/ns#">kernel</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">page tables</category><title>Dumping kernel page tables</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Sometimes when debugging kernel issues, you might come across kernel addresses that you would find very difficult to map to a particular section in the kernel, ie, vmalloc, vmemmap, low/high kernel mapping, kernel text, etc. On x86, Arjan van de Ven has written an interface that provides a dump of the kernel page tables which gives information on the various memory  areas in the kernel.&lt;br /&gt;&lt;br /&gt;# cat /debug/kernel_page_tables&lt;br /&gt;---[ User Space ]---&lt;br /&gt;0x0000000000000000-0xffff800000000000    16777088T                           pgd&lt;br /&gt;---[ Kernel Space ]---&lt;br /&gt;0xffff800000000000-0xffff880000000000           8T                           pgd&lt;br /&gt;---[ Low Kernel Mapping ]---&lt;br /&gt;0xffff880000000000-0xffff880000200000           2M     RW             GLB x  pte&lt;br /&gt;0xffff880000200000-0xffff880040000000        1022M     RW         PSE GLB x  pmd&lt;br /&gt;0xffff880040000000-0xffff8800cfe00000        2302M     RW         PSE GLB NX pmd&lt;br /&gt;...&lt;br /&gt;---[ vmalloc() Area ]---&lt;br /&gt;0xffffc20000000000-0xffffc20000001000           4K     RW     PCD     GLB NX pte&lt;br /&gt;0xffffc20000001000-0xffffc20000004000          12K                           pte&lt;br /&gt;0xffffc20000004000-0xffffc20000005000           4K     RW     PCD     GLB NX pte&lt;br /&gt;0xffffc20000005000-0xffffc20000008000          12K                           pte&lt;br /&gt;0xffffc20000008000-0xffffc2000000d000          20K     RW     PCD     GLB NX pte&lt;br /&gt;0xffffc2000000d000-0xffffc20000010000          12K                           pte&lt;br /&gt;0xffffc20000010000-0xffffc20000011000           4K     RW     PCD     GLB NX pte&lt;br /&gt;....&lt;br /&gt;---[ Vmemmap ]---&lt;br /&gt;0xffffe20000000000-0xffffe20007c00000         124M     RW         PSE GLB NX pmd&lt;br /&gt;0xffffe20007c00000-0xffffe20040000000         900M                           pmd&lt;br /&gt;0xffffe20040000000-0xffffe28000000000         511G                           pud&lt;br /&gt;0xffffe28000000000-0xffffff8000000000          29T                           pgd&lt;br /&gt;0xffffff8000000000-0xffffffff80000000         510G                           pud&lt;br /&gt;---[ High Kernel Mapping ]---&lt;br /&gt;0xffffffff80000000-0xffffffff80200000           2M                           pmd&lt;br /&gt;0xffffffff80200000-0xffffffff80a00000           8M     RW         PSE GLB x  pmd&lt;br /&gt;0xffffffff80a00000-0xffffffffa0000000         502M                           pmd&lt;br /&gt;---[ Modules ]---&lt;br /&gt;0xffffffffa0000000-0xffffffffa000a000          40K     RW             GLB x  pte&lt;br /&gt;0xffffffffa000a000-0xffffffffa000f000          20K                           pte&lt;br /&gt;0xffffffffa000f000-0xffffffffa0016000          28K     RW             GLB x  pte&lt;br /&gt;0xffffffffa0016000-0xffffffffa001b000          20K                           pte&lt;br /&gt;....&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;Understanding the above output:&lt;br /&gt;&lt;br /&gt;o First field indicates the address range of a particular type of area (for example, user space, vmalloc area, kernel space, etc)&lt;br /&gt;o The second field indicates the size of the address range in K,M,G,T units&lt;br /&gt;o The fields following the size of the range have the following meaning:&lt;br /&gt;   USR - whether the page being mapped is a user page or not&lt;br /&gt;   RW - whether the page is read/write. If not RW, the output would be &#39;ro&#39; to indicate a read-only page&lt;br /&gt;   PCD - Page Cache Disabled - maps a page with caching disabled&lt;br /&gt;   PWT - page with Page Write-Through set&lt;br /&gt;   PSE - Extended paging enabled - allows large linear contiguous address ranges to be mapped&lt;br /&gt;   GLB - Page Global flag - The global flag is set for a page that is frequently used and prevents it from being flushed from the TLB&lt;br /&gt;  NX - Page is non-executable, else marked as &#39;x&#39;&lt;br /&gt;o The last entry indicates the particular level of the page table - pgd, pud, pmd or pte that the region corresponds to&lt;br /&gt;  &lt;br /&gt;Enable the CONFIG_X86_PTDUMP configuration option, along with enabling debugfs. The corresponding kernel code for the interface can be found under arch/x86/mm/dump_pagetables.c&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img src=&quot;http://img.zemanta.com/pixy.gif?x-id=92acdb06-0bdb-861e-adde-b3044928b730&quot; alt=&quot;&quot; class=&quot;zemanta-pixie-img&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/08/dumping-kernel-page-tables.html</link><author>noreply@blogger.com (Anki)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-4455472449772741447</guid><pubDate>Fri, 24 Jul 2009 05:42:00 +0000</pubDate><atom:updated>2009-07-23T22:45:35.865-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">debug</category><category domain="http://www.blogger.com/atom/ns#">gdb</category><category domain="http://www.blogger.com/atom/ns#">kernel</category><category domain="http://www.blogger.com/atom/ns#">module</category><title>Using gdb for debugging kernel modules</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;This is a very simple and maybe trivial post.. and nothing novel ! But something that has helped me a lot in debugging issues with my kernel modules and kernel panics in  general. So, when you get a panic originating in a kernel module, you normally get it in the following format:&lt;br /&gt;&lt;br /&gt;BUG: unable to handle kernel NULL pointer dereference at 0000000000000050&lt;br /&gt;IP: [&amp;lt;ffffffff8023262c&amp;gt;] mmput+0x11/0xb0&lt;br /&gt;PGD 22bcf6067 PUD 211839067 PMD 0&lt;br /&gt;Oops: 0002 [#1] SMP&lt;br /&gt;last sysfs file: /sys/block/sdb/size&lt;br /&gt;CPU 6&lt;br /&gt;Modules linked in: &amp;lt;&lt;span style=&quot;color:#000000;&quot;&gt;a routine in my module&lt;/span&gt;&amp;gt; ehci_hcd uhci_hcd [last unloaded: &amp;lt;my module&amp;gt;]&lt;br /&gt;Pid: 26830, comm: &amp;lt;my kernel thread&amp;gt; Not tainted 2.6.28-anki #13&lt;br /&gt;RIP: 0010:[&amp;lt;ffffffff8023262c&amp;gt;]  [&amp;lt;ffffffff8023262c&amp;gt;] mmput+0x11/0xb0&lt;br /&gt;RSP: 0000:ffff8802279fbed0  EFLAGS: 00010246&lt;br /&gt;RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000045&lt;br /&gt;RDX: ffff88022e150300 RSI: 0000000000000282 RDI: 0000000000000000&lt;br /&gt;RBP: ffff8802279fbee0 R08: 0000000000000018 R09: ffff88022e150300&lt;br /&gt;R10: ffff88022e150300 R11: 00007fffe6dfefff R12: ffff88022e52f860&lt;br /&gt;R13: ffff88022e150300 R14: ffff88022d99aed0 R15: ffff88022d99b110&lt;br /&gt;FS:  0000000000000000(0000) GS:ffff88022f818280(0000) knlGS:0000000000000000&lt;br /&gt;CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b&lt;br /&gt;CR2: 0000000000000050 CR3: 0000000211829000 CR4: 00000000000006e0&lt;br /&gt;DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000&lt;br /&gt;DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400&lt;br /&gt;Process memref (pid: 26830, threadinfo ffff8802279fa000, task&lt;br /&gt;ffff88022d4ef1b0)&lt;br /&gt;Stack:&lt;br /&gt; ffff88022e150300 0000000000000000 ffff8802279fbf20 ffffffffa003314b&lt;br /&gt; ffff8802279fbf20 ffff88022d99aed0 ffffffffa00330f2 ffff880210cf1c68&lt;br /&gt; ffff88022f855ee0 ffff88022f855f00 ffff8802279fbf40 ffffffff802468e3&lt;br /&gt;Call Trace:&lt;br /&gt; [&amp;lt;ffffffffa003314b&amp;gt;] &amp;lt;&lt;span style=&quot;color:#000099;&quot;&gt;&lt;b&gt;routine in my module&lt;/b&gt;&lt;/span&gt;&amp;gt;+0x59/0xb2 [&amp;lt;my kernel thread&amp;gt;]&lt;br /&gt; [&amp;lt;ffffffffa00330f2&amp;gt;] ? &amp;lt;my modulee&amp;gt;+0x0/0xb2 [&amp;lt;my kernel thread&amp;gt;]&lt;br /&gt; [&amp;lt;ffffffff802468e3&amp;gt;] kthread+0x49/0x76&lt;br /&gt; [&amp;lt;ffffffff8020cce9&amp;gt;] child_rip+0xa/0x11&lt;br /&gt; [&amp;lt;ffffffff802277a5&amp;gt;] ? dequeue_task+0xbf/0xca&lt;br /&gt; [&amp;lt;ffffffff8024689a&amp;gt;] ? kthread+0x0/0x76&lt;br /&gt; [&amp;lt;ffffffff8020ccdf&amp;gt;] ? child_rip+0x0/0x11&lt;br /&gt;Code: df e8 88 c7 fd ff 48 8b 3d ba 28 6b 00 48 89 de e8 b1 af 05 00 41 59 5b&lt;br /&gt;c9 c3 55 48 89 e5 53 48 89 fb 48 83 ec 08 e8 6a fa 39 00 &amp;lt;f0&amp;gt; ff 4b 50 0f 94&lt;br /&gt;c0 84 c0 0f 84 8b 00 00 00 48 89 df e8 8b 76&lt;br /&gt;RIP  [&amp;lt;ffffffff8023262c&amp;gt;] mmput+0x11/0xb0&lt;br /&gt; RSP &amp;lt;ffff8802279fbed0&amp;gt;&lt;br /&gt;CR2: 0000000000000050&lt;br /&gt;&lt;br /&gt;Now, to find out from where exactly in my module the panic happened, I simply use gdb, as below:&lt;br /&gt;&lt;br /&gt;#gdb &amp;lt;path to my module.o file from the kernel source root dir&amp;gt; [for example, #gdb drivers/misc/ankita.o]&lt;br /&gt;....&lt;br /&gt;(gdb) list  *(&lt;span style=&quot;color:#000099;&quot;&gt;&lt;b&gt;the routine&lt;/b&gt;&lt;/span&gt;)+0x59&lt;br /&gt;&lt;br /&gt;The above gives a source listing, pointing to the lines which correspond to 0x59 address. This serves as a good starting point to debug the issue. Hope this helps some folks atleast :-)&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img src=&quot;http://img.zemanta.com/pixy.gif?x-id=9aa9c1fa-6902-87fc-9a48-ff8543d56728&quot; alt=&quot;&quot; class=&quot;zemanta-pixie-img&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/07/using-gdb-for-debugging-kernel-modules.html</link><author>noreply@blogger.com (Anki)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-4710079587800773933</guid><pubDate>Thu, 16 Jul 2009 17:18:00 +0000</pubDate><atom:updated>2009-07-16T10:21:14.344-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">debug</category><category domain="http://www.blogger.com/atom/ns#">gdb</category><category domain="http://www.blogger.com/atom/ns#">info proc</category><category domain="http://www.blogger.com/atom/ns#">thread state</category><title>Looking at thread state inside gdb</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span style=&quot;font-family:sans-serif;&quot;&gt;While helping a &lt;/span&gt;&lt;span style=&quot;font-family:sans-serif;&quot;&gt;friend debug a multi-threaded application hang on linux, using  gdb. She was facing difficulty in pointing out exactly which were the threads that were in blocked state. Getting thread info only tells us what the thread ids are and the routine they are executing.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:sans-serif;&quot;&gt;(gdb) info threads&lt;br /&gt;12 Thread 4398053392560 (LWP &lt;b&gt;7234&lt;/b&gt;) 0x0000000010005740 in xxxx ()&lt;br /&gt;11 Thread 4398054441136 (LWP 7235) 0x0000000010005740 in xxxx ()&lt;br /&gt;10 Thread 4398055489712 (LWP 7237) 0x0000000010005748 in xxxx ()&lt;br /&gt;9 Thread 4398063878320 (LWP 8263) 0x0000000010000768 in yyy ()&lt;br /&gt;8 Thread 4398062829744 (LWP 8267) 0x0000000010003624 in zzz ()&lt;br /&gt;7 Thread 4398061781168 (LWP 8270) 0x0000000010003624 in zzz ()&lt;br /&gt;6 Thread 4398060732592 (LWP 8273) 0x0000000010001ce4 in ddd ()&lt;br /&gt;5 Thread 4398059684016 (LWP 8276) 0x0000000010000750 in fff ()&lt;br /&gt;4 Thread 4398058635440 (LWP 8277) 0x000000001001e128 in ttt ()&lt;br /&gt;3 Thread 4398057586864 (LWP 8278) 0x0000000010003624 in zzz ()&lt;br /&gt;2 Thread 4398056538288 (LWP 8281) 0x000000001001e140 in rrrr ()&lt;br /&gt;1 Thread 269578240 (LWP 28151) 0x000000001000cba4 in www ()&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:sans-serif;&quot;&gt;She complained that in another proprietary debugger she has worked with in the past, she could easily also get the thread status information as well. Found that on gdb, we need to use the following commands to get the status information of the threads:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;(gdb) &lt;b&gt;help info proc&lt;/b&gt;&lt;br /&gt;Show /proc process information about any running process.&lt;br /&gt;Specify any process id, or use the program being debugged by default.&lt;br /&gt;Specify any of the following keywords for detailed info:&lt;br /&gt; mappings -- list of mapped memory regions.&lt;br /&gt; stat     -- list a bunch of random process info.&lt;br /&gt; status   -- list a different bunch of random process info.&lt;br /&gt; all      -- list all available /proc info.&lt;br /&gt;&lt;br /&gt;(gdb) &lt;b&gt;info proc 7234 stat&lt;/b&gt;&lt;br /&gt;process 7234&lt;br /&gt;cmdline = &#39;/usr/bin/xyz&#39;&lt;br /&gt;warning: unable to read link &#39;/proc/7234/cwd&#39;&lt;br /&gt;warning: unable to read link &#39;/proc/7234/exe&#39;&lt;br /&gt;Process: 7234&lt;br /&gt;Exec file: xyz&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;State: S&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Parent process: 3230&lt;br /&gt;Process group: 7234&lt;br /&gt;Session id: 7234&lt;br /&gt;TTY: 0&lt;br /&gt;TTY owner process group: -1&lt;br /&gt;Flags: 0x402040&lt;br /&gt;Minor faults (no memory page): 96&lt;br /&gt;Minor faults, children: 0&lt;br /&gt;Major faults (memory page faults): 0&lt;br /&gt;Major faults, children: 0&lt;br /&gt;utime: 0&lt;br /&gt;stime: 0&lt;br /&gt;utime, children: 0&lt;br /&gt;stime, children: 0&lt;br /&gt;jiffies remaining in current time slice: 20&lt;br /&gt;&#39;nice&#39; value: 0&lt;br /&gt;jiffies until next timeout: 1&lt;br /&gt;jiffies until next SIGALRM: 0&lt;br /&gt;start time (jiffies since system boot): 4371&lt;br /&gt;Virtual memory size: ...&lt;br /&gt;Resident set size: ....&lt;br /&gt;rlim: ......&lt;br /&gt;Start of text: 0xb8013000&lt;br /&gt;End of text: 0xb8025ca4&lt;br /&gt;Start of stack: 0xbf925630&lt;br /&gt;&lt;br /&gt;(gdb) &lt;b&gt;info proc 7234 status&lt;/b&gt;&lt;br /&gt;process 7234&lt;br /&gt;cmdline = &#39;/usr/bin/xyz&#39;&lt;br /&gt;warning: unable to read link &#39;/proc/7234/cwd&#39;&lt;br /&gt;warning: unable to read link &#39;/proc/7234/exe&#39;&lt;br /&gt;Name:   xyz&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;State:  S (sleeping)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Tgid:   7234&lt;br /&gt;Pid:    7234&lt;br /&gt;PPid:   3230&lt;br /&gt;TracerPid:      0&lt;br /&gt;Uid:    1000    1000    1000    1000&lt;br /&gt;Gid:    1000    1000    109     1000&lt;br /&gt;FDSize: 32&lt;br /&gt;Groups: 4 20 24 46 106 117 118 123 124 1000&lt;br /&gt;VmPeak:     4784 kB&lt;br /&gt;VmSize:     4784 kB&lt;br /&gt;VmLck:         0 kB&lt;br /&gt;VmHWM:       636 kB&lt;br /&gt;VmRSS:       636 kB&lt;br /&gt;VmData:      380 kB&lt;br /&gt;VmStk:        84 kB&lt;br /&gt;VmExe:        76 kB&lt;br /&gt;VmLib:      4020 kB&lt;br /&gt;VmPTE:        20 kB&lt;br /&gt;Threads:        1&lt;br /&gt;SigQ:   0/16382&lt;br /&gt;SigPnd: 0000000000000000&lt;br /&gt;ShdPnd: 0000000000000000&lt;br /&gt;SigBlk: 0000000000000000&lt;br /&gt;SigIgn: 0000000000001002&lt;br /&gt;SigCgt: 0000000180004001&lt;br /&gt;CapInh: 0000000000000000&lt;br /&gt;CapPrm: 0000000000000000&lt;br /&gt;CapEff: 0000000000000000&lt;br /&gt;CapBnd: ffffffffffffffff&lt;br /&gt;Cpus_allowed:   00000000,00000003&lt;br /&gt;Cpus_allowed_list:      0-1&lt;br /&gt;Mems_allowed:   1&lt;br /&gt;Mems_allowed_list:      0&lt;br /&gt;voluntary_ctxt_switches:        627&lt;br /&gt;nonvoluntary_ctxt_switches:     0&lt;br /&gt;&lt;br /&gt;So as we can see, we can get a whole lot of information about the threads and not just the state. There are other options supported by the info proc command as shown by the help. gdb picks up the above information from the /proc/&amp;lt;pid&amp;gt; interface. It helps to be able to look at all the pieces of debug information from the same interface itself.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/07/looking-at-thread-state-inside-gdb.html</link><author>noreply@blogger.com (Anki)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-8476922365298246430</guid><pubDate>Fri, 03 Jul 2009 16:55:00 +0000</pubDate><atom:updated>2009-07-06T22:32:24.209-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">emulation</category><category domain="http://www.blogger.com/atom/ns#">fake numa</category><category domain="http://www.blogger.com/atom/ns#">kernel</category><category domain="http://www.blogger.com/atom/ns#">numa</category><title>Fake NUMA nodes in Linux</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;While NUMA systems are becoming commonplace, many a times we do not have access to such systems when either writng new code, understanding NUMA architecture, conducting experiments or debugging existing code. For such cases, the Linux kernel provides a very neat feature called &#39;fake numa nodes&#39;. One can create fake numa nodes on a non-NUMA machine by simply passing a commandline parameter to the kernel. Below are the steps for x86 systems:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Following config options need to be turned on: &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;CONFIG_NUMA=y&lt;/b&gt;&lt;/span&gt;, &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;CONFIG_NUMA_EMULATION=y&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Build the kernel with the above config options set&lt;/li&gt;&lt;li&gt;The kernel commandline could be any one of the following, depending on your requirement:&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;numa=fake=4&lt;/b&gt;&lt;/span&gt; : Split the entire memory into 4 equal nodes&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;numa=fake=8*1024&lt;/b&gt;&lt;/span&gt; : Split the memory into 8 equal chunks of 1024MB (ie 1G) (note, the number is considered to be in MB) [If system has more memory, the last node will be assigned remaining memory&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;]&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&lt;b&gt;numa=fake=2*512,2*1024&lt;/b&gt;&lt;/span&gt; : Split the memory into 2 nodes of 512MB each and 2 more nodes of 1GB each (and so on)&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Note:&lt;/b&gt; On ppc, the nodes required are specified using cumulative comma separated list. For example, to create 4 nodes of 2GB each the parameter would be: &quot;&lt;b&gt;numa=fake=2G,4G,6G,8G&quot;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;You can play around with more options :) The userspace numa utilities like numactl and numastat would then show the numa environment that has been setup. Details of the cpumap and per-node meminfo can be obtained from the sysfs file /sys/devices/system/node/node&amp;lt;0|1|2..&amp;gt;.&lt;br /&gt;&lt;br /&gt;Fake NUMA has one flaw however and that is the CPU mapping to nodes. There would exist nodes that do not show up as having any CPUs (unde the cpumap file in the node dir of the above mentioned sysfs file). As per the semantics, a CPU must unquely belong to a NUMA node. However, inside the kernel, the CPU is mapped to all the fake nodes.&lt;br /&gt;&lt;br /&gt;Fake NUMA nodes can be created even on a real NUMA system. In this case, the fake nodes are aligned within a real node. The distances between two fake nodes across two real nodes is maintained. Could cover internal implementation details in a separate post. Have fun playing around with NUMA !&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/07/fake-numa-nodes-in-linux.html</link><author>noreply@blogger.com (Anki)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-5298669954532096166</guid><pubDate>Sun, 28 Jun 2009 09:54:00 +0000</pubDate><atom:updated>2009-07-14T21:06:14.012-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">build kernel</category><category domain="http://www.blogger.com/atom/ns#">configure kernel</category><category domain="http://www.blogger.com/atom/ns#">streamline_config</category><title>Build your kernel faster</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Normally when building custom kernels for our laptops or desktops, we tend to make use of the kernel config file used by the particular distro. However the distro config files tend to be huge, having loads of modules turned on, ven those which might not even be needed on our particular laptop or desktop. This is the case since the distro kernels need to cater to a large configurations of systems. . This leads to the kernel taking ages to compile ! If you want to build your kernel fast, and turn off all those modules/drivers which are not needed on your system, &lt;a href=&quot;http://rostedt.homelinux.com/code/streamline_config.pl&quot;&gt;streamline_config.pl&lt;/a&gt; script by Steven Rostedt is what you need (at the sametime ensuring that your kernel does have all that is necessary). &lt;a href=&quot;http://patchwork.kernel.org/patch/20940/&quot;&gt;Here&lt;/a&gt; is the thread where Steven explains how this script can be used. In brief,&lt;br /&gt;&lt;br /&gt;Run the script with the arguement being your architecture&#39;s Kconfig file and save the output&lt;br /&gt;&lt;ul&gt;&lt;li&gt;# ./streamline_config.pl arch/x86/Kconfig &amp;gt; config_stream&lt;/li&gt;&lt;/ul&gt;Copy config_stream as your new .config and run &#39;make oldconfig&#39; or &#39;make menuconfig&#39; if you want to continue configuring the kernel. Your build would now take much lesser time !&lt;br /&gt;&lt;br /&gt;Note: If you already have a .config file that has some of your custom config options set and you want to streamline that, no worries as streamline_config.pl will work on that .config itself (provided its present in the kernel src dir). You might still want to take a backup of your .config [;-)]&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/06/build-your-kernel-faster.html</link><author>noreply@blogger.com (Anki)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-3615164186026971106</guid><pubDate>Mon, 22 Jun 2009 05:17:00 +0000</pubDate><atom:updated>2009-06-22T07:21:52.357-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">large pages</category><category domain="http://www.blogger.com/atom/ns#">numa_maps</category><title>Using large pages</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Linux has had support for large pages (also called huge pages) for a long time now. The size of large pages supported depends on the platform. For example, on Intel it has mostly been 2MB. Large pages offer the advantage of having fewer entries in the TLB and thus fewer cache misses. However, it could lead to more wastage of memory and fragmentation. Many applications typically use large pages for certain designation functions. For example, if supported and required number available, JVM heap is composed of large pages.&lt;br /&gt;&lt;br /&gt;An application can request large pages using the &lt;a href=&quot;http://linux.die.net/man/2/shmget&quot;&gt;shmget&lt;/a&gt; API:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;#include &amp;lt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://linux.die.net/include/sys/ipc.h&quot;&gt;sys/ipc.h&lt;/a&gt;&amp;gt;&lt;/b&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;#include &amp;lt;&lt;a rel=&quot;nofollow&quot; href=&quot;http://linux.die.net/include/sys/shm.h&quot;&gt;sys/shm.h&lt;/a&gt;&amp;gt;&lt;/b&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;int shmget(key_t&lt;/b&gt; &lt;i&gt;key&lt;/i&gt;&lt;b&gt;, size_t&lt;/b&gt; &lt;i&gt;size&lt;/i&gt;&lt;b&gt;, int&lt;/b&gt; &lt;i&gt;shmflg&lt;/i&gt;&lt;b&gt;);&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The &lt;b&gt;SHM_HUGETLB &lt;/b&gt;flag part of shmflg field specifies creation of large pages.&lt;/p&gt;&lt;p&gt;Linux kernel provides an interface using which large pages can be requested.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;#echo 1000 &amp;gt; /proc/sys/vm/nr_hugepages&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;span style=&quot;color:#000000;&quot;&gt;The above causes 1000 large pages to be allocated by the kernel. More information on large pages can be obtained from the /proc fs:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;#cat /proc/meminfo&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;MemTotal:        8114308 kB&lt;br /&gt;MemFree:         5867312 kB&lt;br /&gt;Buffers:            8412 kB&lt;br /&gt;Cached:           107304 kB&lt;br /&gt;SwapCached:            0 kB&lt;br /&gt;Active:            48000 kB&lt;br /&gt;Inactive:          87592 kB&lt;br /&gt;Active(anon):      22704 kB&lt;br /&gt;Inactive(anon):        0 kB&lt;br /&gt;Active(file):      25296 kB&lt;br /&gt;Inactive(file):    87592 kB&lt;br /&gt;Unevictable:           0 kB&lt;br /&gt;Mlocked:               0 kB&lt;br /&gt;SwapTotal:       4883752 kB&lt;br /&gt;SwapFree:        4883752 kB&lt;br /&gt;Dirty:                48 kB&lt;br /&gt;Writeback:            36 kB&lt;br /&gt;AnonPages:         20212 kB&lt;br /&gt;Mapped:            10948 kB&lt;br /&gt;Slab:              25988 kB&lt;br /&gt;SReclaimable:      12916 kB&lt;br /&gt;SUnreclaim:        13072 kB&lt;br /&gt;PageTables:         2400 kB&lt;br /&gt;NFS_Unstable:          0 kB&lt;br /&gt;Bounce:                0 kB&lt;br /&gt;WritebackTmp:          0 kB&lt;br /&gt;CommitLimit:     7916904 kB&lt;br /&gt;Committed_AS:      46040 kB&lt;br /&gt;VmallocTotal:   34359738367 kB&lt;br /&gt;VmallocUsed:       43496 kB&lt;br /&gt;VmallocChunk:   34359693843 kB&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;HugePages_Total:    1000&lt;br /&gt;HugePages_Free:     1000&lt;br /&gt;HugePages_Rsvd:        0&lt;br /&gt;HugePages_Surp:        0&lt;br /&gt;Hugepagesize:       2048 kB&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;DirectMap4k:        3824 kB&lt;br /&gt;DirectMap2M:     8384512 kB&lt;br /&gt;&lt;/p&gt;&lt;p&gt;On a NUMA system, the kernel splits large page allocations equally across the different nodes. For example, if the system has 2 nodes, a request of 1000 large pages would get split into 500 pages from each node. Per node large page information can be obtained from the /sys interface:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;# cat /sys/devices/system/node/node0/meminfo&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Node 1 MemTotal:        4194304 kB&lt;br /&gt;Node 1 MemFree:           40004 kB&lt;br /&gt;Node 1 MemUsed:         4154300 kB&lt;br /&gt;Node 1 Active:          2166524 kB&lt;br /&gt;Node 1 Inactive:         810704 kB&lt;br /&gt;Node 1 Active(anon):    2127084 kB&lt;br /&gt;Node 1 Inactive(anon):     8360 kB&lt;br /&gt;Node 1 Active(file):      39440 kB&lt;br /&gt;Node 1 Inactive(file):   802344 kB&lt;br /&gt;Node 1 Unevictable:           0 kB&lt;br /&gt;Node 1 Mlocked:               0 kB&lt;br /&gt;Node 1 Dirty:                 0 kB&lt;br /&gt;Node 1 Writeback:             0 kB&lt;br /&gt;Node 1 FilePages:        841792 kB&lt;br /&gt;Node 1 Mapped:            11008 kB&lt;br /&gt;Node 1 AnonPages:       2135884 kB&lt;br /&gt;Node 1 PageTables:         5136 kB&lt;br /&gt;Node 1 NFS_Unstable:          0 kB&lt;br /&gt;Node 1 Bounce:                0 kB&lt;br /&gt;Node 1 WritebackTmp:          0 kB&lt;br /&gt;Node 1 Slab:              33704 kB&lt;br /&gt;Node 1 SReclaimable:      30708 kB&lt;br /&gt;Node 1 SUnreclaim:         2996 kB&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Node 1 HugePages_Total:   500&lt;br /&gt;Node 1 HugePages_Free:    498&lt;br /&gt;Node 1 HugePages_Surp:      0&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Recently, in one of the benchmarks (JAVA benchmark) I was running, I was seeing a huge performance degradation of about 6-8%. After some debugging, the issue turned out to be that the application was not able to utilize the large pages allocated (thanks to some weird environment I had ;-) ). To find out the number of large pages being utilized by the app, besides the above meminfo output, you can also use numa_maps. For example,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;# cat /proc/&amp;lt;process pid&amp;gt;/numa_maps&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;00001000 default anon=1 dirty=1 N0=1&lt;br /&gt;00400000 default file=&amp;lt;....library file info..&amp;gt; mapped=10 mapmax=3 N0=10&lt;br /&gt;0050b000 default file=&amp;lt;....library file info..&amp;gt; anon=1 dirty=1 N0=1&lt;br /&gt;0050c000 default heap anon=213 dirty=213 N0=213&lt;br /&gt;00600000 default file=/SYSV00000000\040(deleted) &lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;huge dirty=472&lt;/b&gt;&lt;/span&gt; N0=472&lt;br /&gt;40600000 default&lt;br /&gt;40601000 default anon=2 dirty=2 N0=2&lt;br /&gt;40641000 default&lt;br /&gt;40642000 default anon=4 dirty=4 N0=4&lt;br /&gt;40682000 default&lt;br /&gt;40683000 default anon=2 dirty=2 N0=2&lt;br /&gt;4090f000 default&lt;br /&gt;40910000 default anon=3 dirty=3 N0=3&lt;br /&gt;40a68000 default&lt;br /&gt;40a69000 default anon=4 dirty=4 N0=4&lt;br /&gt;40a70000 default&lt;br /&gt;40a71000 default anon=2 dirty=2 N0=2&lt;br /&gt;40ab1000 default&lt;br /&gt;40ab2000 default anon=2 dirty=2 N0=2&lt;br /&gt;.....&lt;/p&gt;&lt;p&gt;41fc9000 default anon=10 dirty=10 N0=10&lt;br /&gt;427c9000 default anon=535 dirty=535 N0=535&lt;br /&gt;2aaaaac00000 default file=/SYSV00000000\040(deleted) &lt;span style=&quot;color:#3333ff;&quot;&gt;&lt;b&gt;huge dirty=1&lt;/b&gt;&lt;/span&gt; N0=1&lt;br /&gt;7f6024000000 default anon=5578 dirty=5578 N0=5578&lt;br /&gt;7f6027398000 default&lt;br /&gt;7f602a402000 default anon=821 dirty=821 N0=821&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/06/using-large-pages.html</link><author>noreply@blogger.com (Anki)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-4230419618200700881</guid><pubDate>Fri, 19 Jun 2009 11:51:00 +0000</pubDate><atom:updated>2009-06-22T07:22:35.081-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">systemtap</category><category domain="http://www.blogger.com/atom/ns#">task migration</category><title>Useful staps to track task movement across CPUs</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Quite sometime back, I was faced with a situation where I needed to track instances when a particular task was being migrated away from a cpu. It was in the context of a real-time system, where a real-time task was facing huge context switch delays. Obvious suspect being the scheduler, I used &lt;a href=&quot;http://sourceware.org/systemtap/&quot;&gt;systemtap&lt;/a&gt; to infer a few things, besides other debugging:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To find if the task was being migrated away to some other cpu, used the following trivial stap script:&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;/*    Filename: migrate.stp&lt;br /&gt; *      Author: Ankita Garg &amp;lt;ankita@in.ibm.com&amp;gt;&lt;br /&gt; * Description: Captures information on the migration of threads&lt;br /&gt; *&lt;br /&gt; * This program is free software; you can redistribute it and/or modify&lt;br /&gt; * it under the terms of the GNU General Public License as published by&lt;br /&gt; * the Free Software Foundation; either version 2 of the License, or&lt;br /&gt; * (at your option) any later version.&lt;br /&gt; *&lt;br /&gt; * This program is distributed in the hope that it will be useful,&lt;br /&gt; * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt; * GNU General Public License for more details.&lt;br /&gt; *&lt;br /&gt; * © Copyright IBM Corp. 2009.  All Rights Reserved.&lt;br /&gt; *&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;probe kernel.function(&quot;__migrate_task&quot;)&lt;br /&gt;{&lt;br /&gt;        if(($1 != 0 ) &amp;amp;&amp;amp; (tid() == $1)) {&lt;br /&gt;                printf (&quot;thread %d (%s) is migrating from %d to %d \n&quot;, $p-&amp;gt;pid,&lt;br /&gt;                                kernel_string($p-&amp;gt;comm), $src_cpu, $dest_cpu);&lt;br /&gt;        }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Below is a script that tracks all the cpus that a particular task ran on. Pl note it does not track the context switches.&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;/*    Filename: chng_cpu.stp&lt;br /&gt; *      Author: Ankita Garg &amp;lt;ankita@in.ibm.com&amp;gt;&lt;br /&gt; * Description: Captures information on the number of times java thread&lt;br /&gt; * switches cpu&lt;br /&gt; *&lt;br /&gt; * This program is free software; you can redistribute it and/or modify&lt;br /&gt; * it under the terms of the GNU General Public License as published by&lt;br /&gt; * the Free Software Foundation; either version 2 of the License, or&lt;br /&gt; * (at your option) any later version.&lt;br /&gt; *&lt;br /&gt; * This program is distributed in the hope that it will be useful,&lt;br /&gt; * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt; * GNU General Public License for more details.&lt;br /&gt; *&lt;br /&gt; * © Copyright IBM Corp. 2009.  All Rights Reserved.&lt;br /&gt; *&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;global threads&lt;br /&gt;&lt;br /&gt;probe kernel.function(&quot;finish_task_switch&quot;)&lt;br /&gt;{&lt;br /&gt;        if ((threads[tid()] != cpu()) &amp;amp;&amp;amp; (tid() != 0) &amp;amp;&amp;amp; (execname() == @1)) {&lt;br /&gt;                printf(&quot;thread %d (%s) context switched on %d \n&quot;,&lt;br /&gt;                                tid(), execname(), cpu());&lt;br /&gt;                                printf(&quot;state: %d\n&quot;, task_state(task_current()))&lt;br /&gt;                                print_stack(backtrace())&lt;br /&gt;        }&lt;br /&gt;        threads[tid()] = cpu();&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These are a bit older techniques, as now there is a new tracepoints infrastructure which can do these things. But on older kernels, the above would be useful. Expect more posts on kernel RAS features in due time.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/06/useful-staps-to-track-task-movement.html</link><author>noreply@blogger.com (Anki)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-1101171967552473302</guid><pubDate>Fri, 19 Jun 2009 05:47:00 +0000</pubDate><atom:updated>2009-06-22T07:22:53.661-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.ics file</category><category domain="http://www.blogger.com/atom/ns#">lotus notes</category><title>Importing .ics into Lotus Notes 8</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;span style=&quot;font-family:sans-serif;&quot;&gt;A number of times I get calender invites for meetings on my non-Lotus notes email IDs. The calender invites are normally &lt;/span&gt;in the .ics format. Once can easily import it into Lotus Notes. Here is how:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Compose a mail inside notes&lt;/li&gt;&lt;li&gt;Attach the .ics file to it&lt;/li&gt;&lt;li&gt;Right click the attachment, and click on &quot;View&quot;&lt;/li&gt;&lt;li&gt;The calender view would open, with the meeting details. Now accept/decline the invite, save and exit&lt;/li&gt;&lt;/ol&gt;Voila, the entry gets saved to your calender. Ofcourse, there might be other ways to achieve this in notes :-)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/06/importing-ics-into-lotus-notes-8.html</link><author>noreply@blogger.com (Anki)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-4511365914141979276</guid><pubDate>Fri, 19 Jun 2009 04:52:00 +0000</pubDate><atom:updated>2009-06-22T07:23:19.828-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">dentry</category><category domain="http://www.blogger.com/atom/ns#">drop cache</category><category domain="http://www.blogger.com/atom/ns#">memory</category><category domain="http://www.blogger.com/atom/ns#">page cache</category><title>Free up that memory</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Recently came across this cool interface in the Linux kernel. Typically, the memory might be over-provisioned on the system. Instead of wasting the memory, the kernel normally utilizes a lot of it for page cache, dentry cache and inodes. These caches speed I/O operations and improves performance. However, there are cases when large amount of memory might actually be needed by the apps. While most of the cache pages could be easily reclaimed, there is obviously some overhead involved (the pages could be dirty and might have to written back to the disk, thus incurring disk write latency). Linux has a neat kernel.. so now, while it uses its smart to utilize the memory well, it also provides a method for people to indicate that they do not want the kernel to use its smarts ;-)&lt;br /&gt;&lt;br /&gt;To free memory, just do the following:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;# echo 1 &amp;gt; /proc/sys/vm/drop_caches&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;(the above frees only page cache)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;# echo 2 &amp;gt; /proc/sys/vm/drop_caches&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;(for freeing dentry caches and inodes)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;# echo 3 &amp;gt; /proc/sys/vm/drop_caches&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;(for freeing all of the above)&lt;br /&gt;&lt;br /&gt;It would be advisable to first do a &#39;sync&#39; before dropping the caches, so that all the dirty pages could be acted upon.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/06/free-up-that-memory.html</link><author>noreply@blogger.com (Anki)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-5556510995860467920</guid><pubDate>Sat, 30 May 2009 16:20:00 +0000</pubDate><atom:updated>2009-05-30T11:25:36.038-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">gcc</category><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">unix</category><title>Simplifying GCC</title><description>GCC is the GNU Compiler Collection which  provides C, C++ etc compilers. These compilers are used by default in all *nixes .&lt;br /&gt;&lt;br /&gt;Here i  provide simple command line options which can prove to be quite useful.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The simplest way to use GCC to compile a C source file is&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;        $ gcc -o test test1.c&lt;/span&gt;  &lt;span style=&quot;font-weight: bold;&quot;&gt;test2.c &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;gcc is the C compiler, test1.c and test2.c are the input  C source files and -o lets us specify the name of the output file. Here it is &quot;test&quot;. Without the -o option, &quot;a.out&quot; is the default executable that gets created.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; The preprocessor:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $ gcc -E test.c &gt; test.out&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;This option, ensures the compilation process stops after the pre-processor has run. This helps us in figuring out issues/problems in macros.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The Compiler:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $ gcc -c test.c -o test.o&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This option ensures the compilation process completes but doesn&#39;t invoke the linker/loader. This is useful if you want to just remove compilation warnings and errors.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Header Files:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $gcc -c test.c -I /location/of/header/files -o test&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Many a times the headers files you want to use, is located is some other directory. A &quot;bad&quot; practice followed is to include the direct path of the header files in the C src file.&lt;br /&gt;Instead use this option. It tells the compiler which directories to look in for the mentioned header files. The -I options can be used multiple times for multiple directories where header files are located.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Library Files:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $ gcc -c test.c -lpthread -L /usr/lib/libpthread&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Another requirement that is frequently required is using  standard libraries ( NPTL Threads etc)  or non-standard ones (expat etc).  &#39;-l&#39; option tells which library to use while linking while &#39;-L&#39; tells where the find this library. In the above example during linking, it will search for pthread library in the dir /usr/lib/libpthread.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; Warnings, Errors, etc:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $gcc test.c -o test -Wall -Werror&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;-Wall options shows all warnings that are typically not shown during regular compilation. These errors are easy fixable like &quot;Unused varniables&quot;, &quot;implicit function declaration&quot; etc. -Werror options tells the compiler to treat all warnings as errors and stop compilation instantly.&lt;br /&gt;Sometimes -Werror can be too strict for our purpose. Instead you can treat only certain warnings are errors.&lt;br /&gt;eg.  &lt;span style=&quot;font-weight: bold;&quot;&gt;-Werror-implicit-function-declaration&lt;/span&gt;: Treat only implicit function declaration warnings as errors. For more such options check the gcc man pages.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Debugging:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $gcc -g test.c -o test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This option activates all the debugging symbols. This is required if one plans to use gdb for debugging (which is mostly the case).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Optimizations:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;    $gcc -O2 test.c -o test&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This option lets the compiler optimize the code . -O can take 0,1,2 levels of optimizations.&lt;br /&gt;More info is available in the man pages of gcc.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;These options are the ones that are most frequently used. Obviously there are many more options available . Use them as per your needs and refer the man pages for the exhaustive list of options.</description><link>http://linux-hacks.blogspot.com/2009/05/simplifying-gcc.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-239466848799498182</guid><pubDate>Tue, 19 May 2009 09:13:00 +0000</pubDate><atom:updated>2009-05-19T02:13:39.405-07:00</atom:updated><title>Fix Thinkpad Function Keys/Hot Keys in kde 4.2 (Jaunty) - patch to display brightness levels.</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;A small patch &lt;a href=&#39;http://linux-hacks.blogspot.com/2009/05/fix-thinkpad-function-keyshot-keys-in.html&#39;&gt;for the script &lt;/a&gt;to display the brightness level of your Thinkpad display with the brightness Increase/Decrease keys.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;--- softkeys.py 2009-05-08 11:51:28.000000000 +0530                        &lt;br/&gt;+++ softkeys-0.1.py     2009-05-19 12:43:58.000000000 +0530                &lt;br/&gt;@@ -1,6 +1,7 @@                                                            &lt;br/&gt; #!/usr/bin/env python                                                     &lt;br/&gt; # -*- coding: utf-8 -*-                                                   &lt;br/&gt; # Copyright: 2009 by Tillmann Falck &amp;lt;tillmann _at_ falcken _dot_ de&amp;gt;      &lt;br/&gt;+# Uttaran Dutta added the funtion for the display for the brightness for T60p &amp;lt;linux-hacks.blogspot.com&amp;gt;&lt;br/&gt; # License: GPL v2 or later                                                                              &lt;br/&gt;                                                                                                         &lt;br/&gt; from Xlib.display import Display                                                                        &lt;br/&gt;@@ -16,8 +17,11 @@                                                                                       &lt;br/&gt; XF86Battery = 244                                                                                       &lt;br/&gt; XF86Display = 235                                                                                       &lt;br/&gt; KeyUndock = 202                                                                                         &lt;br/&gt;+XF86MonBrightnessDown = 232                                                                             &lt;br/&gt;+XF86MonBrightnessUp = 233                                                                               &lt;br/&gt;                                                                                                         &lt;br/&gt;-keys = [XF86Sleep, XF86Standby, XF86Screensaver, XF86Battery, XF86Display, KeyUndock]                   &lt;br/&gt;+                                                                                                        &lt;br/&gt;+keys = [XF86Sleep, XF86Standby, XF86Screensaver, XF86Battery, XF86Display, KeyUndock, XF86MonBrightnessDown, XF86MonBrightnessUp]&lt;br/&gt;                                                                                                                                  &lt;br/&gt; def callDisplay():                                                                                                               &lt;br/&gt;   try:                                                                                                                           &lt;br/&gt;@@ -63,6 +67,14 @@                                                                                                                &lt;br/&gt;     print &amp;gt;&amp;gt;sys.stderr, &#39;Error while trying to change output, try full auto&#39;                                                     &lt;br/&gt;     os.system(&#39;xrandr --auto&#39;)                                                                                                   &lt;br/&gt;                                                                                                                                  &lt;br/&gt;+def briStats(bus):                                                                                                               &lt;br/&gt;+  bri = bus.get_object( \                                                                                                        &lt;br/&gt;+    &#39;org.freedesktop.Hal&#39;, \                                                                                                     &lt;br/&gt;+    &#39;/org/freedesktop/Hal/devices/computer_backlight&#39;)                                                                           &lt;br/&gt;+  briLevel = (bri.GetBrightness(dbus_interface=&#39;org.freedesktop.Hal.Device.LaptopPanel&#39;)*100)/(bri.GetProperty(&#39;laptop_panel.num_levels&#39;, dbus_interface=&#39;org.freedesktop.Hal.Device&#39;)-1)                                                                                          &lt;br/&gt;+  s = &#39;Brightness level is %d%% &amp;lt;br /&amp;gt;&#39; % (briLevel)                                                                                     &lt;br/&gt;+  return s                                                                                                                               &lt;br/&gt;+                                                                                                                                         &lt;br/&gt; def acStats(bus):                                                                                                                        &lt;br/&gt;   ac = bus.get_object( \                                                                                                                 &lt;br/&gt;     &#39;org.freedesktop.Hal&#39;, \&lt;br/&gt;@@ -91,6 +103,26 @@&lt;br/&gt;     s = &#39;Battery %d level %d%%&amp;lt;br /&amp;gt;&#39; % (n+1, batLevel)&lt;br/&gt;   return s&lt;br/&gt;&lt;br/&gt;+def callBrightness():&lt;br/&gt;+  try:&lt;br/&gt;+    sessBus = dbus.SessionBus()&lt;br/&gt;+    sysBus = dbus.SystemBus()&lt;br/&gt;+&lt;br/&gt;+    hal = dbus.Interface( \&lt;br/&gt;+      sysBus.get_object(&#39;org.freedesktop.Hal&#39;, \&lt;br/&gt;+        &#39;/org/freedesktop/Hal/Manager&#39;), \&lt;br/&gt;+      dbus_interface=&#39;org.freedesktop.Hal.Manager&#39;)&lt;br/&gt;+&lt;br/&gt;+    s = briStats(sysBus)&lt;br/&gt;+    ea = dbus.Array([], &#39;s&#39;)&lt;br/&gt;+    notify = sessBus.get_object(&#39;org.kde.VisualNotifications&#39;, &#39;/VisualNotifications&#39;)&lt;br/&gt;+    notify.Notify(&#39;brightness information&#39;,0,&#39;brightness information&#39;,&#39;&#39;,&#39;Brightness Information&#39;, \&lt;br/&gt;+      s,ea,ea,5000, \&lt;br/&gt;+      dbus_interface=&#39;org.kde.VisualNotifications&#39;)&lt;br/&gt;+  except:&lt;br/&gt;+    print &amp;gt;&amp;gt;sys.stderr, &#39;No notifications or no information&#39;&lt;br/&gt;+&lt;br/&gt;+&lt;br/&gt; def callBattery():&lt;br/&gt;   try:&lt;br/&gt;     sessBus = dbus.SessionBus()&lt;br/&gt;@@ -101,6 +133,7 @@&lt;br/&gt;         &#39;/org/freedesktop/Hal/Manager&#39;), \&lt;br/&gt;       dbus_interface=&#39;org.freedesktop.Hal.Manager&#39;)&lt;br/&gt;&lt;br/&gt;+    briStats(sysBus)&lt;br/&gt;     if hal.DeviceExists(&#39;/org/freedesktop/Hal/devices/computer_power_supply_ac_adapter_AC&#39;):&lt;br/&gt;       ac = acStats(sysBus)&lt;br/&gt;     else:&lt;br/&gt;@@ -197,6 +230,8 @@&lt;br/&gt;     callSuspend()&lt;br/&gt;   elif event.detail == KeyUndock:&lt;br/&gt;     callUndock()&lt;br/&gt;+  elif event.detail == XF86MonBrightnessUp or event.detail == XF86MonBrightnessDown:&lt;br/&gt;+    callBrightness()&lt;br/&gt;   else:&lt;br/&gt;     print &amp;gt;&amp;gt;sys.stderr, &quot;Key %d not handeled&quot; % event.detail&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Note- The patch just enables the display changing for display brightness should be already working through acpi.&lt;br/&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/05/fix-thinkpad-function-keyshot-keys-in_19.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-1815831132334022083</guid><pubDate>Fri, 08 May 2009 09:56:00 +0000</pubDate><atom:updated>2009-05-08T03:50:51.793-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">kde</category><category domain="http://www.blogger.com/atom/ns#">linux</category><title>Fix Thinkpad Function Keys/Hot Keys in kde 4.2 (Jaunty)</title><description>Function keys doent work by default in kde 4.2. Those who migrate from gnome to kde 4 find it difficult to adjust without the &#39;fn&#39; keys. The problem is with powerdevil. The new applet does not have options to configure the acpi events. This will exits till powerdevil is fixed. As of now, we can use a python script to handle these events. Make sure python-2.6, python-dbus and python-xlib are installed in your system. Download the script from &lt;a href=&quot;http://launchpadlibrarian.net/24484539/softkeys.py&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;http://dl4u.savefile.com/89fae9d576d773901806e9b3c21413a2/softkeys.py&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;Give exe permission&lt;br /&gt;#chmod +x softkeys.py&lt;br /&gt;&lt;br /&gt;Place the script in ~/.kde/Autostart/ and restart your system. The function keys must start working now.</description><link>http://linux-hacks.blogspot.com/2009/05/fix-thinkpad-function-keyshot-keys-in.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-9170489903354008960</guid><pubDate>Thu, 30 Apr 2009 08:43:00 +0000</pubDate><atom:updated>2009-04-30T01:46:29.443-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">kde</category><category domain="http://www.blogger.com/atom/ns#">linux</category><title>Create Desktop Shortcuts Using Cmd Line On KDE 4.2</title><description>Here is a quick way to create desktop shortcuts for kde 4.2.&lt;br /&gt;/usr/share/applications/ and /usr/share/applications/kde4 contains all the shortcut files (*.desktop).&lt;br /&gt;&lt;br /&gt;Just copy what ever you want to ~/Desktop. Thats it!</description><link>http://linux-hacks.blogspot.com/2009/04/create-desktop-shortcuts-using-cmd-line.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-9135226191956408651</guid><pubDate>Wed, 29 Apr 2009 03:40:00 +0000</pubDate><atom:updated>2009-04-28T21:08:26.112-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">errors</category><category domain="http://www.blogger.com/atom/ns#">linux</category><title>fsck.ext3 Unable to resolve UUID error</title><description>I installed Kubuntu 9.04 recently and within a day i ran into a peculiar problem. When i boot my system an error message &quot;fsck.ext3 Unable to resolve UUID=&lt;uuid&gt;&quot;. This error generally happens when there is some information mismatch between what is specified in /etc/fstab and what information the OS gives to fsck utility. In this case, its quite easy to solve the problem.&lt;br /&gt;&lt;br /&gt;Enter the root password to enter the Maintenance mode when asked during boot.&lt;br /&gt;&lt;br /&gt;(Control - D to continue): &lt;enter&gt;&lt;br /&gt;&lt;br /&gt;List the partition table of your system.&lt;br /&gt;&lt;br /&gt;#fdisk -l&lt;br /&gt;  &lt;br /&gt;Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sda1   *           1        1913    15361888+  83  Linux&lt;br /&gt;Partition 1 does not end on cylinder boundary.&lt;br /&gt;/dev/sda2            1914        3186    10225372+  83  Linux&lt;br /&gt;/dev/sda3            3187       12161    72091687+   5  Extended&lt;br /&gt;/dev/sda5            3187        9265    48829536   83  Linux&lt;br /&gt;/dev/sda6            9266       11697    19535008+  83  Linux&lt;br /&gt;/dev/sda7           11698       12161     3727048+  82  Linux swap / Solaris&lt;br /&gt;&lt;br /&gt;#vim /etc/fstab&lt;br /&gt;&lt;br /&gt;Verify that each device entry specified in the file matches the correct file-system.This error can occur if FS type is wrongly specified. For example, /dev/sda7 is shown as ext3 FS when it clearly a swap in the above case. Correct such errors and reboot. This should solve the problem.&lt;br /&gt;&lt;br /&gt;If the entries are correct then, possible problem lies in the UUID specified in fstab. To solve this problem&lt;br /&gt;&lt;br /&gt;Determine the UUID of each and every device mentioned in fstab. This exmaple shows for sda1. Repeat this for all devices.&lt;br /&gt;&lt;br /&gt;#vol_id -u /dev/sda1&lt;br /&gt;b056f084-eb83-4374-9635-0b5904ff520a&lt;br /&gt;&lt;br /&gt;A line taken from my fstab&lt;br /&gt;# /virt was on /dev/sda1 during installation&lt;br /&gt;UUID=b056f084-eb83-4374-9635-0b5904ff520a /virt           ext3    relatime        02&lt;br /&gt;&lt;br /&gt;Note that UUID matches the entry in fstab. If there is a mismatch, then the entry shown by fstab must be replaced by vol_id. Thats it! save and reboot. This will solve the problem.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;REASON&lt;/span&gt;: The problem was solved but i was not sure what caused this problem. On further analysis i was able to narrow down on what caused the issue. Apparently, i did a format of a partition (/dev/sda1) which is NOT the / partition using gpartd. Gpart does not allow formats on mounted partitions, so the tools unmounts the partition and formats it. During this step, udev recognizes the new formated device as a new device and old one being removed(formated). Hence it assigned a new UUID which is now not same the one specified in /etc/fstab. Thats why on reboot i ran into this issue.</description><link>http://linux-hacks.blogspot.com/2009/04/fsckext3-unable-to-resolve-uuid-error.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-8008860164062426199</guid><pubDate>Tue, 28 Apr 2009 10:44:00 +0000</pubDate><atom:updated>2009-04-28T04:06:19.798-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">linux</category><category domain="http://www.blogger.com/atom/ns#">udev</category><title>Change/Resassign Interface Name In Linux</title><description>Depending on the linux distro, the interface name given to network cards differ.&lt;br /&gt;For example, on one distro Intel Giga bit Ethernet card might be detected as eth0 and Broadcom card as eth1 while with another distro this might be reversed. This causes a lot of problem, when one uses automated scripts which hardcode &quot;eth0&quot; and &quot;eth1&quot;. In older distros it was matter of changing few network scripts to get this working. One can also use &quot;ip&quot; command to make this change temporarily. But to make it permanent it needs to be changed in udev. Here is how simple it is to change the ethernet names.&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;NOTE&lt;/span&gt;: This is only tested on F-10 and Ubuntu 9.04. Its expected to be the same for other distros. Only the name of the udev script might change.&lt;br /&gt;&lt;br /&gt;Edit the rule script:&lt;br /&gt;&lt;br /&gt;#vim /etc /udev/rules.d/70-persistent-net.rules&lt;br /&gt;&lt;br /&gt;Here the list of n/w adapters and their names are specified!&lt;br /&gt;Change the field NAME=&quot;eth0&quot; to NAME=&quot;eth1&quot; or vice versa&lt;br /&gt;Remember to rename the other adapter whose name you have borrowed.&lt;br /&gt;Restart the system and you will find the new names interchanged!</description><link>http://linux-hacks.blogspot.com/2009/04/changeresassign-interface-name-in-linux.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-3259917490591380565</guid><pubDate>Fri, 13 Mar 2009 11:13:00 +0000</pubDate><atom:updated>2009-03-16T06:21:56.853-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">kopete</category><category domain="http://www.blogger.com/atom/ns#">sametime</category><title>Sametime on Koepete</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Last year cheezo had blogged about &lt;a href=&quot;http://packages.ubuntu.com/dapper/kde/kopete-meanwhile&quot;&gt;getting pidgin to support sametime protocol&lt;/a&gt;. It was great, but as KDE guy i missed it on Kopete. Its only recently i got myself to try it &amp;amp; viola it worked with just a little effort. I have the latest versions of these packages on my KDE 4.2.1 intrepid box (yes i live the bleeding edge tech, but any version of KDE 4.1.x which supports  kdenetwork - 4:4.1.80-0ubuntu1 should do the job).&lt;br /&gt;&lt;br /&gt; - kopete                      4:4.2.1-0ubuntu1~intrepid1&lt;br /&gt; - libmeanwhile1         1.0.2-3+ocdc3+intrepid (I got it from ocdc repo, libmeanwhile is also there in ubuntu multiverse)&lt;br /&gt; - kopete-meanwhile   0.1-0ubuntu2, (optional, can be downloaded from &lt;a href=&quot;http://packages.ubuntu.com/dapper/kde/kopete-meanwhile&quot;&gt;here&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;With the above all installed you should see the &quot;Meanwhile&quot; as one of the options in the _messaging services_ list in Kopete. Add a new account &amp;amp; continue with the username &amp;amp; password in the pretty straightforward _Basic Setup_ tab. The only tweaking required was the &quot;Client Identifier&quot; info in the _Connections_ tab. Use the option &amp;amp; no.s in the shot below.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3XCkWULT10xjuE6JXkeEB0x1O_2N_mSNt-LXHFPNZ-QpFr6GzXodpcd2qCnn6fcoXePrtsMu1ZEd8PFizOujoIbSS29rYMu6YKgFQOp6y6s_ByoQJ2MWYjHdZiGyf0HlUnHJbWNZ4H_6S/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;With that you should be good to go.&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;Enjoy&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/03/sametime-on-koepete.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3XCkWULT10xjuE6JXkeEB0x1O_2N_mSNt-LXHFPNZ-QpFr6GzXodpcd2qCnn6fcoXePrtsMu1ZEd8PFizOujoIbSS29rYMu6YKgFQOp6y6s_ByoQJ2MWYjHdZiGyf0HlUnHJbWNZ4H_6S/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-1106641622677347036</guid><pubDate>Tue, 24 Feb 2009 10:13:00 +0000</pubDate><atom:updated>2009-02-24T02:14:53.802-08:00</atom:updated><title>Why linux keeps connected routes when link goes down?</title><description>I came across this interesting discussion on a particular behavior of linux. This issues was brought up by a system administrator who was facing an interesting situation. When the link of an interface goes down possibly due to hardware failure or cable pull out, the ip address and routes associated with that interface is retained until someone explicitly deletes it. This behavior is built into linux for more than 10 years and the reason for this was stated by &lt;a href=&quot;http://en.wikipedia.org/wiki/David_S._Miller&quot;&gt;David Miller&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre wrap=&quot;&quot;&gt;The default behavior for a general purpose operating system is&lt;br /&gt;to increase the likelyhood of successful communication.&lt;br /&gt;&lt;br /&gt;And the way to maximize successful communication is to associate&lt;br /&gt;addresses with the host rather than the interface.&lt;/pre&gt;It becomes clear why the developers decided to go with associating ip address with a particular node rather than an interface in the node. The problem with this implementation is relevant when linux is being used as a router. A router is a multi-homed host and tends to have multiple interfaces each connected to different network. So if a situation arises where the router finds a route entry to send a particular packet there are chances that the link may be down and packet never reaches the destination. Even if there are alternated routes to reach the particular destination it cannot be used as there is already an existing valid route with a interface that is down. Lennart Sorensen argued against David Miller&#39;s claim that different interface of the router might be connected to same network in which case the alternate interface can be taken. According to Lennart it still useless as we would end up having 2 route entries to the same destination with different interfaces and would pose the same problem when the first route entry points to an interface which is down. The no conclusion to this little problem as David points out in his replay to Lennart.&lt;br /&gt;&lt;br /&gt;&lt;pre wrap=&quot;&quot;&gt;This decision was made at least 10 years ago, and if you think what we&lt;br /&gt;have now is broken just imagine how much struff would explode if we&lt;br /&gt;changed things.&lt;/pre&gt;All is not lost in this regard for people using linux as router. &lt;a href=&quot;http://devresources.linux-foundation.org/shemminger/&quot;&gt;Stephen Hemminger&lt;/a&gt; suggested using &lt;a href=&quot;http://www.quagga.net/&quot;&gt;quagga&lt;/a&gt; for this purpose. There are patches submitted to the quagga mailing list which does what Lennart wants without any modification to the kernel behaviour. Unfortunately those patches are not yet upstream in the quagga branch and has to be applied as patch. So in future would quagga become the routing management daemon for linux? Thats something we need to watch out.</description><link>http://linux-hacks.blogspot.com/2009/02/why-linux-keeps-connected-routes-when.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-8168838358827804153</guid><pubDate>Tue, 03 Feb 2009 08:26:00 +0000</pubDate><atom:updated>2009-02-03T19:58:57.290-08:00</atom:updated><title>Theory Behind Hiding Zipped File Under Jpg Image</title><description>The post &lt;a href=&quot;http://linux-hacks.blogspot.com/2009/02/hiding-zipped-files-under-jpg-images.html&quot;&gt;Hiding Zipped File Under Jpg Image&lt;/a&gt; showed the steps to achieve data hiding in jpg. Since Ego was questioning the theory behind this, i decided to get my hands dirty and find the answer. To understand this, we need to understand the data structures of jpg image and zip files.&lt;br /&gt;Lets bisect the jpg image first.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Jpg Header Format:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Start of Image (SOI) marker -- two bytes (FFD8)&lt;br /&gt;JFIF marker (FFE0)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;  * length -- two bytes&lt;br /&gt;  * identifier -- five bytes: 4A, 46, 49, 46, 00 (the ASCII code equivalent of a zero terminated &quot;JFIF&quot; string)&lt;br /&gt;  * version -- two bytes: often 01, 02&lt;br /&gt;        o the most significant byte is used for major revisions&lt;br /&gt;        o the least significant byte for minor revisions&lt;br /&gt;&lt;br /&gt;  * units -- one byte: Units for the X and Y densities&lt;br /&gt;        o 0 =&gt; no units, X and Y specify the pixel aspect ratio&lt;br /&gt;        o 1 =&gt; X and Y are dots per inch&lt;br /&gt;        o 2 =&gt; X and Y are dots per cm&lt;br /&gt;  * Xdensity -- two bytes&lt;br /&gt;  * Ydensity -- two bytes&lt;br /&gt;  * Xthumbnail -- one byte: 0 = no thumbnail&lt;br /&gt;  * Ythumbnail -- one byte: 0 = no thumbnail&lt;br /&gt;  * (RGB)n -- 3n bytes: packed (24-bit) RGB values for the thumbnail pixels, n = Xthumbnail *&lt;br /&gt;     Ythumbnail&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;The bold words in the above header is of importance to us. The 4 byte value consisting of SOI and JFIF marker. This signifies the starting of the jpg image. Any standard image viewer searches the file for &quot;d8ff e0ff&quot; (little endian mode) pattern. Once this of found, marks the start of the jpg image. The end of the jpg image is marked with &quot;0xd9ff&quot; (little endian mode). A cat on the image is going to make sure that some data is written after 0xd9ff there by making it unnecessary for any image viewer to bother about data after 0xd9ff.&lt;br /&gt;&lt;br /&gt;Lets look at the zip header format.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Overall .ZIP file format:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;[local file header 1]&lt;/span&gt;&lt;br /&gt;[file data 1]&lt;br /&gt;[data descriptor 1]&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;[local file header n]&lt;br /&gt;[file data n]&lt;br /&gt;[data descriptor n]&lt;br /&gt;[archive decryption header]&lt;br /&gt;[archive extra data record]&lt;br /&gt;[central directory]&lt;br /&gt;[zip64 end of central directory record]&lt;br /&gt;[zip64 end of central directory locator]&lt;br /&gt;[end of central directory record]&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;The one that concerns us is local file header&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Local file header:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;local file header signature 4 bytes (&lt;span style=&quot;font-weight:bold;&quot;&gt;0x04034b50&lt;/span&gt;)&lt;br /&gt;version needed to extract 2 bytes&lt;br /&gt;general purpose bit flag 2 bytes&lt;br /&gt;compression method 2 bytes&lt;br /&gt;last mod file time 2 bytes&lt;br /&gt;last mod file date 2 bytes&lt;br /&gt;crc-32 4 bytes&lt;br /&gt;compressed size 4 bytes&lt;br /&gt;uncompressed size 4 bytes&lt;br /&gt;file name length 2 bytes&lt;br /&gt;extra field length 2 bytes&lt;br /&gt;&lt;br /&gt;file name (variable size)&lt;br /&gt;extra field (variable size)&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;As seen in the bold letters is the signature of the start of the zip file. So the unzip program tries to find the above pattern in the file and assumes that the rest of the file till &quot;end of central dir record&quot; is reached. This explains why tar.gz or tar.bz2 files don&#39;t work while zip does. In other words, the gz/bz2 formats look for starting 4 bytes as identifiers and if not found will quit immediately.&lt;br /&gt;The following example will illustrate the file layout of the various file formats.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Example: Generated using hexdump&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Image file (jpg):&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&quot;&gt;&lt;br /&gt;0000000 &lt;span style=&quot;font-weight:bold;&quot;&gt;d8ff e0ff&lt;/span&gt; 1000 464a 4649 0100 0001 0100&lt;br /&gt;0000010 0100 0000 dbff 8400 1000 0c0b 0c0e 100a&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;0005b50 4792 d9ff&lt;br /&gt;0005b54&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As discussed, the hex value in bold indicates the start of the jpg file. Now lets look at the zip file.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Zip file (.zip):&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&quot;&gt;&lt;br /&gt;0000000 &lt;span style=&quot;font-weight:bold;&quot;&gt;4b50 0403&lt;/span&gt; 0014 0000 0008 776b 3a41 d8d9&lt;br /&gt;0000010 00d8 1109 000c 2c00 000d 0009 0015 6f77&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;00c1190 0100 0100 4400 0000 4500 0c11 0000 0000&lt;br /&gt;00c119f&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;&lt;br /&gt;After the concatenation, the file now consists of both jpg and zip content as shown below.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Embedded Image File (jpg):&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;p style=&quot;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&quot;&gt;&lt;br /&gt;0000000 &lt;span style=&quot;font-weight:bold;&quot;&gt;d8ff e0ff&lt;/span&gt; 1000 464a 4649 0100 0001 0100&lt;br /&gt;0000010 0100 0000 dbff 8400 1000 0c0b 0c0e 100a&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;0005b50 4792 &lt;span style=&quot;font-weight:bold;&quot;&gt;d9ff&lt;/span&gt; &lt;span style=&quot;font-weight:bold;&quot;&gt;4b50 0403&lt;/span&gt; 0014 0000 0008 776b&lt;br /&gt;0005b60 3a41 d8d9 00d8 1109 000c 2c00 000d 0009&lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;00c6ce0 0006 0000 0100 0100 4400 0000 4500 0c11&lt;br /&gt;00c6cf0 0000 0000&lt;br /&gt;00c6cf3&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt; &lt;br /&gt;This little example must be able to clear out the doubts of how this works. Next step would be to manipulate the hex file to make zip program believe that jpg data is the zipped data. Stay tuned for more on this.</description><link>http://linux-hacks.blogspot.com/2009/02/theory-behind-hiding-zipped-file-under.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-5491827598657176748</guid><pubDate>Tue, 03 Feb 2009 05:09:00 +0000</pubDate><atom:updated>2009-02-02T21:09:08.601-08:00</atom:updated><title>Hiding Zipped Files Under Jpg Images</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;Sometimes we come across situations when we have to hide certain files. There are many methods in which this can be accomplished. This is one of the many ways to do so. This applies to only zip file contents.&lt;br/&gt;&lt;br/&gt;Step 1: Zip the file/folder to be hidden&lt;br/&gt;&lt;p style=&#39;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&#39;&gt;&lt;br/&gt;#zip xyz.ppt.zip xyz.ppt &lt;/p&gt;&lt;br/&gt;&lt;br/&gt;Lets assume that abc.jpg is the image we are using for the camouflage.&lt;br/&gt; &lt;br/&gt;Step 2: Hide the zipped contents&lt;br/&gt;&lt;p style=&#39;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&#39;&gt;&lt;br/&gt;#cat abc.jpg xyz.ppt.zip &amp;gt; new.jpg&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;The new.jpg will be jpg file that hides the zipped content. The file will have meta data as jpg and any image viewer will be able to open it. &lt;br/&gt;&lt;br/&gt;To extract the hidden contents:&lt;br/&gt;&lt;p style=&#39;margin: 0.5em 35px; padding: 0.5em; background: rgb(228, 170, 22) none repeat scroll 0% 0%; overflow: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); font-family: monospace; font-size: smaller;&#39;&gt;&lt;br/&gt;#unzip new.jpg&lt;/p&gt; &lt;br/&gt;&lt;br/&gt;Vola!! Thats it. Its as simple as it is! Thanks to Naveed for this tip.&lt;/div&gt;</description><link>http://linux-hacks.blogspot.com/2009/02/hiding-zipped-files-under-jpg-images.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3992037435056807380.post-5987508056359797180</guid><pubDate>Wed, 28 Jan 2009 11:15:00 +0000</pubDate><atom:updated>2009-01-28T18:21:47.092-08:00</atom:updated><title>Sample Code To Learn Netlink Infrastructure</title><description>I always wanted to write an article explaining how netlink&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt; infrastructure works in the kernel and how we can make the&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt; best use of it. I dont have the time now, so in future i&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt;t will happen. As of now i wanted to share a sample code&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt; that will help users get the system ip information to&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt; the user space.&lt;br /&gt;&lt;pre&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;errno.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;error.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;netdb.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;unistd.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;netinet/in.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;sys/socket.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;sys/ioctl.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;linux/if.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;linux/netlink.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#include &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&amp;lt;linux/rtnetlink.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#define NIPQUAD(addr) \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ((&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;unsigned&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; *)&amp;amp;addr)[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;], \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ((&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;unsigned&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; *)&amp;amp;addr)[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;], \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ((&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;unsigned&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; *)&amp;amp;addr)[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;], \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ((&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;unsigned&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt; *)&amp;amp;addr)[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#define NIPQUAD_FMT &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%u&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%u&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%u&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%u&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;&lt;br /&gt;#define NIP6(addr) \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;]), \&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;        ntohs((addr).s6_addr16[&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#define NIP6_FMT &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%04x&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;#define INFINITY_LIFE_TIME      &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0xFFFFFFFFU&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; {&lt;br /&gt;              &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; nlmsghdr n;&lt;br /&gt;              &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; ifaddrmsg r;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;//              char             buf[1024];                &lt;/span&gt;&lt;br /&gt;      } req;&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; rtattr *rta;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; sockaddr_in6 *sin6p;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; sockaddr_in *sinp;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;int&lt;/span&gt; status;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt; buf[&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;16384&lt;/span&gt;];&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; nlmsghdr *nlmp;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; ifaddrmsg *rtmp;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; rtattr *rtatp;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;int&lt;/span&gt; rtattrlen;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; in_addr *inp;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; in6_addr *in6p;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; ifa_cacheinfo *cache_info;&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;int&lt;/span&gt; fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; We use RTM_GETADDR to fetch the ip address from the kernel interface table *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * So what we do here is pretty simple, we populate the msg structure (req)   *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * the size of the message buffer is specified to netlink message header, and *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * flags values are set as NLM_F_ROOT | NLM_F_REQUEST. The request flag must  *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * be set for all messages requesting the data from kernel. The root flag is  *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * used to notify the kernel to return the full tabel. Another flag (not used)*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * is NLM_F_MATCH. This is used to get only speficed entried in the table.    *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;         * At the time of writing this program this flag is not implemented in kernel &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      memset(&amp;amp;req, &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;sizeof&lt;/span&gt;(req));&lt;br /&gt;      req.n.nlmsg_len = NLMSG_LENGTH(&lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;sizeof&lt;/span&gt;(&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; ifaddrmsg));&lt;br /&gt;      req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;&lt;br /&gt;      req.n.nlmsg_type = RTM_GETADDR;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; AF_INET6 is used to signify the kernel to fetch only ipv6 entires.         *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;        * Replacing this with AF_INET will fetch ipv4 address table.                 &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      req.r.ifa_family = AF_INET6;&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; Fill up all the attributes for the rtnetlink header. The code is pretty easy*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;        * to understand. The lenght is very important. We use 16 to signify the ipv6  *&lt;/span&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; * address. If the user chooses to use AF_INET (ipv4) the length has to be     *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;        * RTA_LENGTH(4) &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      rta = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; rtattr *)(((&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt; *)&amp;amp;req) + NLMSG_ALIGN(req.n.nlmsg_len));&lt;br /&gt;      rta-&amp;gt;rta_len = RTA_LENGTH(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;16&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; Time to send and recv the message from kernel &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      status = send(fd, &amp;amp;req, req.n.nlmsg_len, &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt; (status &amp;lt; &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;) {&lt;br /&gt;              perror(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;send&quot;&lt;/span&gt;);&lt;br /&gt;              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      status = recv(fd, buf, &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;sizeof&lt;/span&gt;(buf), &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt; (status &amp;lt; &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;) {&lt;br /&gt;              perror(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;recv&quot;&lt;/span&gt;);&lt;br /&gt;              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt;(status == &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt;){&lt;br /&gt;              printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;EOF&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;);&lt;br /&gt;              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; Typically the message is stored in buf, so we need to parse the message to *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;        * get the required data for our display. &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;for&lt;/span&gt;(nlmp = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; nlmsghdr *)buf; status &amp;gt; &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;sizeof&lt;/span&gt;(*nlmp);){&lt;br /&gt;              &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;int&lt;/span&gt; len = nlmp-&amp;gt;nlmsg_len;&lt;br /&gt;              &lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;int&lt;/span&gt; req_len = len - &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;sizeof&lt;/span&gt;(*nlmp);&lt;br /&gt;&lt;br /&gt;              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt; (req_len&amp;lt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;0&lt;/span&gt; || len&amp;gt;status) {&lt;br /&gt;                      printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;error&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;);&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;return&lt;/span&gt; -&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt; (!NLMSG_OK(nlmp, status)) {&lt;br /&gt;                      printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;NLMSG not OK&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;);&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;              rtmp = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; ifaddrmsg *)NLMSG_DATA(nlmp);&lt;br /&gt;              rtatp = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; rtattr *)IFA_RTA(rtmp);&lt;br /&gt;&lt;br /&gt;              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; Start displaying the index of the interface &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;Index Of Iface= &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;,rtmp-&amp;gt;ifa_index);&lt;br /&gt;&lt;br /&gt;              rtattrlen = IFA_PAYLOAD(nlmp);&lt;br /&gt;&lt;br /&gt;              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;for&lt;/span&gt; (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) {&lt;br /&gt;     &lt;br /&gt;               &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; Here we hit the fist chunk of the message. Time to validate the    *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * the type. For more info on the different types see man(7) rtnetlink*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * The table below is taken from man pages.                           *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * Attributes                                                         *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * rta_type        value type             description                 *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * -------------------------------------------------------------      *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_UNSPEC      -                      unspecified.                *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_ADDRESS     raw protocol address   interface address           *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_LOCAL       raw protocol address   local address               *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_LABEL       asciiz string          name of the interface       *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_BROADCAST   raw protocol address   broadcast address.          *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_ANYCAST     raw protocol address   anycast address             *&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;                 * IFA_CACHEINFO   struct ifa_cacheinfo   Address information.        &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt;(rtatp-&amp;gt;rta_type == IFA_CACHEINFO){&lt;br /&gt;                              cache_info = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; ifa_cacheinfo *)RTA_DATA(rtatp);&lt;br /&gt;                              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt; (cache_info-&amp;gt;ifa_valid == INFINITY_LIFE_TIME)&lt;br /&gt;                                      printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;valid_lft forever&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;);&lt;br /&gt;                              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;else&lt;/span&gt;&lt;br /&gt;                                      printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;valid_lft &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%u&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;sec&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;, cache_info-&amp;gt;ifa_valid);&lt;br /&gt;  &lt;br /&gt;                              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt; (cache_info-&amp;gt;ifa_prefered == INFINITY_LIFE_TIME)&lt;br /&gt;                                      printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot; preferred_lft forever&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;);&lt;br /&gt;                              &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;else&lt;/span&gt;&lt;br /&gt;                                      printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot; preferred_lft &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;%u&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;sec&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;,cache_info-&amp;gt;ifa_prefered);&lt;br /&gt;                      }&lt;br /&gt;&lt;br /&gt;                      &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;/*&lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt; NOTE: All the commented code below can be used as it is for ipv4 table &lt;/span&gt;&lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt;(rtatp-&amp;gt;rta_type == IFA_ADDRESS){&lt;br /&gt;                              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// inp = (struct in_addr *)RTA_DATA(rtatp);&lt;/span&gt;&lt;br /&gt;                              in6p = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; in6_addr *)RTA_DATA(rtatp);&lt;br /&gt;                              printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;addr0: &quot;&lt;/span&gt; NIP6_FMT &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;,NIP6(*in6p));&lt;br /&gt;                              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// printf(&quot;addr0: &quot;NIPQUAD_FMT&quot;\n&quot;,NIPQUAD(*inp));&lt;/span&gt;&lt;br /&gt;                      }&lt;br /&gt;&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt;(rtatp-&amp;gt;rta_type == IFA_LOCAL){&lt;br /&gt;                              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// inp = (struct in_addr *)RTA_DATA(rtatp);&lt;/span&gt;&lt;br /&gt;                              in6p = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; in6_addr *)RTA_DATA(rtatp);&lt;br /&gt;                              printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;addr1: &quot;&lt;/span&gt; NIP6_FMT &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;,NIP6(*in6p));&lt;br /&gt;                              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// printf(&quot;addr1: &quot;NIPQUAD_FMT&quot;\n&quot;,NIPQUAD(*inp));&lt;/span&gt;&lt;br /&gt;                      }&lt;br /&gt;&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt;(rtatp-&amp;gt;rta_type == IFA_BROADCAST){&lt;br /&gt;                              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// inp = (struct in_addr *)RTA_DATA(rtatp);&lt;/span&gt;&lt;br /&gt;                              in6p = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; in6_addr *)RTA_DATA(rtatp);&lt;br /&gt;                              printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;bcataddr: &quot;&lt;/span&gt; NIP6_FMT &lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;,NIP6(*in6p));&lt;br /&gt;                              &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// printf(&quot;Bcast addr: &quot;NIPQUAD_FMT&quot;\n&quot;,NIPQUAD(*inp));&lt;/span&gt;&lt;br /&gt;                      }&lt;br /&gt;&lt;br /&gt;                      &lt;span style=&quot;color: rgb(255, 255, 0);&quot;&gt;if&lt;/span&gt;(rtatp-&amp;gt;rta_type == IFA_ANYCAST){&lt;br /&gt;                             &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;//inp = (struct in_addr *)RTA_DATA(rtatp);&lt;/span&gt;&lt;br /&gt;                             in6p = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; in6_addr *)RTA_DATA(rtatp);&lt;br /&gt;                             printf(&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;anycastaddr: &quot;&lt;/span&gt;NIP6_FMT&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 64, 255);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 96, 96);&quot;&gt;&quot;&lt;/span&gt;,NIP6(*in6p));&lt;br /&gt;                            &lt;span style=&quot;color: rgb(128, 128, 255);&quot;&gt;// printf(&quot;anycast addr: &quot;NIPQUAD_FMT&quot;\n&quot;,NIPQUAD(*inp));&lt;/span&gt;&lt;br /&gt;                      }&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;              status -= NLMSG_ALIGN(len);&lt;br /&gt;              nlmp = (&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;struct&lt;/span&gt; nlmsghdr*)((&lt;span style=&quot;color: rgb(0, 255, 0);&quot;&gt;char&lt;/span&gt;*)nlmp + NLMSG_ALIGN(len));&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;</description><link>http://linux-hacks.blogspot.com/2009/01/sample-code-to-learn-netlink.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item></channel></rss>