user-avatar
Today is Thursday
November 28, 2024

September 21, 2009

how to login into screen by default

by viggy — Categories: Uncategorized — Tags: , Leave a comment

Do you have to use multiple terminals while working on console, then screen is the utility for you.
Now you would like to login into screen by default so that you dont have enter the screen command every time you start a new bash. For this all you have to do is enter a line

screen -x || screen

in your .bashrc or .bash_profile file in your home directory.

.bashrc is executed every time you start a console. So adding the above line in .bashrc file executes the above line every time .bash is started. above line just checks if there is already a screen opened on the system. If it is opened, it connects to that or else it starts a new screen.

September 12, 2009

my grievance at pgportal.gov.in

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

Courtesy: Debayan-It was actually his idea as to why Governments should waste so much of money for softwares which is required by each state.

Pooja-She introduced me to this portal.

I have registered my grievance in the Public Grievance Portal successfully and now waiting for their reply and action.

My registration number is MINIT/E/2009/00382

Following is my grievance description:

I feel sorry to see that the hard earned money of people which is collected as income tax by the Central and State Governments and which is also one of the biggest source of revenue is being wasted. Each and every IT Department of all 28 states spend money to build same softwares for their various work. Each state has a Income Tax Department which needs a software to regulate collection of Income Tax. Each state has a Agriculture Department which needs to keep record of all the cultivable land and the different grains being grown there. Each state has a Electricity Department which needs a software to regulate distribution of electricity to different cities and collection of electricity bill in different cities. Each department of the state needs a software to look after their mailing solutions so that each department has its own mail server. Each state has various government schools which all require softwares like operating system, office related softwares and various study softwares for students To sum it all, each of the 28 states of India spends huge money every year to get softwares for each department and maintain these softwares. That means, citizens of India pay 28 times for just one software that is built only once by the software company and resold to every state. This is highly illogical. A simple solution for this is to make all the State Governments to use Free and Open Source Softwares(FOSS). Each government will pay the software companies only to customize the software according to the state needs. This will cost them only 10% of what they are already paying. Since FOSS can be used and customized by any software company this will give a chance for small companies to enter the market and also lead to a very fair competitive market. I hope proper action will be taken to see that such huge amount of money is not wasted and using FOSS becomes compulsory practice in all government institution. Please solve this grievance which is not only mine but also of every Indian citizen as soon as possible.

September 9, 2009

using routes.rb to change the default home page in redmine

by viggy — Categories: Misc, tech — Tags: , 2 Comments

After installing Redmine on the server, I wanted the default home page when to be shown as the home page of my project and not the complete redmine directory. After searching for a while, I found that it can be dome by doing necessary changes in routes.rb file in the config directory. Then I asked it in #redmine channel on freenode server in IRC. And I found the solution there thanks to “relaxdiego”.
I have copied the chat here so that I dont miss anything that was pointed out by him(Also I am too lazy to write it all again).
iggy_prabhu> hi friends
viggy_prabhu> I have installed redmine and added one of my projects
viggy_prabhu> now i want that whenever i open the redmine domain, it directly opens the home page of the project and not the home page
viggy_prabhu> Can I do this by route.rb file or should I use rewrite mod in apache to do this
viggy_prabhu> ?
relaxdiego> viggy_prabhu: try modifying the map.home entry in routes.rb
viggy_prabhu> relaxdiego, any good HOWTO before I start modifying it?
* jas4711_ has quit (“Ex-Chat”)
relaxdiego> none that I know of
relaxdiego> map.home ”, :controller => ‘projects’, :project_id => (your project’s id)
relaxdiego> try that
relaxdiego> and for Rails routing: http://api.rubyonrails.org/classes/ActionController/Routing.html
viggy_prabhu> relaxdiego, i have done the necessary changes
viggy_prabhu> should I restart my apache?
relaxdiego> yep
viggy_prabhu> i did it and got the changes
viggy_prabhu> but i want projects/show/myproject to appear instead of the list of projects
viggy_prabhu> (at present I have only one project)
viggy_prabhu> relaxdiego, hope you got my doubt?
relaxdiego> what’s your project’s id?
relaxdiego> map.home ”, :controller => ‘projects’, :action => ‘show’, :project_id => (your project’s id)
* kibaho1 (n=pelamm@gw.tietoteema.fi) has joined #redmine
viggy_prabhu> relaxdiego, “The page you were trying to access doesn’t exist or has been removed” i am getting this error now
viggy_prabhu> map.home ”, :controller => ‘projects’, :action => ‘show’, :project_id => ‘myproject’
relaxdiego> sorry, i think i got it wrong
relaxdiego> this works for me –> map.home ”, :controller => ‘projects’, :action => ‘show’, :id => (project id)
viggy_prabhu> relaxdiego, finally it is working
viggy_prabhu> relaxdiego, thanks a lot for your time :)
relaxdiego> np :)

September 8, 2009

logic and luck

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

Well I have been thinking about it a lot in my free time. I have come to some obvious conclusions. I should start thinking from here now onwards. First let me define what is logic and luck according to me.
By logic, I mean reasoning. 1+1=2 is logic. Earth rotates around Sun because of gravitational force is logic. We need to oxygen for digestion is logic. Logic can be explained. If it cannot be explained, then it is not logic.

By the same argument, what cannot be explained can be called as luck. Many times we say a person is born talented, that is luck. Why should someone get cancer, that is luck. Why should Earth be exactly at such a distace that all conditions favour for growth of organisms, that is luck.

So what is the relation between the two, logic and luck? The relation is the understanding of things around us. Hundreds of years ago, no one could explain the cause of lightning and they used to consider it as a way Rain God shows his anger. So it was luck then. But now lightning does not scare anybody. So it is logic now. Hence as time progresses, more and more things are understood by humans. This leads us to believe that some or the other day, humans will be able to solve all the mysteries of nature and hence nullify the concept of luck. Theoretically, yes this should be possible. After all that is what we have learned in maths. Any variable can be easily extended to infinity to get an ideal case. But now what is that ideal case equal to. Isnt that is what we call God. He can explains us everything that happens in this world. He has created everything here and he has designed everything so beautifully for us. So is it wrong in believing in him and having trust in him.

Let us see it from another point of view. When we are small, we believe in our parents and whatever they say. They are god for us then. But as we grow up and start gaining knowledge more than them, we dont believe in them any longer and keep searching for logic ourselves. In this juncture some believe in God but some believe themselves to be God. The latter happens because they think that since they have gained knowledge more than their earlier gods( their parents), they can reach the ideal situation of gaining infinite knowledge and hence can themselves become god. But what they forget is that they havent yet reached the ideal situation.

I had drifted away from my main point. I wrote this blog to mention what I think is the right equation for logic and luck.
Logic + Luck = Nature .
By nature, I mean everything. Everything that we see and we observe. I will call this equation of truth as this is what is truth. Infact a better way to put the equation would be
Logic + Luck = Truth .

Here I have not mentioned another important factor which is Love. This cannot be categorized either in logic or in luck. I need to figure where it will appear in the equation and I am sure that the equation will then be complete. :).

September 2, 2009

How can I learn English if it is this complicated?

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

Courtsey: http://www.future-perfect.co.uk/grammartips/grammar-tip-benefited.asp

Is it benefitted or benefited?

When adding -ing and -ed to verbs, we sometimes double the consonant beforehand. People are often confused with ‘benefitted/benefited’, ‘focussed/focused’ and ‘targetted/targeted’. This tip answers some of those queries.

The official requirements are that we ‘double a single consonant letter at the end of any base where the preceding vowel is spelled with a single letter and stressed’.

What does this mean in practice?
Examples:
word present participle past participle
bar barring barred
beg begging begged
occur occurring occurred
permit permitting permitted
patrol patrolling patrolled

It is true to say that there is usually no doubling when the preceding vowel is unstressed (‘enter’ becomes ‘entering/entered’; ‘visit’ becomes ‘visiting/visited’) or when the preceding vowel is written with two letters (‘tread’ becomes ‘treading/treaded’).
Benefit

Mistakes are often made with ‘benefit’. This happens because it is thought to be like ‘fit’, ‘fitted’ and ‘fitting’, but it is not, as the natural stress is not in the same place.

In fact, ‘benefit’ follows the standard rules exactly. It becomes just ‘benefiting/benefited’, because there is usually no doubling when the preceding vowel is unstressed.

Some words change their spelling to cope (they add a letter ‘k’).
word present participle past participle
panic panicking panicked
traffic trafficking trafficked
frolic frolicking frolicked
bivouac bivouacking bivouacked
What about ‘focus’?

This word can take either double or single s, with the single option being highly preferred.
word present participle past participle
focus focusing/focussing focused/focussed

Here’s an odd one to end:
American British English
parallel parallel
paralleling parallelling
paralleled parallelled
Example:

The vetting service from Future Perfect is unparallelled.

September 2, 2009

how to make qmail accept mails for any specifc domains

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

If you have qmail installed on your server and if it is already accepting mails for some specific domain, you may want to add a new domain for which you may like your server to accept mails for more domains. This is usually required either so that your server will relay those domains or it will accept mails even for these domains. This task is very simple to accomplish. If you want your server to relay mails coming to any domains, you need to add that domain in rcpthosts file in /var/qmail/control. If you want your server to accept mails to another domain also, then you will have to add that domain in locals file in /var/qmail/control.

September 1, 2009

This is how you talk to yourself on IRC :)

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

viggy_prabhu hi friends,
viggy_prabhu I am trying to configure apache2 to run redmine
viggy_prabhu I have followed the steps that were given on the site
viggy_prabhu but I am getting the “Internal Server Erro”
viggy_prabhu Error*
viggy_prabhu I am new to apache2 and Ruby on rails, so I might have done some mistake in configuration
viggy_prabhu the problem I dont know how to check that?
viggy_prabhu can anyone help me
viggy_prabhu ?
* kardan| (n=kardan@p54BE393E.dip.t-dialin.net) has joined #redmine
viggy_prabhu I got the following error in my apache2 error log file “apache2: Could not reliably determine the server’s fully qualified domain name”
viggy_prabhu “[Tue Sep 01 20:31:28 2009] [alert] [client 127.0.0.1] /var/www/redmine/public/.htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration”
viggy_prabhu can anybody help me
* hobodave (n=hobodave@63.149.16.13) has joined #redmine
* hobodave has quit (Remote closed the connection)
* hobodave (n=hobodave@63.149.16.13) has joined #redmine
viggy_prabhu Got the solution
viggy_prabhu I just had to enable the rewrite module in apache2

August 29, 2009

installing mysql bindings for ruby

by viggy — Categories: Uncategorized — Tags: , , , , Leave a comment

Courtsey: Daniel Lorch

To install mysql bindings for ruby, use this command
#gem install mysql

You might get the following error:

“extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)”

This probably means that you forgot to install the ruby1.8-dev package. Just do an apt-get install ruby1.8-dev to fix this.

Again after this you might this error:

“Could not create Makefile due to some reason [..] Check the mkmf.log file for more details. [..]”

You should do what the error message tells you: check the mkmf.log! Search for this file using find /usr/lib/ruby/gems/1.8/gems/ -name mkmf.log. Usually, this error message appears because you forgot to install the -dev package for the extension you were trying to install. So if you wanted to install the mysql gem, you probably forgot to install the libmysqlclient14-dev first. Do an apt-cache search | grep dev to find the appropriate packages.

Courtsey: Simon Josefsson Datakonsult

RAILS_ENV=”production”

(in /home/redmine/redmine)
rake aborted!
No such file or directory – /tmp/mysql.sock

(See full trace by running task with –trace)

The problem is that you need the Ruby MySQL wrappers. This isn’t really clear from the error message. Install it using:

# apt-get install libmysql-ruby

August 24, 2009

wget to rescue

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

How often has your download stopped after 99% of download while downloading from Firefox just because your internet connection was lost for a moment or because there was no space in your partition? And you must have sweared in anger but restarted the whole download. Well you dont have to do it any longer as wget is there to rescue your downloads.

Everyone must have known wget’s feature to download a partially downloaded file. Well you will be shocked to know that wget can download the partially downloaded file even if it was downloaded using Firefox.

Firefox downloaded usually downloads the file in .part. So all you have to do is rename the .part file to the actual file name.
Then run the command:
wget -c “link of the server from which it was downloading”

Thats it and wget will resume your download as if your internet connection was not lost at all.

August 16, 2009

After windows reinstallation, Linux no longer boots!, How do I restore GRUB?, I have lost my GRUB, how do I find it again?, I have reinstalled Windows

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

This solution is helpful when you have a LIVE CD.
Courtsey: Thinkdigit forum.
1. Boot from a Live CD, like Ubuntu Live CD or similar.

2. Open a Terminal. Go SuperUser (that is, type “su”). Enter root passwords as necessary. (in kanotix you need to set the passwd for root yourself. Use:
$ passwd root

3. Type “grub” which makes a GRUB prompt appear.

4. Type “find /boot/grub/stage1”. You’ll get a response like “(hd0)” or in my case “(hd0,3)”. Use whatever your computer spits out for the following lines.

5. Type “root (hd0,3)”.

6. Type “setup (hd0,3)”. This is key. Other instructions say to use “(hd0)”, and that’s fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as “(hd0,3)”.

7. Type “quit”.

8. Restart the system. Remove the bootable CD.

Source: http://ubuntuforums.org/showthread.php?t=42030

If the Step 3 doesn’t work, then instead of typing “su” and then “grub” type “sudo grub”. Then continue with Step 4.

Also if GRUB was your main boot loader then use (hd0) in Step 6, otherwise (hd0,x), where ‘x’ is your Linux Boot Partition (in case you are using some other boot loader, like Vista’s Boot Loader for e.g.).

But if you dont have a LIVE CD, then SUPERGRUB is a perfect solution. I have not used it myself, so cant give any good review about it. However you can find more details for your solution here.