Search This Blog

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