Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Tuesday, November 15, 2016

How to modify a user-defined list style in Microsoft Word 2016


  1. Click Format > Bullets and Numbering... > List Styles
  2. Select the style you want to modify and click Modify... . You can only modify user-defined styles.
  3. Update style
  4. Check Add to template. If you don't check this checkbox, your changes will only be applied to the current document else your changes will be applied to the template and will reflect not only to the current document but also to new documents.

How to create a new List Style template in Microsoft Word 2016

  1. Click Multilevel List icon in Home > Define New Multilevel List... or click Format > Bullets and Numbering... > List Styles > +
  2. If you want to change the default multilevel style, click the Format on the lower left part of the window and click Numbering...
    1. To create your own style, you cannot add a new one. You should click Customize.. to modify an existing style. The Reset button is initially disabled/grayed out if the style is not modified/customized (built in style) and becomes enabled after it is modified/customized. When Reset button is enabled, you may click it to reset back to the original built in style.
    2. Select a style
  3. If you want your style to appear under Multilevel List icon > List Styles, check Add to Template

Saturday, May 28, 2016

How to update non modifiable Classpath Variables in Eclipse

M2REPO

  1. Go to Preferences -> Maven -> User Settings
  2. Update User Settings to the location of your Maven settings.xml. The local repository will be automatically updated based on the localRepository configuration in your settings.xml.

Friday, April 29, 2016

How to call a shell script from another shell script

Note: Make sure to add #!/bin/bash to the first line of the script and make it executable through chmod 700 <path to script>.
  1. <path to script> or /bin/bash <path to script> or <scriptname> (add script to $PATH environment variable and call as normal command)
    - child script is executed in a new shell, changes in child script does not affect parent script
    - can be executed asynchronously through background command
  2. <path to script> &
    - same as no. 1 but executes child script on background
  3. source <path to script> or . <path to script>
    - child script is executed in a current shell
    - context is same as parent script (vars and functions of child script becomes visible on parent script)
    - exit call in child script will also exit the parent script
  4. exec <path to script>
    - terminates the current shell and executes on a new shell

Wednesday, April 27, 2016

How to create Bash Script on Mac

  1. Create the bash script file.
    Sample: File myscript.sh
    #!/bin/bash     #”hash-bang" or “she-bang" indicating that this script is to be interpreted and run by the bash shell
    echo hello world     #prints “hello world”
    
  2. Change the file permission to make it an executable. Open the terminal, navigate to the location of the file and type the following command:
    chmod 700 myscript.sh 
    See this link for more info on chmod: http://www.thinkplexx.com/learn/article/unix/command/chmod-permissions-flags-explained-600-0600-700-777-100-etc
  3. Run the script. Type the following in the terminal:
    ./myscript.sh

Tuesday, April 2, 2013

Merging in SVN using Eclipse

  1. Do a fresh checkout of the project where you are going to merge into. This is done to ensure that your target branch is up to date.
  2. Right click the project and click Team -> Merge
  3. In URL, browse on the source project
  4. Click Ok
  5. Resolve any conflicts

Monday, January 28, 2013

Ant buildfile

Each buildfile contains one project and at least one (default) target. Targets contain task elements.

Basic components/tags:
1) project - attributes: name, default, and basedir

2) target - attributes: name, depends, if, unless, descriptiondefault, and basedir

3) tasks - can be built-in or user defined
Common tasks: init, sets properties, prepare, creates directories, build, builds the system, package, creates jar file, install, installs an application to Tomcat or other engine, deploy, deploy a WAR engine, reload, update previously installed application engine, redeploy

4) properties - to reference, enclose in "${" and "}"
Some Built-in Properties: basedir, ant.file, ant.version, ant.project.name, ant.java.version


Tags:
                     ...


Ref:
http://ant.apache.org/manual/using.html

Sunday, January 27, 2013

Windows and Unix common commands

WindowsUnixDescription
attrib

change(clear or set) the attribute of the file

cdpwdprint current working directory
cd <dir>cd <dir>change directory
clsclearclear screen
cmdStarts a new instance of the Windows command interpreter
copycpcopy
cp /mySrc .
date, timedateprint current date and/or time
delrmdelete
deltreerm - rrecursively delete entire directory tree
dirlslist files and directories
ls attributes:
-a Include hidden fiels (beginning with .)
-l long format
-s sort by time modified
-r reverse sort 
doskey /hhistoryprint history
editvi etc.create new file, show edit window

common vi commands:
/<text> - search forward
n - next occurrence
?<text> - search backward
n - previous occurrence
:set number - show line number
:q | :quit | :q! - quit
exitexit
Ctrl-D
exit
findfinds files/folders or string in files
Ex.
dir c:\ /s /b | find "CPU" - display the file names on drive C that contain the string "CPU"
find . -name "foo*"
findgrepsearch
grep -n 'UnknownServiceException' */*/*/server.log
grep -rni "string" * .*
grep -E "a|b"
  r = recursive i.e, search subdirectories within the current directory
  n = to print the line numbers to stdout
  i = case insensitive search
  .* = hidden files/directory
  -E = extended regex (i.e., may use | for or) 
helpmanhelp/manual
displays all available commands & how to use them
ipconfig /allipconfig -aprint network details
mkdirmkdircreate new folder/directory
movemvmove file or folder
rmdirrmdirremove folder/directory
setenvset environment variable
set Pathecho $PATHprint value of environment var PATH
startstarting/opening a command/program
List of commands for Windows XP, Vista and Windows 7: http://ss64.com/nt/run.html
Ex.
subst notepad
start /d "C:\Program Files (x86)\Notepad++" notepad++.exe -> start the executable and close the command prompt that called it
substsubstituting path
subst R: D:\temp\temp
typecatdisplay contents of a file, concatenate files or create a new file
Ex.
cat > 1.txt
This is the first line.
- creates a simple text file. ^D mrks the end of file.
cat 1.txt - display contents of 1.txt
cat 1.txt 2.txt > 3.txt - concatenate 1.txt and 2.txt ans save it in 3.txt
treefind .,
ls -R
print directory structure
lessdisplay the contents of a text file on console
lnmake link
Types:
1. Hard link (default) - Points to a file through inode number. If the original file's name is changed, hard link still points to same file.
2. Symbolic link (ln -s) - Points to a file through name. If the original file's name is changed, symbolic link still points to the original name and does not point anymore to the original file. If the original file's content is changed, symbolic link still points to the same file.
ln -s myFolder myShortcut - create
ln -sfn myFolder2 myShortcut - update
   -f = force
   -n = treat LINK_NAME as a normal file if it is a symbolic link to a directory, else LINK_NAME  will be treated as symbolic link and will not effectively remove link to previous target and point to new target
printenvprint environment variables
tararchive/extract
tar -xvf sample.tar.gz

PATH
WindowsUnixDescription
\/Directory separator, e.g. C:\user\docs\sample.txt
/-Switch, e.g. dir /w
[drive letter:]\ or
\\[server name]\[volume]\
/Root directory
..Current directory
....Parent directory
~Home directory - $HOME var in UNIX, which usually is /home/username
C:\user\docs\sample.txt
docs\sample.txt
A:pic.jpg \\server01\user\docs\sample.txt
//home/user/docs/Letter.txt .
/inthisdir
../../greatgrandparent ~/.rcinfotd>
Sample paths


Source:
https://en.wikipedia.org/wiki/Path_(computing)

Monday, September 3, 2012

Useful Maven Commands

  • mvn --version - displays the Maven version in use
  • mvn dependency:tree - displays the dependency tree for this project
  • mvn eclipse:eclipse - creates/updates Java eclipse project settings (.project, .classpath, .setting/org.eclipse.jdt.core.prefs, & other config files)
  • mvn eclipse:clean - cleans/removes Java eclipse project settings (.project, .classpath, .setting/org.eclipse.jdt.core.prefs, & other config files)

Sunday, May 20, 2012

Apache log4j

DEBUG < INFO < WARN < ERROR < FATAL

Wednesday, July 27, 2011

Maven POM


Source: http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

Friday, July 22, 2011

Installing your own jar into Local Repository

  • Update your maven setting to point the localRepository to where you want to install the jar
    1. Go to <MAVEN_HOME>\conf directory
    2. Open settings.xml and change <localRepositorygt; tag to the path where you want to install the jar file
  • In command prompt, type:
    mvn install:install-file -Dfile=your-artifact-1.0.jar \
                             [-DpomFile=your-pom.xml] \
                             [-Dsources=src.jar] \
                             [-Djavadoc=apidocs.jar] \
                             [-DgroupId=org.some.group] \
                             [-DartifactId=your-artifact] \
                             [-Dversion=1.0] \
                             [-Dpackaging=jar] \
                             [-Dclassifier=sources] \
                             [-DgeneratePom=true] \
                             [-DcreateChecksum=true]
    
    Where: <path-to-file>  the path to the file to load
       <group-id>      the group that the file should be registered under
       <artifact-id>   the artifact name for the file
       <version>       the version of the file
       <packaging>     the packaging of the file e.g. jar

    Sample:
    mvn install:install-file -Dfile=C:\bel\docs\lib\jxl-2.6.3.jar -DgroupId=jexcelapi -DartifactId=jxl -Dversion=2.6.3 -Dpackaging=jar -DgeneratePom -DcreateChecksum=true

  • In your repository, you will find the new jar installed
  • To use the jar, add it in your pom.xml like:
    <dependency>
     <groupId>jexcelapi</groupId>
     <artifactId>jxl</artifactId>
     <version>2.6.3</version>
    </dependency>

Sunday, March 6, 2011

Deployment

  1. Create the package for full release
    1. Check out the Project in Eclipse
      1. Open SVN Repositories. Click Window->Open Perspective->SVN Repository Browser
      2. Assuming that you already have Repository Location set up, find the project in the trunk or branches
      3. Right click project then click Show History to ensure that it has the latest change/fix needed
      4. Tag or make a branch out of the project. Right click project then click New->Tag or Branch
      5. Right click newly created tag/branch then click Show History to ensure that the it has the latest change/fix needed
      6. Check out the newly created tag or branch. Right click project the click Check Out

    2. Build the package
      1. In the console, go to emea-pom of the checked out project
      2. Type
        mvn clean package –DemeaVersion=${currentversion}
      3. After a successful build, go to the emea-release project and copy the whole target folder in a different directory.

  2. Generate the config files/folders of the package
    1. Create a config folder inside the target folder or where the jar is located
    2. Create folders dev, sit, uat and prod inside config folder
    3. Open you FTP Client (e.g. FileZilla) and copy the config files to the newly created folders
      • DEV
      • SIT
      • UAT
      • PROD
    4. Update the ini file with the changes from project and change the VERSION property

  3. Deploy DEV using the exploded jar
    1. In FileZilla, upload/add target/classes/versions to /ams/domains/ACCTSVCS102/versions
    2. In FileZilla, copy target/config/dev to/ams/domains/ACCTSVCS102/versions/config
    3. On DEV WEBLOGIC, stop and delete previously deployed ear
    4. Open Putty and login to DEV (ehdeapp10v.uk.jpmorgan.com)
    5. Point latest to latest deployed version

      1. Go to /ams/domains/ACCTSVCS102/versions/biz-rules
      2. Type rm latest
      3. Type ln -s {newversionFolder} latest
      4. Do step 1-3 to config & emea folders as well

    6. On DEV WEBLOGIC, deploy new ear and start
    7. Delete temporary files

      1. Go to /ams/domains/ACCTSVCS102/scripts and type stop_all.sh
      2. Go to /ams/domains/ACCTSVCS102/servers/admACCTSVCS
      3. Delete tmp folder. Type rm -rf {folderName}
      4. Go to /ams/domains/ACCTSVCS102/servers/mngACCTSVCS
      5. Delete tmp & stage folder
      6. Go to /ams/domains/ACCTSVCS102/scripts and type start_all.sh

    8. Check server: DEV

  4. Copy package(jar) and config files to SIT (ehdeapp10v.uk.jpmorgan.com), /home/eis_dev/a_pfdv01/AMSNA

  5. Create JIRA

  6. Finish!

Sunday, January 16, 2011

Getting started with Ant

A(nother) N(eat) T(ool)

What is Apache Ant?
http://ant.apache.org/

Download bin:
http://ant.apache.org/bindownload.cgi

Getting started with Maven

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Download and extract bin from http://maven.apache.org/download.html

Basics:
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

To install a package into your local repository:
1) Open <MAVEN_HOME>/conf/settings.xml
2) Set the local repository
<localRepository>S:/bel/repo</localRepository>
3) Set profile
4) Set what profile to activate
5) Set proxy (optional?)
6) Run mvn install (if variables are needed, add -D{varname}={varValue}). To skip test add <skipTests>true</skipTests> on pom.xml (inside properties tag). To set a default/permanent variable, set it in MAVEN_OPTS environment variable

How to set MAVEN_OPTS
-> set MAVEN_OPTS=-Xmx512M -XX:MaxPermSize=128M
-> add in mvn.bat
1) edit <MAVEN_HOME>/bin/mvn.bat
2) add SET MAVEN_OPTS=-Dmaven.test.skip=true

Note:
- dependencies -> mvn install copies all libraries first from WEB-INF/lib to the snapshot lib before downloading all dependencies declared in pom into the snapshot lib. so make sure to always clean up WEB-INF/lib first before executing mvn install to remove any conflicting jars

Source: http://maven.apache.org/

Monday, December 6, 2010

Installing Eclipse Plugins

  • Copy and Paste
    1. extract package
    2. copy the contents of the "features" into the "features" folder of eclipse and copy the contents of the "plugins" into the "plugins" folder of eclipse

  • Using Update Manager (existing Eclipse software site)
    1. click Help->Install New Software...
    2. select the update site of you eclipse' version from the dropdown folder
    3. find the feature you want from the list and install

  • Using Update Manager (new software site)
    1. click Help->Install New Software... and click on Available Software tab
    2. add the download site
    3. select the update/download site from the dropdown
    4. find the feature you want from the list and install
    Ex.
    Drools - http://download.jboss.org/drools/release/5.5.0.Final/org.drools.updatesite/

    Some update sites are dependent on the version of eclipse.
    Ex. http://www.jboss.org/tools/download.html

  • Using Extension - to separate your plugins from other users
    1. create an extension folder with eclipse folder, e.g. C:\extension\eclipse
    2. copy the features and plugins folder of the plugin inside the eclipse folder (for additional plugins, do the Copy and Paste method above)
    3. open Update Manager and Add Site
    4. in Add Site window, click Local and specify the location of the extension folder, e.g. C:\extension
    5. browse and check the plugin you want to install in the Available Software list and click Install

  • Using Link
    1. http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-way/

Tuesday, November 30, 2010

Using FileZilla

  1. Open FileZilla
  2. Click File->Site Manager
  3. Enter host, leave the port blank
    Server type: SFTP
    Username: SID
    Password: orangewins
  4. Click Connect

Wednesday, November 3, 2010

Adding new SVN repository / Check out

SVN must already be installed in your Eclipse before this.

  1. Open 'SVN Repository Exploring' Perspective. On the 'SVN Repositories' View, click on 'New Repository Location' button.
  2. Enter URL, username and password, and finish.
  3. Select the project and right click. Click on 'Find/Check Out As...'
  4. Choose 'Check out as a project configured using the New Project Wizard' to ensure that the project is check out as an eclipse project (allow setting of build paths)
  5. Proceed and complete the check out.

Getting started with Eclipse Subversive

Getting started:
http://www.eclipse.org/subversive/documentation/gettingStarted.php

Installation:
http://www.eclipse.org/subversive/documentation/gettingStarted/aboutSubversive/install.php

Sample Installation: (Eclipse Helios)

Install Subversive Plugin using Eclipse update site
1) Help -> Install New Software...
2) In the "Work with" dropdown, select the update site of your eclipse version, e.g Kepler. The available software sites will be listed/displayed.
3) In the list, select Collaboration -> Subversive features then install. At the least, you only need the Subversive SVN Team Provider.

Install Subversive Plugin using SVN update site
1) Help -> Install New Software...
2) In the "Work with" dropdown, select the update site of SVN. If it is not available click "Available Software Sites". On the window that opens, select subversion update locaion. If location is not found, add it. SVN will now appear on the "Work with" dropdown. Select it.
Sample
Name: Subversive
Location: http://download.eclipse.org/technology/subversive/0.7/update-site/
3) In the list, select Subversive features then install.

Install Subversive SVN Connectors
1) Restart Eclipse
2) After restart you'll see connectors discovery dialog.
3) Install Subversive Connectors without registering connectors update site manually.

http://community.polarion.com/projects/subversive/download/eclipse/2.0/helios-site/ -

Update:
If the SVN Connectors are not downloaded,
1. make sure you are using a fresh workspace to launch Subversive Connector Discovery upon restart
2. get the latest release from:
http://www.polarion.com/products/svn/subversive/download.php?utm_source=eclipse.org&utm_medium=link&utm_campaign=subversive
Latest Release – Recommended
Help (free book):
http://svnbook.red-bean.com/

Sources:
http://www.eclipse.org/subversive