Skip to content

Instantly share code, notes, and snippets.

@vinhins
vinhins / ProcessAsyncHelper.cs
Created April 22, 2024 02:50 — forked from AlexMAS/ProcessAsyncHelper.cs
The right way to run external process in .NET (async version)
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
public static class ProcessAsyncHelper
{
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout)
{
var result = new ProcessResult();
@vinhins
vinhins / sources.list
Created December 5, 2023 13:39 — forked from ishad0w/sources.list
Debian 10 (Buster) -- Full sources.list
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb-src http://deb.debian.org/debian buster-updates main contrib non-free
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb-src http://deb.debian.org/debian buster-backports main contrib non-free
deb http://security.debian.org/debian-security/ buster/updates main contrib non-free
@vinhins
vinhins / Service KMS
Created June 22, 2023 06:45 — forked from judero01col/Service KMS
Volume License Activation Key Service - KMS
## Find Available Target Editions
DISM.exe /Online /Get-TargetEditions
## Convert Server Standard 2019 Evaluation to Server Standard 2019
DISM /online /Set-Edition:ServerStandard /ProductKey:N69G4-B89J2-4G8F4-WWYCC-J464C /AcceptEula
## How To Activate
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /skms [server]:[port]
slmgr /ato
@vinhins
vinhins / hetzner-proxmox-docker.sh
Created June 7, 2023 07:39 — forked from Faqahat/hetzner-proxmox-docker.sh
Hetzner Dedicated with Debian 9 (Stretch) and Proxmox 5 (LXC) + Docker-CE + Portainer [NAT]
#############################################
### Proxmox V & Docker-CE + Portainer #
#############################################
## Rescue System
# Erase other disks
dd if=/dev/zero of=/dev/sda bs=1M count=100
dd if=/dev/zero of=/dev/sdb bs=1M count=100
# You can install debian 9 via the guide:
@vinhins
vinhins / WINDOWS7rearm
Created April 24, 2023 04:25 — forked from dmi3mis/WINDOWS7rearm
RESETTING THE REARM COUNT IN WINDOWS 7
WINDOWS 7
RESETTING THE REARM COUNT IN WINDOWS 7
9 JANUARY 2013 IT FUNK 41 COMMENTS
After installing Windows 7, and before activation, the operating system will run in an Initial Grace Period license status for 30 days. When this grace period expires, users can rearm Windows 7 for an additional 30 days, and do this up to 3 times, effectively allowing the OS to run legally for 120 days without a genuine product key.
When a user uses up all three available rearms, the only option left is to enter a genuine product key to activate Windows 7, or leave the operating system in a crippled, non-genuine state. Users will then be subjected to certain annoyances such as black desktop background, repetitive notification messages stating that this copy of Windows is illegal or counterfeited, and a reminder to register the software at login.
Through a Windows Product Activation (WPA) vulnerability that Microsoft introduced in Windows 7, it is possible to reset the remaining rearm count back to 4. There is no limit to th
@vinhins
vinhins / skiprearm
Created April 24, 2023 04:25 — forked from dmi3mis/skiprearm
SkipRearm lets you use Windows without activating
SkipRearm lets you use Windows without activating
RECOMMENDED: Click here to repair Windows problems & optimize system performance
SkipRearm is a registry entry which specifies whether to run the Windows Software Licensing Rearm program. Rearming a computer restores Windows Vista and later, to the original licensing state. All licensing and registry data related to activation is either removed or reset. Any grace period timers are reset as well.
0 : Specifies that the computer will be rearmed & any grace period timers will be reset
1 : Specifies that the computer will not be rearmed & grace period timers will not be reset.
SkipRearm registry key in Windows
SkipRearm specifies whether to run the Windows Software Licensing Rearm program. Rearming a computer restores the Windows operating system to the original licensing state. All licensing and registry data related to activation are either removed or reset. Any grace period timers are reset as well, states Microsoft.
In other words, SkipRearm specifies wheth
@vinhins
vinhins / RFC3339DateTime.cs
Created April 14, 2022 15:33 — forked from JamesDunne/RFC3339DateTime.cs
RFC3339 DateTime struct for C#
public struct RFC3339DateTime : IEquatable<RFC3339DateTime>, IComparable<RFC3339DateTime>
{
private readonly DateTimeOffset _value;
private static readonly string[] _formats = new string[] { "yyyy-MM-ddTHH:mm:ssK", "yyyy-MM-ddTHH:mm:ss.ffK", "yyyy-MM-ddTHH:mm:ssZ", "yyyy-MM-ddTHH:mm:ss.ffZ" };
public RFC3339DateTime(string rfc3339FormattedDateTime)
{
DateTimeOffset tmp;
if (!DateTimeOffset.TryParseExact(rfc3339FormattedDateTime, _formats, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal, out tmp))
@vinhins
vinhins / introrx.md
Last active March 30, 2022 08:53 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@vinhins
vinhins / gist:3c941b6f0272cdf0c6c6ef7aa2b1e5cb
Created February 23, 2022 07:11 — forked from akimboyko/gist:4622557
Custom scope for Ninject that returns same instance based on first constructor argument. Using both kernel and factory
void Main()
{
using(var kernel = new StandardKernel(new Module()))
{
kernel.Load<FuncModule>(); // for sake of LinqPAD
var instance1 = kernel.Get<MyClass>(new ConstructorArgument("myArg", "test"));
var instance2 = kernel.Get<MyClass>(new ConstructorArgument("myArg", "test"));
Assert.That(instance1, Is.Not.Null.And.SameAs(instance2));
@vinhins
vinhins / SlackClient.cs
Created June 16, 2021 09:22 — forked from jogleasonjr/SlackClient.cs
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{