Amazon festival offer

Sunday, 23 December 2012

Basic Unix commands



Basic UNIX commands :-
• To change the current directory to another directory
                     Syntax-          cd [path_of_directory]
Note: - UNIX is case sensitive so type the same directory name
                                              [localhost@root ~]$ cd /home/user/data
                                              [localhost@root data]$
• To change the current directory to your home directory
                     Syntax-         cd
                                              [localhost@root data]$ cd
                                              [localhost@root ~]$
Note: - The current directory should now be your home directory.
• To create a directory inside the current directory
                     Syntax-           mkdir [name_of_new_directory]
                                               [localhost@root ~]$ mkdir test
              Test directory now should exist within the current directory.
• The cp command is use to make a copy of a file
                     Syntax-           cp [name of file] [name of copy]
                                               [localhost@root ~]$ cp old_directory  new_directory_name
• mv command is used to either rename an existing file or folder to something different
                or to “move” a file from one directory to another.
                     Syntax-           mv [name of existing file] [new name for existing file]
                                              [localhost@root ~]$ mv name_of_existing_file new_name_for_existing_file
• To move an existing file, type
                     Syntax-           mv [name of existing file] [path of new location]
                                               [localhost@root inteljasper]$ mv file_name  path_where_to_copy
                                               [localhost@root ~]$ mv mydir  /home/localhost/test/
• rm command is used to delete a file, to remove an existing file, type
                     Syntax-         rm [name of file]
                                              [localhost@root ~]$ rm  file_name
• rmdir command is a separate command for removing directories. To remove a directory, the directory must be empty. To remove an existing directory, type
                     Syntax-          rmdir [name of directory]
                                                 [localhost@root ~]$ rmdir directory_name
Some basic useful commands and there output: -

• date
                     Syntax-           [localhost@root~]$date
                     Output -         Fri Dec 23 10:30:05 IST 2011
• tput clear - To clear the screen clear is an argument of tput command.
                     Syntax-           [localhost@root~]$ tput clear   
• cal – Calendar of current month
                     Syntax-            [localhost@root~]$ cal     
• cal 1 1987 – to see the calendar of January 1987
                     Syntax-           [localhost@root~]$ cal 1 1987    
• who – to see who are the users? It will show all the users who are currently logged in.
                     Syntax-          [localhost@root~]$ who           
                     Output-          localhost   pts/1        2011-12-23 10:29 (sharad-pc.home)
• ps – to view the running process
                     Syntax-          [localhost@root~]$ps             
                     Output-          PID TTY          TIME CMD
                                                  14493 pts/1    00:00:00 bash
                                                  14691 pts/1    00:00:00 ps
• ksh -
                     Syntax-          [localhost@root~]$ksh             Korn shell it will show only like this
                     Output -        $
                     Syntax-          $ sh                                                   Bourne shell(sh-3.2$)
                     Syntax-          $ csh                                                 C shell
                     Syntax-          $bash                                                Bash  shell(original shell)
                     Output-         [localhost@root~]$
• ls – to list all the files
                     Syntax-         [localhost@root~]$ls            
                           files are arranged alphabetically with uppercase having      precedence over lower case)
 •  ls chap*
                     Syntax-        [localhost@root~]$ls chap*      
                            It will list all files starting with chap word
•  ls –l chap*
                     Syntax-       [localhost@root~]$ls -l chap*  
                     Output-       -rw-rw-r-- 1 localhost localhost    286 Dec 19 12:20 list
•  ls > list
                     Syntax-        [localhost@root~]$ls > list     
                               Directing output to a file name list. Prompts return no display on the terminal (">" is a                     
                               metacharacters )
•  cat list  - to open any file
                     Syntax-         [localhost@root~]$cat list         
                                                       list is a file name where all the list of files are stored you can give any name.
•  wc list  -
                     Syntax-          [localhost@root~]$wc list              Counting number of lines in a file
                     Output-           6   6   42 list                  means 6 lines,6words,42 character
•  ls | wc -  Feeding output of one command to another using "|"pipeline
                      Syntax-         [localhost@root~]$ls | wc   or
                                                      [localhost@root~]$ls|wc
• Programing with the shell
                    You can assign a value to a variable at the prompt
                      Syntax-         [localhost@root~]$ x=5             
                     No space on either side of = and then evaluate the value of this variable with the echo command
                      Syntax-         [localhost@root~]$ echo $x
                      Output-        op/  5
• Exit : signing off
                      Syntax-          [localhost@root~]$exit         
                                 Or                    [localhost@root~]$logout
•                    Syntax-         [localhost@root~]$echo sharad            gupta
                      Output-          o/p   sharad gupta
•  
                      Syntax-          [localhost@root~]$echo $PATH
•  
                      Syntax-          [localhost@root~]$type ls
                      Output-           ls is aliased to `ls --color=tty'
•  
                      Syntax-         [localhost@root~]$type echo      to know which command it is
                      Output-          echo is a shell builtin
•  Combined commands
                      Syntax-         [localhost@root~]$wc list; ls -l list
                      Output-        18  18 289 list
                                                          -rw-rw-r-- 1 localhost localhost 289 Dec 19 12:26 list

•  Save the results in new file
                      Syntax-         [localhost@root~]$ ( wc test ; ls -l test ) > newlist
•  To know about any command
                      Syntax-         [localhost@root~]$man -k awk
                      Output-         English              (3pm)  - use nice English (or awk) names for ugly  
                                                             punctuation variables
                                                            a2p                  (1)  - Awk to Perl translator
                                                           awk                  (1p)  - pattern scanning and processing language
                                                          gawk                 (1)  - pattern scanning and processing language
                                                           gawk                (rpm) - The GNU version of the awk text processing utility.

Delete the services in windows operating system



Sometimes you may need to delete the service from windows services.
To delete service go to Run prompt and type services.msc

Right click on the service which you want to delete and make it manual if it is automatic.
Start command prompt 


Type  “sc delete service_name”

If there is space in between service name use “ ” such as if service name is MySQL database
Then type

Reset the root password in Centos 6.3



Sometimes if you forgot the root password of Centos server then you may need to reset the root password.

These are some important steps to reset the root password of the server.

1: Restart the server (to restart the server you may require root password, so start directly from CPU)

2: Press Esc when server start.

3: Select 2nd option 

4: Press e

                      Grub edit>kernel…../…LogVoloo_S (insert S)
 For 6.3 just enter (space ) S or 1

5: Enter

6: b (inorder to boot into single user mode)

7: Check the SELinux mode
                       >getenforce
    If its enforcing type
                       >setenforce 0
Else

8: passwd

9: init 6 (reboot the system)

Monday, 16 July 2012

JasperReport Server Customization - Export JaspReport in Excel Format





JasperReport server provide the facility to export reports in various format like PDF, Excel, CSV and Flash and many more but by default excel export option is disabled in JasperReport server, so if you want to enable excel export option 

Go to this location

<js-install-directory> \apache-tomcat\webapps\jasperserver\WEB-INF\ Applicationcontext.xml

and open Applicationcontext.xml file with notepad and search for the "ignoreGraphics" property


<bean id="xlsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.XlsExportParametersBean">
        <property name="detectCellType" value="true"/>
        <property name="onePagePerSheet" value="false"/>
        <property name="removeEmptySpaceBetweenRows" value="true"/>
        <property name="removeEmptySpaceBetweenColumns" value="true"/>
        <property name="whitePageBackground" value="false"/>
        <property name="ignoreGraphics" value="false"/>
        <property name="collapseRowSpan" value="true"/>
        <property name="ignoreCellBorder" value="true"/>
        <property name="fontSizeFixEnabled" value="true"/>
        <property name="maximumRowsPerSheet" value="0"/>
        <property name="xlsFormatPatternsMap" ref="formatPatternsMap"/>
    </bean>


Change ignoreGraphic property false to true to export charts in excel format

   <property name="ignoreGraphics" value="true"/>


JR Server Customization - Change "Jaspersoft: Login" page name to our "Organization: Login"



JasperReport Server is an open source-reporting tool so sometimes you may need to rebrand and customize according to the customer requirements. Therefore, I am going to tell you how to rebrand and customise JR Server.
In order to change "Jaspersoft: Login" page name to customer "Organization: Login" page.
 (When we login on JasperReport Server default page name is Jaspersoft: Login)
You can see in browser after login.

Go to   this directory

                              \jasperreports-server-cp-4.5.0\apache-tomcat\webapps\jasperserver\WEB-INF\decorator\ directory

 And edit the decorator.jsp file and change

Jaspersoft to "Organization_name

<!--default>
<title>Jaspersoft: <decorator:title /></title>
<!--customized message where we edited pro_nav_messages.properties with NAV_020_FULL_TITLE code >
<title><spring:message code='NAV_020_FULL_TITLE'/></title>


Saturday, 30 June 2012

JasperReport Server Customization - Upload a new theme with your company logo



You can customize your existing JasperServer as per your customer requirement.
You can change the default JasperSoft logo to your customer logo or your company logo, you can customize login page, and even you can customize your whole JasperServer as per your requirement.

Here are the some examples how to customize your existing JasperServer.

1: Upload a new your own theme- 

    a: Click on the Themes directory of the Jasper server and there you can see all the existing themes.
    
    b: Right click on the theme(for example- defaults) which you want to modify and select Download the theme  option.

    c: Give name to the downloaded theme and save it somewhere in your computer

    d: Right click on the Theme folder in Jasper server and select Upload a Theme option

    e: Browse the same .zip file which you just downloaded and upload the theme.

     f: Now you can upload your company logo in place of JasperSoft logo, to upload a new logo click on the your theme which you have just uploaded and select images sub directory, here you can find all the images which are currently being used by theme.

    g: Search for the logo.png image in images and edit the image, and upload your company logo but logo should be the same in dimension of JasperSoft logo.
                 (Logo dimension should be 141* 28 in pixels)
    
     h: Just right click on the new theme and select Set as Active Theme option.
          Now you can see new company logo in place of the JasperSoft logo.
  
     I: You can also change the main login page image, click on the your theme which you have just uploaded and select images sub directory, here you can find all the images which are currently being used by theme, search for the login_welcome_ce_bkgd.jpg and edit the image and upload your image(image size 669*283 in pixels)



How to add hyperlinks in Jasper Server reports or dashboard

Here I am showing you how to add hyperlinks to any test box or any image in Jasper server reports, so we can open another new report by clicking on hyperlink, it will be more useful in dynamic dashboard.
      Steps to add hyperlink:-

1:-  Open any report or dashboard where you want to add hyperlink.
2:-  Right click on the text box on which you want to add hyperlink, if the text is static, transform it to the text field, then only you can see the hyperlink option.

3:- A popup menu will open when you will select the Hyperlink option, select "ReportExecution" Hyperlink type from drop-down list
 

 4:- Now you can add Parameter name and expression for your hyperlink.
     Click Add button 

 

Link parameter name:-    _report   (for any  hyperlink)
Value expression-     "repo:/path_of_that_report_in_Jasper_server_which_you_want_to_open_as_hyperlink "

Value expression should be same as Jasperserver report path.
You can copy the path from Jasper server, when you open any report in jasper server, path always written in red color.
How to link any Web page to any text or graph in Jasperserver:-