Skip to content

Instantly share code, notes, and snippets.

@b4tman
b4tman / send_ctrlbreak.ahk
Created October 15, 2024 13:03
autohotkey script to send ctrl+break by f11
F11::{
send "^{CtrlBreak}"
}
vim.api.nvim_create_user_command(
'Encode',
function(input)
vim.api.nvim_command('%!openssl enc -e -aes-256-cbc -a -salt -pbkdf2 -k ' .. input.args)
end,
{desc = 'Encode buffer with password', nargs = 1}
)
vim.api.nvim_create_user_command(
'Decode',
@b4tman
b4tman / 1C-Link-CA.txt
Last active October 14, 2024 10:28
1c link ca
#!/bin/sh
export HOST=example.com
export PORTNUMBER=443
export SERVERNAME=example.com
echo -n | openssl s_client -connect $HOST:$PORTNUMBER -servername $SERVERNAME | openssl x509 > $SERVERNAME.cer
@b4tman
b4tman / ip_num.py
Created September 27, 2024 10:29
int to IPv4 and IPv4 to int
ip2int = lambda ip: int("".join(map(lambda x: f"{int(x):08b}", ip.split("."))), 2)
int2ip = lambda x: ".".join(str(int(f"{x:032b}"[i:i+8], 2)) for i in range(0,25,8))
print(x := ip2int("127.0.0.1"), int2ip(x))
@b4tman
b4tman / fix_xkbmap.sh
Last active September 25, 2024 11:42
исправить переключение раскладки в X на Linux
#!/bin/sh
setxkbmap -option grp:alt_shift_toggle -layout us,ru
@b4tman
b4tman / curl-format.txt
Created September 13, 2024 06:34
measure curl request/response
time_namelookup: %{time_namelookup}s\n time_connect: %{time_connect}s\n time_appconnect: %{time_appconnect}s\n time_pretransfer: %{time_pretransfer}s\n time_redirect: %{time_redirect}s\n time_starttransfer: %{time_starttransfer}s\n ----------\n time_total: %{time_total}s\n
@b4tman
b4tman / daemon.json
Last active August 5, 2024 10:32
docker registry mirrors (/etc/docker/daemon.json) + podman (/etc/containers/registries.conf)
{
"registry-mirrors" : [
"https://cr.yandex/mirror",
"https://dockerhub.timeweb.cloud",
"https://huecker.io",
"https://noohub.ru",
"https://dcr-px.ru",
"https://mirror.gcr.io",
"https://quay.io",
"https://registry.access.redhat.com",
@b4tman
b4tman / kmskeys10.txt
Created March 4, 2024 06:24 — forked from azhe403/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”

Keybase proof

I hereby claim:

  • I am b4tman on github.
  • I am b4tman (https://keybase.io/b4tman) on keybase.
  • I have a public key whose fingerprint is 46BE F01F B498 5505 9A96 911E 41A0 0BF1 5EA7 E5F3

To claim this, I am signing this object: