Skip to content

Instantly share code, notes, and snippets.

View gitfool's full-sized avatar

Sean Fausett gitfool

View GitHub Profile
shigenobuokamoto / network-mirrored.service
Last active May 18, 2024 20:39
ExecStart=/bin/sh -ec '\
[ -x /usr/bin/wslinfo ] && [ "$(/usr/bin/wslinfo --networking-mode)" = "mirrored" ] || exit 0;\
echo "\
add chain ip nat WSLPREROUTING { type nat hook prerouting priority dstnat - 1; policy accept; };\
sayedihashimi /
Last active May 13, 2024 20:38
MSBuild and Visual Studio Known Error Message Formats

MSBuild and Visual Studio Known Error Message Formats

When a tool is executed that outputs some text, MSBuild will examine the text for errors and warnings. Many tools use a known format to report these messages. By default, MSBuild will examine the text and report errors and/or warnings based on the output. This behavior can be changed or disabled by using these parameters on the Exec task: IgnoreStandardErrorWarningFormat, CustomErrorRegularExpression, and CustomWarningRegularExpression.

NOTE: If you do decide to use your own regular expression to detect error and warnings, then

using System;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
namespace Pulumi.Helpers
public interface ITaggingStrategy
bool IsTaggable(string typeName);
richlander /
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";
SOURCE_NAME=$(kubectl get po -A -o wide | grep $1 | head -n 1 | awk '{print $2}')
TARGET_NAME=$(kubectl get po -A -o wide | grep $2 | head -n 1| awk '{print $2}')
SOURCE_IP=$(kubectl get po -A -o wide | grep $1 | head -n 1 | awk '{print $7}')
TARGET_IP=$(kubectl get po -A -o wide | grep $2 | head -n 1 | awk '{print $7}')
echo "Source: $SOURCE_NAME, Target: $TARGET_NAME"
echo "Source: $SOURCE_IP, Target: $TARGET_IP"
echo "Running command: sh -c \"kubectl sniff -i eth0 -o ./local.pcap $SOURCE_NAME -f '((tcp) and (net $TARGET_IP))'\""
sh -c "kubectl sniff -i eth0 -o ./local.pcap $SOURCE_NAME -f '((tcp) and (net $TARGET_IP))'"
ChristopherA /
Last active May 29, 2024 13:54
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.


If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

ejlp12 /
Last active May 5, 2024 18:51
ECS Best Practices Notes

OpenPGP Encryption Quick Start

OpenPGP is a protocol which allows two parties to communicate 'in pubilc' via a secure channel. Potential malicious agents can read all messages send between the parties but only the receiver of the message is actually able to decrypt the message and read its plaintext content. What follows are all necessary steps to setup a secure, viable and funtional infrastructure to use OpenPGP.