Bash spellchecker

Posted by sp2hari

Spell checking in bash is a cool feature which can be added by adding just one line in your bashrc file.

shopt -s cdspell

That’s all :)
Add that to your ~/.bashrc file.
If you want to enable this for all the users, then append this to your /etc/bash.bashrc (in Ubuntu) or /etc/bashrc (in Fedora). Of course, you need the root privilege to edit the files in /etc.

Now try these
cd /hoem
cd /hoe

Cool right ;)

SSH Client…

Posted by sp2hari

I guess every GNU/Linux user must have sshed from one comp to another sometime or the other. We have different servers for various purposes in our college and ssh is a common thing. Most of the time, we end up typing some thing like

ssh -XCYP hari@spider.nitt.edu

Though not many knows what these options stands for, life will become very simple if you try to understand the command and create a configuration file for ssh and use it when you ssh from one box to another.

The ssh client takes the parameters from three places in the following order.

  • Command line options
  • User-specific configuration file
  • System-wide configuration file

The command line options are the one you specify when connect to other system using the ssh command. For example ssh -X specifies that X11 forwarding should be enabled.

The User specific configuration file is ~/.ssh/config.

The System wide configuration file is /etc/ssh/ssh_config. Note that the configuration file for ssh server (sshd_server) is also found in this folder. The file ssh_config is the configuration file for the ssh client while sshd_config is the configuration file for the server.

Any configuration value is only changed the first time it is set. So if you run the ssh command with X option, X11 will be forwarded no matter what values ~/.ssh/config and /etc/ssh/ssh_config file has. The values are parsed in the order mentioned above.

The User config file gives users the choices to configure ssh client when you ssh often. A config file is explained with an example below.

Host codelabs
    hostname codelabs.nitt.edu
    user hari
    ForwardX11 yes
    port 22

In the above example, very few options were added to make the config file simple. I guess that will be enough for everyone.

The config file has Host blocks. The properties which come under a host are set when you connect to the given to any host. In this example i have used the host machine called codelabs.nitt.edu. You can also specify * to apply to any host or 10.1.39.* to apply to all machines which comes under 10.1.39. series. Remember that the configuration values are set only once. So if * appears in the beginning of your config file, then the configurations which come below that may not be used by the ssh client. For example consider the following configuration file.
Host *.edu
    ForwardX11 yes

Now in the above case when you connect to any server which ends with .edu (spider.nitt.edu, codelabs.nitt.edu …) then the X is forwarded. But if you want to diasable X11 forwarding for spider.nitt.edu, then the following won’ t work

Host *.edu
    ForwardX11 yes
Host spider
    hostname spider.nitt.edu
    ForwardX11 no

This is because in the first block, ForwardX11 is set to yes for all hosts ending with .edu and then it can’t be changed. The correct way to block X11 forwarding for spider is to have a config file as shown below.
Host spider
    hostname spider.nitt.edu
    ForwardX11 no
Host *.edu
    ForwardX11 yes

You can tweak almost everything you need from the public key file, port, number of passwords prompts, compression, ciphers, compression level, user, tunnel, tunnel device and lots more. :) Happy sshing :-)

Gedit Plugin

Posted by sp2hari

In this article, we’ll see how to write plugins for Gedit. Since plugin development is easy in Python, I’m planning to explain this using Python.

When the first caveman programmer chiseled the first program on the walls of the first cave computer, it was program to paint the string “Hello, world” in Antelope pictures. Roman programming textbooks began with the “Salut, Mundi” program. I don’t know what happens to people who break with this tradition, but I think it’s safer not to find out. So we’ll also deal only with HelloWorld in our first plugin.

This plugin is going to do two things. One is to add the string “HelloWorld ” at the cursor position. The next is to convert all “Hello” in the program to “World”. A neat tutorial to write python plugins is can be found at live.gnome.org. Though you can skip that tutorial for now since I’ve explained most of the things one need to know to write this plugin. But i suggest you read that tutorial soon.

Some of the paths you need to know for writing a plugin.

Path Details
/usr/lib/gedit-2/plugins/ System-wide plugins directory
~/.gnome2/gedit/plugins/ User Plugins directory
/usr/share/gedit-2/ Data needed for system-wide plugins.
~/.gconf/apps/gedit-2/ Gedit configuration.
Can be modified using gconf-editor.
/usr/share/gtk-doc/html/gedit gedit Reference Manual

Every python plugin needs at least two files. Let us name our plugin as “frisco”. So we should have two files namely, frisco.gedit-plugin and frisco.py

Let’s start with the contents of frisco.gedit-plugin.
[Gedit Plugin]
Loader=python
Module=frisco
IAge=2
Name=HelloWord
Description=A HelloWorld plugin for Gedit.
Authors=Harishankaran K <sp2hari@gmail.com>
Copyright=Copyright © sp2hari
Website=http://www.sp2hari.com

The contents of this file is almost same for all the plugins. The module, name and description will change for different plugins. If your plugin has the python file frisco.py, then the modulde is frisco.

Note :: We don’t specify the extension in the module name.

The .gedit-plugin file is done now. Next let’s move on to frisco.py.

#!/usr/bin/python

import gedit

class HelloWorldPlugin(gedit.Plugin):
    def __init__(self):
        print "Plugin loaded"

    def activate(self, window):
        print "Plugin activated"

    def deactivate(self, window):
        print "Plugin deactivated"

    def update_ui(self, window):
        pass

This file, frisco.py derives one class from the Gedit.plugin and defines activate, deactivate and update_ui. activate() is called when the plugin is activated. Similarly deactivate() is called when the plugin is deactivated. We will check how our plugin works now.

Run gedit from terminal and check whether your plugin is listed in the plugins list.

You can see that the details you provided in frisco.gedit-plugin can be viewed in the About Plugin and the Credits.

Now enable the plugin and look at shell prompt. You will see the print statements being execute when we activate and deactivate the plugin. :). Wow, our first plugin is ready to add more spice. :-)

Note:: If you get an error saying

WARNING **: Cannot load Python plugin ‘HelloWord’ since file ‘frisco’ cannot be read.

WARNING **: Error activating plugin ‘HelloWord’

Then the file frisco.py is not present in your plugins directory or the python file has an error. Fix the code and try again. You will get the output as shown below.

Frisco Plugin

 

The output for the above plugin in the shell when the plugin is activated and deactivated for a few times will be like


hari@hari-laptop:~$ gedit
Plugin loaded
Plugin activated
Plugin deactivated
Plugin activated
Plugin deactivated
Plugin activated
Plugin deactivated
Plugin activated

Now we have to add functionality to this plugin. A good practice while coding plugin is the create a separate ‘Helper’ Class which will control the window and do all useful actions. It’ll be called once in the main class.

So we will modify the HelloWorldPlugin class as follows

#!/usr/bin/python

import gedit

class HelloWorld(gedit.Plugin):
    def __init__(self):
        gedit.Plugin.__init__(self)
        self._instances = {}

    def activate(self, window):
        self._instances[window] = HelloWorldHelper(self, window)

    def deactivate(self, window):
        self._instances[window].deactivate()
        del self._instances[window]

    def update_ui(self, window):
        self._instances[window].update_ui()

The code for the HelloWorldHelper class will be



class HelloWorldHelper:
    def __init__(self, plugin, window):
        print "Plugin created for", window
        self._window = window
        self._plugin = plugin

    def deactivate(self):
        print "Plugin stopped for", self._window
        self._window = None
        self._plugin = None

    def update_ui(self):
        # Called whenever the window has been updated (active tab
        # changed, etc.)
        print "Plugin update for", self._window

When you run gedit from terminal, now, it will print more details like the Gedit window object. A sample run for the above code is given below

hari@hari-laptop:~$ gedit
Plugin created for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin update for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin update for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin stopped for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin created for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin stopped for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin created for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin stopped for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>
Plugin created for <gedit.Window object at 0x8521504 (GeditWindow at 0x816e000)>

Hereafter there is no need to change the HelloWorldPlugin class. So we’ll work only on the HelloWorldHelper class. We will define a ui_str which will enable us to add a menuitem in the Tools menu.

We will define the ui_str as follows

import gtk 

ui_str = """<ui>
  <menubar name="MenuBar">
    <menu name="ToolsMenu" action="Tools">
      <placeholder name="ToolsOps_2">
        <menuitem name="Insert HelloWorld" action="InsertHelloWorld"/>
        <menuitem name="Change Hello to World" action="ChangeHellotoWorld"/>
      </placeholder>
    </menu>
  </menubar>
</ui>
"""

The activate, deactivate and update ui functions for the HelloWorldHelper Class are modified as follows

    def __init__(self, plugin, window):
        self._window = window
        self._plugin = plugin

        # Insert menu items
        self._insert_menu()

    def deactivate(self):
        self._window = None
        self._plugin = None

        self._remove_menu()
    def update_ui(self):
        # Called whenever the window has been updated (active tab
        # changed, etc.)
        self._action_group.set_sensitive(self._window.get_active_document() != None)

Now we need to write the method insert_menu which will register the callbacks for the actions like inserting hello world and changing hello to world.
The insert_menu function is defined as followed. If you know gtk or pygtk then it’ll be easy for you to understand that code. I’ll advise you to read the basics of pygtk if you plan to write your own plugin.

    def _insert_menu(self):
        # Get the GtkUIManager
        manager = self._window.get_ui_manager()

        # Create a new action group
        self._action_group = gtk.ActionGroup("ExamplePyPluginActions")
        self._action_group.add_actions([("InsertHelloWorld", None, _("Insert HelloWorld"),
                                         None, _("Insert HelloWorld"),
                                         self._inserthelloworld)])
        self._action_group.add_actions([("ChangeHellotoWorld", None, _("Change Hello to World"),
                                         None, _("Change Hello to World"),
                                         self._hellotoworld)])

        # Insert the action group
        manager.insert_action_group(self._action_group, -1)

        # Merge the UI
        self._ui_id = manager.add_ui_from_string(ui_str)

    def _remove_menu(self):
        # Get the GtkUIManager
        manager = self._window.get_ui_manager()

        # Remove the ui
        manager.remove_ui(self._ui_id)

        # Remove the action group
        manager.remove_action_group(self._action_group)

        # Make sure the manager updates
        manager.ensure_update()

Now we are all set the two final functions which will do the required actions. These are defined in the helper class as follows

    def _hellotoworld(self, action):
        doc = self._window.get_active_document();
        if not doc:
            return
        doc.replace_all("Hello", "World", 0);

    def _inserthelloworld(self, action):
        doc = self._window.get_active_document();
        if not doc:
            print "Noe";
            return;
        doc.insert_at_cursor("HelloWorld")

Well, that’s all. Your first plugin is up and running now :-) :-)

The python files used in this example can be downloaded here.

Gedit

Posted by sp2hari

Every GNU/Linux user must be knowing about Gedit. This tiny text editor which comes with gnome is much more powerful than we all think. A few customizations and adding a few plugins will convert this simple text editor into a complete IDE for any programming language. In this article, i have mentioned about the configurations i have made in my box and the plugins which you might find useful.

Any text editor has to be customized according to the need of the end user. The customizations for a C or C++ coder and a PHP or Python coder are totally different. So let me write here according to various needs. Check out in which category you fit in and use those customizations.

The Preferences window in Gedit is the core which converts this simple text editor into a complete IDE. It has features to customize almost everything.

Gedit Preferences

General Configurations

Open Preferences Window (Edit -> Preferences)

In the View Tab

  • Check Enable text wrapping.

I prefer to see the long lines in the same window, which reduces the pain of scrolling across the window using the mouse.

  • Check Display line numbers.
  • Check Highlight current line

In my Ubuntu Studio theme, it wasn’t easy to read when the current line is highlighted. So i disabled this in that theme. So check this whether this suits your gnome theme when you enable this.

  • Highlight matching bracket

An useful option if you are used to getting confused with brackets.

In the Editor Tab

  • Set the Tab width as 4
  • Check Enable automatic indentation
  • Uncheck Create a backup copy of files before saving

Again this depends upon your need. Backup files are created by adding a ‘~’ to the current file name. If you are a web developer and coding in any web development language, better don’t enable this option. Many times these ‘~’ files created might create a security hole in your server. For example, mysql_connect.php file will have a backup called mysql_connect.php~ and your web server will parse the mysql_connect.php but it won’t do the same for the backup file. It’ll just display the source code to the client and thereby your your mysql password is gone :P

  • Check Autosave files every 5 minutes and make that 2 mins

If you don’t have the habit of saving the file often, then this might save you when something terrible happens :P

In the Font & Colors Tab

  • Uncheck the Use the system fixed width font
  • Set the size of the editor font as 10 or 12
  • Choose any one font from the following. Note that Mono space 10 is the system fixed with font.

Standars Symbols L
Serif
Vemana
Sans
Monospace
Mallige Normal
Loma Book

  • I prefer the Classic color scheme. Just three more clicks, you can see all the color scheme and choose anything you like.

In the Plugins Tab

 

Gedit Plugins

This sections makes the gedit a really powerful text editor. By default gedit comes with few standard plugins but you can install more plugins by installing the gedit-plugins package. If you don’t have root access, download the plugins from gedit.org and copy it to your ~/.gnome2/gedit/plugins folder. You can continue if you are lazy to download the plugins now. You can do that when a need arises. ;)

After this jump to section which you might be interested in.

Programming

  • Bracket Completion ( You need to install this plugin)

A plugin which automatically adds closing brackets, single quotes and double quotes. Sometimes really useful and sometimes irritating. When you are typing the code, this is pretty useful but when you are editing a code already written, then this irritates you by adding closing brackets or quotes where you never intended to add.

  • Code Comment ( You need to install this plugin)

A useful plugin for any programmer. You can comment or uncomment a selected block of code.

  • Indent Lines

Very useful when you are specific about the indentation rules. Indents or un-indents a selected block of code. Very useful for python.

  • Snippets

Want to insert a piece of code which just a few keystrokes, then this is for you. Yes lesser keystrokes than Ctrl C Ctrl V.

  • External Tools

This gives amazing power to manipulate anything within gedit. I guess i can’t write about this here. Check out this post about External Tools. And don’t skip that post. It’s the BEST plugin for gedit.

HTML

Download the HTML tidy plugin from here and extract the folder to your ~/.gnome2/gedit/plugins folder. Enable the HTML Tidy plugin from the plugins tab in Preferences Window. HTML Tidy is an utility to clean up and pretty print HTML/XHTML/XML. Enable the Bottom Pane from the View Menu and you can clean up or check any HTML/XHTML/XML document.

The default configurations are enough to use Tidy. If you want to tweak it according to your needs, then Configure Plugin ( There are so many options :P )

Snippets

This is an useful plugin once you know what gives what. If you code for online programming contests like spoj, topcoder, acm or usaco and if your programming language is C++, then download this cpp.xml file and put it in your ~/.gnome2/gedit/snippets folder. Then press template[tab] or topcoder[tab] in a new cpp file.

Apart from that, if you are a web developer, then check out the Snippets for HTML and PHP. Once you remember the shortcuts which you need, they’ll make your life really easy.

Meet GNU/Linux 07

Posted by sp2hari

After 2 successful editions of Meet GNU/Linux, which is conducted by
GLUG-T every year for beginners, the third edition of MGL is starting
on 27th July, at NITT.

A few updates about MGL’07 :

1. Guys are planning to release a beginner handbook, which would be
given out to them. The content is being edited in a wiki :
http://glugt-mgl.pbwiki.com/ Go ahead and edit when you are free.

2. This is GNU/Linux for dummies. So, if you have any of your
friend/relative interested in learning about it(in trichy), you can
ask them to contact suren who is co-ordinating
the event.

3. The co-ords are planning to release podcasts of the events, which
will be helpful.

Ideas, suggestion about how to organise the classes are welcome!

Seg Fault

Posted by sp2hari

Wikipedia says,
A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software. A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system).”

I have seen hundreds and hundreds of seg faults ;-) while coding for record module of LDTP and Spider SMS. But the one i saw yesterday was new, strange and fascinating. I am not sure whether i will be able to reproduce it again. The screenshot says why it is strange and fascinating :-) .

-bash-3.1$ man su
says

AUTHOR
Written by David MacKenzie.

REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.

Maybe i should consider reporting this :P .

Foss.in 2006 at Blore

Posted by sp2hari

Date :: 23 Dec 06 Time :: 4.00 PMPlace :: Cisco Blore

Shagan and evo has already mentioned to me about the great speed at which you can access net at cisco , but i have never taken them that much seriously . But when i sat in shagan’s comp to surf net , MY GOODNESS , was really amazed by the network speed there . Just to test the download speed , started a fc6 download and it downloaded around 7-10 MB in 15 seconds . Shagan later told me that this speed is bit slow and i could have got better speed if i had used wget for downloads :O. Then shagan went to play tt with his friend ( no need to mention that the friend is a female and tt was just a lame reason for kadalai ) , while i went blore central (just to kill time, had no intention of purchasing anything there).

Date :: 24 Dec 06Time :: 10 AMPlace :: IISc Blore

Somehow i got up early ( 8.30 ) , managed to catch a bus to IISc and reached there at 10.00 AM. Taggy was already waiting for me there .The event is supposed to start at 10.00 AM with an opening ceremony by Atul Chitnis. This guy though never spoke tech , spoke really well . With few do’s and dont’s like switching of mobile, asking questions etc etc , he finished his speech at 11.00 AM ( remember he started at 10.30 AM )

Next was the speech on Linux and the art of minimalist development by Suparna from IBM. One of the topics which we wont understand anything is the kernel and unfortunately she is a kernel developer. But topic on what she spoke is simple. It is actually about keeping things simple, solving problems in a clever way etc etc . Though we could grasp these concepts , the examples she gave went wrt kernel over our heads :(

Next speech is by Noor from Wipro . He spoke about something called sUSBix. Though i dont remember much about his speech now few points which i noted down in my notebook says suspend2 JFFS - Journaling Flash File SystemHis speech is about working from the OS booted from a pen drive and then we can carry the pendrive to anywhere and using the pendrive there so that all you need to carry when you want to port your work from office to home or home to office is just a pen drive. The advantage he mentioned is that since the root and swap are present in the pendrive itself , you need not reopen your applications and other stuff once we put it in standbymode. Say if i had opened gedit at home , when i use sUSBix and boot the comp at office , i will have the gedit opened . This is really a big advantage . Some of the todo’s of this project are like increasing the portablity between two comps of totally different type , etc etc

Then was the speech about “Writing as SMS Service with Free Software”. Actually i was a bit interested in this because i thought something from this can be useful for spider sms, but it turned out that he spoke about something very basic which smsd already uses for sending sms. He showed a demo of sending a message if the delivery is success and getting a web page in sms.

Next was the OpenJDK - Opensource Java . I actually slept in this session . So you could guess how boring it will be for me. Then next lecture was also not interesting ( atleast their topics were not intersting ) that we went for a small walk outside IISc . We planned to bunk the next hour ;) though we decided to stay just for the Secure Linux programming

It was 5.00 PM now , the topic was “Secure Linux Programming” , by Jaimon Jose from Novell. The slides he showed us was good and had nice content , though it would have been better if he had got more examples on them or atleast explained about them in depth.He actually spoke about (rather showed slides for )Buffer OverflowInteger Overflow Race ConditionTemp filesDynamic Memory etc etc He gave a nice link for Linux Secure Programming ( http://dwheeler.com/secure-programs/Secure-Programming-HOWTO/)
Thats it for the day . We could not take more . We bunked the next hour about “Solving the fundamental structural problem of the free software movement” and i came home ) .

I was actually tired after those long long lectures . Since it was a long time since i have listened to a lecture properly (classes are either for sleeping or sending messages , infact anything other than listening) . So slept early .

Date :: 25 Dec 06Time :: 8.30 AmPlace :: Shagan’s Home

Just now got up . This means i am going to miss the first speech . Actually i wanted to attend the first one ( coz it is about KDE and not kerenel ) but now it seems impossible. Finally managed to get a bus and reach shivajinagar bus stand at 10.00 . Given some one hour to travel from shivajinagar to IISc , i can reach there by 11 and atleast attend the PHP5 Rasmus ( the guy who wrote PHP ) .

But seems Murphy’s laws never fail .
What i did from 10.00 to 12.30 in shivajinagar can be explained as

for (count=0; ; count++) {
Ask someone which bus goes to IISc .
If that @$$ does not know which/what IISc is curse him 100 times and wait for someone else
If he says to wait in some lane , go to that lane and wait there
After 10 mins , ask someone there and surely he will point me to some other lane.
Go to the new lane.
if ( count > 50 ) {
for every 5 people you ask hereafter , say “fsck” and proceed }
if (count >100 ) {
for every 2 people you ask hereafter sak “fsck” and proceed
}
}

Inbetween this one of the drivers who told me that the bus will go to Indian Institute of Science , droppd me at Indian Express .
All i could is curse more and more and somehow went to IISc at 12.50 .
Then attended the speech about “Hacking the Slug” by Sudhakar from Google .Actually we never knew anything about what he is going to say before the speech . He showed us the Slug , a device which can be used as a firewall , proxy server etc etc . He showed a demo how it can be used .

Next was “Makefiles” by Sulamita from Brazil. She was really tensed when she spoke about makefiles ;) . Taggy was feeling bored coz one could not talk anything interesting with makefiles. I knew Makefiles was really a vast topic and she did cover something which will make one write Makefiles upto a decent size. All i have explored with Makefiles is to add a new file to be compiled in ldtp and that was simple . Search for any one of the files already present and add the new file to the list you see. But writing make files from the scratch is something i just hope i never have to do .

The topics after this were a bit boring or something which we have never heard at all . So we decided to bunk the next two hours ( bunking the last speech has become a habit and we did this the next day too ;) ) . Taggy came home to shagan’s home today and we went out for dinner. Went to garuda mall, had dinner there [ ofcourse shagan payed ;) ] came back to home late.

Date :: 26 Dec 06Time :: 10.00 AMPlace :: IISc Blore

Atleast today reached IISc on time .
First one was “Impact of Indian Copyright and Patent Law on FOSS” by Sunil Abraham . We actually thought that the speech will be boring and no tech , but the interactive session was really good . People actually came up with various doubts which this guy was able to answer properly.

Next one was the Webmarker by Natarajan from Yahoo . This one was also good and interesting .He explained to us how the webmarker was done , algorithms was used in that , the webmarkers that were present before this one was released , the problems with this webmarker etc . This one was really interesting , coz the way he showed us the demo and discussed the problems in the webmarker was good. Actually people who were listening suggested some nice ideas and hacks which can be incorporated into the Webmarker to make it better.

Next one was “Ten Tips To Turbocharge The Team: Getting Smaller User-Groups Moving”. I attended this just to get some nice ideas for GLUG-T. The speaker gave some good links and also answered properly during the interactive session.
Some of the key points which i got from his speech are.1. Maintain a proper mailing list . The more active the mailing list is , the more active the glug is .2. Have a proper FAQ page somewhere so that the topics/problems which were discussed earlier need not be discussed again for the newbies again.3. More number of glugs is always better.

After lunch , had a two hour session on “Writing KDE Applications” by Aaron Seigo. This guy was really cool who explained us about how to write applications in KDE4. Actually it was very similar to GTK except that here you have OOPS concepts, so you have classes for everything. He explained about the filedialog and other classes.

Then was the Tutorial Session on LDTP . Met nags and Casanova here . Here was one session where i knew almost everything what the speaker is going to speak. Casanova spoke for an hour or so. He explained about from the basics, i.e what library ldtp uses , how it works . He showed a demo of ldtp with gedit and a demo recording too. Maybe he could have shown more demos and extended the session a bit.
Even today we bunked the Closing Keynote and the Closing cermony and came home early.

foss.in

Posted by sp2hari


FOSS.IN is one of the world’s largest and most focussed FOSS events, held annually India. Over the years, it has attracted thousands of participants, and the speaker roster reads like a “Who is Who” of FOSS contributors from across the world.

FOSS.IN/2006 will be held on November 24-26, 2006, at National Science Symposium Centre of the Indian Institute of Science in Bangalore, India.

Do check out the other details at foss.in

Ubuntu vs FC

Posted by sp2hari

I think the fight is never going to end . The only topic the whole glugt seems to discuss for the past one month ( or even more than that ) is UBUNTU or FEDORA.

Fedora Supporters :
Gcdart, Sahil , Verma
Ubuntu Supporters
Evo, Donatello and me ,

I have no clue why i support ubuntu. I have never had any big problem with FC , though the only feature which attracted me towards ubuntu is
apt-get dist-upgrade
I had a chance to use ubuntu ( for the first time ) when i was in Novell, Blore. There internet was never the problem . So installed the breezy base and a simple apt-get distupgrade upgraded my system from breezy to dapper. I cant think of something like this for fedora. Though the installation cd always comes with an upgrade option people do go for a fresh install .

Had a small chat with gc regarding the bootup time comparision of ubuntu and FC, finally googled for the comparison , Though i did not get that i got a better one from here.
Some of the details i got from there is

Fedora Ubuntu
GENERAL FEATURES Fedora Core is a community distribution sponsored by Redhat. Fedora Core is a general purpose system - it does not concentrate on one specific market. Fedora Core is innovative (adopts a lot of bleeding-edge software) and secure (includes great security tools like SELinux). It is suitable both for home users, programmers and the corporate server. Ubuntu is usually described as Debian for newbies. It is based on Debian Unstable and offers some Debian compatibility, adding a lot of features to make the system more friendly for new Linux users. Ubuntu installer is very automatic. After the successful installation, the system is mostly confugured. Ubuntu package selection is very wise and non-redundant, providing one app for a single task. The desktop is very clean and looks consistent. Installing Ubuntu is a great way to have a Debian system with minimal knowledge required.
Random screenshot fedora - desktop ubuntu - desktop
TECHNICAL INFO
Supported architectures i386, ppc, x86_64, sparc (via Aurora Project), alpha (via AlphaCore) amd64, i386, ppc
Minimal hardware requirements For text mode: 200 MHz Pentium-class, 64MB RAM, 620MB HDD
For graphical mode: 400 MHz Pentium-class, 192MB RAM, 620MB HDD
For text-mode: 24MB RAM, 450MB hard drive
For graphical-mode: 64MB RAM, 1GB HDD
Software freedom status Free as in freedom.

The distribution is not officially recommended by FSF probably only due to not enough vocal declarations about the free software (Fedora tends to prefer the term “open-source”).

Mostly free, but includes some proprietary drivers
INSTALLATION
Installer - overall (8) Very mature installer, offering features both for beginner and expert users. Contains most of the features a modern OS installer should have. The only flaw can be install speed and no separate expert mode. (8) Since Ubuntu 6.06 (Dapper Drake), a graphcal installer is available with the Live-CD edition. The installer is fast and asks a minimal number of questions. It’s one of the easiest Linux distros to set up for a newbie user.

Ubuntu alternative text-based installer is based on the Debian Sarge installer. It adds a few new screens in expert mode, and removes a few in novice mode, to make it even simpler to install the system with default setting. And the defaults is: latest Gnome with a selection of GTK software.

Package selection (9) Present. Single packages can be selected (ald dependencies resolved) (2) Not available. You can however install additional packages before running the Live-CD installer (graphically or using apt-get). Every package you install before running the main installer will appear in your final installation.
Predefined package groups (9) Very well-thought package grouping. All package groups incude packaes installed by default and optional ones. The default installation is a desktop system with GNOME. (2) Desktop or server installations are available. No package group selection.
Expert mode install (7) No special “expert mode”. Most of the screens (e.g. partitioning) include “advanced” options for non-standard configuration. (8) Expert/Beginner and kernel 2.4/2.6 choices.
Graphical installer (9) Graphical (anaconda) or console based installation. (6) Available since Ubuntu 6.06 (Dapper Drake). The older text (dialog-based) installer is also very simple and suitable for most cases as well.
Installer speed (6) Reasonable speed of the installer. (6) The Live-CD installation is pretty fast. The installer only asks a few questions and then copies the entire Live-CD image to the disk, configuring the hardware and the boot-up menu.

The legacy (alternative) installation process is rather slow. Default installation took 35 minutes on 1.6Ghz, 1GB RAM laptop. On the same machine, Yoper has been installed in 13 minutes.

CONFIGURATION
Graphical system management (7) Many graphical configuration tools (mostly GNOME-based). Most system-wide operations can be performed without the need to open the terminal window. (5) Ubuntu does not provide a disto-specific Control Panel app (like in SuSE or Mandriva). Still, a few Ubuntu-specific tools has been added to the default Gnome desktop: the update notifier, update and installation manager (similar to Windows’ Add/Remove Software app), an applet to mount disks, a NetworkManager for wifi support, Beagle Search integration and more.
Console-based system management (5) Some console tools provided, including network card configuration (netcard-config), etc. (8) Very good package configuration tool - debconf - from Debian project.
PACKAGE SYSTEM
Number of packages (7) Package numer is better than openSUSE, but not as big as Mandriva or Debian. There are however lots of alternative sources of packages, like Freshrpms.net, etc. Recently, with versions Fedora Core 4 and 5 and the arrival of Fedora Extras project, the number of alternative software repositories grew considerably. (8) Except for base Ubuntu packages (built and supported by the Ubuntu team), there are official but unsupported repositories: universe and multiverse. It all sums up to over 10,000 of Ubuntu specific packages. Using alternative sources from Debian or its derivatives is not recommended (and usually not useflu).
Package management, automatic dependency resolving (6) The famous Redhat dependency hell is almost over with the arrival of yum (the default package manager) and apt-rpm (the alternative one). (8) Dpkg, APT and aptitude - Debian package management tools are among the leading GNU/Linux tools for software management. Installing software in Ubuntu is simple and troubleless, and certainly much more pleasurable than in most distros using the RPM format. Only Smart package manager is considered superior to APT (however, it can be used in Ubuntu as well).
Graphical package management tools (7) Fedora Core 5 provides yum based graphical tools such as Pirut for package management and Pup as the
updater. Fedora Core 6 provides an update notifier called Puplet.
There is Synaptic (a frontend to APT) and other similar tools available as the alternatives.
Previous Fedora Core releases (FC4 and earlier) included the old up2date application for package management and a desktop Alert Icon.
(8) Synaptic - a graphical frontend to APT - a software installation and update tool, very useful if someone likes to click rather than type. Also, an “Add/Remove applications” program is delivered, which is much simpler and more straightforward than Synaptic, but allows to install only the most typical desktop apps.
EFFICIENCY
System boot-up speed (5) Average boot-up speed. The boot-up scripts written properly. (6) Thoughtful services selection and default configuration make Ubuntu boot faster than Debian. It’s getting better with each release, but there is still some room for improvements.
System responsiveness (5) Acceptable speed and responsiveness, although there are no special optimizations for either desktop or server use. (7) Quite responsive system. Working with Ubuntu is fast and effective. Much better than default Debian installation. Technically, packages (except for the kernel and libc) are compiled for 486, but with Pentium III (or higher) optimizations.
STABILITY/SECURITY
Popularity (7) Very popular distro. For many months locates around 1-5 place on the DistroWatch rank. (8) Ubuntu got extremely popular during the previous year and places currently takes the first place in the DistroWatch rank.
Security focus (8) SELinux is included in the default install. Fedora Core offers a whole bunch of extra security features like Exec-Shield, Compile Time Buffer Checks, ELF, Data Hardening, Restricted Kernel Memory access and more. (8) All of the key security packages (including kernel package) are being updated daily, so if someone updates the system regularily, he/she should not worry about security much.
Stability and maturity (6) Fedora Core stability is comparable to similar distros like Ubuntu or openSUSE. There are many efforts to make the software testing within Fedora Core even better by implementing an automated test system. Will Woods is currently leading this project. (7) Ubuntu is based on Debian, which is one of the most stable and mature distros available. Still, Ubuntu comes with fresh software and instabilities may occur.
INTERNATIONALIZATION
Does the installer support multiple languages? (8) Fedora installer is pretty well localized. (8) Ubuntu installer is translated into 40 languages which makes it one of the leaders in this area.
Internationalization is one of the Ubuntu project priorities.
Is the system localized after installation? (7) System speaks the language selected during the installation process. Of course not all apps are well-translated, but Fedora-specific ones usually are. (7) The installed system is localized. The only problems may occur with QT-based apps. QtConfig app can fix this problem when installed.
Is manual system localization easy? (8) Additional localization procedures are easily available (docs, FAQ-s) (5) If something does not work, we should make friends with dpkg-reconfigure tool which makes it easier to change the package configuration without the need to mess up with the configuration files.
APPLICATIONS/NETWORK
Support for restricted formats (4) Fedora is a community distro devoted to Free Software thing. No support for non-free formats is available by default. Fedora Wiki entry Forbidden Items explains the reasons for this and offers possible solutions. If you need restricted formats for some reason or don’t care for the FSF philosophy, don’t worry. You can still install all the packages from third-party repositories like rpm.livna.org. (5) Ubuntu is a community distro devoted to Free Software thing. Almost no support for non-free formats is available by default. If you need restricted formats for some reason or don’t care for the FSF philosophy, don’t worry. You can still install all the packages from the multiverse repository (no officially supported but hosted at ubuntu.com). The Restricted Formats wiki entry describes the Ubuntu policy and the multiple ways of getting support for non-free packages. Using EasyUbuntu - a graphical non-free software installer is another good option here.
Sagem DSL modem support (4) No eagle-usb packages. Kernel source and manual module compilation is necessary. (4) Eagle-USB has been available as a Debian package since version 4.11 (Warty Warthhog). Unfortunately, the support for Thompson modems got worse and worse with every release. Now, it’s not posiible to install the modem without kernel recompilation…
Alcatel DSL modem support (4) Like in Sagem, installation process is totally manual.

A speedtouch.conf script (tested with FC2 and FC3) can be also downloaded from http://speedtouchconf.sf.net/ to make the process automatic.

(5) Speedtouch modem installation is not fully automatic. Package “speedtouch” is responsible for firmware loading. Still, we have to copy the driver manually. Manual configuration is also a must.
Wireless support (7) Good WiFi support. Native drivers are well supported (clickable installation). Ndsiwrapper is available for Windows-only cards. (8) System automatically detects wireless connections (adequate icon appears on the desktop). Of course, other debian tools for handling wireless cards are also available.

Each system gets a mark from 0 (min) to 9 (max). In most cases the description precises the mark. A question mark (?) means that we do not have any information about certain feature.

Note :: Have edited the post from FC5 to FC after reading the first comment. Think comment is posted by a FC supporter . :) . Anyway i have not seen Edgy till now, still downloading the repos (seems it is some 14 GB for i386 ) . And not yet explored FC6. I just hope i find enough time to explore both FC6 and Edgy .

rm -rf * :-O

Posted by sp2hari

Went home for diwali hols and the moment i entered my room , the first thing i did is to switch on the comp. I have already taken a resolution that no tech , no php , no linux for the next 5 days [ resolutions are meant be broken , you know :) ] . So instead of booting the comp in linux , i booted the comp in windows ( i had no clue what i was going to do in windows ) .

My sister had stored a few harry potter movies which i was in no mood to see.After some 5-10 minutes of arbit clicking , i decided windows is not for me :-). I noticed a folder called books which was the only useful thing for me in my comp apart from the linux. But reading a book will make me break the resolution. Though reluctant , i started with the “Unix Haters Book”. When i started , i never had an idea how great the book will be .

The book will make anyone hate unix ( this includes linux also ) and i am not an exception. That too even after the first chapter , i started to realize the drawbacks [this is a better way to say hate :-) ] of shell , the most powerful and the tool which i liked the most in Unix or Linux.

So here is the details of the first chapter in short. It mostly blasted a singlr command “rm”. Now i realise the deadliest command one can ever type is “rm”.

The first thing i liked in the book is the way they described unix.
“ Who would have thought it: Unix, the hacker’s pornography.”
I have no clue why the author mentioned Unix as hacker’s pornography , but i seriously liked the guts of the author to say something like this . I did realize that this book is good after reading the foreword ( very few books can do this ) . After reading the first chapter , the author made sure that whenever i type rm , i will surely remember this book.

The first chapter started with the quote saying
“Two of the most famous products of Berkeley are LSD and Unix. I
don’t think that this is a coincidence.”
—Anonymous

Another chapter said this
The most horrifying thing about Unix is that, no matter how many
times you hit yourself over the head with it, you never quite manage
to lose consciousness. It just goes on and on.
—Patrick Sobalvarro
The attack on “rm” gave many real life-horror stories .
“rm” Is Forever
A series of exchanges on the Usenet news group alt.folklore.computers illustrates our case:
Date: Wed, 10 Jan 90
From: djones@megatest.uucp (Dave Jones)
Subject: rm *
Newsgroups: alt.folklore.computers2
Anybody else ever intend to type:
% rm *.o
And type this by accident:
% rm *>o
Now you’ve got one new empty file called “o”, but plenty of room
for it!
Actually, you might not even get a file named “o” since the shell documen-
tation doesn’t specify if the output file “o” gets created before or after the
wildcard expansion takes place. The shell may be a programming lan-
guage, but it isn’t a very precise one.

In my comp i got a file named o , seems the output file gets created after the wild card expansion takes place.

Here is the next real life story
Date: Wed, 10 Jan 90 15:51 CST
From: ram@attcan.uucp
Subject: Re: rm *
Newsgroups: alt.folklore.computers
I too have had a similar disaster using rm. Once I was removing a file
system from my disk which was something like /usr/foo/bin. I was in /
usr/foo and had removed several parts of the system by:
% rm -r ./etc
% rm -r ./adm
…and so on. But when it came time to do ./bin, I missed the period.
System didn’t like that too much.
Unix wasn’t designed to live after the mortal blow of losing its /bin direc-
tory. An intelligent operating system would have given the user a chance to
recover (or at least confirm whether he really wanted to render the operat-
ing system inoperable).
The third case is really really important and a dangerous one .
Date: Wed, 10 Jan 90 10:40 CST
From: kgg@lfcs.ed.ac.uk (Kees Goossens)
Subject: Re: rm *
Newsgroups: alt.folklore.computers
Then there’s the story of the poor student who happened to have a
file called “-r” in his home directory. As he wanted to remove all his
non directory files (I presume) he typed:
% rm *
… And yes, it does remove everything except the beloved “-r” file…
Luckily our backup system was fairly good.

Now i stopped reading the book. I realised that i will surely start a Windows User Group , Trichy if i complete the book. :P .


FireStats icon Powered by FireStats