Posts

Showing posts from April, 2015

Linkedin Status Update Image not displayed

I was facing this problem when I was updating images from my site on linkedin. I even asked a question on stackoverflow ( When using linkedin share api submitted-picture-url or sharing url via linkedin, particular url format doesnot work? ) but never got a good response. After that I did lots of experimentation to figure out few things about linkedin in status update image url. I would list them out below: Max size for image should be 100 MB (read somewhere, have not tried it myself.) Linkedin caches the images on its server for 7 days. So if the image on the url shared have changed, linkedin won't update it. A good workaround is to add a query parameter to the image url with some random string of the timestamp while sharing. So, this would make each image url unique. Set the correct mime-type on the servlet serving the image. I was using cdn and with my servlet acting at a proxy to cdn to serve the image. In the process I was missing out the mime-type in the response head

Email Validation Jquery Plugin.

Image
Recently I wrote a jquery plugin which would allow you to validate an email address for: Syntax checks (RFC defined grammar)   DNS validation Spell checks  Email Service Provider (ESP) specific local-part grammar (if available)  MX  Validation . Free Email Service Check Disposable Email Service check. Sanatize email id based on service provider. In future, I am planning to incorpoprate: Corporate Company details. If you have any suggestion then you can comment.  You can download the plugin here . Try a demo here . Some screenshots of the demo are: Media mention:  Its featured in  10+ Newest Free jQuery Plugins For This Week #16 (2015)   In  10+ Newest Free jQuery Plugins For This Week April #10 (2015) In  4月份本周超过 10 款最新免费 jQuery 插件 In  4月份本周超过 10 款最新免费 jQuery 插件

How to set Tomcat 7 source level to Java 7? Avoid "Resource specification not allowed here for source level below 1.7" error

I have been facing problem where whenever I was accessing jsp page which were using some Java 7 specific features, the compilation of such JSP pages use to fail with following error: Resource specification not allowed here for source level below 1.7 To fix this I googled for hours and set up the JDK home correctly on my catalina.sh with env.sh to point to jdk7. But this never solved my problem. Finally today I hit the gold while reading the apache tomcat jasper  documentation . The JSP compiler had to be set to use 1.7 as target and source version. To do this we need to add two extra init-params in the conf/web.xml file in the tomcat home.  The JSP servlet configuration should have      <servlet>         <servlet-name>jsp</servlet-name>         <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>         <init-param>             <param-name>fork</param-name>             <param-value>false</param-v

NPM Install Failing with EROFS in npm-debug.log on VirtualBox shared Drive [Updated for ETXTBSY]

I have a set up where I use my IDE on my host system and build my code on an Ubuntu server and deploy there. To achieve this I have used virtual box to install and run Ubuntu as a guest system. My host system is Windows.  I have shared a drive across to the guest. Every time my ubuntu comes up, I mount the drive using the command: sudo mount -t vboxsf SHARE_NAME folder_to_mount_on Things were working fine, with my Java server development. Now I decided to move my js and node environment to the same set up and BOOM! it failed. Only hint was EROFS error on the npm-debug.log. Some googling and I find out that VirtualBox has a bug and it does not support sysmlink and since ubuntu by default support symlink creation, npm was failing at the time of creation of sysmlink. My initial solution was to write a build script which rsynced my working directory to a level above and run the build command there. I worked but was slow and hacky. Then I found out that we can switch on symlink