Skip to content

Instantly share code, notes, and snippets.

View DiracSpace's full-sized avatar
:shipit:
Hacking the world, one 0x41414141 at a time

Roberto de León DiracSpace

:shipit:
Hacking the world, one 0x41414141 at a time
  • Asterias Software Solutions
  • San Luis Potosi
  • X @0x0302
View GitHub Profile
@DiracSpace
DiracSpace / SqlCommandProvider.cs
Created September 2, 2025 20:08
Custom implementations for running SQL commands and for building/testing connections with a result pattern.
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;
using System.Text.RegularExpressions;
internal sealed record SqlExecutionResult(
SqlExecutionResult.CommandState Status,
int CommandsExecuted,
IReadOnlyList<SqlRowExecutionResult>? RowsAffected)
{
public enum CommandState
@DiracSpace
DiracSpace / wsl-luks.md
Created March 16, 2025 23:32 — forked from gtirloni/wsl-luks.md
Windows WSL2 and LUKS

If you have a LUKS-encrypted partition on another disk, it's easy to mount it inside WSL.

List your disks:

> wmic diskdrive list brief

Mount the whole disk inside WSL (using --bare so WSL doesn't attempt to mount it automatically):

@DiracSpace
DiracSpace / scrape_videogames.py
Created August 13, 2024 08:10
Simple scrapper of game titles from Myrient
#!/usr/bin/python3
import requests
from bs4 import BeautifulSoup, NavigableString, Tag
from http import HTTPStatus
from typing import List
from dataclasses import dataclass
from enum import Enum
class MyrientConsole(Enum):
@DiracSpace
DiracSpace / myip.ps1
Last active June 17, 2025 20:45
Check IP address with loading in PowerShell and Bash
function Load {
param(
[scriptblock]$function,
[string]$Label
)
$job = Start-Job -ScriptBlock $function
$symbols = @("⣾⣿", "⣽⣿", "⣻⣿", "⢿⣿", "⡿⣿", "⣟⣿", "⣯⣿", "⣷⣿",
"⣿⣾", "⣿⣽", "⣿⣻", "⣿⢿", "⣿⡿", "⣿⣟", "⣿⣯", "⣿⣷")
@DiracSpace
DiracSpace / import.sh
Created August 26, 2023 23:41
Script for importing multiple collections in JSON format into MongoDB using CLI
#! /bin/bash
find -- *.json | sed 's/.json$//' | while read -r col; do
echo "importing $col"
mongoimport -d edgraph -c "$col" --file "$col.json" --jsonArray
done
<#
Uses the dotnet tool for determining NuGet package
vulnerabilities inside a project solution by checking all
available csproj files.
#>
function Find-Vulnerabilities {
param (
[Parameter(Mandatory = $false)]
[string] $FilePath,
[Parameter(Mandatory = $false)]
@DiracSpace
DiracSpace / README.md
Created August 4, 2023 18:42 — forked from taxilian/README.md
Mongodb scripts for incremental backup

Introduction

I can't take credit for much of the work here -- I adapted it from this blog post: https://tech.willhaben.at/mongodb-incremental-backups-dff4c8f54d58

My main contribution was to make it a little easier to use with docker as well as numerous little cleanup tasks. I also made it gzip the oplog backups and added support for SSL connections

Note that I havne't yet tested the point in time restore script; it likely needs work, particularly to make things work with the gzipped oplog files

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

using Asterias.Application.Providers;
using Microsoft.AspNetCore.Http;
namespace Asterias.Infrastructure.Providers.File.LocalFileProvider
{
public class LocalFileProvider : IFileProvider
{
/// <summary>
/// Used for limiting amount of buffer
/// in memory
@DiracSpace
DiracSpace / install-AzCopy.sh
Created June 23, 2023 18:26 — forked from aessing/install-AzCopy.sh
Install AzCopy on Linux
#!/bin/bash
# Download, extract and make executable
sudo bash -c 'cd /usr/local/bin; curl -sSL https://aka.ms/downloadazcopy-v10-linux | tar --strip-components=1 --exclude=*.txt -xzvf -; chmod +x azcopy'