Skip to content

Instantly share code, notes, and snippets.

View bukowa's full-sized avatar

Buk Bukowski bukowa

View GitHub Profile
@bukowa
bukowa / main.py
Last active January 20, 2023 23:50
python pillow simple benchmark
import json
import os.path
import timeit
from collections import namedtuple
from PIL import Image
SizeUnit = namedtuple('SizeUnit', ['size', 'name'])
KB = SizeUnit(1024, 'KB')
MB = SizeUnit(1024*1024, 'MB')
@bukowa
bukowa / github-gpg-key-web-flow
Last active January 20, 2023 01:37
github gpg key pull request trust web flow trust
$ curl https://github.com/web-flow.gpg | gpg --import
$ gpg --edit-key noreply@github.com
gpg> trust
gpg> save
$ gpg --lsign-key noreply@github.com
to delete
$ gpg --delete-key noreply@github.com
@bukowa
bukowa / ducky.MD
Last active January 18, 2023 14:07
ducky one 2 sf
  • to rebind capslock into fn:

    • fn + alt + k for 5 seconds
    • press caps once, it should turn blue press esc
    • done
    • to use caps normally in that mode pres caps + tab
  • function lock (all keys working like holding fn):

    • hold fn (also hold to exit)
  • record macro:

@bukowa
bukowa / bash.sh
Last active November 11, 2022 13:08
bash
#!/bin/bash
# kubernetes delete objects
kubectl get crd -o=json | jq -r '.items[] | .metadata.name' | grep cert-manager.io | xargs kubectl delete crd
# helm get chart latest version
helm search repo jetstack/cert-manager --versions --output=json | jq -r '.[0].version'
# docker delete exited containers
docker ps -q -a --filter status=exited | xargs docker rm
@bukowa
bukowa / .env.sh
Last active November 2, 2022 14:21
bootstrap install k3s via ssh on alpine
#!/bin/sh
export SERVER1="192.168.0.201"
export SERVER2="192.168.0.202"
export SERVER3="192.168.0.203"
export SERVER4="192.168.0.204"
export HOST1="g3w.dell.baza"
export HOST2="g50.dell.baza"
export HOST3="h3m.dell.baza"
@bukowa
bukowa / alpine.MD
Created October 31, 2022 11:46
alpine linux

on ntfs use ntfs-3g - to get uuid blkid UUID=$UUID $DIR ntfs-3g defaults 0 0

@bukowa
bukowa / install.sh
Last active November 2, 2022 11:27
k3s alpine cloned vm prepare
#!/bin/sh
set -eu
IP=${1}
HOST=${2}
echo "${HOST}" > /etc/hostname
printf "127.0.0.1\tlocalhost\n::1\tlocalhost\n" > /etc/hosts
sed -i "s/address.*/address $IP/" /etc/network/interfaces
@bukowa
bukowa / README.md
Created October 26, 2022 00:20
kubernetes k3s virtualbox ubuntu minimal server
@bukowa
bukowa / parse_css.py
Last active December 19, 2019 00:13
css get classes for values
from typing import List
import tinycss2
import tinycss2.ast
def get_desired(filename):
"""
Read desired css line by line from a file.
"""
@bukowa
bukowa / clipboard_script.py
Last active November 14, 2019 06:27
clipboard > windows > python >: read_clipboard_data()
import ctypes
import time
from typing import Any
TABLE = {
'to_list': lambda txt: txt.decode('utf-8').splitlines(),
}
__doc__ = """