Search This Blog

Tuesday, December 21, 2010

Work manager in WebSphere

The Work Manager API offers a solution for performing parallel processing directly within a managed environment. You can leverage this new offering to implement parallel processing within a J2EE container.
here are some interesting links to this issue:

The wise work manager for context-based scoping - Improve thread performance with the Work Manager API

The Work Manager API: Parallel Processing Within a J2EE Container

Notes about the Work class you might implement under websphere , when:
if  isDaemon  return  true, this Work is expected to run a long time and will not use a pooled thread.

enjoy
Yaniv T

Sunday, December 19, 2010

MQ Queue Manager connection pooling (MQQueueManager)

WebSphere MQ classes for Java Version 5.2 provides additional support for applications that deal with multiple connections to WebSphere MQ queue managers.
When a connection is no longer required, instead of destroying it, it can be pooled, and later reused.
This can provide a substantial performance enhancement for applications and middleware that connect serially to arbitrary queue managers.

read this complete article , with sample how to achieve connection pooling in your software.

regards
Yaniv Tzanany

Saturday, December 11, 2010

Android Development - kick start

One of a great Android Development Tutorial  i found  could be found here.
Android Development Tutorial - Gingerbread

you can forget from the above if you like videos
http://www.mybringback.com/tutorials/ - excellent stuff

another good one android-user-interface-design

http://www.vogella.com/android.html

remember there is no shortcuts !!!
enjoy
Yaniv

Friday, December 10, 2010

Eclipse Memory Analyzer with phd files - IBM dump format

If you try to open phd file with the MAT software (Eclipse Memory Analyzer Tool) , you will get some error,"Not a HPROF heap dump (java.io.IOException)".

the solution is to install IBM Diagnostic Tool Framework for Java Version 1.4 to the MAT.
Help -> software update -> find and install ,Click next  -> new archive site -> dtfj-updatesite.zip
The Installation instructions could be found here as well  http://www.ibm.com/developerworks/java/jdk/tools/dtfj.html

after restart your MAT , you can open the phd file, and find your memory leaks.

more info:
Using the IBM DTFJ with the Eclipse Memory Analyzer Tool

enjoy
Yaniv Tzanany

Wednesday, December 1, 2010

How to check your MQ client software connectivity to the QM - 2058 ?

Our software linked to  MQ client library , sometimes when the client deploy our software on new machine , or move it to other , he complain about the mq error 2058 , that we return  while trying to connect to the QM.

i am always explained that we have a buggy-less software, and check your environment :) ,

I suggest to run the built-in sample that arrived with the MQ installation.

This will give us a clue , if its installation issue or software .
I am talking about the amqsputc program (the client version one).
Here is how i managed to put messages on Windows QM , from our AIX.

bash-3.00# cd /usr/mqm/samp/bin

bash-3.00# export MQSERVER='SYSTEM.DEF.SVRCONN/TCP/srv1(1414)'
bash-3.00# ./amqsputc YANIVTIN QM1
Sample AMQSPUT0 start
target queue is YANIVTIN
hello world
^C
bash-3.00#

export MQSERVER='SYSTEM.DEF.SVRCONN/TCP/srv1(1414)'

The first part if the name of a 'svrconn' channel, the second is

the protocol used, and the third is the 'connection name'
consisting of either an ip address or hostname or dsn name,
followed by the port number. By default, MQ uses 1414.

btw:
in windows you set the env setting as follow:
SET MQSERVER=SYSTEM.DEF.SVRCONN/TCP/srv1(1414)


i hope its help
enjoy
Yaniv Tzanany



 

 

suggesting to the client

Thursday, November 25, 2010

Monday, November 22, 2010

Sunday, November 21, 2010

The Essentials of Filters in j2ee

A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. Filters typically do not themselves create responses, but instead provide universal functions that can be "attached" to any type of servlet or JSP page.
Filters are important for a number of reasons. First, they provide the ability to encapsulate recurring tasks in reusable units. Organized developers are constantly on the lookout for ways to modularize their code. Modular code is more manageable and documentable, is easier to debug, and if done well, can be reused in another setting.

All the great article and  sample could be found here The Essentials of Filters.
Must read a  pdf file SERVLET AND JSP FILTERS
more sample catalog JAVA servlet / filter samples

enjoy
Yaniv

Monday, November 15, 2010

How to consume WCF service from Java - step by step

Here is a step by step sample how to consume WCF service from java.

WCF in VS.NET (2008 in my case):
create a new project
file->new->project->web->wcf service application
leave the default settings as is , a new WCF service created by the wizard called Service1.svc.
press F5 -> make sure you can see the service page http://localhost:2813/Service1.svc and his wsdl file
http://localhost:2813/Service1.svc?wsdl.

to connect from java to WCF service we have to change the binding type from the default "wsHttpBinding" to "basicHttpBinding".
to do that , edit the Web.config file
change the end point to somthing like this :
<endpoint address="" binding="basicHttpBinding" bindingconfiguration="Binding1" contract="WcfService1.IService1"> </endpoint>

add the next binding section ( you can change it as you like)
<bindings>
<basicHttpBinding>
<binding name="Binding1"
hostNameComparisonMode="StrongWildcard"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
openTimeout="00:10:00"
closeTimeout="00:10:00"
maxReceivedMessageSize="65536"
maxBufferSize="65536"
maxBufferPoolSize="524288"
transferMode="Buffered"
messageEncoding="Text"
textEncoding="utf-8"
bypassProxyOnLocal="false"
useDefaultWebProxy="true" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
press F5 -> make sure you can see the service page after the changes  http://localhost:2813/Service1.svc and his wsdl file http://localhost:2813/Service1.svc?wsdl

JAVA side:
open cmd  window
cd to your axis2/bin directory  , cd C:\Program Files\Apache Software Foundation\axis2-1.5.2\bin
create directory test in the bin folder , mkdir test.
run the next batch file from your bin directory
wsdl2java.bat -o test -uri http://localhost:2813/Service1.svc?wsdl
the above command should generate the java stub to connect to your wcf service.
Service1CallbackHandler.java and Service1Stub.java.

add those file into your java test program and create your test function.
public static void CallWCFService()
{
try {
Service1Stub srv1 = new Service1Stub();
srv1._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,Boolean.FALSE);
Service1Stub.GetData data = new Service1Stub.GetData();
data.setValue(44);
Service1Stub.GetDataResponse reposne = srv1.getData(data);
System.out.println(reposne.getGetDataResult());
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

if you will remark the yellow line (enable the chunk), you will get the
org.apache.axis2.AxisFault: The input stream for an incoming message is null.
when i disabled the chunk , it works perfect.

i would like to say a special thanks to Yaron Naveh , that guide & helped me to get this works,Yaron have a very informative blog on this subject too, thanks Yaron !!!

From Microsoft article (http://msdn.microsoft.com/library/ee958158.aspx)

“For communication with the Java EE-based reservation application, a binding that uses standard SOAP on the wire is required. If the application and the platform it runs on support some or all of the WS-* specifications, the endpoint used by this client might choose WsHttpBinding. This would allow reliable, secure, and transactional communication between the two applications.
If this application and the platform it runs on support only standard SOAP matching the WS-I Basic Profile, however, the endpoint it uses to access the rental car reservation application would use BasicHttpBinding. If transport security is required, this binding could be configured to use HTTPS instead of plain HTTP.”

enjoy
Yaniv Tzanany

Sunday, November 14, 2010

Rampart FAQ and Web services stuff

Rampart = WS-Security module of Axis2.
in this blog you can find a very good FAQ about Rampart module , from basic to advanced stuff.
this link can be useful too , http://blog.rampartfaq.com/.
great blog on Web Services Security, Interoperability and Performance - WCF, Axis2, WSIT
enjoy

Using embedded DerbyDB

first i created the DB , using the ij tool .
i jar the db directory file into one jar file (dbs.jar).
i add to my class path the derby.jar file and dbs.jar.
i used the next method call
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
DriverManager.getConnection("jdbc:derby:classpath:mydb",m_connectionProperties);


if you want to run a script programmticly ,

The Derby Tools Library(derbytools.jar) contains a class named 'ij' which provides a static method called 'runScript'. This is the key to accomplishing what you want.
NOTE: The 'runScript' method returns the number of errors that occurred during the execution of the script.

http://db.apache.org/derby/javadoc/publishedapi/jdbc4/org/apache/derby/tools/ij.html
 
enjoy
Yaniv T

Apache DerbyDB

DB is a Project of the Apache Software Foundation, charged with the creation and maintenance of commercial-quality, open-source, database solutions based on software licensed to the Foundation, for distribution at no charge to the public.

I got the chance to test it and play with it,, as embedded db in my app.
i wrote some notes so i would like to share with you.
to start the db:
cd D:\MyStuff\R_and_D\DerbyDB\db-derby-10.6.2.1-bin\DERBYTUTOR
set DERBY_HOME=D:\MyStuff\R_and_D\DerbyDB\db-derby-10.6.2.1-bin
set PATH=%DERBY_HOME%\bin;%PATH%
setEmbeddedCP.bat
java -jar %DERBY_HOME%\lib\derbyrun.jar ij
CONNECT 'jdbc:derby:mydb;create=true';

running script
run 'cmd.sql';
disconnect
connect 'jdbc:derby:alis;shutdown=true';
Mapping of java.sql.Types to SQL types
http://download.oracle.com/javadb/10.3.3.0/ref/rrefjdbc20377.html
Derby data types
http://db.apache.org/derby/docs/dev/ref/crefsqlj31068.html
online manual
http://db.apache.org/derby/manuals/#docs_10.6
 
Derby supports the following formats for TIMESTAMP:

yyyy-mm-dd hh:mm:ss[.nnnnnn]
yyyy-mm-dd-hh.mm.ss[.nnnnnn]

Derby Date Format:
yyyy-mm-dd
mm/dd/yyyy
dd.mm.yyyy

DATE Test
create table tmstp (c1 DATE);
valid query:
insert into tmstp values ('1990-03-22 10:00:00');
insert into tmstp values ('05/23/2005');
Tuning
from ij command we run the next command
call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP','T_X',0);
commit;


CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP', 'T_X', null);
execution plan ->tuning
-- turn on RUNTIMESTATISTICS for connection:
CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
-- execute complex query here -- step through the result set
-- access run time statistics information:
VALUES SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0);

Sunday, November 7, 2010

IE9 for developers - what new

Yesterday i went to a session at Microsoft office, whats new in IE9, and how developers should prepared for this version.
its looks like IE9 its all about standard , HTML5 & CSS3 & SVG & performance boost , clean UI.
i understood that you could install this version only on OS VISTA and above , no XP.
i saw some nice feature from this beta browser , You can download the slide deck and demos from the lecturer site  -> IE9 for Web Developers Slide Deck and Demos.

enjoy
Yaniv T

Monday, October 25, 2010

Fiddler as proxy

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet.
its a MUST tool for web developer no matter if you develop for .NET or java.

in the next link you will find important info how to set fiddler as proxy and monitor ALL your web traffic from your application .
Configure an application to use Fiddler

hope you will find it usefull.
Yaniv T

Monday, October 18, 2010

How to enable SSL debugging in java parogram

You can see additional information, such as information about the SSL handshake, by adding jvm option
-Djavax.net.debug=ssl,handshake
-Djavax.net.debug=true
You can verify that this is an SSL mutual authentication by looking at the CertificateRequest during handshake.


If you want to see more debugging information, use the jvm option -Djavax.net.debug=all.


its took me a while to find it  :)
enjoy
Yaniv

Monday, October 11, 2010

How to block IP from different countries ?

Are you frustrated with malicious attacks originating from specific countries?
if your answer is YES ( a big yes) , you will find the next site Country IP Blocks  very useful.

Their database contains up to the minute network information on nearly 250 countries worldwide. They provide the data free of charge in CIDR and Netmask format.

secure your stuff

Yaniv T


Wednesday, October 6, 2010

Visual Studio 2010 and .NET Framework 4 Training Kit

In the next link you can get the "self study kit" of Visual studio 2010 and .Net 4.
Visual Studio 2010 and .NET Framework 4 Training Kit.

You can download the Microsoft Enterprise Library 5.0 from here.


study well ...
Yaniv T

Tuesday, October 5, 2010

log4j xml configuration

for my java web app i used the log4j logging.
here is a good link how to start and configure your log4j xml file configuration.
Log4j XML Configuration Primer

enjoy
Yaniv T

Tuesday, September 14, 2010

DHTML Menus, popup , on top Flash

when you have a flash component in your html page , you probably notice that when you open your menu , or trying to raise a html popwindows , that flash become on top of your html page.
if this is your situation , a very east solution describe here Flash, DHTML Menus and Accessibility.
the idea is simple just to change the "wmode" parameter in the flash starter script.

so easy .....

Yaniv T

Sunday, September 5, 2010

How to generate and analyze websphere heap dump ?

If you need to generate and analyze websphere heap dump , here is the complete action you need to take.

1. There are many ways to generate heap dump , the next way looks like the easiest ( for me ) to generate manually the heap dump
i used the next two commands in the wsadmin:
set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,node=MYXXXNode01,*]

$AdminControl invoke $objectName generateHeapDump

2. To analyze the output - download two useful tools - to analyze heap dump :
to run heaproot i used:
java -jar HR207.jar "C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\heapdump.20100905.152441.6336.0001.phd"

command sample:
ts -100 ->Tabulating all objects (100), sorted by total-size
os -100 -> Showing all objects(100), sorted by size.
up -> move up with the results
down -> move down with the results (next chunk)
os -100 > tt.txt  -> redirect results to file tt.txt

to run heapanalyzer i used ( its failed to open large heap dump):
java -Xmx1000m -jar ha406.jar "C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\heapdump.20100905.152441.6336.0001.phd"

all commands tested on windows with websphere 7.0 , should be ok on linux platform.

reference:
Generating heap dumps manually
Solving memory problems in WebSphere applications
Webcast replay: Using IBM HeapAnalyzer to diagnose Java heap issues

enjoy
Yaniv T

Wednesday, July 14, 2010

MQGET on Cluster Queue manager

you can read about Queue Manager Clusters
"As with distributed queuing, an application uses the MQPUT call to put a message on a cluster queue at any queue manager. An application uses the MQGET call to retrieve messages from a cluster queue on the local queue manager. "

when you are dealing with server binding mode and cluster queue manager you can use MQPUT on any QM in the cluster , when using MQGET  you should use the local QM - otherwise you will get reason code - 2085  while try to access/open it.

i used the next c++ option when i open the queue.

for get: MQOO_INPUT_AS_Q_DEF
For put : MQOO_OUTPUT

Yaniv T

Thursday, July 1, 2010

Slides from "Architecting for the Cloud" - Azure seminar

The next link, is to the post  of Danny Cohen who was the lecture on this interesting session "Architecting for the Cloud", Danny is a microsoft consultant , the seminar & Danny was very good , period.
here you can find all the slides.
Architecting for the Cloud (slide decks)
i am sure you’ll find them interesting and helpfull....

enjoy
Yaniv T

Monday, June 28, 2010

UI framework for web app and mobile device

I found this framework very rich and fantastic to use for web app and mobile too (iPhone) , follow the exisiting sample , and in case of mobile look at their demo on your iPhone, looks like native.

another popular framework is the jQTouch ,a jQuery plugin for mobile web development on the iPhone,
iPod Touch, and other forward-thinking devices.
enjoy
Yaniv

Monday, June 21, 2010

Visual c++ & MFC - useful links

When its coming to c++, i am still using the old new IDE the VC++ (visual studio 6) ( C# on VS2008)
i myself still developing c/c++ application via this version , i know what to expect so i never get disappointment . beside all our legacy source code developed via this IDE.
i found very useful site with some nice links that might be useful for people like me that still using the old IDE from microsoft  "C++, Visual C++, MFC - Tips and Tricks: collection of useful info, sample projects, source code, valuable links."

Yaniv T

Sunday, June 20, 2010

LogonUser API and get the user Groups

network management functions are very useful function to integrate your software with the network services such directory services (LDAP) etc.
In my case i used the LogonUser API to check a valid user/password of a user against the AD, and than i used NetUserGetLocalGroups api to check a valid group to the specific user.
of course you can do it as well with the ADSI api , but i found this easier to use.
note:
your running process should have permission to get the user groups.

Yaniv T

Thursday, June 17, 2010

Running Batch file from network location

I develop a java tester tool for our testers , and to avoid installing java run time on their machines, i create a directory in the network and copy there the java run time with my specific jars.
to make the life easier i create a batch file to run the tester tool.
hammmm , when i tried to run the batch file i get the next error on the next command  cd .\java\bin,
“CMD does not support UNC paths as current directories“.

i solved it by the next command: "pushd %~dp0\java\bin"
the %~dp0  is to Get the Directory Path of an executing Batch file
dont forget in the end use POPD command .

i have put all the stuff on the network e.g. \\server1\tester\
so finally my batch file looks like this :
@ECHO OFF
pushd %~dp0\java\bin
java -DPARAM1=../../param.config -jar ../../param.jar %1
popd
pause

enjoy
Yaniv T

Wednesday, June 16, 2010

C++ MQ application without MQ Client installation

The next stuff tested on mq v5.3.
Sometimes your program run on the same machine where the MQ server is installed , so why to install MQ client on this server , if you have the MQ server there ??
the "Trick" is in your app development , you need to compile and link your application with the correct MQ library , client or server.Usually the server library contains  the s character and the client with the c.
e.g. imq{c|s}23in, imq{c|s}23vn.

when dealing with server binding you need to know the next stuff, the channel name and the server name is ignored, the important parameters is just the queue manager name , and the queues name.
In case you want to connect to the default queue manager name leave the queue manager name empty.

Enjoy
Yaniv T

Sunday, May 30, 2010

Making an existing queue manager the default

on version 5.3
"On Windows systems, use the WebSphere MQ Services snap-in to display the properties of the queue manager, and check the Make queue manager the default box. You need to stop and restart the queue manager for the change to take effect. "
the above instruction  are from Creating a queue manager

on version 6 and 7
On WebSphere® MQ for Windows® and WebSphere MQ for Linux® (x86 platform) systems, you can make an existing queue manager the default queue manager as follows:
1.Open the WebSphere MQ Explorer.
2.Right-click IBM WebSphere MQ, then select Properties.... The Properties for WebSphere MQ panel is displayed.
3.Type the name of the default queue manager into the Default queue manager name field.
4.Click OK.
thats from here http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa10880_.htm


Yaniv

Configuring WebSphere MQ with the WebSphere MQ Explorer - Version: 5.3

The next link is a step by step of description + images , how to set queue manager , and local queue, via MQ explorer , i think its version 5.3.
i find it very useful for beginners .
http://support.sas.com/rnd/itech/doc9/dev_guide/messageq/mqexplor.html

enjoy
Yaniv T

Tuesday, May 18, 2010

Simple login page in asp.net form

sometimes you just want a simple login page , with user name and password, nothing more.
so here is a very quick and easy solution i just found.
ASP.NET version of "Login & Password" 

secure your pages
Yaniv T

Tuesday, May 11, 2010

Queue manager on mainframe / zos.

I have a program that put messages on MQ series its its working like a charm , the other side can pick up the message and everyone are happy, the MQ series installed on windows.
We try to deploy our program on the client environment they only changes was that the MQ series installed on mainframe, we knew that, but MQ is multi-platform OS there was no worries, so we manged to connect to the Queue manager and put a message , the problem was the other side could not pick up the message we sent.
we could not find what can cause it , untill we found this thread strange mq client behaviour whan connecting to mainframe

"Mainframe queue managers use syncpoint by default, other platforms do not. Messages are going onto the mainframe queue (causing the count to increase) but are not eligable to be read back (appearing to be blank) and eventually roll back (causing the count to decrease again). Use an explicit commit (like q.exe does). It won't affect running again non-mainframe queue managers."

so right after the put messages i used
qmgr.commit
and the other side could pick up my message from the mainframe queue - that's worked !!!

enjoy
Yaniv T

Monday, May 10, 2010

How to redirect requests from IIS to Tomcat server ?

i found very good links and articles that you will find them useful in case you want to redirect calls / requests from IIS to tomact server.
a step by step guide can be found here how to configure IIS 6 and tomcat with jk 1.2 connector also for IIS 7 on windows server 2008 .

and The Apache Tomcat Connector - Reference Guide
The Apache Tomcat Connector - Webserver HowTo

hope its get you to business
Yaniv T

Tuesday, April 6, 2010

Configure the firewall on my instance - IBM Cloud

The next link , is very important to read after creating your instances, its talk about how to configure your firewall on your IBM Cloud instances.
configuring a firewall on your instance
enjoy
Yaniv T

Wednesday, March 17, 2010

WebSphere network deployment - cluster

although i didn't created such topology yet, but i am about to do it in the near future . in the mean while i looked for stuff regards this issue.
and i found many many many stuff.

here some useful links i found that its a good starting point(i might add some later - i am sure there are more)
Setting up a multinode environment
step by step -> Using WebSphere Application Server V5 for load balancing and failover.

session Management in cluster is very important here is a useful link.
IBM WebSphere Session Management



Yaniv T

Sunday, March 7, 2010

Visual C++ 2008 Express

recently i found myself looking for a way to improve our development IDE.
we are still coding via vc++ 6.0 , and moving forward sound great, and might improve developer time and life.

BUT - there is no money to "spend" on not necessary product , so i looked at Visual C++ 2008 Express edition.
i immediate found that Applications using either MFC or ATL require the Standard Edition or higher , and our software using MFC.
another point is that Visual C++ 2008 Express does not include OpenMP support, 64-bit compilers, or a resource editor, about the 64 bit support you might find a solution around this in this post.

another good real life situation read this How useful is Visual C++ 2008 Express Edition for commercial use.

enjoy
Yaniv T

Saturday, March 6, 2010

Convert CSV data to DataTable

here is a complete working function ,how to convert csv data , in this case a string array , string[], to data table

Convert CSV data to a ASP.Net DataTable

enjoy
Yaniv T

keep your session with HttpWebRequest

after i manage to do "login" programmatically via HttpWebRequest class i wanted to consume another page that is visible only after you authenticate (e.g you have a valid session) , i found this post C# Spider with HttpWebRequest.
look at the next line , in my case its was the key, to continue with the same session that i already created - i just use the same CookieContainer i created in the first call.
CookieContainer myContainer = new CookieContainer();

enjoy
Yaniv T

Thursday, March 4, 2010

java script code

i know there are many sites for java script , but,i found this efficient java scripts library.
DHTML scripts for the real world.
i am sure you will find something to enhanced your site.
enjoy
Yaniv T

Monday, February 8, 2010

ASP.NET Date Format on Web Hosting

sometimes you need your application to behave in a specific culture behavior e.g. in Hebrew and not in English - in my case is the DataFormat issue between those two culture . in Hebrew (he-IL) its dd/mm/yyyy and in en-us its mm/dd/yyyy.
so in development everything works just fine , your laptop is set in the correct culture , your date foramt is set via the control panel and its all works just fine (the dates in your grid), after deploy it on the Host server, you see that your dates in the grid look like the en-us format , and you do not have any access to the hots control panel or somthing like that.

the simple solution is to override the globalization in your web.config file.
before the </SYSTEM.WEB> add the next line
<globalization culture="he-IL"> and you will see your dates in the grid in the right & expected format.

enjoy
Yaniv T

Sunday, January 31, 2010

Find string in file - Replace string - linux command

find string in file:
grep -r "MAX_BUFF_SIZE" $PWD

only in txt file
grep -r "MAX_BUFF_SIZE" /home/*.txt

OR (fing blabla in rmak file)

find . -name rmak |xargs grep -i 'blabla '


find replace:
the next command will look for "-fpermissive" in rmak files and replace it with "-fpermissive -m32" string
find ./ -name rmak | xargs sed -i -e 's/-fpermissive/-fpermissive -m32/g'


Yaniv

Thursday, January 28, 2010

Recursive Delete file on Linux

if you want to delete file recursive under Linux use the next command .
e.g.
to delete all file with extension o

find . -name *.o -exec rm -rf {} \;

Wednesday, January 27, 2010

IBM Cloud solution

Recently i started to "play" with IBM solution for the cloud , you can find it at Development & Test from IBM .

Its still in Beta and open for developers and test, the idea very much looks like Amazon WS , you can create you instance in a minutes and you can choose from several existing instances (Images) , you can even create your own image publish it ( i guess) , also you can have your own storage on the cloud and mount it to any instance you already have.
i suggest first to create your storage and than your instance , because while creating the instance you can mount the storage easily.
i created my SUSE Linux Enterprise v10 SP2 from an exiting image , i manage to connect to it via putty (watch this video for Accessing Instances using SSH Clients ).
in the next steps i will explain how do i install MQSeries 7.0.1 on it .
i upload to my Storage the MQSeries installation file (tar.gz file) via ftp (i used filezilla - use the next link how to use filezilla with the key supplied- Key based authentication ).
i unzip it and open it.
the complete installation step for MQ 32bit -> Installing a WebSphere MQ
i didn't update any kernel parameters.
you have to run the mqlicense.sh under root permission , but we do not have any root password , so the trick is:
use the sudo command on the cloud to run command under root.
so i use -> sudo su - root
and than i run the installation
add idcuser to the mqm group -> useradd -G mqm idcuser
for RedHat version i used -> usermod -G mqm idcuser

IBM cloud solution is still in Beta so their site is quite slow and buggy , but its looking good and do the job at the moment , in 2 minutes i created my Suze server with websphere 7, i want to see you do it by yourself , and its working too !!!

Get started with the IBM Smart Business Development and Test on the IBM Cloud


regards
Yaniv T

Check If file exist in c++

to check weather file exist in a directory , you can use the next system call:
access C Method
See usage example here: How to check professionally if a directory exist?
in unix it’s a valid C method , you might need to include unistd.h

Yaniv

Monday, January 25, 2010

MySQL Connector Net on Hosting server

while i try to deploy my site that use asp.net with Mysql Database , i get the next error:
"Unable to find the requested .Net Framework Data Provider. It may not be installed. ".
to fix it , you need to set your mysql connector as a provider , because you can not edit the machine.config file , so you will have to add the next lines to your web.config file , you can copy and paste from yours machine.config file.
<system.data>    <DbProviderFactories>      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.1.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />    </DbProviderFactories>  </system.data>


you may have to set the version number, depending on which Connector you are using.

enjoy
Yaniv T

Monday, January 11, 2010

Java theory and practice

i like to recommend on a very good JAVA articles
Technical library view

enjoy
yaniv

Sunday, January 10, 2010

Making modal dialog windows work in ASP.Net

In the next link you will find - A perfect solution for a very frustrating problem , opening Modal window from asp.net.
Making modal dialog windows work in ASP.Net the easy way.

the next link describe how to Referencing the Opener (communicate with the opener window)


enjoy
Yaniv T