Skip to content

Instantly share code, notes, and snippets.

# python -m venv .venv
# .venv\Scripts\activate
# pip install numpy
# pip install matplotlib
# python Disservin_SMP_scaling.py -e .\Lynx.Cli.exe -m 16 -g 256
# deactivate
from subprocess import Popen, PIPE
import multiprocessing
import os
@eduherminio
eduherminio / ubuntu.ps1
Created April 6, 2025 15:29
Ubuntu docker playground
docker run --rm -it -v ${PWD}:/home/Lynx ubuntu:22.04 bash
SET WEBHOOK_URL=<your_webhook_url>
curl ^
-H "Content-Type: application/json" ^
-d "{\"content\": \"<your message>\"}" ^
%WEBHOOK_URL%
@eduherminio
eduherminio / heic-to-jpg
Created October 17, 2022 12:57
HEIC to JPG
Based on https://blog.jjhayes.net/wp/2020/09/03/open-source-heic-to-jpg-conversion/
1. Download ImageMagick (portable editions available)
https://imagemagick.org/script/download.php
2. Extract the magick executable
3. Move the directory with your .heic pictures at the same level of the executable
4. Execute the conversion by:
@eduherminio
eduherminio / Day_XX.cs
Last active November 13, 2022 22:56
AoC Day VS template
namespace $rootnamespace$;
public class $itemname$ : BaseDay
{
private readonly List<string> _input;
public $itemname$()
{
_input = ParseInput();
}
@eduherminio
eduherminio / setup.ps1
Created September 15, 2020 18:06
Basic .NET Core WebApi setup (.net core 3.1)
$projectName = ""
mkdir src && cd src
dotnet new classlib -n "$projectName"
dotnet new webapi -n "$projectName.Api"
cd ..
mkdir tests && cd tests
dotnet new xunit -n "$projectName.Test"
cd ..
dotnet new sln -n "${projectName}Solution"
@eduherminio
eduherminio / DateId
Last active November 1, 2020 20:55
DateId() helper method useful for naming files/dirs
# C#
public static string DateId() => DateTime.Now.ToString("yyyy'-'MM'-'dd'__'HH'_'mm'_'ss");
# Bash
date +%Y-%m-%d__%H_%M_%S
@eduherminio
eduherminio / show_wifi_password.bat
Created March 20, 2020 22:34
Reveals a WiFi password already saved in a Windows machine
netsh wlan show profile <wifi_name> key=clear
@eduherminio
eduherminio / package_search.linq
Last active June 13, 2020 19:43
Finds repositories with a given package as a dependency within a GitHub organization
<Query Kind="Program">
<NuGetReference>Octokit</NuGetReference>
<Namespace>Octokit</Namespace>
</Query>
void Main()
{
const string packageName = "MyPackage";
var searchResult = new RepositoryFinder()
@eduherminio
eduherminio / DockerCheatsheet.md
Last active September 23, 2021 13:34
Docker commands and shortcuts

Disclaimer: use under your own responsibility

Containers

Enter a container

docker exec -it <container> bash / docker exec -it <container> cmd

Attach standard input/output to container process, preventing ctrl+c to close it

docker attach --sig-proxy=false <container>