POKE ME for any consultancy

Friday, January 8, 2016

How can I resolve a Subversion svnsync lock?

Question:
Failed to get lock on destination repos, currently held by 'amitanand.com:d7283e06-08ca-479a-8de9-20467d191098'

svnsync: Couldn't get lock on destination repos after 10 attempts

Answer

You have to remove the lock property on the remote repository via svn command line on the remote site which has been left over from a failure during synchronization.
svn propdel --revprop -r0 svn:sync-lock file:///path/to/the/repository

Tuesday, December 22, 2015

Difference between Ant and Maven

Ant and Maven are different building tools in Java. Both the tools are considered good but with slight differences.


ANT full form is Another Needed Tool. Ant is a build tool that is java based. A build tool performs the following tasks:


  • Compiling java code into byte code
  • Placing this byte code in a package
  • Deployment to production systems
  • Document creation and release notes preparation.

Before start using ANT, we should be clear about the project name and the .java files and most importantly, the path where the .class files are to be placed.

How to use Maven
Refer: http://www.javatpoint.com/maven-repository and http://mvnrepository.com/
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

  • Repeatable builds: if you can build the project, your colleagues will always be able to on their machines. It'll also be repeatable on the build server.
  • Standardization of the build system: new developers who understad Maven will instantly know how to build, release, test etc, removing a lot of learning overhead.
  • Focus on automation: Maven puts you in a mindset of automating processes around your software development.
  • Convention over configuration: no setup or minimal configuration required to build artifacts.
  • Dependency management: Maven will resolve and manage your dependencies for you.
  • Testing: the ability to run tests and integration tests as part of your project life cycle.
  • Plugins: there are thousands of plugins to carry out various tasks. These are simply configured in just by adding a reference into the POM.



The great advantage of using Maven is its repository infrastructure. This promotes standard protocols for the sharing of 3rd party libraries and enables teams to collaborate more effectively without being forced to check everything into the same source code repository (Modular builds).
Repository managers are freely available and I'd recommend installing one of the following:
  • Nexus
  • Artifactory
  • Archiva

Maven pom.xml file:

POM is an acronym for Project Object Model. The pom.xml file contains information of project and configuration information for the maven to build the project such as dependencies, build directory, source directory, test source directory, plugin, goals etc.


Element
Description
projectIt is the root element of pom.xml file.
modelVersionIt is the sub element of project. It specifies the modelVersion. It should be set to 4.0.0.
groupIdIt is the sub element of project. It specifies the id for the project group.
artifactIdIt is the sub element of project. It specifies the id for the artifact (project). An artifact is something that is either produced or used by a project. Examples of artifacts produced by Maven for a project include: JARs, source and binary distributions, and WARs.
versionIt is the sub element of project. It specifies the version of the artifact under given group.

Software Configuration Management Best Practices


  • SCM Best Practices are designed and implemented to ensure software quality, integrity and reproducibility.
  • Properly Supporting Distributive Development Environments.
  • Customize SCM to Support all SDLC Methodologies.
  • Create Auditable Processes.
  • Build Early and Build Often.
  • Fully Automate the Build Process
  • Continuous Integration builds.
  • Creating a repeatable build process
  • Using a secure and dedicated build server
  • Require all necessary files be checked-in prior to the build
  • Label the source code in each build with a unique identifier.
  • Reporting tool to be integrated with Build tools/Source code tools
  • Create a build manifest of the build artifacts.
  • Create and keep your build logs
  • Send build status emails
  • Track release baselines of your software build

Saturday, December 19, 2015

ANT Build file

<?xml version="1.0"?>
<project name="AmitAnand" default="jar" basedir=".">
<property name="src.dir" location="src" />
<property name="build.dir" location="D:\build" />
<property name="project.name" value="AmitAnand" />
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="makedir">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/classes" />
</target>
<target name="compile" depends="clean,makedir">
<javac srcdir="${src.dir}" destdir="${build.dir}/classes"/>
</target>
<target name="jar" depends="compile">
<jar destfile="${build.dir}/jars/${project.name}.jar" basedir="${build.dir}/classes" />
</target>
</project>

Wednesday, August 26, 2015

Basic Memory Structures

Refer: http://docs.oracle.com/cd/E11882_01/server.112/e40540/memory.htm#CNCPT7778

The basic memory structures associated with Oracle Database include:
  • System global area (SGA)
    The SGA is a group of shared memory structures, known as SGA components, that contain data and control information for one Oracle Database instance. The SGA is shared by all server and background processes. Examples of data stored in the SGA include cached data blocks and shared SQL areas.
  • Program global area (PGA)
    A PGA is a nonshared memory region that contains data and control information exclusively for use by an Oracle process. The PGA is created by Oracle Database when an Oracle process is started.
    One PGA exists for each server process and background process. The collection of individual PGAs is the total instance PGA, or instance PGA. Database initialization parameters set the size of the instance PGA, not individual PGAs.
  • User Global Area (UGA)
    The UGA is memory associated with a user session.
  • Software code areas
    Software code areas are portions of memory used to store code that is being run or can be run. Oracle Database code is stored in a software area that is typically at a different location from user programs—a more exclusive or protected location.
Figure 14-1 illustrates the relationships among these memory structures.
Figure 14-1 Oracle Database Memory Structures
Description of Figure 14-1 follows
Description of "Figure 14-1 Oracle Database Memory Structures"

Oracle Database Memory Management

Memory management involves maintaining optimal sizes for the Oracle instance memory structures as demands on the database change. Oracle Database manages memory based on the settings of memory-related initialization parameters. The basic options for memory management are as follows:
  • Automatic memory management
    You specify the target size for instance memory. The database instance automatically tunes to the target memory size, redistributing memory as needed between the SGA and the instance PGA.
  • Automatic shared memory management
    This management mode is partially automated. You set a target size for the SGA and then have the option of setting an aggregate target size for the PGA or managing PGA work areas individually.
  • Manual memory management
    Instead of setting the total memory size, you set many initialization parameters to manage components of the SGA and instance PGA individually.

Monday, August 17, 2015

How Devops can be improved?

Few tips to improve Devops:

Frequency of deployments – The number should either remain steady or go up week to week.
Volume of changes – Measure the volume and complexity of user stories and new lines of code deployed.
Amount of time from development to deployment – The lead time from when the code begins development till it’s deployed to production. The amount of time should decline as the team develops – and is a central gauge of how efficient the process is and where it must be improved.
What is the ratio of unsuccessful deployments? – How often do deployments fail or even cause outages? As DevOps is implemented, the quality of the deployments should go up and the percentage of failed deployments should go down.
Recovery Time – This is perhaps the greatest test of the quality of the team – how long does it take to recover when a failure does occur. Although the time should generally trend downwards, teams should not be discouraged by the occasional spike as they run into issues for the first time.
Customer Tickets – The goal of DevOps is to increase deployments without causing failures. By reviewing the number of customer tickets you’ll have a good idea how well you’re doing.
Increase in user volume – By tracking how many users are signing up you can make sure the organization can handle the new requests.
Response Time – This number should remain steady no matter the percentages of change in user volume as the product should be functioning in predetermined thresholds.