Blog

Santex at the Nexus Nearshore Conference

By The Santex Editorial Team

In recent years, Latin America’s software and services industry has made significant progress, establishing itself as world class outsourcing destination. The region has taken on the challenge of responding to the increasing demand for technology and services of the information age and the knowledge economy.

Santex Sharing Knowledge at Nexus 2014 (via PRWeb)

Santex attended Nexus 2014 which took place at the Jersey City Hyatt Regency, New Jersey on April 8th. Today, Agile is a must in every business approach, specially within the software industry. The use of Agile methodologies explains the acceleration…


Continue reading

Create a global GIT hook to check Flake8 before each commit

By Matías Herranz

FIRST, LET’S INSTALL FLAKE8:

$ sudo pip install flake8==2.0

Note: It is important to set the right version when installing Flake8, since there are some versions that are bugged and will prevent the GIT hook to work properly (like the 2.1.0 version).

NOW, LET’S SET UP GLOBAL GIT COMMIT HOOKS:

1. Enable git templates:

$ git config –global init.templatedir ‘~/.git-templates’

This tells git to copy everything in ~/.git-templates to your per-project .git/ directory when you run git init.

2. Create a directory to hold the global hooks:

$ mkdir -p ~/.git-templates/hooks

3. Write your hooks in ~/.git-templates/hooks.

For example, here’s a post-commit hook (located in ~/.git-templates/hooks/post-commit):

#!/bin/sh
# Copy last commit hash to clipboard on commit
git log -1 –format=format:%h | pbcopy
# Add other post-commit hooks

4. Make sure the hook is executable.

chmod a+x ~/.git-templates/hooks/post-commit

5. Re-initialize git in each existing repo you’d like to use this in:

$ git init

Note: If you already have a hook defined in your local git repo, this will not overwrite it.

NOW, LET’S CREATE A GLOBAL GIT PRE-COMMIT HOOK:

#!/usr/bin/env python
import glob
import os
import sys
# git usurbs your bin path for hooks and will always run system python
site_packages = glob.glob(‘%s/lib/*/site-packages’ % os.environ['VIRTUAL_ENV'])[0]
sys.path.insert(0, site_packages)
from flake8.run import git_hook
COMPLEXITY = 10
STRICT = True
if __name__ == ‘__main__’:
sys.exit(git_hook(complexity=COMPLEXITY, strict=STRICT))

FINALLY, LET’S TAKE IT FOR A SPIN!
Go to some of your repos and re-initialize it to take the pre-commit hook:

$ git init

Now, edit some of your Python files, introducing some violation (like a >80 columns line, only one blank line between function/class definitions, etc.) and try to commit it:

$ git commit setup.py
setup.py:4:1: E302 expected 2 blank lines, found 0
setup.py:8:1: E302 expected 2 blank lines, found 0

Voilà!

Matias Herranz is as a Python Developer for Santex. He is a Computer Science and Open Source software enthusiast. His professional experience has focused on Python/Django web app development and some incursions in mobile apps for iPhone/Android. He is a team player who enjoys and finds it rewarding to share the things he learns, either through conferences and lectures, or through day-to-day communication with his coworkers.

Translate CMS/Block pages in Magento with the inline translator

By Miguel Balparda

Even though Magento has a native inline translator, it doesn’t work for CMS pages and static blocks. For different languages, Magento has the option to create one CMS page or static block for each different language and assign it to the correct store view.

This issue came up when developing a new Magento clothing eCommerce Platform, specifically when we needed to make the site available in multiple languages.

In order to avoid doubling the amount of CMS pages and blocks and the time consumed that is required to maintain them, i did some research and came to some forum answers and created an extension out of them. The extension uses the inline translator used by default in Magento, extending this feature to the CMS pages and static blocks.

The extension has had more than 300 visits in the last few days, showing a huge interest by the Magento community.

The GIT source can be found in the following link. Feel free to submit any comments, issues or pull requests: https://github.com/miguelbalparda/MB_Translate

The extension has been submitted to Magento Connect and will be soon available for download.

Miguel Balparda has been developing Magento for almost four years. During this time, he has witnessed the exponential growth the platform has undergone; today it is one of the largest and most popular online stores in the world. There is a great deal of documentation and resources available for both merchants and developers. It is best to start by scanning the official Magento website, where you can find resources to get in touch with the application, as well as free extensions to learn the structure of modules. Miguel can be contacted at communication@santexgroup.com

LinC: a simple screen grabber tool for Linux

By Maximiliano Sbrocca

I currently work on a project that uses Techsmith Jing as a Corporate Tool. Jing is used to create videos for demos and to reproduce bugs on tracking tools among other things. However, Jing has one big problem: it can only be run on MAC and Windows systems. For that reason, creating a video for a demo was a tough task for co-workers with Linux stations.

After some research, I realized that Techsmith had never planned the Linux migration of Jing. After exploring different tools with the same features that Jing offers in the market, I could see that none of them fulfilled my expectations. I suggested to one of my coworkers, “What if we create a Jing Linux version using Python?” He agreed and we picked up the challenge and started the development process of LinC.

LinC was born out of the necessity to create screenshots and screen video captures on Linux systems and share them on the Internet. LinC is now a Beta (rather Alpha :D) the new version has helped me a lot with my daily tasks.

The tool was built with Python 2.7, using TKInter as GUI package. This technology, allows LinC to run on Mac, Windows and Linux.

LinC’s main features are (http://i.imgur.com/uha6avD.png)

  • Screenshots: Select the screen region you want to capture. Once the region is selected, you can save the screenshot to disk or share it on Intenet through three different servers http://i.imgur.com/y7F9LFS.png.

  • Video Captures: This alpha level feature is only available for Linux, but it will later on be implemented on another OS.  Select a screen region to record. Once selected, you can choose between records with sound or without sound.

Because server share is not implemented yet, once you stop the video record, it is automatically saved to disk.

http://i.imgur.com/HKrQ0Th.png

Today, LinC is a free tool and comments and feedback are welcomed. You can download LinC code here:  https://bitbucket.org/msbrocca/screen-capturer.

There, in the overview section, you’ll find the Readme.md file that explains how to install it, all the requirements and how to use it. You can also use the issues section to create tickets to improve the tool.

Maximiliano Sbrocca is a talented and accomplished Software Engineer with extensive background in Java and Python technologies. He has proven expertise when using new tools and technical developments to drive improvements throughout an entire software development lifecycle.

Continuous Delivery using ASP.NET MVC4 – Web API

By Gastón Robledo, Architect at Santex

Software Needed

  • Jenkins
  • MSBuild
  • Web Deployment Tool 3.5
  • IISWebSiteCreation (Custom Application)
  • MSTests
  • GIT
  • Jenkins MSBuild Plugin
  • HTTP Requests Plugin

Both environments, deployment target server and CI server must have installed Web Deployment Tool 3.5.

Jenkins Set Up

Step 1

Create a Jenkins job that will pull the code from a specific branch of code. To do this, you must set a String parameter to receive the branch name to build.

Step 2

Once Jenkins clones or pulls the code from that branch, we need to call MSBuild to actually build the code. In order to do this Jenkins MSBuild Plugin must be installed and configured as a build step.

Add a new build step named “Build a Visual Studio project or solution using MSBuild”.

Following command line arguments need to be set exactly as below:

/p:Configuration=Release
/p:DeployOnBuild=True
/p:DeployDefaultTarget=WebPublish
/p:WebPublishMethod=FileSystem
/p:DeleteExistingFiles=True
/p:publishUrl=”$WORKSPACE\builds”
/p:publishUrl is the destination folder where the build will be located, at this point you can choose any location.

Step 3

IISWebSiteCreation (.NET Framework  4.5 – Custom Component)

Download, build and install the attached component into the deployment server.

IISWebSiteCreation is a windows service that I wrote in C# that allows you to create websites on IIS. This Windows service exposes a url so we can call it from Jenkins to create a website.

How to use the component:

http://[IP/DOMAIN]:9000/create/website/{sitename}/{applicationPoolName=null}/{tcpPort=null}/{ipAddress=null}/{hostHeader=null}

sitename = The name of the branch in this case or whatever you want.

Parameters that can be set as default in the app.config file

applicationPoolName: AppPoolName of IIS
tcpPort: Port where the website is listening requests.
ipAddress: If you have more than one IP to listen on IIS you can put here what you want. Default = ‘*’
hostHeader: Here you can put the header of the website like my_branch.example.com

Step 4

So let’s call the service and start deploying our branches!

Configure the HTTP Request Plugin.

Add a new build step named “HTTP Request”.

URL: http://example.com:9000/create/website/$BRANCH_NAME

Method: GET

Where $BRANCH_NAME is the branch code that we indicate to Jenkins to pull the code from, so that the service will create a site named http://branch_name.example.com on IIS pointing to an specific folder that will contain the built code, inside the main domain.

Step 5

Now, let’s call the Web Deploy command.

Create a build step name “Execute Command”.

Hint: It is best not to reveal the password or something on the Jenkins job configuration. To do so, create a cmd file and put it on the Jenkins server. It’s up to you!

Command:

“C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe” -allowUntrusted -verb:sync -source:contentPath=”%WORKSPACE%\builds” -dest:contentPath=’C:\inetpub\wwwroot\example.com\%BRANCH_NAME%

‘,computerName=’https://example.com:8172/msdeploy.axd?site=%BRANCH_NAME%’,userName=’USERNAME’,password=’PASSWORD’,authType=’basic’,includeAcls=’False’

Once it finishes you can go to http://[branch_name].example.com in the deployment target server and you will see your code deployed!

I hope you enjoy it!

Download: IISWebCreatorService

Gaston Robledo is a versatile System Architect that specializes in enterprise software development and has more than 10 years of experience in the IT industry. Gastón started his career exclusively as .NET developer and over the years expanded to include a wide array of technologies (.NET, PHP, Java and Python). He adapts quickly and excels in almost any programming language. He enjoys collaborating with innovative teams and laterally thinking problems. Gastón always challenging himself to come up with an out-of-the-box solutions.

Python sorting capabilities

by Matias Herranz

Custom sorting function as parameter to sorted() in Python

I am currently working with Python and I came across a list of image names which I’d like to have them sorted. So, I call the sorted function with this list:

HA! It doesn’t work as I would have liked it to. So I asked myself: What can be done to sort the list as I want to?

Python’s standard library sorted function, as you can see here, has an optional cmp parameter, through which one can pass a custom comparison function.

Going back to my example, I needed the images to be compared by the number in their name. For that reason I made this little function to achieve this goal:

And now let’s put all together:

TA DA!

Matias Herranz is as a Python Developer for Santex. He is a Computer Science and Open Source software enthusiast. His professional experience has focused on Python/Django web app development and some incursions in mobile apps for iPhone/Android. He is a team player who enjoys and finds it rewarding to share the things he learns, either through conferences and lectures, or through day-to-day communication with his coworkers.

How to setup your repo GIT and local instance (like for GitLab) and not to fall in despair

By Matias Herranz

While collaborating with several projects, I noticed issues when generating and setting up the public keys as well as configuring the access to GIT repositories. These usually gives people a bit of a harsh time.

When it comes to recurring problems there is nothing better suited than a little reference tutorial to blaze the trail. So, let’s get started!

#1: Generate your SSH key-pair and set it up

Step #1: Check if you don’t already have a key pair

Open a terminal and run the following command:

1
2
3

cd ~/.ssh
ls
# Lists the files in your .ssh directory

Check the directory listing to see if you have a file named either id_rsa.pub or id_dsa.pub. If you don’t have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.

Step #2: Generate new SSH keys

To generate a new SSH key, enter the code below in the terminal. We want the default settings so when asked to enter a file in which to save the key, just press enter.

1
2
3
4
5

$ ssh-keygen -t rsa -C “your_email@example.com”
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
ssh-add id_rsa

Now you need to enter a passphrase.

1
2

Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]

Which should give you something like this:

1
2
3
4

Your identification has been saved in /Users/you/.ssh/id_rsa.
# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com

Step #3: Add your SSH key to GitLab

1. Go to your account settings:

2. Now go to the SSH keys section:

3. Click “Add SSH key”

4. Give it a title you like (in the “Title” field) and paste your public key in the bigger “Key” field:

5. Click “Add key” and we are done with loading the SSH public key in GitLab!

Step #4: Check everything worked

Now we should have the key pair generated and set up locally and the public key loaded in GitLab. Let’s now make sure this is the case and that everything went fine.

To achieve such a certainty, run the following command:

1

$ ssh -T git@git.santexgroup.com

If everything went well, you should see an output like this:

1
2

$ ssh -T git@git.santexgroup.com
Welcome to GitLab, <Your Username>!

#2: Some extra hints

Now we have the keys and our GitLab repo set up and ready to work. Now you should be able to clone, push/pull and do all sorts of thing with your GIT repos without being prompted for your username and password. If GIT, after making a command, asks you for your username or password, it means something at some point went wrong.

Go back and make sure you didn’t miss any steps or ask someone for help.

Done with this and want to learn some new tricks? Take a look at this link!

Hope this saves you time and frustrations in the near future!

Matias Herranz is as a Python Developer for Santex. He is a Computer Science and Open Source software enthusiast. He has professional experience on Python/Django web app development and also in mobile apps for iPhone/Android. He is a team player who enjoys and finds it rewarding to share the things he learns, either through conferences and lectures, or through day-to-day communication with his coworkers.

Software Outsourcing: Case Study Argentina

By Gonzalo Fernandez

According to Tholons, both, the city of Buenos Aires and Córdoba rank among the best outsourcing destinations in the World.  Unquestionably, Argentina’s software industry is smaller than the other IT industries in the globe like India’s, Ireland’s or the Philippines’, however, many Argentinean and South Americans cities are regarded as world class service centers.

In fact, the region as whole is immersed in a kind of outsourcing virtuous cycle. South America continues its aggressive growing pace in the near term and much of the traction reflected is the result from past developmental efforts. The combination of human capital, aggressive marketing and infrastructure development has led to the creation of a favorable outsourcing scenario attracting companies all over the world.

Argentina IT industry facts

  • Growing ratios ranging from 15% to 20%.
  • Cultural affinity: Regardless of where your outsourcing team is located, it’s important to make sure that their workforce culture and company values mesh well with your team’s goals and priorities.

  • IT industry went from 15.000 employees in 2001-2002, to 60.000 professionals in 2009, reaching a record of 65.000 in 2011 (with an estimated 11% increase in 2012 and 2013).
  • Time zone compatibility with Europe and the United States. It has proved to be incredibly significant when using Agile methodologies since frequent interaction is needed between development teams and the stakeholder.

  • A talented pool of technically savvy and well educated people with great command of the English language. Unlike other outsourcing destinations, Argentina has a long lasting engineering culture.

  • Active policies from the government over the last decade: Argentina’s Software Law (25.922) provides tax incentives, tax stability and other benefits to software companies.

Argentina’s Internet culture in Latin America

Sources

 

Magento, the King of eCommerce. Part II.

By Miguel Balparda, Magento Developer at Santex

Today I will be developing some concepts and ideas regarding the architecture of Magento and its components.

The Zend Framework

As I stated my last article, Magento is an open source web application based on one of today’s most popular and complete frameworks: Zend Framework. This particular framework has grown into a very popular trend within the eCommerce world. This should be no surprise for Zend Framework is rightnow one of the best options in the market due of its simplicity and modularity: Each of its components have really few dependencies between each other, are 100% object oriented and are regularly updated because they use new features of the latest versions of PHP.

Over the years, the number ZF users grew exponentially, leading to the creation of a vibrant and active community. This escalation in interaction also constitutes a fundamental part of the development of this framework.

Magento Architecture and the use of Observers

Regarding the Magento architecture, the application uses a slightly different approach from the well-known MVC pattern. In the Magento world, it is referred to as configuration driven MVC.

The most striking differences between the traditional pattern and the Magento one are the following:

  • The use of layouts to manage the views.
  • The use of blocks to control the views and to profit from thin controllers.
  • The use of model rewrite systems.
  • The use of Observers (one of the most powerful features in Magento to my view).

As I regard them as one of the most powerful features in Magento, I will dig a little deeper into the use Observers. In a nutshell, What do Observers do? Observers looks for specific events in order to perform an action. An Event is something that occurs in a certain place during a particular sequence flow, such as a user login or an add to cart.

By just creating an observer class, a module can modify objects without overriding any other class. This is particularly helpful to avoid conflicts with other extensions that might be present in the system. The main problem though, is that Magento doesn’t have an official list of events, but one can always use the unofficial for reference and check the core classes to see which and when events are being fired. Though it may seem not as important at first, once one is into the world of developing a module, one may find this as one of the most useful features in the system.

Magento database architecture

Another thing to keep in mind about Magento is the architecture of the database. Magento uses EAV (entity-attribute-value) for most of the database tables. EAV is a data model used to describe entities where there are a number of attributes (properties, parameters).  The number of attributes is potentially vast, but the actual number is relatively modest. The opportunity cost of flexibility is, always the case, the complexity.

In practice, this means one will not find all the attributes of a product or a category in a single table but in many. The EAV tables are identified by the “eav_“ prefix in the database for a better understanding. This can be changed for a better performance. A Magento store will need a heavily optimized server to run properly because the database server will be making a big amount of queries for every record loaded.

We have gone over important aspects regarding the Zend Framework, the use of Observers and Magento Database architecture. In my next article I will be writing about server optimization for Magento better performance.

About the author

Miguel Balparda has been developing Magento for almost four years. During this time, he has witnessed the exponential growth the platform has undergone; today it is one of the largest and most popular online stores in the world. There is a great deal of documentation and resources available for both merchants and developers. It is best to start by scanning the official Magento website, where you can find resources to get in touch with the application, as well as free extensions to learn the structure of modules. Miguel can be contacted at communications@santexgroup.com

Minding the Tech Gap: Internet and technology penetration in the world.

By Gonzalo Fernández, Market Analyst

We spend so much of our time online on our phones and laptops that is easy to forget that there are still plenty of people who are not connected to the internet or that do not even know what a computer is. We are so used to hearing about income and economic inequality that we don’t see that ever widening gap between the rich and poor people in the world is also brought about by technological progress; the so called technological gap.

What is the technological gap? It is the disparity between communities that have access to Internet and those that not.  It is the inequalities produced by rapid technological innovations, such as the personal computer, mobile technology, broadband and other devices. It is the differences between groups according to their ability to use technology effectively, due to the different levels of literacy and capability.

Disparity within technological progress is regarded as one of the main factors driving the recent increase in inequality between societies. When the time lags between the appearance of a new technology and its acquisition by a person, region or country is too big, a gap is created. The problem should be addressed, since technology is a powerful weapon, an instrument directly related to a society’s capacity to produce wealth and development. In fact, nowadays, technology and internet access constitute one of the key variables that determine a society’s position in the worldwide human development index.

United, but separate: Closing the tech gap

Undoubtedly, the tech gap sets a series of new challenges for societies in the world, but especially for Latin America. The integration of new information and communication technologies needs to be a core strategy to generate new learning and employment opportunities for the future.

As a country, Argentina has achieved huge success on expanding the use of internet across its population. According to Maky Makeer’s study, internet penetration in Argentina is the highest in the region, ahead of Brazil and Mexico and only behind the United States: 7 out of 10 argentineans have access to the web. Perhaps the challenge for the future is to spread  internet and technology access even more.

The technological revolution is radically transforming our societies, and if addressed properly, it could improve all aspects of our social, economic and cultural lives. In this regard, technology needs to be seen as a  development accelerator factor, one which needs to be spread to every corner of our planet.

Some of Santex’s initiatives to address the Technology gap include our SANTEX’ CHANGEMAKERS PROGRAM.

The Santex Volunteering Team:

  • Painted the local school.
  • Set up a tech-center in a rural community in the outskirts of the city of Córdoba, Argentina.
  • Is currently giving IT training to child and adults in order to teach them how to use computers: General use of computers, Microsoft Office Package, Internet as tool to solve daily problems and surf through information are some of the topics.

SOURCES