tag:blogger.com,1999:blog-26822139984922059702024-03-14T01:55:21.651+05:30Thinking ElectronMeghanad ShingateMeghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-2682213998492205970.post-303504452849131962016-12-02T17:46:00.000+05:302016-12-02T18:26:44.195+05:30QEMU : Installing Debian on Qemu emulated MIPS - Linux(x86) host<div dir="ltr" style="text-align: left;" trbidi="on">
Hello People,<br />
<br />
So, Here I needed to test some drivers functionality with 16K page size specifically. After walking through my options I settled with Linux on Qemu emulated MIPS. <a href="http://wiki.qemu.org/Main_Page" target="_blank">QEMU</a> is a generic and open source machine emulator. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-FdsMeJz2FDs/WEE6YCzULHI/AAAAAAAAE3E/1gBe75kXilAcfK0r3pYoo80xaHqrtKThACLcB/s1600/mips.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="206" src="https://4.bp.blogspot.com/-FdsMeJz2FDs/WEE6YCzULHI/AAAAAAAAE3E/1gBe75kXilAcfK0r3pYoo80xaHqrtKThACLcB/s320/mips.png" width="320" /></a></div>
<br />
<br />
Here are the steps to install Debian on emulated MIPS machine using Qemu:<br />
<br />
<br />
<b><span style="font-size: large;">Preparation</span>:</b><br />
Here I am using Ubuntu 14.04 x86 system as my host machine.<br />
<br />
1 . Installing Qemu on host system - install qemu package,<br />
<br />
<div class="code">
apt-get install qemu</div>
<br />
2. Need to download a debian-installer kernel (<a href="http://ftp.de.debian.org/debian/dists/Debian8.6/main/installer-mips/current/images/malta/netboot/vmlinux-3.16.0-4-4kc-malta">vmlinux-3.16.0-4-4kc-malta</a>) and initrd (<a href="http://ftp.de.debian.org/debian/dists/Debian8.6/main/installer-mips/current/images/malta/netboot/initrd.gz">initrd.gz</a>) to boot from.<br />
<br />
<span style="font-size: large;"><b>Setting up the MIPS system:</b></span><br />
<br />
1. First need to create a virtual disk to install Debian on,<br />
<br />
<div class="code">
qemu-img create -f qcow2 debian_mips.qcow2 10G </div>
<br />
This will create virtual disk of 10G size.<br />
<br />
2. Next, install Debian to this virtual disk <br />
<div class="code">
qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-3.16.0-4-4kc-malta -initrd initrd.gz -append "console=ttyS0" -nographic</div>
<br />
Then follow shown on terminal as of normal Debian installation to the end.<br />
This will take quite a while (so better get that fresh cup of coffee) as it will download all packages needed for installation.<br />
<br />
<span style="font-size: large;"><b>boot:</b></span><br />
After installations, next step is to boot into the system we just installed.<br />
<br />
<div class="code">
qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-3.16.0-4-4kc-malta -append "root=/dev/sda1 console=ttyS0" -nographic</div>
<br />
Voilà, you will be booted into MIPS system with Debian Linux!! <br />
Rest is just usual Debian/Linux.<br />
<br />
<br />
<span style="font-size: large;"><b>Accessing Host: </b></span><br />
Next thing that any developer will need is access to the Host system for exchanging all sort of stuff....driver, applicatin, source code etc.<br />
<br />
You can SSH into the Host as bellow or just do SCP.<br />
<div class="code">
ssh host_user@10.0.2.2</div>
<br />
<b><span style="font-size: large;">Referances:</span></b><br />
Networking: <a href="http://wiki.qemu.org/Documentation/Networking">http://wiki.qemu.org/Documentation/Networking</a><br />
Qemu: <a href="http://wiki.qemu.org/Main_Page">http://wiki.qemu.org/Main_Page</a><br />
<br />
Cheers!!
</div>
Meghhttp://www.blogger.com/profile/05145442745113957355noreply@blogger.com0Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-2682213998492205970.post-26624173628724652072016-09-23T12:38:00.001+05:302016-09-23T17:47:12.598+05:30Android CTS 7.0_r1 : Running modules list through automated script<div dir="ltr" style="text-align: left;" trbidi="on">
Hello Guys,<br />
How are you doing? hope all is well. Its been while, lets get started!<br />
<br />
So whats new? Yeah <a href="https://www.android.com/versions/nougat-7-0/" target="_blank">Android 7</a> is new! Android 7 has been out now for a while and everybody (device vendors) wants it up and running as soon as possible. So here I am trying to get Android 7 up for some super secrete project, just kidding, yes I (and my team) had just completed bring up of the device with Android N (i.e. Android 7, called <span class="eyebrow">Nougat) yeeeh! but that's just the half battle, still need to run Android Compatibility Test Suite (CTS) to win the rest.</span><br />
<span class="eyebrow"><br /></span>
<span class="eyebrow"></span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-d3SHXKm6qXg/V-TX0iLshhI/AAAAAAAAEzY/_aeboBco9ekFs1829UDkZ9JBzd9igAAjgCLcB/s1600/android-nougat-100669396-primary.idge2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://1.bp.blogspot.com/-d3SHXKm6qXg/V-TX0iLshhI/AAAAAAAAEzY/_aeboBco9ekFs1829UDkZ9JBzd9igAAjgCLcB/s400/android-nougat-100669396-primary.idge2.png" width="400" /></a></div>
<span class="eyebrow"><br /></span>
<span class="eyebrow">So, here is the issue, The device I have has some serious battery problem, it cant charge through USB if its connected to computer, it needs to be connect to charger to do so. So every time I kick CTS plan device goes down before it completes. The solution is instead of running whole plan run module by module and get result but its heck lot of manual work and I have to keep eye on it. Also in CTS 7 google has changed structure a bit lot.</span><br />
<span class="eyebrow"><br /></span>
<span class="eyebrow">So here I am going to give you scripts which helps you run CTS modules one-by-one and also saves results location in log file. So if device goes down while running some module you can continue from where you left. You just need to follow some steps as bellow:</span><br />
<span class="eyebrow"><br /></span>
<br />
<h4 style="text-align: left;">
<span class="eyebrow">1. Download CTS 7 </span><span class="eyebrow"> </span></h4>
<div style="text-align: left;">
<span class="eyebrow">You can download CTS package from : <a href="https://source.android.com/compatibility/cts/downloads.html" target="_blank">CTS download</a> and extract it.</span></div>
<h4 style="text-align: left;">
<span class="eyebrow"> </span></h4>
<h4 style="text-align: left;">
<span class="eyebrow">2. Get list of modules</span></h4>
<div style="text-align: left;">
<span class="eyebrow">After extracting CTS package go to <span style="font-family: "courier new" , "courier" , monospace;">android-cts/tools</span> directory and execute following command to get available modules list,</span></div>
<div style="text-align: left;">
<script src="https://gist.github.com/meghanads/0970174160878481b71a7863b939384c.js"></script>
<span class="eyebrow">Then copy list of modules to a file e.g. modules.lst or you can get it here </span><br />
<br />
<h4 style="text-align: left;">
<script src="https://gist.github.com/meghanads/7c8cd4f1d314f78e2f3eaa24e4238426.js"></script> <span class="eyebrow">3. Script to run modules one-by-one from the list</span></h4>
<div style="text-align: left;">
<span class="eyebrow">Now what you need is a script that runs modules from above list one-by-one, here it is, </span></div>
<div style="text-align: left;">
<script src="https://gist.github.com/meghanads/68fa967e1ce62a012a444740e84b92f2.js"></script>
</div>
<div style="text-align: left;">
<br />
<span class="eyebrow">Running the CTS modules using script,</span><br />
<br />
<script src="https://gist.github.com/meghanads/643bb531ad5bcc92ec9ea787ec14b9b5.js"></script>
<span class="eyebrow">If device dies while running some module using the script, you can press 'ctrl+c' to stop script in between and remove modules from <span style="font-family: "courier new" , "courier" , monospace;">'modules.lst</span>' file which ran to completion successfully, then run the script again as before to continue from where you left.</span><br />
<br />
<h4 style="text-align: left;">
<span class="eyebrow">4. Collecting logs of CTS </span></h4>
<div style="text-align: left;">
<span class="eyebrow">Result of each module ran using above script can be found in<span style="font-family: "courier new" , "courier" , monospace;"> android-cts/results/</span> directory in separate sub-directories with sub-directory name as time-stamp when respective module has started. Above script collects all modules time-stamp in log file, <span style="font-family: "courier new" , "courier" , monospace;">modules.lst.log</span>, which you can use latter to correlate time-stamps recorded to find each modules result/log directory. See snap-shot bellow, </span></div>
<div style="text-align: left;">
<script src="https://gist.github.com/meghanads/e5dff1f94aa1854eb96b287671badfb1.js"></script>
</div>
<div style="text-align: left;">
<br />
<span class="eyebrow">That's it guys, have a nice day!!</span></div>
<div style="text-align: left;">
<span class="eyebrow">Cheers!!! </span></div>
</div>
<div style="text-align: left;">
</div>
</div>
</div>
Meghhttp://www.blogger.com/profile/05145442745113957355noreply@blogger.com2Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-2682213998492205970.post-85765002962184117462016-07-26T11:54:00.001+05:302016-07-26T15:08:46.453+05:30Ubuntu 14.04 : How to install 4.4.8 Kernel<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Hello,<br />
<br />
Here are some simple steps to install Kernel 4.4.8 on your Ubuntu machine.<br />
<div style="text-align: left;">
Open terminal and execute following commands in given order.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-ubmVbLnqgzc/V5cCEs-l2mI/AAAAAAAAAK0/iJaH5lhJoXUzuysTH_gauo1UIatWLsUzACLcB/s1600/images5.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-ubmVbLnqgzc/V5cCEs-l2mI/AAAAAAAAAK0/iJaH5lhJoXUzuysTH_gauo1UIatWLsUzACLcB/s1600/images5.jpeg" /></a></div>
<h4 style="text-align: left;">
<b>32bit Ubutnu:</b></h4>
Lets download the packages needed for installation.<br />
<script src="https://gist.github.com/meghanads/fcb39ec5bad2f1b3d5bcff85b03e868d.js"></script></div>
<br />
Now, install downloaded packages: it will take a while, just sit back and relax<br />
<script src="https://gist.github.com/meghanads/c1db7ca8aeb402e067c7c4d36bbdbcf7.js"></script>
<br />
<h4 style="text-align: left;">
<b>64bit Ubuntu:</b></h4>
Same way as earlier, lets download required packages first,<br />
<script src="https://gist.github.com/meghanads/c5a03e187ece4b852f2525e65fe10165.js"></script>
Installing downloaded packages: same as that of 32bit<br />
<script src="https://gist.github.com/meghanads/c1db7ca8aeb402e067c7c4d36bbdbcf7.js"></script>
<br />
We are done! Just reboot system and you should see newer Kernel installed on your system.<br />
Cheers!! </div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com1Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-2682213998492205970.post-7301603963233748562016-03-31T10:44:00.001+05:302016-03-31T10:44:27.127+05:30issue "/usr/include/linux/errno.h:1:23: fatal error: asm/errno.h: No such file or directory" while cross-compiling<div dir="ltr" style="text-align: left;" trbidi="on">
Aloha,<br />
<br />
So, making this post as it did cost me more than couple of hours to figure-out what the hell is happening.<br />
<br />
I was building some (secrete) driver for android yesterday and I needed to install cross-compile tool-chain for same, but while installing tool-chain on Ubuntu some of the packages already installed got removed by package installer.<br />
<br />
Next, I set up the environment for building driver and kicked the build. Suddenly I started getting following error from compiler:<br />
<br />
<script src="https://gist.github.com/meghanads/f3a8cf0edd9a4d4f90c29cd21db658a2.js"></script>
<br />
I did not noticed that some package has been forcefully removed while installing tool-chain. After some Googl'ing I found the package that needs to be installed.<br />
<br />
Just install following package and issue will disappear :)<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">$sudo apt-get install linux-libc-dev:i386 </span></blockquote>
<br />
cheers!! <br />
<br /></div>
Meghhttp://www.blogger.com/profile/05145442745113957355noreply@blogger.com1tag:blogger.com,1999:blog-2682213998492205970.post-12395396447770452452015-07-21T15:56:00.000+05:302015-07-21T15:56:38.038+05:30Tmuxing with Tmuxinator<div dir="ltr" style="text-align: left;" trbidi="on">
Ooolo,<br />
<br />
So, Here is what’s happened, I was doing some testing with driver for #top_secrete project. So each time to test my driver, I have to go through following steps,<br />
<br />
- ssh to target platform (tab0), run <a href="http://www.vim.org/" target="_blank">vim</a> to edit code <br />
- ssh to target platform (tab1), cd to source dir<br />
- source environment<br />
- build/install<br />
- ssh to target (tab2), cd to log dir and start <a href="http://thinking-electron.blogspot.in/2014/09/capture-and-monitor-dmesg-continuously.html" target="_blank">ldmesg</a> script to continuously monitor dmesg logs<br />
- ssh to target (tab3), cd to test dir and start test (server)<br />
- ssh to target (tab3), cd to test dir and start test (client).<br />
<br />
<br />
aahh, lots of steps and if driver crashes during testing (and that's what happens most of the times), I have to repeat this whole process again. Above described (steps) stuff is mostly unproductive. So how to avoid it??<br />
<br />
So here comes <i><b>tmux</b></i>, <br />
<br />
<a href="https://tmux.github.io/" target="_blank">Tmux</a> (terminal multiplexer) allows you to switch between multiple programs in single terminal. Its similar to <span style="font-family: "Courier New",Courier,monospace;"><i>screen</i></span>.<br />
<br />
<b>Getting started resources for tmux :</b><br />
-<a href="http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/" target="_blank">Part1</a><br />
-<a href="http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/" target="_blank">Part2</a><br />
<br />
So if I login in to target system over SSH in one terminal and start <span style="font-family: "Courier New",Courier,monospace;">tmux</span>, I can create multiple tabs inside single terminal using <span style="font-family: "Courier New",Courier,monospace;">tmux</span> to run multiple programs. This solves partial problem i.e. multiple SSH logins, but sill I have to do lots of stuff manually after creating multiple tabs using <span style="font-family: "Courier New",Courier,monospace;">tmux</span>. I needed further automation in the process...<br />
<br />
After doing some googling I came across tool called <i><b>tmuxinator.</b></i><br />
It does exactly what's needed. <a href="https://github.com/tmuxinator/tmuxinator" target="_blank">Tmuxinator</a> is awesome tool that allows you to configure <span style="font-family: "Courier New",Courier,monospace;">tmux</span> session i.e. how many TTYs (tabs) to start with, executing some commands on start, splitting window, base/root directory for each tabs can be configured separately, cool right!<br />
<br />
<b>Getting started resources for tmuxinator:</b><br />
-<a href="http://aokolish.me/blog/2013/02/12/using-tmux-and-tmuxinator/" target="_blank">Basics</a> <br />
<br />
So <span style="font-family: "Courier New",Courier,monospace;">tmuxinator</span> automates most of the steps above, it launches <span style="font-family: "Courier New",Courier,monospace;">tmux</span>, creates multiple tabs, source env, changes dir to specific directory and additionally we can maintain multiple project settings/profiles much easily and what it needs is simple configuration file.<br />
<br />
Cheers!<br />
(will update more soon!)</div>
Meghhttp://www.blogger.com/profile/05145442745113957355noreply@blogger.com0Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-2682213998492205970.post-70138581811458562142015-05-19T09:59:00.000+05:302015-05-19T09:59:58.297+05:30How to increase vmalloc size [vmalloc: allocation failure]<div dir="ltr" style="text-align: left;" trbidi="on">
Hello,<br />
<br />
So this is what happened, I was working on the graphics driver and testing some GLBenchmark applications to see if everything is smooth and healthy. But one of the test was always failing for unknown reason (at that time). I have put more than couple of hours to debug that. I was ignoring some errors in dmesg (kernel log) that I was getting,<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">May 18 14:53:38 pc-vbox kernel: [412318.373157] vmap allocation for size 37752832 failed: use vmalloc=<size> to increase size.<br />May 18 14:53:38 pc-vbox kernel: [412318.373161] vmalloc: allocation failure: 37748736 bytes<br />May 18 14:53:38 pc-vbox kernel: [412318.373163] GLBenchmark27_X: page allocation failure: order:0, mode:0xd2</span><br /><br />
<br />
Latter I found that application was quite a heavy and vmalloc is failing due to insufficient space. On x86_32 systems default vmalloc size is 128MB and can be override by vmalloc kernel boot option. vmalloc() allocates block of memory with continuous virtual addresses or pages (no guarantee that pages are actually contiguous in physical RAM) . You can find current vmalloc size of your system as bellow,<br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">$cat /proc/meminfo | grep -i vmalloc</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">VmallocTotal: 122880 kB</span><br />
<span style="font-family: "Courier New",Courier,monospace;">VmallocUsed: 28216 kB</span><br />
<span style="font-family: "Courier New",Courier,monospace;">VmallocChunk: 94156 kB</span><br />
<br />
<br />
<span style="font-size: large;">How to increase vmalloc space?</span><br />
We have to modify the kernel boot options in grub in order to do that.<br />
open <span style="font-family: "Courier New",Courier,monospace;">/etc/default/grub</span> and make following change,<br />
<script src="https://gist.github.com/meghanads/b41ace03b81e85675f40.js"></script>
This will increase total vmalloc space to 512MB, next you need to update the grub as follows,<br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">$sudo update-grub</span><br />
<br />
After this corresponding change will be reflected in <span style="font-family: "Courier New",Courier,monospace;">/boot/grub/grub.cfg</span> file as bellow,<br />
<br />
<script src="https://gist.github.com/meghanads/94403b6a1ab263e131ea.js"></script>
<br />
Then just reboot the system and that solved my problem. Its not the thumb rule to set vmalloc to 512M but just set to what solves your problem!<br />
<br />
After reboot you can see vmalloc size increased,<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">$cat /proc/meminfo | grep -i vmalloc</span><br />
<span style="font-family: "Courier New",Courier,monospace;">VmallocTotal: 524288 kB<br />VmallocUsed: 64768 kB<br />VmallocChunk: 366544 kB </span><br />
<br />
cheers <br />
<br />
<br />
<br /></div>
Meghhttp://www.blogger.com/profile/05145442745113957355noreply@blogger.com0Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-2682213998492205970.post-73547248100442371132014-09-17T11:50:00.000+05:302014-09-17T11:54:34.690+05:30Capture and monitor dmesg continuously <div dir="ltr" style="text-align: left;" trbidi="on">
Greetings folks!<br />
<br />
If you are working on device drivers for Linux/Android we do rely on dmesg for almost all of the times. But you know the dmesg buffer is limited, its circular buffer. So what ever overflows the buffer is lost for good (?). We feel need to increase the buffer size but its not trivial task and also most of the times enough is just not enough!<br />
<br />
Here are some simple scripts for Linux to log dmesg continuously and dump into file and at the same time you can monitor changes in dmesg!<br />
<br />
Give exe permissions to script and run as bellow,<br />
$sudo ./ldmesg.sh <br />
<br />
<script src="https://gist.github.com/meghanads/1af8d299347872b0a7f7.js"></script>
Now, dmesg is getting continuously logged in dmesg.log file in current directory. Next script needs to be run in another terminal tab/window which will monitor changes in dmesg (actually dmesg.log).<br />
<br />
Give exe permissions to script and run as bellow,<br />
$./mdmesg.sh<br />
<br />
<br />
<script src="https://gist.github.com/meghanads/8db1b8403cb1c3ec8a28.js"></script>
Image bellow shows dmesg being monitored.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-lUO1BJDLDeE/VBkmYzha2MI/AAAAAAAAEK4/XXKjN4u143k/s1600/mdmesg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-lUO1BJDLDeE/VBkmYzha2MI/AAAAAAAAEK4/XXKjN4u143k/s1600/mdmesg.png" height="121" width="640" /></a></div>
<br />
For Android developers, here is ldmesg modified to use it over adb,<br />
<script src="https://gist.github.com/meghanads/f594932588baf6620e59.js"></script>
<br />
--
Cheers!!
</div>
Meghhttp://www.blogger.com/profile/05145442745113957355noreply@blogger.com0Pune, Maharashtra, India18.5204303 73.85674369999992518.2795358 73.534020199999929 18.7613248 74.17946719999992tag:blogger.com,1999:blog-2682213998492205970.post-53512235034711810162014-06-02T15:46:00.003+05:302014-06-02T17:03:02.160+05:30Linux Experience on Windows!<div dir="ltr" style="text-align: left;" trbidi="on">
Yes, I love Linux and Windows too (yaah!..lets just say that!, as I use windows phone :)). Almost all engineers works most of the time on Linux and likes to fly <a href="http://www.vim.org/" target="_blank">VIM</a> and similar editing tools. But sometimes sh*t happens and we forced to work on Windows and believe me it really feels like trapped in hell. Yes, I have been there, So here is your door to Heaven through the Hell!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-O5hZMo9XhgY/U4xSZkSI4FI/AAAAAAAAAI4/FmWEuA6OScs/s1600/cygwin_icon.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-O5hZMo9XhgY/U4xSZkSI4FI/AAAAAAAAAI4/FmWEuA6OScs/s1600/cygwin_icon.PNG" height="240" width="320" /></a></div>
<br />
<a href="http://www.cygwin.com/" target="_blank">Cygwin</a> , Its your door way. It gives same experience as Linux shell. It includes most of the packages engineer/programmers need. Even you can ssh to remote Linux system using same command as in Linux shell, do you believe! and list goes long, <i>Let curiosity be your guide!</i><br />
<br />
Here are some basic instructions for setup...<br />
<br />
<span style="font-size: large;"><b>1. Installation</b></span><br />
Download installer according to your system needs (32/64bit) and start installation.<br />
Just go through usual installation steps,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-U5AvqnR25N4/U4xF3HqpRTI/AAAAAAAAAHY/rXwEc4a2wdA/s1600/cygwin1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-U5AvqnR25N4/U4xF3HqpRTI/AAAAAAAAAHY/rXwEc4a2wdA/s1600/cygwin1.PNG" height="295" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Next...Next... </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-vNjJgbWpGtQ/U4xGC3hVvYI/AAAAAAAAAIk/-aQoD3C18uQ/s1600/cygwin2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-vNjJgbWpGtQ/U4xGC3hVvYI/AAAAAAAAAIk/-aQoD3C18uQ/s1600/cygwin2.PNG" height="294" width="400" /></a> </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Choose any site to download from...</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-wCAP4S7oGfw/U4xGDuavAYI/AAAAAAAAAH4/Xt4osciWolI/s1600/cygwin_choose_site.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-wCAP4S7oGfw/U4xGDuavAYI/AAAAAAAAAH4/Xt4osciWolI/s1600/cygwin_choose_site.PNG" height="291" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: left;">
Wait for a minute... </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-834m5HqCz_0/U4xGDhBZ0yI/AAAAAAAAAH8/0lgkNCwH79k/s1600/cygwin_download.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-834m5HqCz_0/U4xGDhBZ0yI/AAAAAAAAAH8/0lgkNCwH79k/s1600/cygwin_download.PNG" height="292" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now you need to search packages you need and mark them for installation. </div>
<div class="separator" style="clear: both; text-align: left;">
There long list but I'll install vim for reference.</div>
<div class="separator" style="clear: both; text-align: left;">
Search for it...</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-MmfiyrFKAxY/U4xGC_bdBRI/AAAAAAAAAH0/ecMUBaJAWAk/s1600/cygwin_choose_pkgs.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-MmfiyrFKAxY/U4xGC_bdBRI/AAAAAAAAAH0/ecMUBaJAWAk/s1600/cygwin_choose_pkgs.PNG" height="296" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: left;">
Mark VIM for installation and go next...</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-syYnsH5UcC8/U4xGEcKbE7I/AAAAAAAAAIU/JigqOGpw0jU/s1600/cygwin_vim.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-syYnsH5UcC8/U4xGEcKbE7I/AAAAAAAAAIU/JigqOGpw0jU/s1600/cygwin_vim.PNG" height="231" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It will find package dependencies and start downloading it, give it a time...</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-b_D4dvbKBG4/U4xGFEKT0LI/AAAAAAAAAIc/NWb9qqaJk5M/s1600/cygwin_vim_dwnload.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-b_D4dvbKBG4/U4xGFEKT0LI/AAAAAAAAAIc/NWb9qqaJk5M/s1600/cygwin_vim_dwnload.PNG" height="230" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Click 'Finish' and installation is done.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-1PrxgwCiaj0/U4xGDzqkjDI/AAAAAAAAAIg/CQ8wEueYWsk/s1600/cygwin_finish.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-1PrxgwCiaj0/U4xGDzqkjDI/AAAAAAAAAIg/CQ8wEueYWsk/s1600/cygwin_finish.PNG" height="225" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: large;"><b>2. Running VIM in Cygwin: </b></span></div>
<div class="separator" style="clear: both; text-align: left;">
Now, go to start menu and start Cygwin. It will open shell similar to Linux shell. Your <i>root</i> directory will be installation directory (<i>C:\cygwin64\</i>)</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-cV6ZJlQ46As/U4xGEZ1grfI/AAAAAAAAAIM/vJyh-1PFScM/s1600/cygwin_run.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-cV6ZJlQ46As/U4xGEZ1grfI/AAAAAAAAAIM/vJyh-1PFScM/s1600/cygwin_run.PNG" height="204" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now, you can put your vimrc in your $HOME directory (i.e. <i>C:\cygwin64\home\user.name\.vimrc</i>) and it works just perfectly.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here is bashrc file in vim (<span style="font-family: "Courier New",Courier,monospace;">$vim .bashrc</span>)</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-V5kaWXUbx5k/U4xGFdA1lJI/AAAAAAAAAIo/SFq9f0eXiys/s1600/cygwin_vim_run.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-V5kaWXUbx5k/U4xGFdA1lJI/AAAAAAAAAIo/SFq9f0eXiys/s1600/cygwin_vim_run.PNG" height="203" width="400" /></a></div>
<br />
Cheers!</div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0Bangalore, Karnataka, India12.9715987 77.59456269999998312.4764182 76.949115699999979 13.4667792 78.240009699999987tag:blogger.com,1999:blog-2682213998492205970.post-75390769429104807072013-06-15T06:13:00.001+05:302014-06-02T16:49:09.063+05:30VPN Client for Linux Systems: Alternative for Cisco AnyConnect VPN Client<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
Here is how you can connect to your VPN server without Cisco AnyConnect VPN client.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-MM7U_nLQ2Vs/U4xdobsmCuI/AAAAAAAAAJI/S41iT6-kTYw/s1600/linuxvpn.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-MM7U_nLQ2Vs/U4xdobsmCuI/AAAAAAAAAJI/S41iT6-kTYw/s1600/linuxvpn.jpg" height="187" width="320" /></a></div>
<br />
<br />
1. First install network-manager plug-in for VPN<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $ sudo apt-get install network-manager-openconnect
</code></pre>
<br />
2. Click on your network manager applet you will see "<span style="color: #cc0000;">VPN Connections</span>" option, roll mouse over it, some options will pop-up, then click on "<span style="color: #cc0000;">Configure VPN...</span>"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-UzmCU8vqGL0/Ubu3B1z_ijI/AAAAAAAAAFc/jaDllOXRkoY/s1600/vpn1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-UzmCU8vqGL0/Ubu3B1z_ijI/AAAAAAAAAFc/jaDllOXRkoY/s1600/vpn1.png" height="192" width="400" /></a></div>
<br />
<br />
3. Then click on "<span style="color: #cc0000;">Add</span>" to add new VPN connection, select VPN connection type "<span style="color: #cc0000;">Cisco AnyConnect Compatible VPN (openconnect)</span>" and click on "create". Window to configure new VPN connection will pop-up.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-lM5rq9DC-Ok/Ubu3UKDDAJI/AAAAAAAAAFk/U7P0vZA6y20/s1600/vpn3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-lM5rq9DC-Ok/Ubu3UKDDAJI/AAAAAAAAAFk/U7P0vZA6y20/s1600/vpn3.png" height="240" width="400" /></a></div>
<br />
<br />
4. Then enter your VPN gateway and click save.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-D1bTCFjY3dM/Ubu3geJd2KI/AAAAAAAAAFs/qxbf3qiojWw/s1600/vpn2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-D1bTCFjY3dM/Ubu3geJd2KI/AAAAAAAAAFs/qxbf3qiojWw/s1600/vpn2.png" height="400" width="310" /></a></div>
<br />
<br />
5. To Connect to VPN, go to network manager applet again, then "<span style="color: #cc0000;">VPN Connections</span>", it will pop-up VPN connection you just created, click on it. Then VPN connection window will be up, just click on connect icon to establish VPN connection.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-BHDppIYIk6c/Ubu4R1GdV0I/AAAAAAAAAF4/F0fgq448ec4/s1600/vpn4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-BHDppIYIk6c/Ubu4R1GdV0I/AAAAAAAAAF4/F0fgq448ec4/s1600/vpn4.png" height="290" width="320" /></a></div>
<br />
<br />
Done!<br />
cheers!!</div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com4Kings Langley, Hertfordshire, UK51.716249 -0.4561569999999619551.6768965 -0.536837999999962 51.7556015 -0.37547599999996195tag:blogger.com,1999:blog-2682213998492205970.post-45570615135729626092013-06-13T02:09:00.001+05:302014-06-02T16:56:18.304+05:30Life of C : Part 1 - Compilation<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Guys,<br />
<br />
From so long I was thinking of putting some stuff together regarding all basic things about C that gives better understanding not only about C but also some about OS perspective. So Here is the start, (oh please... "Hello World!" again)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-kkf8jauYq9Q/U4xfT6ZpXBI/AAAAAAAAAJU/dQm7L9-appw/s1600/gnu-db-3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-kkf8jauYq9Q/U4xfT6ZpXBI/AAAAAAAAAJU/dQm7L9-appw/s1600/gnu-db-3.jpg" height="320" width="220" /></a></div>
<br />
<br />
<span style="font-size: large;"><u><b>0. Prerequisites </b></u></span><br />
Through out the post I am assuming that reader has some knowledge of C. All explanations/examples bellow are tested/explained on Linux system. To prepare system install following packages,<br />
<br />
<script src="https://gist.github.com/meghanads/5776936.js"></script>
<span style="font-size: large;"><u><b>1. Compilation</b></u></span><br />
Bear with the stupid example :)<br />
This is basic C program, almost all programmers have written this program at least one in life.<br />
<br />
<script src="https://gist.github.com/meghanads/5768847.js"></script>
Ok, so this is the C syntax to say computer to write/ display "Hello Guys!". What happens next?<br />
Program to become executable it needs to go through certain steps,<br />
<br />
1. Pre-processing<br />
2. Compilation<br />
3. Assembly<br />
4. Linking<br />
<br />
<br />
To see all intermediate file in process of compilation compile above program as follows,<br />
<br />
<script src="https://gist.github.com/meghanads/5776909.js"></script>
This will save all intermediate files in current directory.<br />
<b><span style="color: #990000;"> 1. Pre-processing</span></b><br />
This is very first step in process of compilation of the C program. It mainly does following tasks,<br />
<br />
1. Macro substitution<br />
2. Comments stripping<br />
3. Expansion of included files<br />
<br />
<br />
Output of pre-processor for above program is as shown bellow,<br />
<br />
<script src="https://gist.github.com/meghanads/3acd354754cc41da76ea.js"></script>
file explanation:<br />
1. first observation is at end of the file you can see argument in printf() is replaced by string "Hello Guys!" instead of macro.<br />
2. second is it does not have any comments we added, they have been stripped out.<br />
3. Third observation in "#include<stdio.h>" is replaced by lots of other stuff. It has been expanded and added in the source file so that compiler can clearly see "printf()" function.<br />
<br />
It says printf() is defined somewhere externally.<br />
<br />
<script src="https://gist.github.com/meghanads/5780445.js"></script>
<br />
<b><span style="color: #990000;">2. Compilation</span></b><br />
Next, compiler takes helloguys.i as input and converts it into compiler intermediate output file. This is assembly code. You can see "helloguys.s" file bellow. its consists of assembly instructions of your processor. Next assembler takes this instructions and converts them into machine code.<br />
<br />
<script src="https://gist.github.com/meghanads/5777276.js"></script>
<b><span style="color: #990000;">3. Assembly</span></b><br />
In this stage "helloguys.s" file is taken as input and intermediate file "helloguys.o" is generated. This is object file.<br />
<br />
This file contains machine level instructions. But function calls to external functions are not resolved yet. Since this is machine code it's not readable. But still see, it will look as bellow,<br />
<br />
<script src="https://gist.github.com/meghanads/5777360.js"></script>
ELF string in file tells that this is Executable and Linkable Format.<br />
<br />
<b><span style="color: #990000;">4. Linking</span></b><br />
So, this is the final stage of compilation process. It does linking of function calls and their definitions. Like printf() function. Until now this code doesn't know anything about printf(). It only puts place holder at the place of function call. At his stage actual function call printf() gets resolved and function address gets plugged-in.<br />
<br />
function of linker:<br />
1. Plug-ins actual function address<br />
2. It also adds some extra code/info in your file. To run our code we need to submit it to system, so this stage adds some extra code to your code like, at start of code OS needs to set some environment variables, command line arguments plus some OS specific code so that OS can signal your application. Also to while exiting, code needs to return some variables to OS which will help to maintain the status of code and its environment. This all extra things will be added by linker.<br />
<br />
To verify it, do following,<br />
<br />
<script src="https://gist.github.com/meghanads/5777684.js"></script>
<br />
<div>
<b><span style="color: #990000;"><br /></span></b></div>
<div>
At least you can see that size of executable is lager than object file.</div>
<div>
<br /></div>
<div>
So, now you know<span style="color: #990000; font-style: italic;"> Life of C</span>, the stages that your code needs to go through before becoming executable. This is just a tip of an ice-burg, there is lot more if you want to go into details.</div>
<div>
<br /></div>
<div>
Next part of the <span style="color: #990000; font-style: italic;">Life of C</span>, will contain the life of your executable, what all happens when you submit it to OS to run.</div>
<div>
<br /></div>
<script src="https://gist.github.com/meghanads/5777730.js"></script>
<br />
<div>
<br /></div>
<div>
Cheers!!! </div>
<div>
<b><span style="color: #990000;"><br /></span></b></div>
</div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com1Kings Langley, Hertfordshire, UK51.716249 -0.4561569999999619551.6768965 -0.536837999999962 51.7556015 -0.37547599999996195tag:blogger.com,1999:blog-2682213998492205970.post-60928482188452717792013-06-05T00:12:00.001+05:302013-06-05T00:12:16.525+05:30How to fix "VPN client driver encountered an error" on Windows 7/8 : Cisco AnyConnect VPN ClientThis is most common problem with the windows 7/8.<br />
While connecting to the corporate (or personal) network using Cisco AnyConnect VPN Client it gives error massage as bellow,<br />
<blockquote class="tr_bq">
<span style="color: red;">" The VPN client driver has encountered an error"</span></blockquote>
<br />
Solution is very simple, its just error in driver name in windows registry for VPN client driver.<br />
<br />
<ul>
<li><b>Solution: (Windows 8)</b></li>
</ul>
1. Press Windows key to go to start menu<br />
2. type "<span style="color: #783f04;">regedit</span>" and hit enter, you will enter into Registry Editor window<br />
3. Go to registry key "<span style="color: #783f04;">DisplayName</span>" for vpn client driver as follows:<br />
<br />
<blockquote class="tr_bq">
<span style="color: #cc0000;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vpnva\DisplayName</span></blockquote>
<br />
4. Double click on "<span style="color: #783f04;">DisplayName</span>" and remove everything before <i>"Cisco AnyConnect VPN Virtual Miniport Adapter for Windows"</i> <br />
<br />
For Example:<br />
<blockquote class="tr_bq">
<b>replace:</b> <i>"<strike>@oem8.inf,%vpnva_Desc%;</strike>Cisco AnyConnect VPN Virtual Miniport Adapter for Windows"</i> </blockquote>
<blockquote class="tr_bq">
<b>with:</b> <span style="color: #cc0000;"><i>"Cisco AnyConnect VPN Virtual Miniport Adapter for Windows"</i> </span></blockquote>
<br />
5. Click on "OK" and (re)start Cisco AnyConnect VPN Client<br />
6. Enter your vpn server (e.g. myvpn.company.com), and enter your credentials as requested.<br />
7. Click on Connect, DONE.<br />
<br />
(Similar changes apply to Windows 7) <br />
Cheers!!! <br />
<blockquote class="tr_bq">
<br /></blockquote>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com12tag:blogger.com,1999:blog-2682213998492205970.post-28511786388327960332013-05-24T11:09:00.000+05:302014-06-03T09:51:01.027+05:30Free Source Code Hosting for Personal/Business Use<div dir="ltr" style="text-align: left;" trbidi="on">
Even as student or in life time of Engineer we do many things, many great things (hehe), tonnes of projects, seminars etc. and we never know when we might need to re-touch or re-collect the project codes, presentations, latex reports, documents and so and so ... yes storing them on the optical disk or in some back-up drive is good idea but not the great one... we never know when this stuff stop working, after all we built it... isn't it? So you need to put them in place where they never get lost....on SOURCE CODE HOSTING SITES.<br />
<br />
So there are many free source code hosting sites out there. Some of them can be used for small businesses for sharing and development, most of them comes with version control tools like mercurial (on of the best and easy). Here I am going to introduce you to some of them.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-SeNa_uRanyg/U41NHwkgTdI/AAAAAAAAAJk/jPufPGPo3bc/s1600/bitbkt.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-SeNa_uRanyg/U41NHwkgTdI/AAAAAAAAAJk/jPufPGPo3bc/s1600/bitbkt.PNG" height="320" width="288" /></a></div>
<ol>
<li><b><a href="https://bitbucket.org/" target="_blank">Bitbucket</a>:</b><br class="Apple-interchange-newline" />This is the one of the best source code hosting site suited for small business and of course for personal use too, its closed source site, no one can peek into your repository. For business purpose you can share any repository between FIVE users for free. You need to pay for more than five users. It comes with mercurial and git version control tools. Only disadvantage is that, if you are going to develop some open source tool/project you cant put good wiki pages related to your project.<br class="Apple-interchange-newline" /><br /><div class="separator" style="clear: both; text-align: center;">
</div>
<br class="Apple-interchange-newline" /><br class="Apple-interchange-newline" /><i><b>Advantage</b>: </i>Closed source code, no one can peek into your code, professional tool<br class="Apple-interchange-newline" /><i><b>Disadvantage</b>: </i>No good wiki support<br class="Apple-interchange-newline" /><i><b>Version Control</b>: </i>Mercurial, Git</li>
<div class="separator" style="clear: both; text-align: center;">
</div>
<li><b><a href="http://www.codeplex.com/" target="_blank">CodePlex</a>:</b><br class="Apple-interchange-newline" />This is <i>Microsoft's </i>code hosting site. This is having most elegant interface and awesome wiki support. It also has best code sharing, discussion forum support. It has all facilities that person/group need for open source project development.<br class="Apple-interchange-newline" /> <div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-X13cGV99UMc/UZ76wTNNg5I/AAAAAAAAAFA/ACi8fda4Y9g/s1600/codeplex.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-X13cGV99UMc/UZ76wTNNg5I/AAAAAAAAAFA/ACi8fda4Y9g/s1600/codeplex.png" height="43" width="320" /></a></div>
<br class="Apple-interchange-newline" /><i><b>Advantage</b>: </i>Best suited for open source projects. It has wiki, forum, sharing support, elegant design.<br class="Apple-interchange-newline" /><i><b>Disadvantage</b>: </i>Your code might not be closed.<br class="Apple-interchange-newline" /><i><b>Version Control:</b> </i>Mercurial, Git</li>
<li><b><b><a href="http://code.google.com/" target="_blank">Google Code</a>:</b></b><br class="Apple-interchange-newline" />As can be seen from name itself, its service provided by Google. It also has good facilities, but interfaces are not that good. CodePlex is better than this, which provides same (more) services in elegant way. But one advantage is that, its linked to your Google mail account.
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-QvlGBSZsOTc/UZ762-wz84I/AAAAAAAAAFI/GL9FqMjJDIw/s1600/googlecode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-QvlGBSZsOTc/UZ762-wz84I/AAAAAAAAAFI/GL9FqMjJDIw/s1600/googlecode.png" height="73" width="320" /></a></div>
<br class="Apple-interchange-newline" /><br class="Apple-interchange-newline" /><i><b>Advantage</b>: </i>Gives all basic tools with simple interface. Linked to your Google account, wiki support.<br class="Apple-interchange-newline" /><i><b>Disadvantage</b>: </i>Interface is simple, your code might not be closed.<br class="Apple-interchange-newline" /><i><b>Version Control:</b> </i>Mercurial, Git</li>
</ol>
<div>
<br /></div>
<div>
<br /></div>
<div>
So, in short if you are looking for personal, closed source backup tool or small business source sharing tool BitBucket it best suited for you. If you are open source enthusiast CodePlex is best suited. Google Code is just an alternative if you are looking for...</div>
<div>
<br /></div>
<div>
Cheers !!! </div>
</div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-8503752671209894302013-05-23T18:26:00.000+05:302013-05-23T19:03:26.203+05:30Create your own Linux (custom) commandsHi,<br />
Most of the time we need to use some commands repeatedly while working. It's just annoying to type them again and again, of course we can use reverse search [ctrl+r] for reverse command search but I am lazier than that ;)<br />
<br />
Here are couple of ways to customize (or get more lazy) Linux commands,<br />
<br />
<ul>
<li><b>Use Aliases to Customize Linux Commands:</b></li>
</ul>
<br />
<div>
This is actually for small commands (can be used for large ones also). You can set it in terminal as bellow,</div>
<div>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $alias ll='ls -l'
</code></pre>
<br />
Now onward whenever you execute <span style="color: #b45f06;">'ll</span>' command it will work as '<span style="color: #b45f06;">ls -l</span>', so simple.<br />
<br />
Another way is to add aliases in <span style="color: #b45f06;">.bashrc</span> file in your home directory so it will become permanent.<br />
e.g. put following at end of <span style="color: #b45f06;">~/.bashrc</span><br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> # Aliases:
alias ll='ls -l'
alias la='ls -a'
</code></pre>
</div>
<br />
<div>
<ul>
<li><b>Write shell scripts for your commands:</b></li>
</ul>
<div>
<div>
This is when you need some larger scripts as your shorten command. In this case you can write script and put them under bin directory in your home directory. You also need to give exe permission to the script.<br />
<br />
e.g I want to make following script as my Linux command. This script initializes the current directory as root for cscope and also creates cscope database for recursive directory structure,<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> #!/bin/bash
# cscope_init script
# Creating cscope database for large project
# with recursive deirectory structure
# First go to root dir of the source code
# Run this script - cscope_init $PWD
if test $# -ne 1; then
echo "usage - $0 <PROJ_ROOT>"
exit 1
fi
echo "PROJ_ROOT - $1"
cd /
find $1 -name "*.[ch]" -o -name "*.asm" > $1/cscope.files
cd $1
cscope -b -q -k
echo "Done!
</code></pre>
</div>
<ol>
</ol>
<div>
write this script to <span style="color: #b45f06;">cscope_init</span> file, and add permission to execute it.<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $chmod +x cscope_init
</code></pre>
<br />
Now copy this file to<span style="color: #b45f06;"> ~/bin/cscope_init. </span>Now onward you can run following command in any directory to create recursive cscope database for that directory,<br />
<br /></div>
<div>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $cd /path/to/project/root/directory
$cscope_init $PWD
</code></pre>
<br />
Result,
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> PROJ_ROOT - /path/to/project/root/directory
Done!
</code></pre>
<br />
Done!!!!!!<br />
<br /></div>
</div>
</div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com2tag:blogger.com,1999:blog-2682213998492205970.post-28855850317194437092013-04-28T04:39:00.000+05:302013-04-28T04:41:16.900+05:30Monitoring dynamic changes in dmesgBy running following command in terminal allowes you to monitor dynamic changes in dmesg.<br />
<br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $ watch "dmesg |tail -15"
</code></pre>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0Watford, Hertfordshire, UK51.656489 -0.3903199999999742451.4988965 -0.71304349999997418 51.8140815 -0.067596499999974247tag:blogger.com,1999:blog-2682213998492205970.post-43733630207222429232013-04-27T17:52:00.000+05:302013-04-27T17:52:23.568+05:30Resizing the image and convert between image format<span style="background-color: white; font-family: Candara, sans-serif; font-size: 13px;">Use the <a href="http://www.imagemagick.org/script/convert.php" target="_blank">convert</a></span><span style="background-color: white; font-family: Candara, sans-serif; font-size: 13px;"> program to convert between image formats as well as resize an image. It has ability to crop, change aspect ratio of image etc. </span><br />
<span style="background-color: white; font-family: Candara, sans-serif; font-size: 13px;"><b><br /></b></span>
<span style="background-color: white; font-family: Candara, sans-serif; font-size: 13px;"><b>Resizing image to exact size:</b></span><br />
<span style="background-color: white; font-family: Candara, sans-serif; font-size: 13px;"><b><br /></b></span>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> convert <input_img> -resize 300x200^ -gravity center -extent 300x200 <output_img>
</code></pre>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-17513841691711943522012-08-06T09:57:00.000+05:302013-04-09T15:10:14.501+05:30Failed to read NTFS $Bitmap: Input/output error<div dir="ltr" style="text-align: left;" trbidi="on"><ul style="text-align: left;"><li><b>ERROR:</b><blockquote class="tr_bq">Error mounting /dev/sdb2 at /run/media/user/Study: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdb2" "/run/media/user/Study"' exited with non-zero exit status 13: ntfs_attr_pread_i: ntfs_pread failed: Input/output error<br />Failed to read NTFS $Bitmap: Input/output error<br />NTFS is either inconsistent, or there is a hardware fault, or it's a<br />SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows<br />then reboot into Windows twice. The usage of the /f parameter is very<br />important! If the device is a SoftRAID/FakeRAID then first activate<br />it and mount a different device under the /dev/mapper/ directory, (e.g.<br />/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation<br />for more details.</blockquote></li><li><b>REASON:</b><br /><br />This is due to fragmentation problem of the NTFS partition<br /></li><li><b>SOLUTION:</b><ul><li>Windows - Run command prompt in Administrative mode<br />run following command:<br /><br /><blockquote class="tr_bq" style="background-color: black; color: white;"><span style="background-color: black;">chkdsk /r f:</span></blockquote>(help - <a href="http://technet.microsoft.com/en-us/library/cc730714%28v=ws.10%29.aspx" target="_blank">command manual </a>)<br /><br />(if partition is "F")</li><li>Linux (fedora/ubuntu) - install "ntfsprogs" package<br />Run following command:<br /><blockquote class="tr_bq"><pre style="background-color: white; color: white;"><code><span style="background-color: black;">$ ntfsck /dev/sda1 #If your partition is /dev/sda1</span>1</code></pre></blockquote></li></ul><b><br /></b><br /><br /><br /><br /><blockquote class="tr_bq"><br /></blockquote> </li></ul></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-31432538804240787902012-07-27T16:33:00.000+05:302013-04-28T04:53:39.964+05:30samba share - ctags: Warning: cannot open source file "directory" : Value too large for defined data type<div dir="ltr" style="text-align: left;" trbidi="on">
<ol style="text-align: left;">
<li><b>Reason</b>: Samba share mounted from windows in linux (fedora) may be read-only check in windows by going to properties of folder.</li>
<li><b>Solution</b>: if its marked as read-only, un-check box.</li>
<li><b>fstab</b>: add following lines at end of your /etc/fstab file</li>
</ol>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> //server/share_name /path/to/mount/point cifs rw,uid=1000,gid=1000,credentials=/home/user_home/smbcredential_file,dir_mode=0755,file_mode=0755 0 0
</code></pre>
<ol style="text-align: left;">
<li><b>details</b>: add your credentials to smbcredentials_file:</li>
</ol>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> username=server_username
password=server_password
</code></pre>
</div>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-37734065549116499052012-07-25T16:44:00.000+05:302013-04-09T15:10:14.528+05:30openGL : Fedora 17 : undefined reference to symbol 'cos@@GLIBC_2.0'<div dir="ltr" style="text-align: left;" trbidi="on"><ol style="text-align: left;"><li><b>ERROR</b>:<br /><br />gcc wave.o -o wave -I/usr/include -L/usr/lib -lglut -lGL -lGLU -lX11 -m32<br />/usr/bin/ld: wave.o: undefined reference to symbol 'cos@@GLIBC_2.0'<br />/usr/bin/ld: note: 'cos@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line<br />/lib/libm.so.6: could not read symbols: Invalid operation<br />collect2: error: ld returned 1 exit status</li><li><b>Solution:</b><br />Add '-lm' flag while compiling.<br /><br /><span style="background-color: black; color: white;">gcc wave.o -o wave -I/usr/include -L/usr/lib -lglut -lGL -lm -lGLU -lX11 -m32</span></li></ol></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com1tag:blogger.com,1999:blog-2682213998492205970.post-42411458563968303832012-07-24T13:57:00.000+05:302013-04-09T15:10:14.539+05:30Sharing using SAMBA on fedora 17<div dir="ltr" style="text-align: left;" trbidi="on"><ol style="text-align: left;"><li><b>Install SAMBA in fedora 17:</b></li><ul style="background-color: black; color: white;"><li>$ sudo yum install system-config-samba samba-client samba-common samba system-config-samba system-config-users</li></ul><li><b>Set SElinux permissions:</b></li><ul><li style="background-color: black; color: white;">$ sudo yum install policycoreutils-gui</li><li>in gnome go to Administration > SELinux Management and check (set) the following booleans</li><ul><li>Allow qemu to share any file/directory read/write</li><li>Allow samba to share users home diectory </li><li>Allow samba to export ntfs/fusersfs volumes</li></ul></ul><li><b>Configure Firewall</b> :</li><ul><li>check the samba box in System > Administration > Firewall</li></ul><li><b>Configure SAMBA:</b></li><ol><li><b>Adding users:</b></li><ul><li><b> </b>Go to System > Administration > Samba > Preferences > Samba Users > Add User</li></ul><ul><li> Then to edit the Samba share that was created earlier, click on the share then > File > Properties > Access > Give access to users or choose to give access to everybody.</li></ul><li><b>Sharing user's HOME directory:</b>Here is configuration file /etc/samba/smb.conf<br /><span style="color: #990000;">(<b>NOTE</b>: make changes in above file look as bellow and do not change other options, leave other settings as it is) </span><br /><br />########## PART of smb.conf file #############<br /><blockquote class="tr_bq">#=======Global Settings=======<br />[global]<b> </b> <br />workgroup = WORKGROUP<br />server string = YOURSERVER<br />netbios name = YOURSERVER<br />interfaces = eth0 192.168.92.3/24<br /># ----------------------- Standalone Server Options -------------------<br />security = user<br />#------------------------ Name Resolution -------------------------------<br />wins support = yes<br />#========= Share Definitions ===========<br />[homes]<br /> comment = Home Directories<br />; browseable = yes<br /> writable = yes<br /> valid users = %S<br /><br />[your_share]<br /> path = /path/to/your_share<br /> read only = no<br /> browseable = no<br /> valid users = username</blockquote>#######################################<br /> </li></ol></ol> 5. <b>Accessing share:</b><br /><ul style="text-align: left;"><ul><li>Access users HOME sharing:<br /><br />In windows go to <b>Run> \\YOURSERVER\samba_username</b><br /><br />Enter your username and password of samba user.</li><li>Auto mount as Network drive:<br />Right-click on <b>computer>Map network drive</b><br /><br />choose <b>Drive</b> from drop down (e.g. L:)<br /><br />At <b>Folder</b> enter <b>\\YOURSERVER\samba_username </b>to access home directory share or enter <b>\\YOURSERVER\your_share </b>to access shared directory.</li></ul></ul></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-13298830209178292502012-07-23T15:41:00.000+05:302013-04-28T05:24:36.712+05:30Installing openGL on Fedora 17<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Steps to install openGL on fedora 17:</b><br />
<b>Installing:</b><br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $sudo yum install freeglut-devel build-essential </code></pre>
<div>
<b>Compiling sample program:</b></div>
<div>
<ol style="text-align: left;">
<li>Get sample programs from <a href="http://www.opengl.org/archives/resources/code/samples/simple/" target="_blank">SAMPLE PROGRAMMS</a></li>
<li>Makefile:</li>
</ol>
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> LDFLAGS=-lglut -lGL -lGLU -lX11 -lm
INCLUDES=-I/usr/include
LIBS=-I/usr/lib
CC=gcc
SOURCES=wave.c teapot.c logo.c
TARGETS=$(SOURCES:.c= )
DEPS=
OBJS=$(SOURCES:.c=.o)
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(INCLUDES) $(LIBS) $(LDFLAGS)
wave: $(OBJS)
$(CC) $@.o -o $@ $(INCLUDES) $(LIBS) $(LDFLAGS)
teapot: $(OBJS)
$(CC) $@.o -o $@ $(INCLUDES) $(LIBS) $(LDFLAGS)
logo: $(OBJS)
$(CC) $@.o -o $@ $(INCLUDES) $(LIBS) $(LDFLAGS)
.PHONY: clean
clean:
rm -f $(OBJS) $(TARGETS) </code></pre>
</div>
</div>
<span style="background-color: white;">E.g. Compiling wave.c</span><br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $make wave </code></pre>
<b style="background-color: white;">Running program:</b><br />
<span style="background-color: white;">E.g. To run wave.c program</span><br />
<pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $./wave
</code></pre>
<span style="background-color: white;"> </span><br />
<span style="background-color: white;"><br /></span>
Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-73355172776041867402012-04-24T01:05:00.000+05:302013-04-09T15:10:14.570+05:30Grep excluding .svn directories<div dir="ltr" style="text-align: left;" trbidi="on"><br /><ol style="text-align: left;"><li>Temporary/one-time solution:</li></ol><blockquote class="tr_bq"><span style="background-color: white; font-family: 'Courier New', Courier, monospace;">grep -Rin "what r u looking for" *|grep -v "\.svn/*"</span></blockquote> 2. Permanent solution (for Ubuntu/Linux) - add following line to ~/.bashrc<br /><blockquote class="tr_bq"><span style="background-color: white; font-family: 'Courier New', Courier, monospace;">export GREP_OPTIONS="--exclude=*\.svn*"</span></blockquote></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-83345447210785029172012-04-16T01:31:00.000+05:302013-04-09T15:10:14.590+05:30Linux Kernel Cross-compilation for ARM based systems<div dir="ltr" style="text-align: left;" trbidi="on"><span class="Apple-style-span" style="font-family: inherit;">Here is the link for small presentation regarding cross-compilation of Linux kernel for arm based systems. Presentation also includes <span class="Apple-style-span" style="line-height: 18px;">guide for how to edit existing Linux drivers to adapt to your application.</span></span><br /><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="line-height: 18px;"><br /></span></span><br />link : <a href="https://sites.google.com/site/meghanads/stuff-1/linux-kernel-compile---arm" target="_blank">Linux Kernel Compilation-ARM</a></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-39999743551259478832012-04-08T18:22:00.000+05:302013-04-09T15:10:14.612+05:30Download Youtube Videos on Linux (Behind Proxy)<div dir="ltr" style="text-align: left;" trbidi="on"><ul style="text-align: left;"><li>Install youtube-dl</li><ul><li>Ubuntu: sudo apt-get install youtube-dl</li><li>Fedora: sudo yum -y install youtube-dl</li></ul></ul><ul style="text-align: left;"><li> Open terminal and export http_proxy</li><ul><li>export http_proxy=http://username:passwd@proxy.com:port_num/</li></ul></ul> ( escape spacial characters in password by '\')<br /><ul style="text-align: left;"><li>Download videos</li><ul><li>youtube-dl --all-formats url-of-video</li></ul></ul></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-23138433540857412512011-11-30T01:52:00.000+05:302013-04-09T15:10:14.632+05:30C Program to find endianness ...<div dir="ltr" style="text-align: left;" trbidi="on"><br />#include stdio.h<br /><br />typedef union s{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>int i;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>char c[4];<br />} Utype;<br /><br />int main()<br />{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>Utype u;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>char c;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>u.i = 0x12345678;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf(" %p - 0x%X\n", &u.i, u.i);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf(" %p - 0x%X\n", &u.c[0], u.c[0]);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf(" %p - 0x%X\n", &u.c[1], u.c[1]);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf(" %p - 0x%X\n", &u.c[2], u.c[2]);<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf(" %p - 0x%X\n", &u.c[3], u.c[3]);<br /><br /><span class="Apple-tab-span" style="white-space: pre;"> </span>c = (u.i & 0x00000078);<br /><br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if(c == u.c[0])<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf("\n***LITTLE ENDIEN***\n");<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>else<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>printf("\n***BIG ENDIEN***\n");<br />}<br /><div><br /></div></div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0tag:blogger.com,1999:blog-2682213998492205970.post-47185714061589095782011-11-11T02:35:00.000+05:302013-04-09T15:10:14.765+05:30Python Digital Circuit Simulator<div dir="ltr" style="text-align: left;" trbidi="on"> If anyone is looking for the digital circuit simulator in python can refer to my project on google code hosting <a href="http://code.google.com/p/pydlcs/wiki/Introduction" target="_blank">Pydlcs</a>. It provides basic digital elements like AND, OR gates, some combinational elements (e.g. half/full adder, mux/demux) and sequential elements (e.g. D-flipflop). You can create and simulate any digital circuit using this basic elements in this simulator.<br /><br /><br />HAVE FUN :)</div>Meghanad Shingatehttp://www.blogger.com/profile/08129120937019228138noreply@blogger.com0Mumbai, Maharashtra, India19.0176147 72.856164418.7774257 72.5403074 19.2578037 73.172021399999991