Skip to main content

Posts

Build Wine rpm with 32 bit application support

Wine is a software to allow running Windows applications in Linux, MAC etc. platforms. It is available for installation from package managers like yum (RHEL, CentOS) and apt (Ubuntu). You can find more details on how it works in Wine wiki . But the default Wine package available from package manager does not have support for 32 bit Windows applications. This was the case for me. In Redhat Enterprise Linux 7.3, the wine package did not contain support for 32 bit windows applications. So the only option was to build a separate rpm of wine which will include this support. All the steps are executed on a RHEL 7.3 VM (x86_64). Step 1 Download and run shell script which will make wine 64 and 32 support for RHEL: https://github.com/zma/usefulscripts/blob/master/script/install-wine-i686-centos7.sh It accepts a version no. as CLI parameter e.g. 2.0.3 The script installs wine in /usr/local/ directory by default. We can verify the files that are being copied for wine using "...

Generate POM files for a 3rd party artifact in Maven

Maven is a popular software project management tool. It is used heavily for building you project deliverables. More information about maven can be found here . Maven works on the dependency concept. It essentially means that every project should identify its required artifacts. These artifacts can be found in repositories. Repository is a central place where you keep all your required jars (or other resources). There is a specific structure required to put your artifacts into the repository. We can not just copy every thing at same place. To identify a resource through dependency mentioned in pom.xml, maven looks for the specific structure. Also ther should be a .POM file at the same location of the artifact. Normally the artifacts generated by maven build comes with the POM for it. So that, any other project wanting to use this artifact can do that. But if the artifact is created from a build other than maven (e.g. ant, Makefile etc), it will not have the POM generated. So this ar...

Using Multi threading with Drools

Drools is a very popular rule engine. It is based on Rete algorithm. To understand what is a rule engine and how to use it check here . But here I will assume that you have some working knowledge on Drools. What I am going to discuss in this post is 'how to use multi-threading with Drools'. Below is a snippet which creates a KnowledgeBase from a DRL file. If this method is called from multiple threads I get below exception - Exception in thread "Thread-60" [Error: incomplete statement: (possible use of reserved keyword as identifier: )] [Near : {... globals != empt ....}] ^ [Line: 0, Column: 0] at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(* MVELInterpretedRuntime.java:153*) at org.mvel2.MVELInterpretedRuntime.parse(* MVELInterpretedRuntime.java:44*) at org.mvel2.MVEL.eval(*MVEL.java:514*) at org.mvel2.templates.res.IfNode.eval(*IfNode.java:61*) at org.mvel2.templates.res.TextNode.eval(*TextNode.java:46*) at org.mvel2.templates.res...

How to add new nonCacheable resource by inheriting Tomcat's DefaultServlet

D o you have a web resource in your application which is dynamically generated/modified? And do you use JavaScript/Ajax (i.e. you do not have the resource mapped to a servlet in your application web.xml) to read that resource? If both answers are yes, then you may have seen that the request for the resource does not return the updated file always. The reason is DefaultServlet class of Tomcat which implements a caching technique for resources. If there is a HTTP request to access the resource before 5 sec of the last modification time, DefaultServlet will send the file from its cache (older content). DefaultServlet is a servet provided by Tomcat distribution (and JBoss too). As the name suggests, it is the default choice. If your web application does not map a web resource to some servlet, DefaultServlet serves that resource. Only exception is JSP pages. Check out DefaultServlet Javadoc  and source code . The servlet mapping is defined in Tomcat web.xml which is normally present ...

'Copy attachment from another email' feature in web based email clients

T his is purely an experience driven idea. Looks a bit crazy right now. But should be possible to implement this one. Let me brief about the feature I am looking for in web based email clients. To mention a few web based email clients- Gmail , Yahoomail , Hotmail etc which you use from your browser. Lot of times we send some documents via email. These are called attachments. If you are using a web based email client you have to upload the document to the mail server to attach them in email. The uploading definitely takes time in a slow connection or for a big size attachment. The act gets annoying for me if the same attachment has to be sent in 3 or 4 different emails. Just think of a situation, where I have 3 mails from 3 different contacts requesting for my CV. The easiest way is to reply all of them in a single mail attaching the CV. But what if I don't want to disclose to any contact that I am sending my CV to others as well. I am sure you have been in such a situation many a...

Starting up

T his is the first blog I'm creating and this is the first post. Feeling a bit nervy. Though its a great experience to write a blog. Initially I felt its not my stuff. But I follow other blogs and really like the whole idea of blogging.  Still somehow it took a long time for me to start on this space.  As they say, it is never late to start something new, I have started blogging. This blog will be about tech topics that I occurs to me. I'll share my new ideas and hacks. Sometimes I may try to explain some common technology concepts in my own way. I do hope that it becomes useful for somebody.