Skip to main content


Showing posts from November, 2011

Advantages of working remote

There are many disadvantages of working remote  but there are many advantages of working remote.
You are saving time on commute so you get more time for family if you are disciplined enough to start/stop work at office times (rarely happens on all days but still better than getting stuck in traffic)Less people coming and distracting you by just walking into cubicle to discuss office politicsLess people coming and asking you things that they can just google for themeselves.Due to the above points you get more work done in less amount of time.You RTFM more than usual. If you are stuck on an issue you are the only one who can find the solution as the luxary of walking into someone's cubicle for help is gone, In a sense its a double edged sword but as you are left with no choice in the end you come up as winner and you become more and more of problem solver on your own. This way you tend to research things in detail and increase your arsenal of skills.

openoffice and NFS file saving issue

I recently integrated a file preview application in our application with team, so now users can preview most of the files without downloading them. The hard part was to deal with NFS issues due to locking and caching. We chose to buy v/s build for the file preview and bought some third party service. The third party service lets call it APreview had a http api where you can pass the source and target file path. It would have been much better if we could stream the input and it could stream the output but that option was not there. Because we can only pass paths to it the natural solution was to use NFS paths. So we ran into two major issues:

1)The APreview application internally uses openoffice to convert word/PPT/Xls files to pdf and then it converts pdf to swf. openoffice has some issues with writing to NFS and we could use vi and other tools to write files but openoffice would just refuse to save the file as pdf. Finally I found that commenting these two lines in /usr/lib64/openoff…

Disadvantages of working remote

Just ranting it out loud, I am working remote for the past two years for a startup and there are many advantages of working remote but there are many disadvantages also.

Its hard to chase people over phone. As people wont pick up the call or they wont reply to Instant Messages. So you are stuck in your chain of thoughts cursing the monitor.You miss the coffee talk.You miss what's going on in the office and really dont know whats going in the company.In meetings you could be writing code and its easy to get distracted over phone.Some people prefer to chat over talk and thats a pain because you already miss the social connection and typing is always a pain.You miss all company dinners and lunches.Because you save time on travel you tend to overwork.Worse if you are working in a different timezone then people would disturb you off hours.Lots of time is spent in trying to screen share or do go to meeting.People will prefer to talk to person in house and unless you are a rockstar and on…

Jesey writing an authentication filter

It seems there are two ways to add authentication to Jersey REST apis

1) You can add a servlet filter.
public class RestAuthenticationFilter implements Filter {     @Override     public void destroy() {         // TODO Auto-generated method stub            }     @Override     public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {          try {            User user = BasicAuthHelper.authenticateUser(request);             if (user == null) {                 response.sendError(HttpServletResponse.SC_UNAUTHORIZED);             } else {                 request.setAttribute("user", user);                 chain.doFilter(request, response);             }     } catch (ApplicationException e) {             response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());      }     }     @Override     public void init(FilterConfig config) throws ServletException {     } }

2) You can do it using the j…