Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile

autopi

do not set gateway for wifi which has no internet

add nogateway to /etc/dhcpcd.conf

interface wlan0
metric 200
nohook wpa_supplicant
javascript:(function(){
let tryAttempts = 0;
function loadComments () {
let needRescheduling = false;
const buttons = document.querySelectorAll(".ajax-pagination-btn[data-disable-with]")
buttons.forEach((button) => {
button.click();
lvremove /dev/pve/data -y
lvcreate -L 32G -n data pve -T
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
@matti
matti / tdx.md
Last active April 24, 2022 09:34

usva-1 install:

dnf remove buildah podman
curl -Lsf get.docker.io | sh
systemctl start docker

dnf install -y git screen
git clone https://github.com/intel/tdx-tools.git

Dope Dockerfile

Copy all from a docker image to a path

COPY --from=mattipaksula/reflex:sha-0238059 /* /usr/bin/

Bind port below 1024 without root

## 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')