Skip to content

Instantly share code, notes, and snippets.

@bluewalk
bluewalk / pihole-spotify.txt
Created December 28, 2017 09:37
Spotify Pi-Hole
media-match.com
adclick.g.doublecklick.net
googleads.g.doubleclick.net
www.googleadservices.com
pagead2.googlesyndication.com
desktop.spotify.com
pubads.g.doubleclick.net
audio2.spotify.com
crashdump.spotify.com
adeventtracker.spotify.com
@bluewalk
bluewalk / TaskScheduler.cs
Last active November 2, 2020 12:27
Simple C# class for task scheduling
/// <summary>
/// Task scheduler
/// </summary>
public class TaskScheduler
{
private readonly ILogger _logger;
private readonly List<Timer> _timers = new List<Timer>();
public TaskScheduler(ILogger<TaskScheduler> logger)
{
@bluewalk
bluewalk / install-git-completion.sh
Created April 29, 2019 17:51 — forked from johngibb/install-git-completion.sh
Mac OS X - Install Git Completion
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@bluewalk
bluewalk / DateTimeLogger.cs
Last active October 10, 2019 12:03
DateTimeLogger: ILogger with DateTime stamp for .NET Core projects
/// <summary>
/// DateTimeLogger
/// </summary>
/// <typeparam name="T"></typeparam>
/// <inheritdoc />
public class DateTimeLogger<T> : ILogger<T>
{
private readonly ILogger _logger;
/// <inheritdoc />
@bluewalk
bluewalk / KeepConsoleOpenInDocker.cs
Created October 10, 2019 13:01
Keep a .NET Core console app open in Docker container
class Program
{
// AutoResetEvent to signal when to exit the application.
private static readonly AutoResetEvent WaitHandle = new AutoResetEvent(false);
static async Task Main(string[] args)
{
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location).ProductVersion;
Console.WriteLine($"[APP] version {version}");
Console.WriteLine("[GITHUB_LINK]\n");
@bluewalk
bluewalk / GetServiceProvider.cs
Created November 12, 2020 06:58
GetServiceProvider
public static class GetServiceProvider
{
public static IServiceProvider _ { get; set; }
public static T GetServiceOrCreateInstance<T>()
{
return ActivatorUtilities.GetServiceOrCreateInstance<T>(_);
}
public static object GetServiceOrCreateInstance(Type type)
@bluewalk
bluewalk / Fix_standby_battery_drain_MBPro-BigSur.md
Last active July 12, 2023 17:16
Fix standby battery drain Macbook Pro - Big Sur

Fixing standby battery drain issue Macbook Pro - Big Sur

1. Reboot into recovery mode

  1. Disable FileVault (System Preferences -> Security & Privacy -> FileVault -> Turn Off Filevault)
  2. Boot to recovery mode by holding Command + R during boot

2. Preparation

  1. Open Terminal
  2. Run csrutil authenticated-root disable to disable signature validation on the bootable snapshots
  3. Run ioreg -l | grep board-id to get your board ID and write it down.
@bluewalk
bluewalk / README.md
Created November 20, 2020 18:28
Git GL
[alias]
	gl = "!git log --graph --pretty=format:'[ %Cred%h%Creset | %Cblue%an%Creset | %Cgreen(%cr)%Creset ] ->%C(yellow)%d%Creset %s' --abbrev-commit --date=relative"
@bluewalk
bluewalk / IdleClient.cs
Created November 24, 2020 06:43
Imap IDLE client (using MailKit)
public class IdleClient : IDisposable
{
private readonly string _host, _username, _password;
private readonly SecureSocketOptions _sslOptions;
private readonly int _port;
private readonly CancellationTokenSource _cancel;
private CancellationTokenSource _done;
private bool _messagesArrived;
private readonly ImapClient _client;
private readonly bool _deleteOnProcessed;
@bluewalk
bluewalk / GetNordVPNWireGuardDetails.md
Last active November 15, 2024 06:08
Getting NordVPN WireGuard details

About

Instructions to obtain WireGuard details of your NordVPN account. These can be used to setup a WireGuard tunnel on your router to NordVPN.

Source: https://forum.gl-inet.com/t/configure-wireguard-client-to-connect-to-nordvpn-servers/10422/27

Prerequisites

If you have any linux machine, use that or install a vm if you don't have one.

Get their official linux app installed. Make sure you have wireguard installed too. And set the used technology to Nordlynx by running nordvpn set technology nordlynx