Skip to content

Instantly share code, notes, and snippets.

@dimalyshev
dimalyshev / shutdown demo.cmd
Created May 21, 2020 14:01
Stress test for MQ connection
rem Reproduce connection multiplication on RabbitMQ shutdown
rem Use rabbitmqctl, sor REQUIRES
rem set PATH=%PATH%;"c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.3\sbin"
echo off
del demo-*.log demo-connections-*.log
set OUTPUT=demo-connections-%date%.log
:: RUN dotnet run
dotnet build --nologo -v q %1 >nul
@dimalyshev
dimalyshev / import.awk
Last active December 14, 2021 12:26
libre
# import.awk - convert LibreView.com csv export to Diabetes:M (Android App) import csv
BEGIN {
FS = "[, ]"
print("name:DIABETES_M","version:2.0.0","export:Entries")
print("DateTimeFormatted","glucose","carbs","proteins","fats","calories","carb_bolus","correction_bolus","extended_bolus","extended_bolus_duration","basal","basal_is_rate","bolus_insulin_type","basal_insulin_type","weight_entry","weight","category","category_name","carb_ratio_factor","insulin_sensitivity_factor","notes","is_sensor","pressure_sys","pressure_dia","pulse","injection_bolus_site","injection_basal_site","finger_test_site","ketones","google_fit_source","timezone","exercise_index","exercise_comment","exercise_duration","medications","food","us_units","hba1c","cholesterol_total","cholesterol_ldl","cholesterol_hdl","triglycerides","microalbumin_test_type","microalbumin","creatinine_clearance","egfr","cystatin_c","albumin","creatinine","calcium","total_protein","sodium","potassium","bicarbonate","chloride","alp","alt","ast","bilirubin",
@dimalyshev
dimalyshev / create
Created May 20, 2018 00:58
virtualbox
set NNN=tiny
::vbox createvm --name %NNN% --ostype Windows7 --basefolder T:\vm --register
::vbox modifyvm %NNN% --memory 2000 --acpi on --boot1 dvd --nic1 nat
::vbox createhd --filename "T:\vm\%NNN%\hdd.vdi" --size 8000
echo %NNN%
vbox.bat storagectl %NNN% --name SATA --add sata --controller PIIX3
vbox.bat storageattach %NNN% --storagectl SATA --port 0 --device 1 --type dvddrive
vbox.bat storageattach %NNN% --storagectl SATA --port 0 --device 0 --type hdd --medium "C:\vm\usb.vmdk"
@dimalyshev
dimalyshev / mkwc_svn
Last active May 20, 2018 00:49
config
md wc & cd wc
svn co https://svnsrv:8443/svn/myrepo/dev --depth empty .
:: precise fetch dirs
svn up client services contrib setup
:: precise fetch files
svn up mkver.bat setver.js build.bat
@dimalyshev
dimalyshev / VDI links
Last active May 19, 2018 13:38
VDI,XRDP etc.
@dimalyshev
dimalyshev / mkca.bat
Last active September 9, 2018 13:05
openssl
:: make ca self signed cert
md ca
:: root ca
openssl genrsa -out ca/%1.key 4096
:: make self-signed ca cert
openssl req -new -x509 -days 1826 -subj "/CN=myca" -key ca/%1.key -out ca/%1.crt
@dimalyshev
dimalyshev / a.bat
Last active June 21, 2018 18:13
android env
call %*
goto:eof
:init
echo set env: tools=%1
set JDK=C:\Program Files\Android\Android Studio\jre
@dimalyshev
dimalyshev / convert.bat
Last active May 2, 2018 11:38
convert & organize (by dates) video & photos
for /F "delims=;" %%i in ('dir /b/s "%~1\%2"') do ffmpeg -i "%%i" -strict -2 "%%~ni.mp4" && move "%%~ni.mp4" "%%i"
for /F "delims=;" %%i in ('dir /b/s "%~1"') do ffmpeg -i "%%i" -strict -2 "%%~ni.mp4" && del "%%i"