Category Archives: tools

Git Lezione 1 – Cos’è git e le basi per usarlo

Introduzione

Da dove si comincia con git? Quali sono i concetti di base per iniziare? In questo video imparerai:

  • Come si crea un repository git da zero (git init)
  • Come si crea un repository copiandone uno che già esiste (git clone)
  • Il concetto del commit (git add, git commit)
  • I branch (git branch)
  • Il checkout (git commit)

Videolezione

My developer/it pro toolkit for Windows (2021)

Every IT professional / programmer / developer has a toolkit to do be more productive. It’s the based on years of experience, tips from colleagues, friends, and experts.
This is my list of tools that I use more often. I don’t use every tool every day.

This is my first list and it will be interesting to see how this will evolve year over year.

Misc

Windows Terminal / If you are a terminal user this is for you. It’s a modern implementation of a terminal for Windows. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and the ability to create your own themes and customize text, colors, backgrounds, and shortcuts.
Chocolatey / The Package Manager for Windows. Forget browsing to the website of your favorite tool, click download, open the setup, next-next-next-finish. Just write choco install mytool -y and you’re done!
Windows Subsystem for Linux / A complete GNU/Linux environment inside Windows. I use this to learn or explore Linux commands. It’s fast and without the overhead of a traditional virtual machine.
Notepad2 / A replacement for the standard notepad.exe. Syntax highlight support, super light and fast!
Visual Studio Code / Free. Built on open source. Runs everywhere. Free. Built on open source. Runs everywhere. A swiss-army knife for any code related activity.
Nightingale / A native Windows application REST client. An alternative to Postman. A lovely UI and smooth user experience.
PowerToys / A collection of tools to improve your Windows experience.
ZoomIt / It’s perfect to zoom on the screen and draw arrows, lines, and rectangles while doing screen sharing sessions.
Fork / a great UI for git.
Total Commander / A replacement of Windows File Explorer. Good old, feature rich and you can use it with just keyboard shortcuts. Blazing fast to rename, move or copy batch of files.
Markdown Monster / An IDE for your markdown files!
Fiddler / THE web debugger.
BeyondCompare / Compare directories, files, exe… If you have to compare something this is the tool you’re looking for.
SnagIt / screen capture on steroids
Procmon / Do you want to know every single detail of what happens in your registry, file system, and processes/thread activities? This is the tool that you’ll open to diagnose issues or behaviors happening on Windows.

Visual Studio Code Extensions

GitLens / Git superpowers in your VS Code.
Docker for VS Code / You can get IntelliSense when editing your Dockerfile and docker-compose.yml files, with completions and syntax help for common commands.
PowerShell / Bye bye PowerShell ISE.
RESTClient / Send HTTP request directly and view the response directly from VS Code. It can also generate code snippets to make HTTP call in the most common languages.

How to fix 8000000A error when building VDPROJ

The Microsoft Visual Studio Setup Project is an old technology to create installer developed by Microsoft. It is out of support from nearly a decade and not present in Visual Studio anymore but when I visit customer sites I find legacy technologies and I need to deal with it on the short-term.

A couple of days ago I was working on an automated CI build on Azure DevOps and we hit an issue when trying to compile an old VDPROJ (migration to Wix in progress, btw ☺). We encountered an HRESULT 8000000A error.

Continue reading How to fix 8000000A error when building VDPROJ

Reduce your build time with parallelism in Azure DevOps

Your team works with a project in Azure DevOps. Your build time starts to increase as the project’s complexity grows but you want your CI build to deliver results as quickly as possible. How can you do that? With parallelism, of course!

Let’s do this together.

Prerequisites

Before we start to design a build pipeline with parallelism we must be aware of how Azure DevOps orchestrate parallelism and how many parallel jobs we can start. I recommend to read the official Microsoft Docs page about this.

Designing the build

The following example shows how to design a build with:

  1. A first “initialization” job.
  2. The proper build jobs: build 1 and build 2 that we want to run in parallel after the step 1.
  3. A final step that we want to execute after that build 1 and build 2 are completed.

We start with configuring the build to look like the following picture:

To orchestrate the jobs as we specified before we use the “Dependencies” feature. For the first job we have no dependencies so leave the field blank.

For the Build 1 job we set the value to Init. This way we’re instructing Azure DevOps to start the Build 1 job only after that Init has completed.

We do the same thing with the Build 2 job.

For the final step we set Build 1 and Build 2 as dependencies so this phase will wait for the 2 previous builds to complete before starting.

Here we can see the build pipeline while it’s executing.

TL;DR

With this brief tutorial we learned how to design a build pipeline with dependencies and parallelism that can reduce the delay of our CI processes. A fast and reliable CI process is always a good practice because we must strive to gather feedback as quickly as possible from our processes and tools. This way we can resolve issues in the early stages of our ALM, keeping the costs down and avoiding problems with customers.

Deploy a new IIS Web Site with Azure DevOps Pipelines

I was experimenting with deploying a completely new Web Site to a machine with a brand new IIS installation to see what are the required parameter to do a basic deployment.
I share here my findings.

Continue reading Deploy a new IIS Web Site with Azure DevOps Pipelines

Docker PowerShell commands and AutoHotKey

Commands

I’m doing quite a few exercies with Docker in the last fiew days. I start to notice that I need a toolkit of useful commands to cleanup all the containers or images that I move around.

I record here, for future memory, a collection of useful PowerShell script.

Bonus point: an AHK (AutoHotKey) script to be able to rapidly insert those commands with just a few chars!


# Maintenance commands or utils
docker container prune # Remove all stopped containers
docker volume prune # Remove all unused volumes
docker image prune # Remove unused images
docker system prune # All of the above, in this order: containers, volumes, images
docker ps -a -q | % { docker rm $_ } # Remove all containers
docker images -q | % { docker rmi $_ } # Remove all images
docker volume rm $(docker volume ls -f dangling=true -q) # Remove all volumes
https://gist.github.com/phenixita/6b3b65e58cf19ff38d9e4f44e6f79a54.js

How to release a hotfix with pull-request inside VSTS in 3 steps

We all know the situation: the customer finds a critical bug in the latest release and he wants us to release a new version of our application with a fix. How do we handle this situation without breaking our team policies? How to release a specific fix to avoid regression problems?

First we need to fix that bug with the classical approach of feature-branches. We create a branch, fix the bug, create a pull-request and the team approves. These activities are set at the highest priority because a customer is in trouble and we must help.

Now we are in a situation where we have a specific commit that solves a specific problem with only the necessary lines of code modified.

commit-with-fix.png

Our target is to ship that specific commit that fixes that specific bug with a standard pull-request, without all the other work done in the development branch since the latest release. So we write down (in our clipboard for example) the id of the commit.

shaid

What can we do now to release?

1. New branch

We create a new branch.

git checkout -b my-hotifx

Now we fetch the latest updates from the remote repo.

git fetch origin

Then we set our branch my-hotfix to point to the latest commit of the remote release branch.

git reset --hard origin/release

branch-release.png

2. Cherry-pick

Now we cherry-pick the specific commit we want to apply to the release branch without commiting (–no-commit option). We choose the no-commit option to carefully inspect what is going on in our files. It’s here where we use the commit id we saved early.

git cherry-pick <commit-hash> --no-commit

We verify that everything is fine (where fine depends on your specific project). Now we can commit and push to VSTS.

git add .
git commit -m "Hotfix"
git push origin mybranch:mybranch

final-situation-1

3. Open pull-request

Our branch is now on the remote repo and we can open the pull-request with VSTS.

pull-request.png

From here the team can approve the PR and fire up our automated release process that activates our automated test and if everything is fine we deploy safely.

TL; DR

With this blog post we explored the critical situation to release a hotfix without breaking the rules or taking shortcuts to avoid our release pipeline. As engineers we must maintain a cold approach even in hot situation and rely on our best practices. Human errors are always possible in particular when we’re stressed and a customer is making our phones hot.

Power is nothing without control

You can’t control (leave alone improve) what you can’t see – Me

Power is nothing without control – Pirelli

Why a dashboard?

When we drive our car we have everything under control: speed, revs, oil and water temperatures and fuel level. We need a dashboard in our car because we have to know our current speed to respect speed limits, to know how much petrol we have in our fuel-tank to decide if we can go to work without a trip to the gas station etc. All this data to do the simple job of driving! This is necessary because we need to take informed decisions.

white motorcycle cluster gauge
Photo by Mikes Photos on Pexels.com

What does it mean for our daily activities in a software department? We need our dashboard, too! How can we do our job of deliveing (not only writing!) a working software with the lowest bug count as possibile, quickly, on a budget and coordinating with other people? It’s a huge task compared to drive a car alone and yet many of us rely on instinct and guts to make decisions for an entire software team.

A dashboard for the software Engineer

Which indicators and gauges do we need as software engineers? I think there are a few things we Always need to know about our team.

  1. Team Cycle time: how much time/days does a unit of work take to go from started to completed? And with completed we mean delivered to the customer.
  2. Team Lead time: how much time/days dows a unit of work take to go from a created to completed?
  3. How fast are we going? How many story points we deliver every fixed amount of time? (sprint, week… name your favorite).
  4. Bug count. How many known defects (bugs) have we? Is the count increasing or decreasing?

Here we can see a dashboard created with Microsoft VSTS where the team can get an immediate report of the situation.

2018-08-03_13-46-49.png

Create a dashboard

Every team is different and needs specific/custom dashboard. To create a dashboard with Microsoft VSTS we can go to

https://THE_DOMAIN/THE_PROJECT/_dashboards/

and then we expand the dashboard list with the arrow button (1) and click New Dashboard (2).

2018-08-03_14-02-31.pngWe give our dashboard a name and hit Create.

2018-08-03_14-09-48.pngWe can add widgets picking from the right-side list, search or browse the Marketplace to add something extra to our VSTS.

2018-08-03_14-11-55.png

When we’ve finished to create our dashboard we click “Done editing”.

TL; DR

A dashboard is a must have to control or improve our team and our process. It enables us to understand our current indicators and shows if a new way to work improves or worsen the situation. With a dashboard we can take informed decisions about many arugments: current velocity of the team, quality of the software, lead time and so on. We’ve seen how to create and configure a dashboard with Microsoft VSTS.

Reference

Microsoft VSTS Docs: https://docs.microsoft.com/en-us/vsts/report/dashboards/?view=vsts

Clean your Windows 10 like a pro

The space on your hard drive is running low and you don’t know what to do. What to clean? Is there an app that can clean my PC?

The vast majority of Windows users rely on third party apps like CCleaner to do this job. Make yourself a favor: don’t do this. Windows has a built-in tool that can safely clean-up your PC and it’s called Disk Cleanup 4.png.

With the latest Windows 10 April 2018 Update (1803) the Disk Cleanup has been improved and you can now access it from the Settings.

1. Check you’re currently running Windows 10 1803

Open Run by right-clicking the Start Menu or with the keyboard shortcut Win+R. Then type winver and press Enter.

 

1

2. Remove Files

Open Settings by writing settings from the Start menu or press Win+X and then Settings. Choose the Storage section on the left and then click on Free up space now.

2

This feature will show you simple but well explained user interface where you can understand what you’re going to purge when you’ll press Remove files.

3

Happy cleaning!

VSTS for beginners: release your web-app to Azure

In the previous post of this series dedicated to VSTS we talked about continuous integration. Now we’ll talk about publishing our Web-App hosted on Azure with the release management tools provided by VSTS. With this kind of tools we can deploy the latest version of our web-app to Azure in complete automation removing manual procedures and human errors. The setup of Azure will be covered in another blog post.

 

Continue reading VSTS for beginners: release your web-app to Azure