Skip to content

Instantly share code, notes, and snippets.

@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”
@b4tman
b4tman / git_config.sh
Created February 24, 2024 14:30
git config
git config --global --bool pull.rebase true
git config --global merge.conflictstyle zdiff3
git config --global --bool rebase.autostash true
git config --global init.defaultBranch master
git config --global --bool commit.verbose true
git config --global --bool rerere.enabled true
git config --global help.autocorrect 10
git config --global diff.algorithm histogram
git config --global --bool fetch.prune true
git config --global --bool fetch.prunetags true

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:

@b4tman
b4tman / 1c-install-upd.sh
Last active February 7, 2025 10:37
установка обновлений 1с (запуск установщиков из zip архивов)
#!/bin/sh +ex
ZDIR="."
if [ -d "$1" ]; then
ZDIR="$1";
fi
# распаковка
UDIR=$(mktemp -d)
function encode($s){
return $s | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString
}
function decode($s){
$SecureString = $s | ConvertTo-SecureString
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
$PlainString = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)
return $PlainString
}
@-moz-document url(chrome://browser/content/browser.xhtml) {
/* tabs on bottom of window */
/* requires that you set
* toolkit.legacyUserProfileCustomizations.stylesheets = true
* in about:config
*/
#main-window body { flex-direction: column-reverse !important; }
#navigator-toolbox { flex-direction: column-reverse !important; }
#urlbar {
top: unset !important;
$dups = Get-ChildItem -Recurse -File -Exclude "dups.csv" |
Get-FileHash -Algorithm SHA256 |
Select-Object -Property Hash, Path |
Group-Object -Property Hash |
Where-Object -Property Count -ge 2 |
Sort-Object -Property Count -Descending |
Select-Object -Property Count -ExpandProperty Group |
Select-Object -Property Count, Hash, Path
$dups | ConvertTo-Csv -NoTypeInformation |