Skip to content

Instantly share code, notes, and snippets.

View trymzet's full-sized avatar
🚀

Michał Zawadzki trymzet

🚀
View GitHub Profile
# Referenced videos:
# How to run local multi-node Kubernetes clusters using kind: https://youtu.be/C0v5gJSWuSo
# K3d - How to run Kubernetes cluster locally using Rancher K3s: https://youtu.be/mCesuGk-Fks
# Should We Replace Docker Desktop With Rancher Desktop?: https://youtu.be/bYVfCp9dRTE
# What Do Developers Really Need (And How Can Ops Help)?: https://youtu.be/gxx8EM08ihs
#########
# Setup #
#########
@djfdyuruiry
djfdyuruiry / README.md
Last active April 28, 2024 08:34
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@ProgramAlgo
ProgramAlgo / ODataJSONDateObjectToTimestamp.java
Created December 25, 2018 08:43
OData JSON Date Object to Timestamp
// OData json date string "/Date(1545727221)" to Timestamp
Pattern pattern = Pattern.compile("(\\d+)");
String onboardingDate = "/Date(1545727221)";
Matcher matcher = pattern.matcher( onboardingDate );
if (matcher.find()) {
String matched = matcher.group();
Timestamp dateToValidate = new Timestamp(Long.parseLong(matched));
}