Skip to content

Instantly share code, notes, and snippets.

@b4tman
b4tman / daemon.json
Last active May 31, 2024 10:43
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:

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 |
@b4tman
b4tman / who_alive.ps1
Last active April 4, 2023 11:35
powershell + fping > onliner for list alive IP's on /24 net
fping -g 192.168.0.0/24 2>nul | Select-String -SimpleMatch -Pattern "is alive" | Select-Object @{Name=“IP”;Expression={($_ -split " ")[0]}} | Select-Object IP,@{Name=“D”;Expression={[int]($_.IP -split "\.")[3]}} | Sort-Object -Property D| Select-Object -Property IP
Stop-Service wuauserv
Set-Service -Name wuauserv -StartupType disabled
$NewAcl = Get-Acl -Path "C:\WINDOWS\system32\wuaueng.dll"
Set properties
#$identity = "BUILTIN\Administrators"
$identity = "Администраторы"
$fileSystemRights = "FullControl"
$type = "Allow"
$fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type
@b4tman
b4tman / merge-tabledoc-formats.bsl
Created January 19, 2022 06:53
Объединение табличных документов с разным количеством колонок
// srcs:
// https://forum.mista.ru/topic.php?id=837711
// https://fastcode.im/Templates/7861
// Добавляет один сформированный табличный документ к другому
//
// Параметры:
@b4tman
b4tman / bench.py
Last active September 30, 2021 12:52
import time
import statistics
import functools
def bench(num_iters = 1000):
def make_wrapper(func):
@functools.wraps(func)
def wrapper(*args, **kw):
times = []