Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
# affinity -- Affinity for pod assignment
affinity: {}
autoDiscovery:
# cloudProviders `aws`, `gce`, `magnum` and `clusterapi` are supported by auto-discovery at this time
# AWS: Set tags as described in https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#auto-discovery-setup
# autoDiscovery.clusterName -- Enable autodiscovery for `cloudProvider=aws`, for groups matching `autoDiscovery.tags`.
# Enable autodiscovery for `cloudProvider=clusterapi`, for groups matching `autoDiscovery.labels`.

Kumbersome Kubernetes

kubectl get pods on a node

kubectl get pods --all-namespaces \
  --output jsonpath="{range .items[?(@.spec.nodeName=='ip-192-168-13-3.eu-north-1.compute.internal')]}{@.metadata.namespace}{': '}{@.metadata.name}{'\n'}"

kubectl get instance types

Beautiful Bash

until something is true

if "creation" command fails, sleep 1

while true; do
  kubectl get namespace mynamespace && break
 kubectl create namespace mynamespace || sleep 1
---
apiVersion: v1
kind: Namespace
metadata:
name: inflate-1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: inflate-1
var ss = SpreadsheetApp.openById('1AKPTWbOiRactKDBxc-dA25JgWiXSjwKCK1ivVfa1xnw');
function minutely() {
run('minutely')
}
function hourly() {
run('hourly')
}
function daily() {
run('daily')
rm /etc/apt/sources.list.d/pve-enterprise.list
apt-get update && apt-get install -y sudo

curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.gpg | sudo apt-key add -
curl -fsSL https://pkgs.tailscale.com/stable/debian/bullseye.list | sudo tee /etc/apt/sources.list.d/tailscale.list

sudo apt-get update
sudo apt-get install tailscale
# ssd: 440mb/s (36s for 16gb)
# nvme: 1.0gb/s (17s for 16gb)
# nvme encrypted 260mb/s
dd bs=1M count=16k if=/dev/zero of=test status=progress oflag=direct; rm test
#!/usr/bin/env bash
set -euo pipefail
while true; do
(
exec cpuminer-gr-1.1.9-x86_64_ubuntu_20_04/cpuminer-zen2 -a gr -o stratum+tcps://stratum-eu.rplant.xyz:17056 -u RVmmg18q53WyAzPCV3v3JsGYoD4fswnjiJ.mara -t 47
) &
miner_pid=$!
(
@matti
matti / cpuminer
Last active September 28, 2021 15:27
apt update && apt install -y screen
apt update && apt install -y libjason-dev libnuma-dev
wget https://github.com/WyvernTKC/cpuminer-gr-avx2/releases/download/1.1.9/cpuminer-gr-1.1.9-x86_64_ubuntu_20_04.tar.gz
tar -xvof cpuminer-gr-1.1.9-x86_64_ubuntu_20_04.tar.gz
echo """
./cpuminer-gr-1.1.9-x86_64_ubuntu_20_04/cpuminer-zen3 -a gr -o stratum+tcps://stratum-eu.rplant.xyz:17056 -u RLsDsCjXk2RJ8vnuAtmo4Lc1UK2a5bP29q.lennart2 --tune-full
""" > /root/lol.sh
require "json"
skipenvs = %w(
_
SHLVL
PATH
TERM
HEROKU_RELEASE_CREATED_AT
HEROKU_DYNO_ID
HEROKU_APP_NAME