-
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
on ntfs use ntfs-3g
- to get uuid blkid UUID=$UUID $DIR ntfs-3g defaults 0 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
import tinycss2 | |
import tinycss2.ast | |
def get_desired(filename): | |
""" | |
Read desired css line by line from a file. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import time | |
from typing import Any | |
TABLE = { | |
'to_list': lambda txt: txt.decode('utf-8').splitlines(), | |
} | |
__doc__ = """ |