Saturday, April 3, 2010

Linux ssh Tips

Connect to ssh

You can connect to ssh using root@hostname.com If you have root access

If you dont have root access then do as below

1. First login ssh user@host1.com
2. su
3. Password: root password
After you login to host1's root.

then ssh user@host2.com -p 2222
host2password :

Now you logged into host2 from host1's root.

To come out to host1. use exit.

stickerguy@web2.greatbasin.net




locate is the command to search any folder or files.

Drupal usefull reference URLs

Usefull modules
Handbooks
http://drupal.org/handbooks

http://www.nicklewis.org/40-essential-drupal-6-modules

http://www.eadhoc.com/2010/03/drupal-terminology.html

Node auto term.It will create categories automatically when node contetn added.
http://www.facebook.com/note.php?note_id=196164430516

Node autotem
http://blog.adyax.com/2009/03/english-drupal-tutorial-node-auto-term-taxonomy-tips-and-jquery-menu-api-in-use/


Drupal 6
http://drupal.org/node/733182

Module functions
http://drupalcontrib.org/api/drupal/contributions--nat--nat.module/6


Taxonomy
http://drupal.org/node/2498

Reasons for why you use drupal
http://www.tajahdev.com/Resource/drupal.htm


15 Usefull views modules
http://ntt.cc/2009/01/28/15-userful-views-module-for-drupal.html

Views theming
http://www.packtpub.com/article/drupal-6-attachment-views-page-views-theming

http://realtech.burningbird.net/content-management/planet-drupal-entries/drupal-views-and-taxonomy-pages

http://zugec.com/drupal/theme-wizard-in-views-with-drupal-5

Advanced taxonomy term blocks
http://www.pixelclever.com/documentation-advanced-taxonomy-blocks-module-drupal-6

Views Help
http://views-help.doc.logrus.com/
http://drupal.org/node/59157

http://drupal.org/files/issues/nat-views-support-term-node-count_1.patch

Copying files from one host to another with scp command

Best Reference

http://www.lesbell.com.au/Home.nsf/b8ec57204f60dfcb4a2568c60014ed0f/04eaff076bce249dca256fb6007f53e5?OpenDocument

Copy entire folder with all files and subfolders
user@user:~$ scp -r /var/www/localdir/ user@192.168.10.150:/var/www/


In windows
Putty and pscp are excellent tools for ssh and scp operations in windows os.
Download putty and pscp softwares from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
They are self executable files so no need to install those just place in some folder ex: c:\programfiles\putty folder and set the path in command prompt.

open command prompt (DOS Prompt)from start -> run -> cmd

set PATH=C:\path\to\putty\directory;%PATH%

So to copy the file /etc/hosts from the server example.com as user fred to the file c:\temp\example-hosts.txt, you would type:

pscp fred@example.com:/etc/hosts c:\temp\example-hosts.txt

To send (a) file(s) to a remote server:

pscp [options] source [source...] [user@]host:target

So to copy the local file c:\documents\foo.txt to the server example.com as user fred to the file /tmp/foo you would type:

pscp c:\documents\foo.txt fred@example.com:/tmp/foo

You can use wildcards to transfer multiple files in either direction, like this:

pscp c:\documents\*.doc fred@example.com:docfiles
pscp fred@example.com:source/*.c c:\source

Copy entire folder from remote server to local computer along with files and subfolders
pscp -r user@example.com:source/* c:\source

Ref : http://www.jfitz.com/tips/ssh_for_windows.html