Skip to content

Instantly share code, notes, and snippets.

@abakum
abakum / sshd_config
Last active March 15, 2024 15:20
sshd_config
ListenAddress 127.0.0.1
PasswordAuthentication no
ChallengeResponseAuthentication no
Subsystem sftp sftp-server.exe
ClientAliveInterval 100
# Клиент и хост проверяют друг друга по сертификатам
# Клиенту нужен сертификат клиента в ~/.ssh/id_rsa-cert.pub, ключи ЦС хостов в known_hosts
# Хосту нужен сертификат хоста в HostCertificate, ключи ЦС клиентов в TrustedUserCAKeys и принципалы сертификатов клиентов в AuthorizedPrincipalsFile
#TrustedUserCAKeys __PROGRAMDATA__/ssh/trusted_user_ca_keys
@abakum
abakum / ssh.txt
Last active February 25, 2024 09:58
rutoken for OpenSSH client
У меня есть RSA:2048 ключ в шифрованном паролем id_rsa.ppk
Запишем его в шифрованный паролем PKCS #8 pem PRIVATE KEY ENCRYPTED
MINGW64
`pacman -S mingw-w64-x86_64-putty`
`puttygen id_rsa.ppk`
Вводим пароль и в меню Conversion~Export OpenSSH key~id_rsa.pem
Чтоб не вводить пароль расшифруем его в PKCS #1 pem https://gist.github.com/tuansoibk/0b1f279be5c1b782d95f4e15af1442cb
Не забыть удалить этот расшифрующий и подписывающий ключ (РиПК) PRIVATE KEY
`openssl rsa -in id_rsa.pem -out priv.pem`
@abakum
abakum / a.txt
Created February 20, 2024 17:00
golang in msys2
# https://gist.github.com/voidexp/604c61cb7fd1bbcba8142ac94c184f20
if go is installed then
echo 'export PATH=/c/Program\ Files/go/bin:$PATH' >> ~/.bashrc
echo 'export PATH=$(cygpath $GOPATH/bin):$PATH' >> ~/.bashrc
---
git clone https://github.com/thales-e-security/p11tool
cd p11tool
go get -u
go install
@abakum
abakum / EnRu.ahk
Created October 16, 2023 09:13
Another global keyboard layout switch by clicking the left or right Ctrl key
;EnRu.ahk
;Another global keyboard layout switch by clicking the left or right Ctrl key
;Еще один глобальный переключатель раскладки клавиатуры щелчком левой или правой клавиши Ctrl
en:=0x4090409
ru:=0x4190419
WM_INPUTLANGCHANGEREQUEST:=0x0050
HWND_BROADCAST:=0xFFFF
Frequency:=523
@abakum
abakum / SwitchKeyboardLayoutsToDefault.ps1
Last active October 12, 2023 13:37
Switch Keyboard Layouts To Default
Add-Type -AssemblyName 'System.Windows.Forms'
$WinUserLanguageList=Get-WinUserLanguageList
if ( [System.Windows.Forms.InputLanguage]::CurrentInputLanguage.Culture.Name -ne $WinUserLanguageList[0].LanguageTag ) {
Set-WinUserLanguageList $WinUserLanguageList -Force
}
@abakum
abakum / net stop repeater_service^&net start repeater_service.bat
Last active August 3, 2023 09:56
Remember the command line as .bat file
@cd /d %~dp0
@set cmd=%~n0
%cmd:;=:%
@timeout /t 9
@abakum
abakum / mov2mkv.bat
Last active August 1, 2022 13:27
Convert .mov files with pcm to .mkv files with flac as DaVinci Resolve helper
SetLocal EnableExtensions EnableDelayedExpansion
:forfiles
if "%~1"=="nul" (
call :doit "%~2"
goto :EOF
)
:main
if "%~1"=="" (
if not exist "%UserProfile%\SendTo\%~n0.lnk" (
@abakum
abakum / mvc2x.bat
Last active August 2, 2022 19:56
Convert mvc to yt=sbsl rl=sbsr sbs=sbs2l rlq=sbs2r tab=ab2l ba=abr baq=ab2r ab=abl frameseq=alt lines=row arcd hdmi
SetLocal EnableExtensions EnableDelayedExpansion
:main
echo Convert mvc to yt=sbsl rl=sbsr sbs=sbs2l rlq=sbs2r tab=ab2l ba=abr baq=ab2r ab=abl frameseq=alt lines=row arcd hdmi
echo Run "mvc2x.bat" without parameters to place it in "%UserProfile%\SendTo"
echo Send "c:\d\" to "mvc2x"
echo or drop it to "mvc2x.bat"
echo "c:\d\film\BD\BDMV\STREAM\00001.m2ts" and "c:\d\film\BD\BDMV\STREAM\00002.m2ts" will be used as mvc source
echo "c:\d\film\d.mkv" will be used as sound and metadata source
echo Then look at "c:\d\x\d.mkv" where x is you choose
@abakum
abakum / JPG2VR.bat
Last active June 1, 2022 12:32
Convert 2D panoramas from left and right vr360 cameras to VR.JPG files for cardboard and photos.google.com
SetLocal EnableExtensions EnableDelayedExpansion
:forfiles
if "%~1"=="nul" (
call :doit "%~2"
goto :EOF
)
:main
if "%~1"=="" (
if not exist "%UserProfile%\SendTo\%~n0.lnk" (
@abakum
abakum / VR2PL.bat
Last active April 4, 2021 17:26
Convert 3D photos or panoramas from VR.JPG to playlist of MKV or MP4 for YouTube or 3DTV
setlocal enableDelayedExpansion
:forfiles
if "%~1"=="nul" (
call :doit "%~2"
goto :EOF
)
:main
if "%~1"=="" (