Thursday, November 22, 2012

Track your modified files with Eclipse MyLin

I know how difficult for us to track files which we are working in a give task. Specially when we work on multiple issues where we cannot track modified files for each task. Lets see how Mylyn could support to over come this.

Mylyn is a subsystem of Eclipse for task management. Mylyn is an open source implementation of the Task-Focused Interface. It provides an application programming interface for tools embedding the task-focused interface.

Steps Give Below

  • Window → Show View → Mylyn → Task List
  • To create a new task press "New Task" (or right-click → New → Task. Select the "Local" repository
  • In the “New Task” field enter the Task / Issue ID
  • To start working on a task, select the Activate task button. This removes all elements from your Package Explorer View as you have not worked on anything yet.

  • Remove the task filter by clicking the Focus on Active Task button in the Package Explorer View. Now all files are displayed. If you open a file, it will be added to the context of your task. 

  • Check the modified files in the context tab

Sunday, November 11, 2012

Useful Linux Commands

1. Copy Files
    cp -r [copy location] [to location] 
    ex. cp -r /home/myDocuments/* /mysystem/sharedFolder

2. Remove directory
     rm -r [folder Name]

3. Check the folder size
    du -hs /mysystem/myfile/server/default/deploy/anyfile.ear

4. zip the file1.
     Go to the directory
        zip -r [requiredName].zip [FolderName]

5. move folder
    mv [folderName] [DestinationLocation]

6. Check java memory
    ps -eO size,pcpu|grep java

7. Check the free momory

8. Check the CPU processors

9. Find a file
    find [Location] -name [FileName]
    ex. find /mySystem/ -name run.sql

10. give rights to a FIle
     chown [user] [FileName]
     chgrp [user] [FileName]
     chmod 775 [FileName]
     Note : You might need to login as root

11. Give rights to the folder
      chown rezuser /[folderName]/ -R
      chgrp rezuser /[folderName]/ -R
      chmod 775 /[folderName]/ -R
12. Chcek hidden files
        cd /[file name ] -a

13. Edit file
     vi [file name]
     press insert button
     Edit the file
     press ctrl + c
     type colon(:) and wq
     press enter

     vi - edit the file
     cat - view the file
     esc : wq - with saving
     esc : q - withou saving

14. Check java process
     ps -ax|grep java
     ps -e|grep java

15. Read first 10 lines in a file
     head -n 10 [fileName]

16. Read last 10 lines in a file
     tail -n 10 [fileName]

17. Monotor java process
     watch "ps -ax |grep java"

18. Tar file
     tar -cjf [DesiredfileName].tar [Source File Name]

19. Untar file
     tar -xjf [fileName]

20. Trasnfer file from one server to another
     scp -r [fileName] [userName]@[serverIp]:[destinationFolder]

21. Download a file from the net
     lwp-download [full url]

22.Execeute a shell script with the arguments
    [shellFileName].sh [arg1]  [arg2]  [arg3]

23. Replace the text in a file
      find [Foldername] -name "*.[fileExtenstion]" -type f -exec sed -i 's/[findText]/[replaceText]/' {} \;

      ex. find /mySystem/MyDocyment -name "*.log" -type f -exec sed -i 's/localhost/' {} \;

24. Ubuntu - how to set customized ssh in the terminal
       Open a terminal
       Create a New Profile : File -> New Profile
        and set the following.
        In the Custom Command type
           ssh -p22 [user]@[serverIp]

25. How to enable root
     sudo -i

26. Disable root
     sudo usermod -p '!' root

27. How to map Network drives
     smbmount [network Folder Name] [localFolderName] -o username=[userName],password=[pw]

28. How to unmount Network drives
     sudo umount -f [network Folder name] [Local Folder Name]

28. How to check what process is opening the ports : Similer to cports in windows
        sudo netstat -lntp

29. modifty the rights
        chmod a+rwx [folder Name]

30. split large
     split -b 20000k my_large_file

31. Find a text in a directory and provide the files names which has the given text
grep -Rl --include=*.txt "text to search"

32. find the package inside the jar file. Go to the path and then run the below command

grep 'org.hibernate.cfg.Configuration' `find . \-name '*.jar'`

Friday, November 9, 2012

Convert Outlook .msg to Thunderbird .eml

Most of ubuntu users have faced the same issue when client attach the outlook mails (.msg format) to your issue tracking system and you cannot open with the thunderbird. So all the time you need to open the .msg in the outlook client with windows environment. Don't worry !! There is a way to handle this  by running a small script you can convert the .msg format to .eml format and open in thunderbird. :)

Steps Given below.

  1. First of all you need to install the "Email::Outlook::Message" and "Email::LocalDelivery"
  2. Use the following command sudo apt-get install libemail-outlook-message-perl libemail-localdelivery-perl
  3. Once the installation is done you need to download the following file in to local folder
  4. Copy .msg file to the above location and run the following command ./ --mbox [desiredFilename].eml [currentFileName].msg
    ex. ./ --mbox myMail.eml myMail.msg
  5. Once above is done you can open the myMail.eml in thunderbird
  6. When you get the .msg attachment next time you can follow the step 4 onwards