Showing posts with label Technical. Show all posts
Showing posts with label Technical. Show all posts

Friday, 30 May 2014

Get list of installed libraries in a system using python

From lovable python terminal its possible to get list of all installed python libraries. Here is the piece of cake for you that I already tested. Try from yourself too :)

Open your python terminal doesn't matter whatever OS you are using(As of now I' using windows. Type following command

from pkg_resources import WorkingSet , DistributionNotFound
working_set = WorkingSet()

# Printing all installed modules
print tuple(working_set)

# Detecting if module is installed
try:
    dep = working_set.require('paramiko>=1.0')
except DistributionNotFound:
    pass

Output of above print will be as:
(astroid 1.0.1 (c:\python27\lib\site-packages), BeautifulSoup 3.2.1 (c:\python27\lib\site-packages), blinker 1.3 (c:\python27\lib\site-packages),....


Tuesday, 1 April 2014

Transfer files or folder from windows to Unix using putty Or vice versa

Sometimes we want to transfer files/folder from UNIX server to our windows via putty. So its possible??

Its possible via pscp. Wait what is the pscp?? :P

"Its a tool for transferring files from computers to SSh or vice versa."
Picking one scenario to use pscp. Lets consider I want to transfer one file from windows to unix, So the command for the same is given below. You have to run this command on cmd

Main syntax is:
" pscp [options] source [source...] [user@]host:target "

Command for the above scenario is as:

C:\Program Files\PuTTY> pscp C:\Test.xml  hv3775@sbsdev01:/A/GM/app/script/TestFolder/

Explanation of above example:

  • pscp - The PuTTY Secure Copy client, is a tool for transferring files securely between computers using an SSH connection.
  • C:\Cat2014ZD.xml  - Its the source, which we want to transfer.
  • hv3775@sbsdev01:/A/GM/app/script/TestFolder/ - It is the user+host+path where we want to move files.







References:
http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter5.html
http://www.it.cornell.edu/services/managed_servers/howto/file_transfer/fileputty.cfm
https://community.freescale.com/thread/220596

Tuesday, 21 January 2014

Paste In Putty For New Users


Sometimes its a gotcha, a new user is not able to paste a password in Putty when trying to login. Don't worry here is the simple solution. Copy your password and on putty press Right Click Of Your Mouse where its mention to give password .

Hope its helpful.

Thanks