NP++ pattern

[/*](.*)[*/]

for matching

/* 1: */

Advertisements

MS Font for J2EE Web application Deploying in Linux

Add this dependency to your projects POM

<dependency>

<groupId>ar.com.fdvs</groupId>

<artifactId>DynamicJasper-core-fonts</artifactId>

<version>1.0</version>

</dependency>

Red Hat Linux 6.6 configuring firewall

Found a superb command for configuring firewall in redhat linux

system-config-firewall-tui

Thanks http://ask.xmodulo.com/open-port-firewall-centos-rhel.html

Postgresql 9.5 and Red Hat Enterprise Linux 7.0

I used to use Postgresql 9.5 with Red Hat Enterprise Linux 6.6.

As quite a long time passed using them, I had change my server configuration. So, I tried to start using Postgresql 9.5 and Red Hat Enterprise Linux 7.0 . When started installing them, I found out that these completely new command set.  Here it goes,

wget https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
rpm -ivh pgdg-redhat95-9.5-3.noarch.rpm
yum install postgresql95-server.x86_64

Read more of this post

Check Linux Max Directory Size

Check Linux Max Directory Size

du -h –max-depth=1 | sort -hr

JSF : Check Version

JSF : Check Version

String version = FacesContext.class.getPackage().getImplementationVersion();

Tomcat – java.lang.OutOfMemoryError

Windows

find catalina.bat and add

# for out of memory
# Ensure that any user defined CLASSPATH variables are not used on startup,
# but allow them to be specified in setenv.sh, in rare case when it is needed.
CLASSPATH=

if [ -r “$CATALINA_BASE/bin/setenv.sh” ]; then
. “$CATALINA_BASE/bin/setenv.sh”
elif [ -r “$CATALINA_HOME/bin/setenv.sh” ]; then
. “$CATALINA_HOME/bin/setenv.sh”
fi

Read more of this post

Postgresql : moving data from windows to linux

I was trying to move my database from Windows server to Linux server. I thought it will be a simple process. But, it is not. It took backup from windows server via pgAdmin III. and tried to restore the backup to linux server via command line.

pg_restore -d dbname -U username -C /home/back1.backup

Then I got peer authentication error. so i fixed my pg_hba.conf file. It was

local   all             all                                     peer

I changed it to

local   all             all                                     trust

Then again I tried to run restore command. I got the following error.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2021; 1262 16483 DATABASE dbname dbname
pg_restore: [archiver (db)] could not execute query: ERROR: invalid locale name: “English_United States.1252”
Command was: CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ‘UTF8’ LC_COLLATE = ‘English_United States.1252’ LC_CTYPE = ‘Engli…
WARNING: errors ignored on restore: 1

Read more of this post

JDK installation in Redhat Linux

I had OpenJDK installed in my Redhat Linux. That openJDK was 1.6, i wanted to install jdk 1.7 from http://www.oracle.com/technetwork/es/java/javase/downloads/jdk7-downloads-1880260.html

So at first I had to uninstall OpenJDK. So,

yum remove java-1.6.0-openjdk.x86_64

Then I downloaded jdk-7u79-linux-x64.rpm from the above oracle.com link.

I copied the rpm to /usr/java and issued command as root

rpm -ivh jdk-7u79-linux-x64.rpm

after installation I issued

java -version

To check the installation.

The result. hmmmm….

java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Looks like we are cool.

Making an executable jar file

Process

Right click on your Java Project and select Export.

Select Java -> Runnable JAR file -> Next.

Select the Launch Configuration and choose project file as your Main class

Select the Destination folder where you would like to save it and click Finish.

Execute

java -jar <jar-file-name>.jar