Wednesday, September 30, 2009

SMTP numeric codes

After you have set-up the connection with any SMTP server using telnet, you can try different commands, and they’ll be processed and responded to with numeric response codes.
These three-digit coded responses, like 220, may look familiar to Webmasters. The first digit indicates success or failure. 1 indicates a success requiring confirmation, 2 indicates complete success, and 3 indicates success so far, but that more input is expected. 4, the first failure code, is used for failures that may be temporary, such as the mail account existing but being locked; 5 indicates that the failure condition is permanent, such as a syntax error in the command. The second and third digits provide further details, but at the top level, all that matters is that 1xx, 2xx, and 3xx are good, and 4xx and 5xx indicate problems. (For further information on mail response codes, read RFC 1893.)

Wednesday, September 23, 2009

how to repair a mysql table using myisamchk

For some very easy repairs, this utility can be used.

myisamchk is an table-maintainence utility. It is used to repair corrupted mysql tables.

First, try myisamchk -r -q tbl_name (-r -q means “quick recovery mode”). This attempts to repair the index file without touching the data file. If the data file contains everything that it should and the delete links point at the correct locations within the data file, this should work, and the table is fixed. Start repairing the next table. Otherwise, use the following procedure:

1.

Make a backup of the data file before continuing.
2.

Use myisamchk -r tbl_name (-r means “recovery mode”). This removes incorrect rows and deleted rows from the data file and reconstructs the index file.
3.

If the preceding step fails, use myisamchk --safe-recover tbl_name. Safe recovery mode uses an old recovery method that handles a few cases that regular recovery mode does not (but is slower).

Courtsey: http://dev.mysql.com/doc/refman/5.1/en/repair.html

Monday, September 21, 2009

how to login into screen by default

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.

Wednesday, September 9, 2009

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

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 :)

Wednesday, September 2, 2009

how to make qmail accept mails for any specifc domains

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.

Tuesday, September 1, 2009

This is how you talk to yourself on IRC :)

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
 
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 Generic License.