Skip to content

Instantly share code, notes, and snippets.

@swami87aws
swami87aws / amazoneks_addon_commands
Created March 16, 2023 18:40
Sample commands for managing third party addons on Amazon Addons
## Using EKSCTL
#Describe Addon Versions
eksctl utils describe-addon-versions --kubernetes-version 1.24 | grep AddonName
#Describe Addon Configuration
eksctl utils describe-addon-versions --kubernetes-version 1.24 --name tetrate-io_istio-distro | grep AddonVersion
#Create Addon
eksctl create addon --cluster ${testcluster} --name tetrate-io_istio-distro --version latest --force
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active November 11, 2024 20:23
Make Firefox fast again
@maiermic
maiermic / copy-to-docker-volume.sh
Created July 24, 2021 16:11
Copy files to Docker volume
# Usage: copy-to-docker-volume SRC_PATH DEST_VOLUME_NAME [DEST_PATH]
copy-to-docker-volume() {
SRC_PATH=$1
DEST_VOLUME_NAME=$2
DEST_PATH="${3:-}"
# create smallest Docker image possible
echo -e 'FROM scratch\nLABEL empty=""' | docker build -t empty -
# create temporary container to be able to mount volume
CONTAINER_ID=$(docker container create -v my-volume:/data empty cmd)
# copy files to volume

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

@BennieCopeland
BennieCopeland / improving-as-a-software-developer.md
Created October 20, 2020 09:15 — forked from Kavignon/improving-as-a-software-developer.md
Always hungry for more. This is a list of resources I've used or that I plan to use as a way to improve my knowledge and technical skills as a software developer.

Some of the books I'll be recommending are based on .NET. Do not be discouraged. We shouldn't strive to stick to a specific technology stack. Your ambitions and goals will evolve over time and that might lead you a completely new space. Moreover, there are lessons to be learned from an environment that's different from what you're used to.

Software Development

/* SQL Server Statistics Explained with Playing Cards
v0.1 - 2020-08-14
https://BrentOzar.com/go/learnstats
This first RAISERROR is just to make sure you don't accidentally hit F5 and
run the entire script. You don't need to run this:
*/
RAISERROR(N'Oops! No, don''t just hit F5. Run these demos one at a time.', 20, 1) WITH LOG;
GO
@atheiman
atheiman / User_Data.md
Last active November 15, 2024 09:40
EC2 User Data examples for Windows and Linux

EC2 User Data examples

Basic Windows local user with Administrator and RDP access

Add a local rdp user via user data at launch of a Windows EC2 instance. Note that this includes a password passed in thru both the user data and powershell command line and is a bad security practice because they can be viewed later. At a minimum, you should connect to the instance immediately after launch and change the password interactively. Also, delete the userdata from the instance after launch. More secure would be to connect the instance to a domain for authentication or use AWS native tooling to connect to the instance (e.g., AWS Session Manager).

<powershell>
# Be sure to set the username and password on these two lines. Of course this is not a good
# security practice to include a password at command line.
@RickStrahl
RickStrahl / ColorConsole.cs
Last active September 2, 2024 14:49
Color Console - a simple class to add color to .NET Console commands more easily.
using System;
using System.Text;
using System.Text.RegularExpressions;
namespace MainColorConsole
{
class Program
{
static void Main(string[] args)
{
@samsch
samsch / stop-using-jwts.md
Last active October 3, 2024 22:31
Stop using JWTs

Stop using JWTs!

TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.

If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)

A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/

The reason to avoid JWTs comes down to a couple different points:

  • The JWT specification is specifically designed only for very short-live tokens (~5 minute or less). Sessions
@alanstevens
alanstevens / standard.md
Last active October 8, 2018 03:29
Proposed C# Coding Standard

Proposed C# Coding Standard

Naming

  • Method, property and class names are PascalCased (as opposed to camelCase, snake_case or kebob-case)
  • Local variables and parameters are camelCased
  • Private fields start with an underscore and are _camelCase.
  • Classes, methods and variable names should have meaningful English names using whole words where it makes sense.
  • Avoid unnecessary contractions in your names. e.g. "Product" instead "Prod"
  • Give your DTOs meaningful English names. DO NOT rename any properties on a DTO. They are necessary for mapping to the stored procedure.
  • When converting FoxPro code do not automatically use the existing variable and function names.
  • Avoid Hungarian Notation (https://en.wikipedia.org/wiki/Hungarian_notation).