/images/myAvatar200.png

Disable keyring password on boot in Linux Mint

Overview I use Linux Mint in my Slimbook laptop and one of my favorite tools is Slimbook Face, which allows me to login using face recognition. Configure it it’s super easy and I can login using my pretty face, moreover, I can also SUDO 🤩 Slimbook Face tool But from time to time, when loging an anoying message appears 🤦 ENTER PASSWORD TO UNLOCK YOUR LOGIN KEYRING What the hell is that?

Dapper: How to change CommandDefinition parameters values

Overview In my current development I’m using Dapper, a light ORM to access the database. Using Dapper is really easy and provides super-fast performance. Here’s an example of use: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 public async Task<List<T>> GetSomeDataAsync<T>( DateTime startDate, DateTime endDate, CancellationTokenSource sourceToken = null) { if (sourceToken == null) sourceToken = new CancellationTokenSource(); using (var con = CreateConnection()) { var sql = @"SELECT (your field list) FROM (your table/view/function))( @StartDate, @EndDate)"; var command = CreateCommand(sql, new { @StartDate = startDate, @EndDate = endDate }, cancellationToken: sourceToken.

Retrieving events from SQL Server

Overview When executing some long-running server side processes on a SQL Server (Stored procedures or functions) would be nice to get progress messages, and why not, a percent value in order to show a progress bar in our application. In the past I’ve used different techniques to archive this, from SQL Assemblies for calling a SignalR server, to execute xp_cmdshell, and so many other esoteric ways. None of that solved the problem in an elegant way, but well, it worked… more or less…

Getting data from OLAP cubes

Overview Recently I had to read some data from different OLAP cubes and show this information in our application. This could be accomplished using ADOMD.NET client library, which is the multidimensional equivalent to the ADO.NET libraries. This library provides a set of classes (Connections, Commands and Readers) that allow developers to connect, query and get data from these multidimensional sources in the same way the classical ADO.NET library does. Maybe the easiest way to read data is using the class AdomdDataReader.

Connect via SFTP using SSH.NET

Overview In these times of APIs-everywhere, it may sound like an anachronism the use SFTP to connect to a remote server and get a list of files for exchanging information, but in the financial world (sadly) it’s more common than you think. In my current project I’ve to connect to a remote server via Secure File Transfer Protocol (aka SFTP) using a user name, a RSA private key and a phassphrase.

Remove diacritics (accents) in strings

Quick note How to remove diacritics (accents) from a C# string? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public static string RemoveDiacritics(this string input) { var stFormD = input.Normalize(NormalizationForm.FormD); var len = stFormD.Length; var sb = new StringBuilder(); for (int i = 0; i < len; i++) { var uc = System.Globalization.CharUnicodeInfo.GetUnicodeCategory(stFormD[i]); if (uc != System.Globalization.UnicodeCategory.NonSpacingMark) { sb.Append(stFormD[i]); } } return (sb.ToString().Normalize(NormalizationForm.FormC)); } Bonus track How to remove in TSQL (Microsoft SQL Server)