Skip to content

Instantly share code, notes, and snippets.

View WillSams's full-sized avatar
🚀

Will Sams WillSams

🚀
View GitHub Profile
#!/bin/bash
# Discussion, issues and change requests at:
# https://github.com/nodesource/distributions
#
# Script to install the NodeSource Node.js 16.x repo onto a
# Debian or Ubuntu system.
#
# Run as root or insert `sudo -E` before `bash`:
#
ARG ARCH=""
FROM ${ARCH}node:16.20.0-alpine3.17
# Install Node.js and Node-RED
RUN apk add --no-cache \
python3 && \
apk add --no-cache --virtual .build-deps \
build-base gcc abuild binutils binutils-doc gcc-doc \
&& npm install -g npm \
@WillSams
WillSams / ssh_on_vbox_mv.sh
Last active March 29, 2023 12:38
Configuring SSH & Hostname on Virtual Box VM
#!/bin/bash
# **************** CONFIGURATION FOR LOGGING INTO VM FROM HOST VIA SSH ******************
#
# Download and execute this script on your VM, not your host machine
#
# Pre-req:
# - Ensure you have openssh-server installed on the VM.
# - Go to File-> Host Network Manager -> Create. DO NOT enable `DHCP Server`.
#
# In your VM's settings, go to Network tab, add a 2nd network adapter and do the following:
@WillSams
WillSams / loft_and_devspace.md
Last active March 15, 2023 13:24
Improving the Development Experience with Loft & DevSpace

Improving the Development Experience with Loft & DevSpace

Introduction

The success of any software project relies on providing developers with the tools and resources they need to work efficiently and effectively. This is particularly true when it comes to Kubernetes, which is a powerful platform for building and deploying applications. However, Kubernetes can be complex and challenging to work with, especially for developers who are new to the platform. As a result, providing a good developer experience is essential to ensure successful Kubernetes projects. In order to provide a good developer experience with Kubernetes, it's important to offer tools and resources that help developers work efficiently and effectively. By providing these tools and resources, developers can focus on building and deploying applications, rather than spending time on administrative tasks or troubleshooting issues. Organizations can also ensure that their developers are working efficiently and eff

@WillSams
WillSams / argocd_github_actions.md
Last active March 15, 2023 13:22
Further Improving the Developer Experience with Argo CD and GitHub Actions

Further Improving the Developer Experience with Argo CD and GitHub Actions

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. With Argo CD, you can define your application deployment as a code, store it in a Git repository and use Argo CD to keep the deployed application in sync with the state specified in the Git repository. Your GitHub repository is the source of truth for your application deployment. Argo CD continuously monitors your Git repository and automatically deploys your application whenever a change is detected. The flow looks like this:

        ---> Merge PR Request ---> Image Tag/Push to Registry     

Developer

        -------------------------> Argo Sync ---> Argo CD ---> Kubernetes Cluster

Prerequisites

@WillSams
WillSams / DapperTest.py
Created October 11, 2012 15:03
Quick And dirty example of IronPython using Dapper.NET (w/MySql backend and stored procedures)
#DapperTest.py - Quick And dirty example of IronPython using Dapper.NET (w/MySql backend and stored procedures)
import System
import clr
#clr.AddReferenceByPartialName("System.Core")
clr.AddReferenceByPartialName("System.Data")
from System.Collections import IDictionary
from System.Collections.Generic import IDictionary, IList
from System.Data import IDbConnection, IDbCommand, CommandType
@WillSams
WillSams / windows-dev-install.ps1
Last active March 8, 2023 19:20
Windows Dev Install
echo "************************************************************"
echo "* WINDOWS-DEV-INSTALLER SRCIPT *"
echo "* this script should be executed with admin privileges *"
echo "************************************************************"
echo "* STEP 1 - Install Chocolatey ******************************"
mkdir C:\ProgramData\chocoportable
"# Set directory for installation - Chocolatey does not lock
@WillSams
WillSams / helm-charts-tutorial.md
Created March 1, 2023 22:52
The Case For Helm Charts Over DevSpace and/or Loft

The Case Over Helm Charts Over DevSpace/Loft

DevSpace and Loft are both tools designed to simplify the development and deployment of applications on Kubernetes. Both tools provide features such as local development environments, simplified deployment workflows, and streamlined debugging and logging. However, they have some differences in their approach and feature sets. DevSpace is more focused on providing an end-to-end development workflow, while Loft emphasizes multi-tenancy and collaboration features for teams.

Many of the features that DevSpace/Loft provides can be achieved by a more cost-effective approach: just by packaging and deploying Helm charts as normal.

Pre-requisites

@WillSams
WillSams / es_systems.cfg
Last active February 9, 2023 05:10
Retropie example es_systems.cfg
<?xml version="1.0"?>
<systemList>
<system>
<name>3do</name>
<fullname>3DO</fullname>
<path>/home/pi/RetroPie/roms/3do</path>
<extension>.cue .chd .m3u .iso .CUE .CHD .M3U .ISO</extension>
<command>/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-opera/opera_libretro.so %ROM%</command>
<platform>3do</platform>
<theme>3do</theme>
@WillSams
WillSams / cplusplus_lambdas_kata.cpp
Last active January 16, 2023 12:36
GoF Command Pattern using C++ Lambdas
#include <iostream>
#include <stack>
#include <functional>
using Receiver = std::function<void(std::function<void()>)>;
class Command {
public:
virtual void setReceiver(Receiver receiver) = 0;
virtual void execute() = 0;