Skip to content

Instantly share code, notes, and snippets.

View diev's full-sized avatar

Dmitrii Evdokimov diev

View GitHub Profile
@diev
diev / CryptoPro.md
Created July 18, 2024 17:12 — forked from Barolina/CryptoPro.md
Linux cryptopro5 подпись файлов и установка

Чуть-чуть об установке

  1. что б каждый раз не вводить полный путь до команд крипто
export PATH="$(/bin/ls -d /opt/cprocsp/{s,}bin/*|tr '\n' ':')$PATH"
  1. так как, выше описная команда измениет переменную PATH тольк на время сесии, это можно исправить так: меняем PATH

  2. если во время установки, к примеру от пользователя www-data, произошла ошибка во время установке pfx, убедитесь, что

@diev
diev / CredentialManager.cs
Created March 12, 2024 02:35 — forked from meziantou/CredentialManager.cs
Using the Windows Credential API (CredRead, CredWrite, CredDelete, CredEnumerate).
// The most up to date version is available
// on GitHub: https://github.com/meziantou/Meziantou.Framework/tree/master/src/Meziantou.Framework.Win32.CredentialManager
// NuGet package: https://www.nuget.org/packages/Meziantou.Framework.Win32.CredentialManager/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32.SafeHandles;
@diev
diev / appsettings.json
Created September 28, 2023 08:32 — forked from yetanotherchris/appsettings.json
.NET Core Examples: configuration binding and appsetting.json
{
"Smtp": {
"Host": "smtp.gmail.com",
"Port": 587,
"UseSSL": true,
"Username": "bob",
"Password": "password",
}
}
@diev
diev / make-nuget-with-tag-version.yml
Created March 29, 2023 21:54 — forked from deitry/make-nuget-with-tag-version.yml
Simple GitHub action to build NuGet package on tags push
name: Build NuGet package and push to GitHub registry
on:
workflow_call:
inputs:
organizationName:
required: true
type: string
nuspecPath:
required: true
@diev
diev / make-nuget.yml
Created March 29, 2023 21:53 — forked from deitry/make-nuget.yml
Simple GitHub action to build NuGet package
name: Build NuGet package and push to GitHub registry
on:
workflow_call:
inputs:
organizationName:
required: true
type: string
nuspecPath:
required: true
@diev
diev / Xerox Phaser 3140 macOS Catalina driver update
Created March 11, 2022 00:53 — forked from santiago26/Xerox Phaser 3140 macOS Catalina driver update
How to get worked old Xerox printer in macOS Catalina
# Intro
Xerox said that Phaser 3140 hass "level 2" of support which means that Xerox not planning to update it's driver any way.
macOS no longer supports 32bit apps since macOS Catalina, and Xerox drivers installer provided at xerox.com is 32bit-app. But drivers will still work if we can install it. So we just need to install drivers itself manually.
To make it old printers work you just need to copy few files from installer to their designed locations.
# Download
You can download unpacked files from macOS 10.14 (10.11+) or unpack from official site by yourselve.
https://yadi.sk/d/K4Z-FlHFTyT2BQ?w=1
#Installation
@diev
diev / Recursively SearchAccessibleFiles
Created July 24, 2021 10:29 — forked from smith-neil/Recursively SearchAccessibleFiles
c# recursive function used to search for a file by name in a given directory and all subdirectories under the given root
IEnumerable<string> SearchAccessibleFiles(string root, string searchTerm) {
var files = new List<string>();
foreach (var file in Directory.EnumerateFiles(root).Where(m => m.Contains(searchTerm))) {
files.Add(file);
}
foreach (var subDir in Directory.EnumerateDirectories(root)) {
try {
files.AddRange(SearchAccessibleFiles(subDir, searchTerm));
}
@diev
diev / totp.ps1
Created June 19, 2019 14:47 — forked from jonfriesen/totp.ps1
TOTP Client for PowerShell
#requires -version 2
<#
.SYNOPSIS
Time-base One-Time Password Algorithm (RFC 6238)
.DESCRIPTION
This is an implementation of the RFC 6238 Time-Based One-Time Password Algorithm draft based upon the HMAC-based One-Time Password (HOTP) algorithm (RFC 4226). This is a time based variant of the HOTP algorithm providing short-lived OTP values.
.NOTES
Version: 1.0
@diev
diev / short-markdown-notation-for-image-with-link.md
Created February 14, 2019 09:21 — forked from TomoyukiAota/short-markdown-notation-for-image-with-link.md
[Markdown] Short notation for an image with a link using reference-style link
@diev
diev / md2html.ps1
Created November 14, 2018 23:41 — forked from pohatu/md2html.ps1
Use the GitHub markdown service to convert md to html via powershell.
[CmdletBinding()] Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[ValidateNotNullOrEmpty()]
[Alias('FullName')]
[String]
$filePath
)
function ConvertFrom-md($mdText){
$response = Invoke-WebRequest -Uri 'https://api.github.com/markdown/raw' -Method Post -body "$mdText" -ContentType "text/plain"