Skip to content

Instantly share code, notes, and snippets.

View deitry's full-sized avatar
🤷‍♂️

Dmitry Vornychev deitry

🤷‍♂️
View GitHub Profile
@deitry
deitry / autospace.py
Created July 30, 2023 22:42
Simple script to simulate spacebar key pressing
"""Simulate space press once in random time between 1 and 120 seconds to prevent the computer from sleeping."""
import random
import pyautogui
while True:
# get a random int between 1 and 120
# delay = 10
delay = random.randint(1, 120)
pyautogui.sleep(delay)
@deitry
deitry / README.md
Last active July 26, 2023 18:35
Search delays in MSI installation log
  1. Tested with Python 3.11, no specific packages were used
  2. Before running script ensure that python output is UTF-8 by setting environment variable. E.g. in powershell: it seems working now with internal encoding into utf-8
$env:PYTHONIOENCODING = 'utf-8'
  1. Run script with providing a path to source MSI log:
python check-installer-time.py "C:\Users\deitry\Downloads\MSI.log" | Out-File MSI-parsed.log -Encoding oem

Please note that Out-File -Encoding .. part is necessary to keep correct encoding in file. For some reason default utf-8 in pwsh generates erroneous symbols

@deitry
deitry / make-vpn-client.sh
Created December 31, 2022 13:02
Simple script to make a VPN client
#!/bin/bash
# https://losst.pro/nastrojka-openvpn-v-ubuntu
username=$1
cd /etc/openvpn/easy-rsa/
./easyrsa build-client-full $username nospass
mkdir -p /etc/openvpn/clients/$username/
@deitry
deitry / DiveIntoMatrixxx.ps1
Created December 10, 2022 17:11
Matrixxx in PowerShell
while ($true) { Write-Host "$(@(32) + (65..90) + (97..122) | Get-Random |% {[char]$_})" -f green -nonewline }
{
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"definitions": {
"architecture": {
"type": "string",
"enum": ["ARM32", "x64", "x86"]
},
"branch": {
@deitry
deitry / slnf-schema.json
Last active September 2, 2022 07:29
JSON schema for MSBuild solution filters
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "JSON Schema for MSBuild solution filters",
"properties": {
"solution": {
"type": "object",
"description": "Solution filter description",
"properties": {
"path": {
"type": "string",
@deitry
deitry / .mytheme.omp.json
Last active May 19, 2023 08:54
Nice theme for oh-my-posh
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"style": "plain",
"type": "time"
},
@deitry
deitry / remove-line.ps1
Created July 24, 2022 07:15
Remove last line from file
$content = Get-Content $file
$content[0..($content.length-2)] | Out-File $file -Force
@deitry
deitry / make-nuget-with-tag-version.yml
Last active March 29, 2023 21:54
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
@deitry
deitry / make-nuget.yml
Last active March 29, 2023 21:53
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