Skip to content

Instantly share code, notes, and snippets.

View backnotprop's full-sized avatar
📟
E.Alderson

Michael Ramos backnotprop

📟
E.Alderson
View GitHub Profile
@yanniszark
yanniszark / cpu_manager.sh
Created December 2, 2019 17:58
GKE CPU Pinning Script - Run this as a DaemonSet
#!/bin/bash
HOSTFS="/mnt/hostfs"
function sleep_forever() {
while true; do sleep 100; done
}
function setup_kubectl() {
# Setup kubectl
@backnotprop
backnotprop / bear_survival.md
Last active July 21, 2019 13:19
Can the bear population survive

Looking for a solution to my below game problem. I believe it to require some sort of reinforcement learning, dynamic programming, or probabilistic programming solution, but am unsure... This is my original problem, and is part of an initiative to create "unique and challenging problem that you're able to conceptualize and then solve. 3 Judging criteria: uniqueness, complexity, and solution (no particular weighting and scoring may favor uniqueness/challenge over solution"

Inspirations: Conway's Game of Life, DeepMind's Starcraft Challenge, deep Q-learning, probabilistic programming

BEAR SURVIVAL

A bear is preparing for hibernation. A bear must reach life-strength 1000 in order to rest & survive the winter. A bear starts off at a health of 500. A bear explores an environment of magic berries. A bear makes a move (chosen randomly with no optional direction) and comes across a berry each time. There are 100 different types of berries that all appear across the wilderness equally and

@jjo
jjo / node-custom-setup.yaml
Last active January 28, 2023 03:23
Run commands at Kubernetes *nodes* via `privileged` DaemonSet + `nsenter` hack, very useful for setups requiring base packages pre-installed at nodes. Please take a moment to understand what it does, and *don't* use it for *production*. Grab the logs with: kubectl logs -n kube-system -l k8s-app=node-custom-setup -c init-node
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
namespace: kube-system
name: node-custom-setup
labels:
k8s-app: node-custom-setup
annotations:
command: &cmd apt-get update -qy && apt-get install -qy tgt ceph-fs-common ceph-common xfsprogs
@rickcrawford
rickcrawford / golang_public_gcs_bucket.md
Last active July 16, 2022 15:00
Golang Read from a GCS Cloud Storage bucket

Read data from a public bucket using gzip compression.

First bit of code opens a bucket and lists contents.

Next reads a gzip json file and deserializes it to an array. Please note not very efficient for a large array since the byte array is loaded into memory.

package main

import (
	"compress/gzip"
@manekinekko
manekinekko / regex-es6-imports.js
Last active February 1, 2024 16:05
A regular Expression to parse ECMAScript6 import syntax
let regex = `import
(?:
["'\s]*
([\w*{}\n, ]+)
from\s*
)?
["'\s]*
([@\w/_-]+)
["'\s]*
;?
@staltz
staltz / introrx.md
Last active May 17, 2024 07:59
The introduction to Reactive Programming you've been missing