Skip to content

Instantly share code, notes, and snippets.

View cybergitt's full-sized avatar
🎯
Focusing

Sigit Prayitno cybergitt

🎯
Focusing
View GitHub Profile
// Worker Service Program.cs
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using FluentValidation;
using FluentValidation.Results;
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
// Program.cs (Console App)
using System;
using System.Threading.Tasks;
namespace ResultPatternConsoleApp
{
class Program
{
static async Task Main(string[] args)
{
@cybergitt
cybergitt / ApiErrors.cs
Created July 30, 2025 13:46
Api Error from Error Model
using BAS.Application.Common.Constants;
using Microsoft.AspNetCore.Http;
namespace BAS.Application.Common.Errors
{
public static class ApiErrors
{
public static readonly Error Unavailable = new(
code: "unavailable",
message: ApiMessages.Unavailable,
@cybergitt
cybergitt / Error.cs
Created July 30, 2025 13:45
Error Model
using Microsoft.AspNetCore.Http;
namespace BAS.Application.Common.Errors
{
public class Error(string code, string message, int? status) : IEquatable<Error>
{
public static readonly Error None = new(string.Empty, string.Empty, null);
public static readonly Error NullValue = new("Error.NullValue", "The specified result value is null.", StatusCodes.Status204NoContent);
public string Code { get; } = code;
@cybergitt
cybergitt / install-docker-ubuntu-2025.md
Last active October 20, 2025 16:44
How to Install Rootless Docker on Ubuntu on 2025

Rootless Docker

This guide teaches how to use Rootlesskit and Docker to install a Rootless Docker and run Docker containers in Rootless mode. The setup works for Linux (Ubuntu, Debian, etc.), and Raspberry PI Docker allows you to create Rootless containers. This means, Docker Engine will create and run these containers in Rootless mode. They will run as unprivileged to the user namespaces creating them.

Install Rootless Docker Kit and Run Rootless Container Mode

You will learn different ways to get Rootless container ready:

  • Using Docker Engine
  • Using Rootlesskit
public class FilesHandler
{
public string GetContentType(string path)
{
if (!File.Exists(path))
{
return "application/octet-stream";
}
new FileExtensionContentTypeProvider().TryGetContentType(path, out string contentType);
@cybergitt
cybergitt / system-design-cheatsheet.md
Created January 10, 2025 03:41
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@cybergitt
cybergitt / design-documentation-in-software-engineering.md
Last active January 10, 2025 03:17
Design Documentation in Software Engineering

The main goal of a design documentation is to make you more effective by forcing you to think through the design and gather feedback from others. People often think the point of a design documentation is to to teach others about some system or serve as documentation later on. While those can be beneficial side effects, they are not the goal in and of themselves.

A functional design document (FDD) outlines how a system will work, while an application design document, such as a technical design document (TDD), describes how to build it. Both documents are important for system development and should be consistent and updated as the project progresses.

Functional design document (FDD)

  • What it describes: How a system will work, including its requirements, specifications, and plans
  • Who it's for: Business stakeholders, developers, and testers
  • What it includes: Use cases, system inputs and outputs, process flows, diagrams, and mockups
  • Why it's important: Saves time, resources, and money by ensuring ever
@cybergitt
cybergitt / ubuntu-cli-rocks.md
Created January 1, 2025 05:48
Ubuntu CLI Rocks

Ubuntu CLI Rocks

List of ubuntu commands

Check Specific Port Is Open

To check if a specific port is open on your Ubuntu server, you can use the netstat or ss command. For example, to check if port 80 is open, run:

sudo netstat -tuln | grep :80

or

sudo ss -tuln | grep :80
@cybergitt
cybergitt / configuring-no-subscription-repository-in-proxmox-ve-8x.md
Last active February 21, 2025 15:07
Configuring No Subscription Repository in Proxmoxm VE 8.x

Configuring No Subscription Repository in Proxmoxm VE 8.x

Proxmox VE is a robust open-source solution for virtualization, widely popular among home lab enthusiasts. By default, Proxmox is configured to use Enterprise repositories that require a subscription. For home lab setups where budget constraints are a consideration, purchasing a subscription may not be feasible. Fortunately, Proxmox provides a no subscription repository that you can use to keep your server updated without needing a subscription. In this tutorial, we'll walk you through the process of configuring your Proxmox VE installation to use no subscription repositories.

Understanding the Need for No Subscription Repositories

When you first set up Proxmox VE, it is configured to use Enterprise repositories, which require a paid subscription for access. Without a subscription, you won't be able to fetch updates from these repositories, which is critical for maintaining a secure and up-to-date system. By switching to the no subscription r