Speech Therapy, Apraxia Articulation Word FlashCards
Contact: kidsappbaba@gmail.com or Call : +1-980-APRAXIA
$dir = "backupsDir";And with this, if you run this script, your backup should get triggered, it should create a joomla backup with SQL file, it should get zipped and sent to your google drive and your should get an email that says Backup has been shared with your email account !
$dh = opendir($dir);
$strToSreach = "NameOfThebackpFile".date("Ymd");
printf($strToSreach);
$nameOfFile = "";
//Search the file
while (false !== ($filename = readdir($dh))) {
if( substr($filename,-4) == ".sql" && substr($filename,0,15) == $strToSreach ) {
printf("Found the file: ".$filename);
$nameOfFile = $filename;
}
}
$path = $dir."/".$nameOfFile;
printf("zipping the file: ".$nameOfFile ."
");
exec('gzip ' . $path);
$path = $dir."/".$nameOfFile.".gz";
printf( "Uploading %s to Google Drive\n", $path ."
");
$service = new DriveServiceHelper( CLIENT_ID, SERVICE_ACCOUNT_NAME, KEY_PATH );
Sometime you might have to change the context root(CR) of the application deployed on weblogic from CR1 to CR2. This can be easily done by updating the context root in the application.xml file in your ear file.
But then if you might also want to redirect all the old URL references to this new context root. So if somebody access http://yourhost/CR1 it should redirect to http://yourhost/CR2. It’s easy to do in Apache server using mod_rewrite module. But weblogic as such don’t provide this functionality.
So here is quick handy way to achieve this:
1. Create a dummy web module under CR1.
2. Update application.xml as follows:
<module >
<web>
<web-uri>newAppDir</web-uri>
<context-root>/CR2</context-root>
</web>
</module>
<module>
<web>
<web-uri>oldAppDir</web-uri>
<context-root>/CR1</context-root>
</web>
</module>
3. Configure web.xml for this dummy web application such that all the requests will be handled by a single JSP, redirector.jsp
a. Set the welcome file as redirector.jsp
b. Add Following servlet mapping to catch all the URLs and let it handle by redirector.jsp
<servlet-name>wlRedirector</servlet-name>
<jsp-file>/redirector.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>wlRedirector</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
4. In the redirector.jsp add code to change the CR1 to CR2 and sendRedirect to CR2
String recvUrl = request.getRequestURI();
recvUrl = "/CR2" + recvUrl;
if (request.getQueryString() != null) {
recvUrl += '?' + request.getQueryString();
}
URL reconstructedURL = new URL(request.getScheme(),
request.getServerName(),
request.getServerPort(),
recvUrl);
response.sendRedirect (reconstructedURL.toString());
Rahul Ner
Non-Recursive Find in Unix for "*.log": Just current directory
find . \( ! -name . -prune \) -name "*.log" -print -type f
Is your J2EE application responding slowly ? Is it getting hanged every now and then ?
The best way to start is take thread dump whenever you think performance is not to up to the mark and then analyze it.
Taking Thread Dump:
On unix system , you just have to first find out PID of your java process. You can use PS –alf | grep –in ‘java’ to find out the same.
Once you have PID, simply execute Following command:
kill -3 PID
This will inform JVM to take current snapshot. It will be then copy to your standard log file/stdout file.
On windows, you have to execute ctr-break on the command prompt.
Analyzing Thread Dump:
If you don’t have right to tool for this, then it’s very hard to grasp what’s going on. I have used TDA http://www.ohloh.net/p/tda . This one is very nice, simple, easy and free tool. Once you open your log file (containing dump) in this tool, it will show all threads in tree structure, along with details of each thread. Most important of it is the thread state which could be like runnable, wait, wait on monitor, wait on conditions etc. Also it will show sleeping and locking threads separately. This will help you to identify the object on which threads are waiting and thereby identifying bottleneck in the system.
It has one feature to compare multiple thread dumps. It helps in finding out long running threads instantly.
If you have set -XX:+PrintClassHistogram JVM option while starting it, in thread dump it will also provide information of number of instance create for each classes along with the total bytes required for those objects. This should give you a fair idea of what classes and which modules are the one to look first for the optimization.
Rahul Ner
(RNer)
Axis provides excellent platform for web service creation and deployment. Let's say you have a plain java class that you would like to expose as a web service. You can achieve this in few minutes. I assume here axis.war is already deployed on to your app server.
1. Create your java class with the method that you want to expose. (Its not web service aware.. so you don’t need to implement any interface etc.)
2. Now, register your web service with Axis. Simply add entry following entry to axis.war\WEB-INF\server-config.wsdd.
<service name="WebServiceDemo" provider="java:RPC">
<parameter name="className" value="test.wbservice.Demo"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="wsdlTargetNamespace" value="http://test.wbservice"/>
</service>
Class Name is fully qualified name of the class created in step 1. Now copy demo.class file to axis.war\WEB-INF\lib. If you prefer, You can create jar file containing this class and copy that to lib directory.
3. Restart your app server
4. Now you have deployed web successfully. You can check that using http://appsever_url/axis/services/webserviceDemo
You can generate WSDL file containing all information of your web service using http://appsever_url/axis/services/webserviceDemo?wsdl
5. Now You can generate client side stubs and classes required using WSDL2Java tool provided by axis.
You have to execute this class passing wsdl to it.
java -cp axis.jar;commons-discovery.jar;commons-logging.jar;jaxrpc.jar;saaj.jar;log4j-1.2.8.jar;xml-apis.jar;xerces.jar;wsdl4j.jar org.apache.axis.wsdl.WSDL2Java http://appsever_url/axis/services/webserviceDemo?wsdl
This will create all required file at the client side.
6.Generate client
DemoServiceLocator demoLocator = new DemoServiceLocator ();
Demo demo = demoLocator .getWebServiceDemo();
Demo.call_your_method()
Rahul Ner