Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile
while true; do
kubectl get pods --all-namespaces --no-headers | awk '$5 > 3 {print $1,$2}' | xargs -r kubectl delete pod -n || echo "failed to delete pods"
sleep 30
done
while true; do
kubectl delete pods -n "$NAMESPACE" --field-selector=status.phase=Failed || true
sleep 10
done
var items = document.querySelectorAll(".list-item--8QFZA")
var elements = Array.from(items)
//var els = elements.slice(0, 3)
var els = elements
document.addEventListener("visibilitychange", function () {
if (document.visibilityState === 'visible') {
els.pop().click()
}
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf $(printf "$(ls -tr)")

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`.