“CQS (Command Query Separation) in Azure Functions”

Introduction Azure Functions made it very easy to create services on the cloud. It’s very simple to get started just like Logic Apps , but also extensible like a full ASP.NET Core application (if you’re using .NET). You also have a variety of language options to choose from, so it’s not just exclusive to C# or .NET. It uses a serverless architecture so that you don’t need to maintain any runtime dependencies, operating system patches, and infrastructure maintenance as well. You then just focus on your business requirements on the behaviour that you want to create as a “function”. ...

<span title='2022-09-20 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Code Signing and Notarizing your MacOS Apps

Introduction One of the biggest pain points of every developer in the Apple ecosystem is Application signing. It was never straightforward. Even after more than a decade of exposure in mobile and desktop development, it’s still a painful experience overall. On the flip side, there are reasons this is the case. From time to time, big companies like Apple have to refresh their security posture and that means developers have to follow those rules to maintain a secured and trusted platform. Code Signing and Notarization are some of them. This blog post will focus more on MacOS Desktop apps, and won’t directly apply to iOS and iPadOS. ...

<span title='2022-09-18 21:52:19 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Creating native MacOS background apps with .NET

Introduction In the previous blog post , I covered how you can create Universal Apps for MacOS. But what if you actually want to create and run a head-less (no UI) application in your Mac using your favourite .NET framework and libraries? Then I have some good news for you, it’s possible, but then again - with some caveats. For those who are already familiar with Windows Services, with .NET, you traditionally create a Windows Service project using the .NET Framework. But with introducing .NET Core you can now run .NET apps (Console and Web) on Linux and Mac without the need to use Mono . Then with it, comes the Worker Service project that allows you to create hosted services that run in the background using the IHostedService interface that allows you to run the app to any generic host - meaning no need for runtime dependencies like .NET framework. ...

<span title='2022-09-15 21:52:19 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Preparing for the upcoming Recession

Introduction I woke up today seeing my portfolio bloody red again. Stocks and ETFs are down. Cryptos are down. Gold is down. These and having high interest rates with our home loan plus commodities are becoming more expensive (high inflation). It’s quite an alarming state. We’re currently in a Technical Recession. Recession is such a big topic, but a Technical Recession simply means that the GDP in the past 2 quarters had a negative growth. This means that the value generated by countries like the USA (default currency USD), Australia (where I live), and the Philippines (where I was born) are not doing well - economic wise. If you want to learn more about recession, that is easily digestible, I advise to look at this page from RBA (Reserve Bank of Australia) . ...

<span title='2022-09-14 21:52:19 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Publishing and Consuming Azure Event Hubs with AMQP and Rust

Rust has been gaining a lot of traction lately. Being in the Blockchain space, a lot of chains such as Solana uses Rust to develop smart contracts. There’s also an increase adoption of it in regards to high performance, memory safety, and concurrency benefits to name a few. In my opinion, it’s still a niche market (in terms of size) from both Companies’ adoption and the availability of talent out there. But I’m lucky enough to work on a low-level programming project. ...

<span title='2022-09-14 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Creating MacOS universal apps in .NET

It’s been a while since the most mind-breaking thing happened to .NET developers who are also Mac users like me - the introduction of .NET Core (of course equally excited with Xamarin and Mono as well). But with .NET core which is supported by Microsoft themselves, we can now create self-hosted applications and deploy it to almost anywhere, including Macs. This means that if you want to create an application that you want to target Macs as the host (not an app), then .NET is now a viable option. Since then .NET Core has evolved its naming into “just .NET” hence with .NET 5, .NET 6, .NET 7 - it’s just .NET that targets all platforms. ...

<span title='2022-09-13 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Using named pipes for interprocess communication in C#

There are multiple ways applications can communicate to each other. You can use HTTP, gRPC, gRPC, web sockets, shared databases, message brokers (and buses), and the list goes on. One of the overlooked fundamentals is the use of Pipes and Streams. Pipes - a communication channel between two processes. Streams - a data collection that moves from a source to a destination. Just think of the actual ‘pipe’ where water flows. The actual pipe is the infrastructure to hold the water stream. The stream is what moves the water from point A to point B via gravity and force. In some regards, they are also considered ‘queues’ as it serves as a messaging layer between a publisher and a subscriber. They are not mutually exclusive, as streams can exist without pipes. ...

<span title='2022-09-12 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Installing Kafka on WSL2 (Windows Subsystem for Linux)

Kafka is a robust event streaming platform that is used by a lot of companies these days. As companies and developers adopt an event-driven architecture, advanced data pipelines, and real-time analytics - Kafka is often the default platform of choice. The project itself is open-source and I’ve noticed a lot of “managed” Kafka offering around. I myself have been using a flavour of Kafka (Azure Event Hubs ) quite a lot in my projects and startups. ...

<span title='2022-09-09 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

In Memory SQLite database on C#

If you’re running a .NET application that doesn’t require a database, one of the options that you can use is having In Memory Database. What this means is that you are using the machine’s RAM to store data for your application. There are multiple ways of implementing these: Plain C# object / list / dictionary / hash table Dependency Injection with proper lifetime (singleton/trancient/scoped) Using SQLite (preferred) Why use it? If you need a temporary place to store your data. This is often used when the machine is offline. An efficient (cheap and fast) way of retrieving small data within a short lifecycle such as configurations and logs. The machine is capable enough to handle the storage size. As of right now, RAM is relatively cheap compared to latency (network) costs. When not to use it? If you need to store the data for future use. When the machine restarts, or when the application closes, all of your data will be flushed. If you need to centrally store it so that other applications can consume it. This is not meant to store large number of data set. Sample Application in SQLite One of the advantages of using SQLite is the ability to treat the data store just like a SQL database. You can perform simple T-SQL query statements and even use Entity Framework. ...

<span title='2022-08-26 00:00:00 +0000 UTC'>August 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Backup Azure SQL Database using Azure Data Studio on your Desktop

Doing it via the Portal I’m trying to backup our SQL Azure database, and to my surprise, it doesn’t seem to be “straight forward”. Officially, you have to do it via the Azure portal (or Azure CLI), but I find the process a bit overwhelming for simple backup of “I just want the file”. If you do it via the portal, you have to go to the Database instance, and click on Export. ...

<span title='2022-08-22 00:00:00 +0000 UTC'>August 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

My Tech List 2022

Here is a list of all the relevant technology set up that I use personally at work, home, and everything in between. I grouped them on different groups according to function. Nowadays, I tend to be minimalist on what I purchase both on hardware and software, and make sure that I am very intentional with their uses and not because of vanity / impulse buying. Work and Personal Devices Macbook Pro M2 Windows Desktop: 64 GB RAM, i9 CPU, and Nvidia RTX 3080 iPhone 13 mini (Personal) Samsung Galaxy S20 (Work) Apple AirPods Pro Bose Quietcomfort 35 Kindle Papewhite Desk Setup V20 Desk Xiaomi Monitor HP Monitor Dell Docking Taotronics Speaker Multiple charging Bay Webcam USB Spliter Blue Snowball Microphone Playmax Logitech Mouse Logitech Keyboard Desk Thredmill Attached Drawers Development Software Visual Studio Code (and extensions) Visual Studio 2022 (Windows) Jetbrains Rider Docker WSL Terminals: iTerm 2 and Windows Terminal Productivity Software Obsidian Outlook Calendar Mobile Apps I use daily Apple Notes, Reminders, Calendar, and Voice Memos Obsidian and Working Copy Health: Trainerize, Strava, Garmin Connect Audible, 12 Min, Kindle, and Goodreads Banking & Crypto Apps SnoreLab and SnoreGym Life

<span title='2022-08-08 00:00:00 +0000 UTC'>August 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Run for Autism - 2021

A couple of weeks ago, I started a campaign to raise money into my Run For Autism 2021 . Long story short, I made it! Raising the money, running the distance, and raising more awareness. It’s been a challenging journey given I experienced a lot of adversaries along the way. Here are some of the key takeaways of this journey: - Always define the purpose - Set realistic expectations - Love the process - Deliver what you’ve committed - Know when to rest ...

<span title='2021-11-08 00:00:00 +0000 UTC'>November 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

Productive this Pandemic - Accountability Partner

For the longest of time, I would consider myself as the lone wolf at work. Most days, I’d rather stay alone and be in my world to get things done. I found in the past that the effort to collaborate is counterintuitive and would just mean more work for me. Back then, I’d rather do things “my way” than to delegate so that I don’t get disappointed with the results from someone else. These have changed because I finally found the right sweet spot on this. It’s called an accountability partner. ...

<span title='2021-09-13 00:00:00 +0000 UTC'>September 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

Productive this Pandemic - Planning your week ahead

People have asked me lately, how do I do it? Having a full-time consulting company, spending quality time with family, doing groceries, cooking, house errands, taking part at online communities, blogging, journaling, building a house, getting involved to a dozen startups, creating a podcast, reading books, losing weight, and the list goes on. It’s even harder because it’s the pandemic. Most people’s motivation and morale are down right now because of the never ending lockdowns, non-purposeful workplace, fear of missing out, and other negative emotions. I won’t be dismissing these and I experience these a lot of times in the past year alone. However, I’ve developed some useful habits and tricks that are effective. I find myself to be relatively happy and fulfilled with my life right now because of these systems and mental models. ...

<span title='2021-09-04 00:00:00 +0000 UTC'>September 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

The Hybrid Cloud Journey with Microsoft Azure

Hybrid cloud is the trend right now I see in a lot of companies and enterprises. The term hybrid has grown too in the last couple of years. It used to be just the connectivity between an on-premises data center to public clouds like AWS and Azure. This time, hybrid now also includes multi-cloud and edge computing. It’s about borderless connectivity across different topologies or deployment models happening around. Why hybrid cloud? To answer the most important question: Why hybrid cloud? The answer is really simple, not all apps and data should be on 1 public cloud. ...

<span title='2021-08-28 00:00:00 +0000 UTC'>August 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

Using WSL2 (Windows Subsystem for Linux) for Blockchain Development

In the past, I’ve been using my Macbook Pro to do all things blockchain and smart contracts development. One of the hurdles I encountered in the past is that some tooling and frameworks were not first class citizens on Windows. Majority of these tools, especially those that come with scripts and complex networking architecture (circa 2015) just works in MacOS and Linux:Ubuntu. Introduction Of course there have been a lot of improvements now in the ecosystem since then. A lot of the workflow now will just work natively on Windows or there are a lot of binding libraries or wrappers that can interop with. If you’re using Windows, there are a lot of options for virtualisation of Linux such as Virtualbox, Hyper-V, VMware Fusion, and much more. Running Linux virtual machines on cloud such as Microsoft Azure is also an option. ...

<span title='2021-08-15 00:00:00 +0000 UTC'>August 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

What are these blockchain and crypto tokens?

So you keep hearing or reading about “tokens”, these “cryptos”, the “blockchain bitcoins”, and so on. It’s been quite some time now that it has involved me with blockchains and cryptos that over and over, I have to explain to people (often new clients) on what are these tokens. Even until now, at almost late 2021, I still get asked about these: Is it Bitcoin? Is it Ethereum? Is it Coin X, Coin Y? What are these NFTs? This is my attempt on how I can simplify these concepts to answer most of the important questions like what are these different tokens and shed some light on some real world use cases of them. ...

<span title='2021-08-10 00:00:00 +0000 UTC'>August 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

Developing MacOS Apps using .NET

The .NET framework (and the wider ecosystem) has embraced a lot of openness these past few years. Gone are the days when .NET only works on Windows. However, as the journey to “One .NET” is still unfolding, there is a lot of confusion on how we can use .NET on MacOS. There is Mono, .NET Core, .NET 5, Xamarin.Mac, Xamarin.Forms, Mac Catalyst, .NET 6, and MAUI. This blog post explains some of the core concepts across these nomenclature. ...

<span title='2021-07-23 00:00:00 +0000 UTC'>July 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

Message to the young

I recently gave a graduation speech to my high school alma matter. Compared to my usual technical talks, this time it’s about inspiring the younger generation and to share some of the key lessons and experiences I’ve had for over 12 years since I graduated. This is also a good reflection of what I will advise my younger self if I am talking to him right now. Below, I summarize my speech that is in a written medium. The words may not be the same, but the meaning are. ...

<span title='2021-07-21 00:00:00 +0000 UTC'>July 2021</span>&nbsp;&middot;&nbsp;Michael John Peña

Getting Started with DeFi

Introduction Blockchain is not dead. Actually, quite the contrary is happening in the past year. There are more and more interest and it’s gaining a lot more traction than before. A big portion of this growth is due to “DeFi” AKA Decentralised Finance applications. From the hyped cryptocurrencies, we are now seeing the new next wave of this transformation as we see more financial products being developed: lending, exchanges, yield farming, and pools just to name a few. It is a hot topic right now and there are a lot of demand in this space. There are also a lot of opportunities to start creating your own innovative products as part of this wave. ...

<span title='2021-07-15 00:00:00 +0000 UTC'>July 2021</span>&nbsp;&middot;&nbsp;Michael John Peña