<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Posts Tagged With 'Linux' RSS Feed</title>
    <link>http://www.programmersheaven.com/blog/tags/Linux</link>
    <description>Contains the latest posts from the Programmer's Heaven blogs that are tagged with the label 'Linux'</description>
    <lastBuildDate>Sun, 07 Sep 2008 15:51:19 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <item>
      <title>Running C# .NET Applications On Fedora 8 Linux</title>
      <link>http://www.programmersheaven.com/user/digioz/blog/89-Running-C-NET-Applications-On-Fedora-8-Linux/</link>
      <description>One of the main challenges and the reason most corporations choose to target a windows operating system for their custom applications is that developing custom linux applications is not something that most entry level developers know how to do. To acomplish this they would have to rely on some of the most unreliable groups of programmers to control in the business: The Linux GUI or Java GUI Developers, both of which are hard to find, and even harder to manage. Some have even been known to walk off of jobs just because they weren't given enough of a say on how their master pieces should run and function!&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is changing all of that through the use of the Mono Project. The Mono Framework, is a Framework that is essentially a carbon copy of all the libraries in the original .NET Framework, compiled for other platforms like Linux, Mac OS X, Solaris and even Nokia 770 and 800 Devices! This puts the .NET Framework a step ahead of other frameworks like Java, because of the fact that it turns your standard C# developer (very easy to please group) to do the work that Java type developers used to do. Needless to say that this phenomenon is speading like wildfire through more and more coprorations, because now you can develop applications on your standard Windows .NET Development environment, and have it run on Linux, which comes free! To make things even more convinient, you can even write Webservices and other types of .NET Applications for Linux!&lt;br /&gt;
&lt;br /&gt;
It shouldn't come as a big surprise therefore that Fedora 8 Linux distribution (Redhat) comes with the Mono framework pre-installed fresh out of the box. I have also noticed a surge in the number of open source C# linux projects on open source community sites like SourceForge.net that take advantage of the Mono framework to write fairly complex linux applications in record time, and take advantage of the CLR type debugging that the framework has to offer to find bugs and fix them even faster.&lt;br /&gt;
&lt;br /&gt;
Most developers at one point or another have thought about installing a linux OS on a Virtual Machine like "Microsoft Virtual PC 2007", which can be downloaded for free HERE simply because that way they wouldn't have to take up a whole PC for testing on a Linux OS, and at the same time this allows them to try out several different flavors (distributions) of linux on the same machine. Most of you however are discouraged when you notice that neither your Mouse, Nor your Display (either one or both) functions, which eventually forces you to delete the whole virtual PC and forget about linux yet once more, cursing Microsoft for not making their Programs a bit more competitor friendly! I am here however to tell you that it IS POSSIBLE to run a Linux OS on a Virtual Machine (with a few tweaks to the grub booting agent).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;THE OPERATING SYSTEM - Fedora 8&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
For my experiment with the Mono Framework, I choose Fedora 8, since I have worked with other Redhat products in the past, and find it to be one of the most active Linux distributions out there. I probably would have considered Open SuSE 10.3 instead, if they had the mono framework preinstalled on it like Fedora 8 does (call me lazy, but that's a good hour or two that I don't have to keep messing with the OS to get mono working correctly, which I can spend on other thing like figuring out how to run the OS on Virtual PC and work).&lt;br /&gt;
&lt;br /&gt;
So go ahead and grab the ISO image for Fedora 8 from HERE. This is the DVD ISO image, which you have to burn on a DVD to install Fedora 8. Other download options can be found HERE. Be prepared to take a nice long 3-4 hour coffee break while it is downloading, just don't overdue it with the coffee, because then you got to take a bathroom break every 5 minutes while trying to do the work, and that makes it hard to focus on the task at hand. :)&lt;br /&gt;
&lt;br /&gt;
While you are waiting for the Fedora image to download, go ahead and grab a copy of Microsoft Virtual PC 2007 for Free (special thanks to our good friend Billy Gates for that) from HERE. I assume that everyone knows how to do a simple install of this, so I am not going to walk you through that part. I ran my experiment on a Windows XP SP 2, but Virtual PC does also install on Windows Vista (even though you get a warning that it is not a supported OS, but it still runs). Run Virtual PC, and you should see this screen:&lt;br /&gt;
&lt;br /&gt;
[includethumb:1]&lt;br /&gt;
&lt;br /&gt;
Click on "New" to create a new virtual PC. Hit "Next" to go to the next screen. Choose "Create a Virtual Machine" and hit "Next". On the next screen, enter "Fedora 8" for description and go to the next screen. Notice that it automatically selects OS of "Other" for you. Accept it and hit "Next". Check "Adjust the Ram" and enter 512 for your RAM. Select "A New Virtual Hard Disk", go to the next screen and select the default path and hard drive size and click "Finish" to complete.&lt;br /&gt;
&lt;br /&gt;
Hopefully your Fedora 8 download is done at this point. Burn the ISO image to a DVD with your favorite DVD burning software and pop it in your drive. You should have a new icon in your Virtual PC Console called "Fedora 8" at this point. Select it and click on "Start" to start the install process. You may have to reset the virtual machine once to get thei Fedora 8 installer to work right. Go to "Action &amp;gt; Reset" to reboot the Virtual Machine.&lt;br /&gt;
&lt;br /&gt;
The actual Fedora 8 installation is sadly not a very straight forward process, because you will have to tweak it to get the Mouse and Display to work right. I am not going to go through every detail of the install process, but to get the Display and Mouse to work correctly:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Install: Hit the button and add the following to the boot line:&lt;br /&gt;
&lt;br /&gt;
vmlinuz initrd=initrd.img vesa i8042.noloop&lt;br /&gt;
&lt;br /&gt;
After Install: Stop reboot at the grup by hitting the ESC key or Spacebar. Press "e" to edit the boot line, and add the "i8042.noloop" to the second line. Hit "Enter" key followed by pressing the "b" key to boot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To Fix Mouse Problem for good: After logging in, go to Applications &amp;gt; System Tools &amp;gt; Terminal, and enter the following:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
su
nano /boot/grub/menu.lst
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
sunano /boot/grub/menu.lstGo down to the line that starts with "Kernel" and add "i8042.noloop" to the end of that line. Press Ctrl+O to write out, hit "Enter" followed by a Ctrl+X to exit out. Reboot and you should be good to go. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Running Standard .NET Applications&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Lets first start by logging in as your regular user. I have created two test applications using C#, which can be downloaded from my website. The Command Line Test Application can be downloaded HERE and the GUI TEST Application from HERE. Both of those are simple "Hello World!" type applications written in C#. One outputs it to the Command Prompt and the other pops up a GUI messagebox for it, to proove the concept.&lt;br /&gt;
&lt;br /&gt;
If you are a hardcore windows application developer, the first thing you will do is to double click on the executables once you have them downloaded on your Fedora Desktop. If you did that, you would see the following message:&lt;br /&gt;
&lt;br /&gt;
[includethumb:2]&lt;br /&gt;
&lt;br /&gt;
You are NOT in Windows any more, so snap out of it! You can't just go around double clicking on a windows application on Linux! What you have to do instead is to call mono and have it launch your program for you instead. So lets do that real quick. Go to "Applications &amp;gt; System Tools &amp;gt; Terminal" and open a new Terminal window. Next, navigate to the folder you downloaded the "exe" files to (in my case its "/home/Pedram/Documents") and type "mono HelloWorldCS.exe". You will get the output "Hello World!" back, showing you that everything is working OK. Congratulations! You have just run your first .NET Application on Linux! Here is what your desktop should look like at this point:&lt;br /&gt;
&lt;br /&gt;
[includethumb:3]&lt;br /&gt;
&lt;br /&gt;
Getting our GUI Application to run is a bit more complicated then this. Don't get me wrong, the process is exactly the same. But there are some file permission issues with it that I myself have yet to figure out. So lets do the same for our GUI Application. Type "mono HelloWorldGUICS.exe" in your Terminal Window. You would expect to see a standard messagebox like this:&lt;br /&gt;
&lt;br /&gt;
[includethumb:4]&lt;br /&gt;
&lt;br /&gt;
But instead, the first time you run it, you will see an error message saying Mono can not find GDI+ library. That's because the first time you run the GUI "exe", mono tries to recompile it to a Linux compatible application before runnning it, but does not have permission to several critical GUI related libraries! Log out as your regular user, log back in as "root" user and try the same thing. This time you should get the correct message pop up.&lt;br /&gt;
&lt;br /&gt;
If you now go back and log in as your original user, you will notice that you can now run this application as your regular user as well! That's because the GUI Application has already been compiled by the root user, and Mono grabs that compiled version when you try to run the Application under a regular user.&lt;br /&gt;
&lt;br /&gt;
At this point you are probably ready to shout for joy, jump up and down and start coding all kinds of weird .NET GUI Applications for Linux. But with Fedora 8 being a newly release Operating System, and having the advanced security system on it that kind of behaves like Vista Security, there will be all kinds of error messages that will pop up here and there that will puzzle the heck out of you. If you do come across some weird error message that you would like to share with me or get my opinion on, email me at webmaster@digioz.com to talk about it. Best of luck with Mono!&lt;br /&gt;
&lt;br /&gt;
Pete Soheil&lt;br /&gt;
DigiOz Multimedia&lt;br /&gt;
&lt;a href="http://www.digioz.com/"&gt;http://www.digioz.com/&lt;/a&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/user/digioz/blog/89-Running-C-NET-Applications-On-Fedora-8-Linux/</guid>
      <pubDate>Sun, 09 Dec 2007 19:21:29 -0700</pubDate>
      <dc:creator>digioz</dc:creator>
    </item>
    <item>
      <title>Using screen To Survive SSH Disconnects</title>
      <link>http://www.programmersheaven.com/user/pheaven/blog/63-Using-screen-To-Survive-SSH-Disconnects/</link>
      <description>You've used SSH to log into a shell account on a remote Linux or UNIX server and are happily waiting for a large download or a long compile to complete. All of a sudden, the connection between you and the server is dropped. You log back in, but what you were doing has stopped and you'll have to start again. How annoying!&lt;br /&gt;
&lt;br /&gt;
Recently I have started using &lt;a href="http://www.gnu.org/software/screen/"&gt;screen&lt;/a&gt;. This allows you to start additional terminals that you can attach to and detach from. Being able to switch between them means that you can be running a large compile or download and still be able to get on with other things. That's nice, but what is really cool is that these terminals will last between your SSH sessions.&lt;br /&gt;
&lt;br /&gt;
This means that you can start a screen terminal, do some work in it, detach from it, log out, go to another computer, log in again, re-attach to the terminal and it's as if nothing ever happened. If your connection is dropped, then the screen terminal will still be there too - just reconnect, re-attach and keep going.&lt;br /&gt;
&lt;br /&gt;
So, this must be really hard, right? Wrong!&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Check Screen Is Installed &lt;/h3&gt;&lt;br /&gt;
First, we'd best make sure the screen program is installed. Once you have SSH'd into the box that you are interested in being able to use screen on, issue the command&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;screen -v&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The result of doing this should look something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen -v
Screen version 4.00.03 (FAU) 23-Oct-06&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
If not, then you need to install screen. How to do this will vary depending on what package manager, operating system and/or distribution you are using. Consult your usual source of packages. Alternatively, you can build and install screen from the &lt;a href="http://www.gnu.org/software/screen/"&gt;source&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Starting A New Screen Terminal &lt;/h3&gt;&lt;br /&gt;
Starting a new screen terminal is as straightforward as typing:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;screen&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The result of this will be a copyright notice with a prompt to press enter or space. Do either of these, and you will be presented with a normal shell prompt. You are now running inside a screen terminal. To demonstrate this, we will run some long-running command, then detach from the terminal, disconnect, reconnect and reattach.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Running Commands &lt;/h3&gt;&lt;br /&gt;
You can run things inside of screen just as you normally would. For example, we can run this one-line Perl insult script, which will insult you every ten seconds. Leave it for a little while to print the first message.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ perl -e 'while(sleep 10){print reverse split //, "\n!llems uoY"}'
You smell!
You smell!
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Detaching From A Terminal &lt;/h3&gt;&lt;br /&gt;
Now we want to detach from this terminal. Hold down the "Control" key on your keyboard and press "a" once. Now release ALT and press "d". You will find yourself back at the terminal where you started screen.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen
[detached]
jnthn@jnthn:~$&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Notice that you were able to detach while a program was still running. Our insult program is in fact still running in the background.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Reattaching To A Terminal &lt;/h3&gt;&lt;br /&gt;
We want to reattach to the terminal to see how our insult program is doing. This is achieved using the "-r" flag, along with specifying the terminal that we want to reattach to. The thing is, how do we find out what it is called? The answer lies in the "-list" flag, which provides a list of all terminals.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen -list
There are screens on:
        9547.pts-39.jnthn     (Detached)
1 Sockets in /var/run/screen/S-jnthn.&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
We can now take the name of the terminal and reattach to it.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen -r 9547.pts-39.jnthn&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Where we will see that we have been insulted plenty. Do Ctrl+a,d again to detach. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Surviving A Disconnect &lt;/h3&gt;&lt;br /&gt;
Back in the original terminal, type exit to end the SSH session.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ exit&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
This is a controlled disconnect, where you detached from the screen terminal first. If you reconnect now, you will find that your terminal is still in this list.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen -list
There are screens on:
        9547.pts-39.jnthn     (Detached)
1 Sockets in /var/run/screen/S-jnthn.&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Then you can reattach as before. It may happen that your disconnect is not controlled though - you lose the connection while inside your screen terminal. If this happens, the terminal may not be detached properly. In this case, when you reconnect you should also supply the "-d" flag. This will detach the terminal if it is currently attached "elsewhere". This is also useful if you forgot to detach when logged in from a different computer, and if you are still logged in there.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen -r -d 9547.pts-39.jnthn&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
You can shorten that to:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ screen -rd 9547.pts-39.jnthn&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Ending A Screen Terminal &lt;/h3&gt;&lt;br /&gt;
If you are finished with a screen terminal, simply attach to it and use the usual exit command.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;jnthn@jnthn:~$ exit&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Back in the terminal where you started screen, you will see the message:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;[screen is terminating]&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Being on IRC, 24/7 &lt;/h3&gt;&lt;br /&gt;
While screen is useful for all of the above things, for me it is most useful when combined with an IRC client. I work on a medium-sized open source software project and there is an IRC channel where a lot of the developers hang out. Using &lt;a href="http://www.irssi.org/"&gt;irssi&lt;/a&gt; (a text-based IRC client) and screen, I stay connected to the channel 24/7 and don't miss any messages for me. I can also move between computers easily (a bonus since I may be working in the office, back home or on my laptop if I'm on the road).&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Conclusion &lt;/h3&gt;&lt;br /&gt;
If you work on remote servers regularly, screen is probably a useful tool to know about, whether you're doing compiles or just routine system administration where you'd rather not have a disconnect get in the way of your work too much.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/user/pheaven/blog/63-Using-screen-To-Survive-SSH-Disconnects/</guid>
      <pubDate>Mon, 05 Nov 2007 04:57:53 -0700</pubDate>
      <dc:creator>pheaven</dc:creator>
    </item>
    <item>
      <title>MIcro-kernel linux</title>
      <link>http://www.programmersheaven.com/user/kallolpar/blog/58-MIcro-kernel-linux/</link>
      <description>Linux is easily the most versatile, ubiquitous operating system of our times. Its has presence in handheld embedded devices to the high end enterprise systems. Linux prevalence could be attributed to its Open Source nature and perhaps to the timing of its surge in popularity.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/user/kallolpar/blog/58-MIcro-kernel-linux/</guid>
      <pubDate>Thu, 01 Nov 2007 21:48:14 -0700</pubDate>
      <dc:creator>kallolpar</dc:creator>
    </item>
  </channel>
</rss>