Saturday, December 15, 2012

How to add a user to sudo list

Edit the the sudo user list using the command
'visudo'
 under the line that looks like the following:

    root ALL=(ALL) ALL

Add the following

    joseph ALL=(ALL) ALL  // Here joseph is the user which is to be added to the sudo user list

You can go to root prompt by
sudo -s
or
sudo -i
provided you have access permission

Tuesday, December 4, 2012

Web programming using Java

When accessing a parameter from Java code, use request.
getParameter(“xxx”). When accessing a parameter from HTML, use the
expression language ${param.xxx}.

Tuesday, November 20, 2012

Un-taring a specific directory inside of a tar

tar zxvf alfresco-Nov19-2012.tar.gz --strip 1 alfresco/alf_data

or

 tar zxvf alfresco-Nov19-2012.tar.gz --strip = 1 alfresco/alf_data

To avoid the ssh login prompt delay

Create a file  named 'config' in .ssh/ with contents 'GSSAPIAuthentication=no'
ie
cat ~joseph/.ssh/config
GSSAPIAuthentication=no

Sunday, September 9, 2012

CVS notes

To login to cvs using pserver method it is
cvs -d :pserver:myuser@myserverip:/CVS/Repo/Location login

or u can do
export CVSROOT=:pserver:myuser@myserverip:/CVS/Repo/Locations
and
cvs login

Tuesday, September 4, 2012

Hibernate Learning Points

##

When a domain object gets created, it is in transient state
save() method makes a transient object into persistent object
save() method assigns object identifier and returns it as return value
Actual SQL requests are sent when persistent objects in a session get committed

##

Transient objects do not get committed to the database table
Only persistent objects do get committed to the database table

##

Each session represents a different persistence context
Persistent objects in a session becomes detached objects after the session it belongs to closes
A detached objects still maintains the object identifier that has been assigned before
The difference between transient object and detached object is that the transient object does not have the object identitifer (since it has never been assigned before) while detached object does
merge() takes a detached object as an argument and then returns a new persistent object that contains the same object identifier that the detached object used to have but of course

##

Tuesday, August 14, 2012

DELL Linux Support Laptops

Precision M4700
Precision M6700
DEL XPS 13

Monday, August 6, 2012

Java Notes, Factory Method


Factory method is just a fancy name for a method that instantiates objects. Like a factory, the job of the factory method is to create -- or manufacture -- objects.

The factory pattern (also known as the factory method pattern) is a creational design pattern.
A factory is a Java class that is used to encapsulate object creation code.
A factory class instantiates and returns a particular type of object based on data passed to the factory.
The different types of objects that are returned from a factory typically are subclasses of a common parent class.

The data passed from the calling code to the factory can be passed either when the factory is created or when the method on the factory is called to create an object. This creational method is often called something such as getInstance or getClass .

centralize creation of objects
In simple words, if we have a super class and n sub-classes, and based on data provided, we have to return the object of one of the sub-classes, we use a factory pattern.

Sunday, August 5, 2012

vFabric txc Server Developer startup problem


Server VMware vFabric tc Server Developer Edition v2.7 was unable to start within 120 seconds. If the server requires more time, try increasing the timeout in the server editor.
In the server view , double click the server, that will pop up editor window, please increase the time out value    

Thursday, August 2, 2012

creating roles and Role description in Lifeary

In 'portal-ext.properties'  give
system.roles = ABC1, CBD2, DEF3
system.role.ABC1.description=ABC Role
system.role.CBD2.description=CBD Role
system.role.DEF3.description=DEF Role

Thursday, July 26, 2012

template pages which are copied while creating themes

The following velocity templates are copied from Liferay to your theme's /docroot/templates folder:
  •  init_custom.vm: This file allows you to override and define new    velocity variables.
  •  navigation.vm: This file is called by portal_normal.vm and provides the
  •  portal_normal.vm: This file controls the basic skeleton HTML of the page HTML to make the navigation menus that Liferay will serve.
  •  portal_pop_up.vm: This file controls the layout of portal templates for pop-up notifications.
  •  portlet.vm: This file wraps the content of every portlet.

Wednesday, July 18, 2012

My Sample Alfresco DM, setup

Recently I had to setup  a demo on Alfresco 4.0.d as DM, the requirement was having Own document type. This document types has its own properties. I was able to do it by following the document by Jeff Potts "http://ecmarchitect.com/images/articles/alfresco-content/content-article-2ed.pdf" and help from the Alfresco forum.

Here I am planning to write it down, the steps which I had followed so that new comers can refer it.

Demo Requirement :- Customized document types, with properties. Some of the properties are text field, other have drop down, check box and dates.





Alfresco footer customization


To modify the footer of ALfresco Share

To see your organization in "GoTo" option in LR

To see your created organization on the "GoTo" menu
  •  You should be a member of those organization. 
  •   For the Organization, there should be a site created and existing 

file conversion using VLC

You can convert media files to different format using VLC
Go to menu
Media => Convert /Save file
Select the file which you want to convert
then click "convert/ save" option
name the file with extension and click "start"

Sunday, July 15, 2012

Liferay entry in portal-ext.properties for Linux system

redirect.url.security.mode=ip
redirect.url.ips.allowed=127.0.0.1,SERVER_IP

To see more than default 9 sites in Liferay

You need to modify "portal-ext.properties" to reflect the values
my.sites.max.elements=10

Sunday, June 3, 2012

Chaning MySQL user password


1) login to MySQL server, type following command at shell prompt to login as root
$ mysql -u root -p

2) Use mysql database (type command at mysq prompt, do not include string "mysql>"):
 use mysql;

3) Change password for user saji:
update user set password=PASSWORD("mypass") where user='saji';

Tuesday, May 29, 2012

Hylafax-DM integeration

Document Management integeration with Fax

Objective:-
After  FAX is received by the FAX server, it needs to be stamped with date and copied it to the DM
Once copied it to the DM, a notification is to be send to the user

Software used:- Hylafax and Alfresco 4.0.d

How to do :-
I have done the Hylafax setup in a CentOS 6.2. The installation for Hylafax server was straight simple, except the entry for "faxgetty"
In previous release of CentOS we normally added the faxgetty in /etc/inittab
In centOS 6.2 , we need to create a file in "/etc/init/" . I creeated a file known as "faxgetty.conf" over there
cat /etc/init/faxgetty.conf
start on runlevel [2345]
stop on runlevel [S016]
respawn
exec /usr/sbin/faxgetty ttyS1

Now the fax are received in a folder "/var/spool/hylafax/recvq/"
I have to read the new faxes every 5 minutes, If new fax comes I need to stamp the fax with the date and copy it to the DM

Alfresco setup
CIFS setup
For port redirecting, I created file "alfresco_cifs.sh" and run it , and then save the iptables setting using "iptables-save"
 The content of "alfresco_cifs.sh" is given below
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-ports 1445
iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-ports 1139
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1137
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1138

Then I needed to add the below configuration in  "/tomcat/shared/classes/alfresco-global.properties"

cifs.enabled=true
cifs.Server.Name=fax_a
cifs.domain=MYDOMAIN
cifs.hostanounce=true
cifs.broadcast=0.0.0.0
cifs.tcpipSMB.port=1445
cifs.ipv6.enabled=false
cifs.netBIOSSMB.namePort=1137
cifs.netBIOSSMB.datagramPort=1138
cifs.netBIOSSMB.sessionPort=1139
audit.enabled=true
audit.dod5015.enabled=true

Now again back to the Faxserver, we need to do steps for
(a) Mounting the Alfresco Share
(b) call a script using crontab to execute every 5 minutes,[ which will stamp the fax and copy to the DM)

Mounting the Alfresco Share in Hylfax server
make a directory to mount the Alfresco share
mkdir /mnt/faxdm
edit the "/etc/fstab" add simillar content
//Give-IP-DM/Alfresco/yoursite/documentLibrary/faxin    /mnt/faxdm    cifs    rw,suid,credentials=/etc/faxpass,domain=GEX

give mount -a
if success you should be seeing  DM contents using ls "/mnt/faxdm"

Now for copying the file, create a script named "FaxstampScript.sh"  with the following contents

#!/bin/bash
touch /root/myoutput
# search all the files which has been created since the last 5 minute
find /var/spool/hylafax/recvq  -mmin -5 -type f -name "*.tif"  > /root/myoutput

for i in `cat /root/myoutput`
do
cp -f $i /mnt/faxdm
cd /mnt/faxdm
# Stamping The copied FAX with present time
convert $i -pointsize 60 -draw "gravity south  fill yellow  text 8,26 '`date`' fill blue  text 12,20 '`date`' "  $i

done
rm /root/myoutput

To call this file, every 5 minutes make a crontab entry, simillar to
*/5 * * * *   /root/scripts/FaxStampScript.sh


At this stage we have a system now ready in which Fax is received by Hylfax, after each 5 minutes, the spool directory is checked for new faxes and the new fax is stamped and copied to the DM

For the notification, set ruls on the folder "faxin"

Hope this post will be helpfull to new comers like me
Thanks
Joseph John
Will be happy to personaly help and guide  freely to users in UAE

Mount Alfresco SAMBA dir

mounting sambashare

entry in the /etc/fstab

Sunday, May 27, 2012

Installing Alfresco Model Designer

Installing "Alfresco Model  Manager"
installing AMP


Wednesday, May 23, 2012

FAX receiving in Hylafax

edit /etc/init/faxgetty.conf , add the content  :
--
contents in faxgetty.conf

Sunday, May 20, 2012

To generate a simple keystore that can be used to sign a document

To generate a simple keystore that can be used to sign a document, run keytool with the following options:
keytool -genkey -keyalg RSA -alias "Your Name" -keypass yourpass -keystore keystore.ks -dname "cn=Your Name, c=US"

Wednesday, May 16, 2012

Installation of Alfresco Form Model Management addons

Step 1
copy

Step 2
java -jar /opt/ld/bin/alfresco-mmt.jar install alf_forms_management_1_2_3.amp alfresco.war -verbose

Step 3
restart the alfreso service

Step 4
In alfresco Explorer    create two spaces named  "Constraints" and "JsonModels"
under "Company Home/Data Dictionary/Models" 

Step 5
restart the alf service (I do'nt think step 5 is needed), test it for your self



adding addons in Alfresco


/opt/alfresco-4.0.1/java/bin/java -jar /opt/alfresco-4.0.1/bin/alfresco-mmt.jar install alf_forms_management_1_2_3.amp alfresco.war -verbose

java -jar /opt/ld/bin/alfresco-mmt.jar install alfresco-pdf-toolkit-0.97.amp  alfresco.war -verbose

Monday, May 14, 2012

Ifresco, setting for Apache


Cut and paste in apache conf file

Sunday, April 29, 2012

Client access / pgadmin access

In " var/lib/pgsql/data" edit the file  "pg_hba.conf" and add
 host    all         all         192.168.21.237/24        trust


also edit the file "postgresql.conf"  to refelect
 listen_addresses = '*'   

Tables which should not be used as any custom table

    A_ - asset management
    AD_ - application dictionary
    C_ - core functionality
    FACT_ - accounting (general ledger postings)
    FIN_ - financial management
    GL_ - general ledger
    I_ - import
    M_ - material management
    MA_ - manufacturing
    MRP_ - material resource planning
    R_ - request (CRM functionality that is deprecated now)
    S_ - services
    OB - Openbravo owned modules


The above prefixes belong to the core of Openbravo and should not be used by any custom tables.