December 11, 2014

On the sometimes painful email-delivery process


Email is not dead, is not even a zombie. If something is well alive and working in all areas I can think of; given that, many of not all applications have to know how to (at least) send mails properly to all the different SMTP servers and providers there are.



Now in my current job we deal mainly with Java-based projects in which JavaMail is the major, sometimes we deal with legacy systems with old implementations, sometimes we deal with new projects that have to communicate to old SMTP servers.

In either case, the problem is how to do it, how to ensure that a mail is sent once the application you are working on is ready and running.

Among the many approaches we've tried there are mainly two issues than come from time to time:

  • How do I communicate with this particular SMTP server?
  • What's the best way to implement this functionality in my application?
Both questions can be easily answered now with little effort, but in some cases we have to dig deeper. This is my approach to answer these questions:

  • How do I communicate with this particular SMTP server?
    • Use tools, check with telnet, use a command-line application like mailsender (I wrote it ;-)) to see which setup works with your SMTP server.
    • Use a local and simple SMTP server to test with, something like MailCatcher.
  • What's the best way to implement this functionality in my application?
    • Take what is working, no matter how old it is, it's being tested and used in many environments and works as customers expect it.

September 15, 2014

Top ten shell commands for daily use

As software writers, we spend much time reading code, writing code, browsing it, searching things on it, breaking it, fixing it, etc. All for the sake of a good behavior in a component/module we try to build.

During this process there are several opportunities in which you need something, a tool, that helps you find and do things quickly, and perhaps an IDE is an overkill when you have several things opened. So there's the shell, and with it, a lot of applications.

Normally these are the tools I most use during my daily work:
  • find - Whenever you wanna search files by name and many other options, it's mandatory.
                     $> # I'm trying to get all build reports from the projects
                     $> find /opt/projects -iname *report.html
  • grep - Excellent tool to search patterns and strings within files
                      $> # what if want to check for all logs containing the ERROR level?
                     4> grep -nHr --include="*.log" "ERROR" /opt/servers/logs/
  • tmux - Multiple SSH connections are not a problem anymore, just install tmux and create sessions within a single SSH connection.

  • tar - Mandatory tool for packaging and compressing data
                      $> tar cvfz db_dumps.tar.gz *.sql
  • watch - Lets you execute a command or script within a defined interval, helpful for monitoring things
                      $> watch -n 10 "du -hs /opt/packages"
  • xargs - Pipelines!!, who doesn't use them!? with this utility you can easily pass output data to another application
                      $> # delete all my missing files from the repo
                      $> hg missing | xargs hg rm
  • jed - Must have a simple shell editor, I prefer jed over all of them.
  • ssh - Server connections are a must have when deploying applications, learn how to use it.
  • scp - Copy files through an SSH connection without problems.
  • wget - Get those HTTP files easily, use wget.

September 10, 2014

This is where I work

Disclaimer: Draft from a long time ago.

Back in December of 2009 I was preparing my thesis work for my graduation, and somehow a very funny guy called me saying that we have talked a while ago about a job offer in a software development company.



At the beginning I was thrilled, I hadn't worked in a professional way by that moment, I couldn't talk nor understand English properly and I was very insecure about my skills against the European standards.

But then I found out something, these guys were really interested in personal values above all, they might need skillful people, but it wasn't (and I dare to say it still isn't) the most important thing.

We were a very small group, now a little bit larger, doing things I found challenging. There are several goals I have set for me in this workplace, I like working there, I enjoy the work I'm doing and the people whom I working with.

Perhaps you want to take a look at the website to know the company a little bit ;-)