• Home
  • Linux
  • Docker
  • Windows
    • PS
    • C#
    • Exchange Server
  • Other
    • Perl
    • IPV6
    • MacOS
  • DB
    • MSSQL
    • MariaDB
    • PG

Home

victoria-metrics

Details
Written by: po3dno
Category: Linux
Created: 20 November 2024
Hits: 354
mkdir -p /data/victoria-metrics-data

docker run -d -it --rm -v /data/victoria-metrics-data:/victoria-metrics-data -p 8428:8428 --name victoria-metrics victoriametrics/victoria-metrics

curl -v http://localhost:8428/metrics

Extract all DLLs from a Nuget package (nupkg) with Windows cmd batch file

Details
Written by: po3dno
Category: C#
Created: 13 November 2024
Hits: 403
@echo off
REM Extracts all .dll files from nugets in this folder or its subfolders and copies them to a subfolders
REM .
REM Note: Uses .NET 4.5 to unzip the nugets. If this fails, use 7zip or something similar. 
REM       See http://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca/26843122#26843122


echo Extracting all dlls from nugets to folder \extracted-dlls

REM %mypath% is where the batch file is located
set mypath=%~dp0

set temppath=%~dp0temp\
set dllpath=%~dp0extracted-dlls\

REM Delete old dlls
echo Deleting old files
rd /s /q %dllpath%"
mkdir %dllpath%

rem traverse all nupkg files
pushd %mypath%
	for /r %%a in (*.nupkg) do (
		
		echo \- Processing %%~nxa
		
		REM unzip nuget to %temppath% folder.
		powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%%a', '%temppath%'); }
		
		REM Copy all dlls 
		REM See: http://stackoverflow.com/questions/11720681/windows-batch-copy-files-from-subfolders-to-one-folder
		pushd %temppath%
			for /r %%b in (*.dll) do (
				echo     \- Found %%~nxb
				COPY "%%b" "%dllpath%%%~nxb"
			)
		popd
		
		REM Delete Temp folder
		rd /s /q %temppath%"
    )
popd

pause

nuget

Details
Written by: po3dno
Category: Windows
Created: 13 November 2024
Hits: 382

https://dist.nuget.org/win-x86-commandline/latest/nuget.exe

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps

nuget add new_package.1.0.0.nupkg -source \\myserver\packages

 

Setup Proxy

First you’ll need to tell your PowerShell session to use your proxy. You might also need to change the TLS protocol that’s accepted. Basically, what’s happening above is just a bad error message. It’s not verbose enough to say “HTTPS failure” or anything like that.

$proxy = '<YOUR CORPORATE PROXY HERE>'  # update this
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy($proxy)
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true

Update Package Providers

This is similar-ish to sudo apt-get update. The first line gives you the package provider itself, the second registers PSGallery and the third installs PowerShellGet, which is basically an installer that a lot of packages use.

Install-PackageProvider -Name nuget -Scope AllUsers -Confirm:$false -Force -MinimumVersion 2.8.5.201
Register-PSRepository -Default -verbose
Install-Module -Name PowerShellGet -Scope AllUsers -Confirm:$false -Force -AllowClobber -MinimumVersion 2.2.4 -SkipPublisherCheck

Disable Virtualization Based Security

Details
Written by: po3dno
Category: Windows
Created: 02 October 2024
Hits: 354
If you used Group Policy, disable the Group Policy setting that you used to enable Windows Defender Credential Guard (Computer Configuration -> Administrative Templates -> System -> Device Guard -> Turn on Virtualization Based Security).
Delete the following registry settings:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\LsaCfgFlags
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceGuard\LsaCfgFlags
If you also wish to disable virtualization-based security delete the following registry settings:
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceGuard\EnableVirtualizationBasedSecurity
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceGuard\RequirePlatformSecurityFeatures
If you manually remove these registry settings, make sure to delete them all. If you don't remove them all, the device might go into BitLocker recovery.
Delete the Windows Defender Credential Guard EFI variables by using bcdedit. From an elevated command prompt, type the following commands:
mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d

Установка и подключение PostgreSQL на Mac Os

Details
Written by: po3dno
Category: pg
Created: 30 September 2024
Hits: 366

Устанавливаем PostgreSQL на Mac OS.

Содержание:
  • Установка PostgreSQL на Mac Os
  • Ошибки в командах
  • Не обязательно
  • Подключение к PostgreSQL на Mac OS
  • Пример создания нового пользователя и БД
  • Как подключиться к PostgreSQL на Mac OS
  • Исправление ошибок
  • Подключение в сторонней программе к БД

Read more …

  1. Working with ODBC Connections in Powershell
  2. Обход мастера приветствия Windows 11
  3. Search update
  4. rebuild BCD

Subcategories

Power Shell Article Count:  53

C# Article Count:  10

Perl Article Count:  1

Exchange Server Article Count:  15

Other Article Count:  24

MSSQL Article Count:  17

Windows Article Count:  25

MariaDB Article Count:  3

Linux Article Count:  9

Docker Article Count:  3

pg Article Count:  2

Page 3 of 32

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 177
  • Articles View Hits 173489