Posts

Watch files for changes in Bitbucket

Image
I am porting a large enterprise web application written in Knockout.js to Angular 2+ . Some complex pages (with large amount of dependencies and business logic)  might take weeks to complete.  Dozens of developers constantly updating the app by adding new features or modifying the existing functionality. Freezing the pieces of the code I am working with (so no-one would apply any change), until I complete my task is ruled out. So I have to keep an eye for the changes to the files I am working with.  Checking the repository manually is not the option so I’ve created the open source “Bitbucket Repo Watcher” ( https://github.com/Havrl/bitbucket-repo-watcher ). Basically it is a Node.js application that checks periodically (using BitBucket API ) the most recent commits and send email notifications when specific folders / files modified. Below is how it works. The app is making a number of pre-configured paginated requests, which return the col...

Inspecting HTTP traffic using OWASP Zed Attack Proxy tool

Image
Whether I develop or debug a mobile application for Android or iOS with some networking functionality I might want to inspect HTTP traffic. Even for a web development there might be a need to intercept and modify the HTTP requests. There are number of tools available to intercept HTTP/HTTPS traffic. One of the most popular and well documented is probably Fiddler . That’s what I used on Windows platform. If you are on MAC, you have to configure Fiddler to run in a virtual machine or use some alternative tools. This post is about the second option. Specifically, OWASP Zed Attack Proxy (ZAP) tool -  free, open source, easy to install and use, penetration testing tool for finding vulnerabilities in web applications. This tool provides a lot of functionality whereas I am going to cover here only how to configure and use it as an intercepting  proxy on Mac. Also I include the steps to configure Android and iPhone devices in order to intercept the HTTP traffic. ZAP docu...

Inspeko - new app for inspectors

Image
Today I have the first release of my app “Inspeko” – cloud-based mobile ready Inspection system . This is the version 0.1 release, which contains the minimum set of features and running only on the up-to-date modern browsers. The system designed for inspectors of various industries who requires collecting information through visual observation during a walk-down inspections. Inspeko will empower inspectors to efficiently and effectively do their inspection while saving their time and efforts of capturing the required information. Every inspection is different and requires different data input. Classically, most of inspection results written into some pre-designed paper form and later communicated with the interested parties. Inspeko allows creating custom inspection forms which would match those ready-made paper forms.  Inspectors will be able to carry out most of the inspection types, e.g. property inspections, room inspections, safety inspections, vehicle inspectio...

User authentication on Android against hashed passwords created with Asp.Net Identity

Microsoft shipped a new membership system called ASP.NET Identity with Visual Studio 2013 and .Net 4.5.1. It allows us to add login features to the applications built for the web, phone, or store. By default the ASP.NET Identity system will store all the user information in a database. ASP.NET Identity uses Entity Framework Code First to implement all of its persistence mechanism. What if we going to build an Android app with offline capabilities, where the users would sync the stored credentials created by Asp.Net Identity on the server in order to login? We would have to verify the provided user password against locally stored hashed password to authenticate the user. Below is the code that can be used for this task: /** * Verifies provided plain text password against hash * @param hashedPass * @param password * @return true or false */ private boolean verifyPassword(String hashedPass, String password){ if (hashedPass == null){ return false; } byte[] n...

Synchronization algorithm for exchanging data in the “Client – Server” model via REST API

Image
Many mobile applications require to sync data with a server if they operate in the client – server model to exchange data with the central repository. If the server serves up resources through a REST API , then all sync logic can be handled on the client side. The sync logic is able to handle bi-directional sync between central server and multiple clients where only incremental changes apply on both sides with some conflict detection. Each table (both server and client) participating in the sync process should include two additional fields: “ Ts ” as Number , “ Deleted ” as Boolean . The Ts  field is maintained by the server side. For example SQL Server automatically generates a unique incremental value on each insert or update. The Ts field is used to determine whether one record in the table was modified more recently than another so to download only the incremental changes. Also it will help to identify the new records created on the client as they will...

Managing hiring process in tech-sector

Image
Recently we used a five stages hiring process to fill two openings for .Net Senior Developers. The process was based on Jeff Atwood’s article " How to hire a programmer " to minimize our time waste on unqualified candidates and find the good fit. The idea was to dedicate our time only to candidates who passed online technical test. We didn’t bother to study the received CVs as recruitment agencies already used to filter applicants to match our job specs (well, maybe just short glance to ensure the candidate claims the relevant experience). Each candidate had to go through five stages listed below: Online technical test (15-30 minutes) – we used Interview Zen where we created the test with three programming questions (SQL, C# collections, JavaScript). Portfolio check - successful candidates had to share some code they wrote (open-source / personal projects, blog posts, etc.) Phone interview (20-30 minutes) – a few programming related questions such as: What is ...

Send emails with SQL Server using Html files

Image
Sending emails from MS SQL Server using the Database Mail is easy. Once the Database Mail is active and configured (see this blog for quick configuration) the emails can be send using the SQL script below: USE msdb GO EXEC sp_send_dbmail @profile_name='EmailProfile', @recipients='test@example.com', @subject='Test message', @body='This is a test message.' In cases where there is a need to send emails in html format - creating the content inside of SQL script is not so convenient. With the help of OPENROWSET function we can read the content of html file, which contains the properly formatted and tested html. For example below is the html file that we can easily open in the browser and validate it displays correctly the way we want. It contains the html and body tags which wraps the content that will be inserted into the email’s body. Test Email This is a test message Below is the SQL script which will send the emails by readi...