Skip to content

Instantly share code, notes, and snippets.

View marvin-hansen's full-sized avatar
🕊️
Progressing

Marvin Hansen marvin-hansen

🕊️
Progressing
View GitHub Profile
@marvin-hansen
marvin-hansen / setup.sh
Last active October 31, 2017 03:56
Creates a fast.ai DL environment on Google Cloud
# Preare disk
# Here sdb is the device ID I get from lsblk
# Uncomment if you want to use a shared disk.
# Details on: # https://cloud.google.com/compute/docs/disks/add-persistent-disk
# You can add a persistent disk already when creating a computing instnance
#echo "Format Disk"
#sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb
#sudo mkdir -p /mnt/disks/data
#echo "Mount Disk"
// Copyright (c) 2021. Marvin Friedrich Lars Hansen. All Rights Reserved. Contact: marvin.hansen@gmail.com
package web_socket
import (
"testing"
"time"
)
func TestNewWebSocketClient(t *testing.T) {
@marvin-hansen
marvin-hansen / LF_Checklist.md
Created July 18, 2023 07:13
Checklist for hosting DeepCausality with LF AI & Data

Checklist for hosting DeepCausality with LF AI & Data

Basic preparations in the GH org and repo

✅ Enable two-factor authentication for all members of the project’s GitHub org.

✅ Install the GitHub DCO app on all repos.

Achieve the basic OpenSSF badge

@marvin-hansen
marvin-hansen / Output.txt
Created December 14, 2023 10:21
Most weirdo messaging bug
Sending record 0
Got record: key=Some("Key 0"), value=Value 0
Got record: key=Some("Key 1"), value=Value 1
Got record: key=Some("Key 2"), value=Value 2
Got record: key=Some("Key 3"), value=Value 3
Got record: key=Some("Key 4"), value=Value 4
Got record: key=Some("Key 5"), value=Value 5
Got record: key=Some("Key 6"), value=Value 6
Got record: key=Some("Key 7"), value=Value 7
Got record: key=Some("Key 8"), value=Value 8
@marvin-hansen
marvin-hansen / proton-pulumi.py
Created March 10, 2024 05:28
Proton Pulumi Deployment Descriptor
import pulumi
import pulumi_gcp as gcp
from pulumi_kubernetes import Provider, apps, core
# Define the GCP cluster.
cluster = gcp.container.Cluster("time-plus-demo",
initial_node_count=3,
node_config=gcp.container.ClusterNodeConfigArgs(
machine_type="n1-standard-1",
# Assuming default disk size and image type.
rust_binary(
name = "bin",
crate_root = "src/main.rs",
srcs = glob([
"src/**/*.rs",
]),
aliases = aliases(),
proc_macro_deps = all_crate_deps(proc_macro = True),
rustc_flags = select({
"//:release": [
############################
# This Dockerfile runs relative to the repo root.
# Therefore, copy it to the root folder before running.
############################
FROM my-registry/rust-build:1.77-alpine as build
# Set workspace directory
WORKDIR /app
# Copy over the entire source code
@marvin-hansen
marvin-hansen / WORKSPACE.bzlmod
Created June 23, 2024 08:58
Workaround to use BuildBuddy toolchain with Bazelmod until Bazelmod support arrives later
###############################################################################
# BuildBuddy Toolchain
#
# Not yet available for Bazelmod.
# See: https://github.com/buildbuddy-io/buildbuddy-toolchain/issues/18
#
# Releases: https://github.com/buildbuddy-io/buildbuddy-toolchain/
###############################################################################
http_archive(
@marvin-hansen
marvin-hansen / BUILD.bazel
Last active July 1, 2024 10:46
Shell scripts to pull docker images from a private repo in BB
sh_test(
name = "pull_private_dockerhub",
srcs = ["tests/docker_test_docker_hub.sh"],
exec_properties = {
# Tell BuildBuddy to run this test using a Firecracker microVM.
"test.workload-isolation-type": "firecracker",
"test.init-dockerd": "true",
# Tell BuildBuddy whether to preserve the microVM state across test runs.
"test.recycle-runner": "false",
# Tell BuildBuddy to create a dedicated microVM to isolate the test.
@marvin-hansen
marvin-hansen / Module.bazel
Last active July 4, 2024 14:09
MUSL RBE toolchain debug
module(name = "queng")
###############################################################################
# B A Z E L D E P E N D E N C I E S # https://registry.bazel.build/
###############################################################################
# https://github.com/bazelbuild/bazel-skylib/releases/
bazel_dep(name = "bazel_skylib", version = "1.7.1")
# https://github.com/bazelbuild/rules_rust/releases
bazel_dep(name = "rules_rust", version = "0.46.0")